diff -uprN binutils-2.16.90.0.3/bfd/aout-target.h binutils-2.16.91.0.1/bfd/aout-target.h --- binutils-2.16.90.0.3/bfd/aout-target.h 2005-05-10 15:46:40.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/aout-target.h 2005-06-22 13:53:34.127445839 -0700 @@ -462,6 +462,9 @@ MY_bfd_final_link (bfd *abfd, struct bfd #ifndef MY_find_nearest_line #define MY_find_nearest_line NAME (aout, find_nearest_line) #endif +#ifndef MY_find_inliner_info +#define MY_find_inliner_info _bfd_nosymbols_find_inliner_info +#endif #ifndef MY_sizeof_headers #define MY_sizeof_headers NAME (aout, sizeof_headers) #endif diff -uprN binutils-2.16.90.0.3/bfd/aout-tic30.c binutils-2.16.91.0.1/bfd/aout-tic30.c --- binutils-2.16.90.0.3/bfd/aout-tic30.c 2005-05-10 15:46:40.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/aout-tic30.c 2005-06-22 13:53:34.128445674 -0700 @@ -904,6 +904,9 @@ tic30_aout_set_arch_mach (bfd *abfd, #ifndef MY_find_nearest_line #define MY_find_nearest_line NAME (aout, find_nearest_line) #endif +#ifndef MY_find_inliner_info +#define MY_find_inliner_info _bfd_nosymbols_find_inliner_info +#endif #ifndef MY_sizeof_headers #define MY_sizeof_headers NAME (aout, sizeof_headers) #endif diff -uprN binutils-2.16.90.0.3/bfd/archive.c binutils-2.16.91.0.1/bfd/archive.c --- binutils-2.16.90.0.3/bfd/archive.c 2005-05-10 15:46:40.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/archive.c 2005-06-22 13:53:34.136444352 -0700 @@ -129,6 +129,7 @@ DESCRIPTION #include "bfd.h" #include "sysdep.h" +#include "libiberty.h" #include "libbfd.h" #include "aout/ar.h" #include "aout/ranlib.h" @@ -821,9 +822,15 @@ do_slurp_coff_armap (bfd *abfd) /* The coff armap must be read sequentially. So we construct a bsd-style one in core all at once, for simplicity. */ + if (nsymz > ~ (bfd_size_type) 0 / sizeof (carsym)) + return FALSE; + carsym_size = (nsymz * sizeof (carsym)); ptrsize = (4 * nsymz); + if (carsym_size + stringsize + 1 <= carsym_size) + return FALSE; + ardata->symdefs = bfd_zalloc (abfd, carsym_size + stringsize + 1); if (ardata->symdefs == NULL) return FALSE; diff -uprN binutils-2.16.90.0.3/bfd/archures.c binutils-2.16.91.0.1/bfd/archures.c --- binutils-2.16.90.0.3/bfd/archures.c 2005-05-10 15:46:40.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/archures.c 2005-06-22 13:53:34.137444187 -0700 @@ -316,6 +316,9 @@ DESCRIPTION . bfd_arch_iq2000, {* Vitesse IQ2000. *} .#define bfd_mach_iq2000 1 .#define bfd_mach_iq10 2 +. bfd_arch_ms1, +.#define bfd_mach_ms1 1 +.#define bfd_mach_mrisc2 2 . bfd_arch_pj, . bfd_arch_avr, {* Atmel AVR microcontrollers. *} .#define bfd_mach_avr1 1 @@ -453,6 +456,7 @@ extern const bfd_arch_info_type bfd_w65_ extern const bfd_arch_info_type bfd_xstormy16_arch; extern const bfd_arch_info_type bfd_xtensa_arch; extern const bfd_arch_info_type bfd_z8k_arch; +extern const bfd_arch_info_type bfd_ms1_arch; static const bfd_arch_info_type * const bfd_archures_list[] = { @@ -493,6 +497,7 @@ static const bfd_arch_info_type * const &bfd_mmix_arch, &bfd_mn10200_arch, &bfd_mn10300_arch, + &bfd_ms1_arch, &bfd_msp430_arch, &bfd_ns32k_arch, &bfd_openrisc_arch, diff -uprN binutils-2.16.90.0.3/bfd/bfd.c binutils-2.16.91.0.1/bfd/bfd.c --- binutils-2.16.90.0.3/bfd/bfd.c 2005-05-10 15:46:40.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/bfd.c 2005-06-22 13:53:34.146442700 -0700 @@ -1161,6 +1161,14 @@ DESCRIPTION . BFD_SEND (abfd, _bfd_find_nearest_line, \ . (abfd, sec, syms, off, file, func, line)) . +.#define bfd_find_line(abfd, syms, sym, file, line) \ +. BFD_SEND (abfd, _bfd_find_line, \ +. (abfd, syms, sym, file, line)) +. +.#define bfd_find_inliner_info(abfd, file, func, line) \ +. BFD_SEND (abfd, _bfd_find_inliner_info, \ +. (abfd, file, func, line)) +. .#define bfd_debug_info_start(abfd) \ . BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) . diff -uprN binutils-2.16.90.0.3/bfd/bfd-in2.h binutils-2.16.91.0.1/bfd/bfd-in2.h --- binutils-2.16.90.0.3/bfd/bfd-in2.h 2005-05-10 15:46:40.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/bfd-in2.h 2005-06-22 13:53:34.145442865 -0700 @@ -893,6 +893,9 @@ extern struct coff_comdat_info *bfd_coff void bfd_init (void); /* Extracted from opncls.c. */ +bfd *bfd_fopen (const char *filename, const char *target, + const char *mode, int fd); + bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); @@ -1851,6 +1854,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 + bfd_arch_ms1, +#define bfd_mach_ms1 1 +#define bfd_mach_mrisc2 2 bfd_arch_pj, bfd_arch_avr, /* Atmel AVR microcontrollers. */ #define bfd_mach_avr1 1 @@ -2441,6 +2447,15 @@ to compensate for the borrow when the lo /* Low 16 bits. */ BFD_RELOC_LO16, +/* High 16 bits of 32-bit pc-relative value */ + BFD_RELOC_HI16_PCREL, + +/* High 16 bits of 32-bit pc-relative value, adjusted */ + BFD_RELOC_HI16_S_PCREL, + +/* Low 16 bits of pc-relative value */ + BFD_RELOC_LO16_PCREL, + /* MIPS16 high 16 bits of 32-bit value. */ BFD_RELOC_MIPS16_HI16, @@ -2602,6 +2617,8 @@ in the instruction. */ BFD_RELOC_X86_64_DTPOFF32, BFD_RELOC_X86_64_GOTTPOFF, BFD_RELOC_X86_64_TPOFF32, + BFD_RELOC_X86_64_GOTOFF64, + BFD_RELOC_X86_64_GOTPC32, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -2748,44 +2765,23 @@ not stored in the instruction. The 2nd field in the instruction. */ BFD_RELOC_THUMB_PCREL_BLX, -/* These relocs are only used within the ARM assembler. They are not -(at present) written to any object files. */ - BFD_RELOC_ARM_IMMEDIATE, - BFD_RELOC_ARM_ADRL_IMMEDIATE, +/* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. +The lowest bit must be zero and is not stored in the instruction. +Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an +"nn" one smaller in all cases. Note further that BRANCH23 +corresponds to R_ARM_THM_CALL. */ + BFD_RELOC_THUMB_PCREL_BRANCH7, + BFD_RELOC_THUMB_PCREL_BRANCH9, + BFD_RELOC_THUMB_PCREL_BRANCH12, + BFD_RELOC_THUMB_PCREL_BRANCH20, + BFD_RELOC_THUMB_PCREL_BRANCH23, + BFD_RELOC_THUMB_PCREL_BRANCH25, + +/* 12-bit immediate offset, used in ARM-format ldr and str instructions. */ BFD_RELOC_ARM_OFFSET_IMM, - BFD_RELOC_ARM_SHIFT_IMM, - BFD_RELOC_ARM_SMI, - BFD_RELOC_ARM_SWI, - BFD_RELOC_ARM_MULTI, - BFD_RELOC_ARM_CP_OFF_IMM, - BFD_RELOC_ARM_CP_OFF_IMM_S2, - BFD_RELOC_ARM_ADR_IMM, - BFD_RELOC_ARM_LDR_IMM, - BFD_RELOC_ARM_LITERAL, - BFD_RELOC_ARM_IN_POOL, - BFD_RELOC_ARM_OFFSET_IMM8, - BFD_RELOC_ARM_HWLITERAL, - BFD_RELOC_ARM_THUMB_ADD, - BFD_RELOC_ARM_THUMB_IMM, - BFD_RELOC_ARM_THUMB_SHIFT, + +/* 5-bit immediate offset, used in Thumb-format ldr and str instructions. */ BFD_RELOC_ARM_THUMB_OFFSET, - BFD_RELOC_ARM_GOT12, - BFD_RELOC_ARM_GOT32, - BFD_RELOC_ARM_JUMP_SLOT, - BFD_RELOC_ARM_COPY, - BFD_RELOC_ARM_GLOB_DAT, - BFD_RELOC_ARM_PLT32, - BFD_RELOC_ARM_RELATIVE, - BFD_RELOC_ARM_GOTOFF, - BFD_RELOC_ARM_GOTPC, - BFD_RELOC_ARM_TLS_GD32, - BFD_RELOC_ARM_TLS_LDO32, - BFD_RELOC_ARM_TLS_LDM32, - BFD_RELOC_ARM_TLS_DTPOFF32, - BFD_RELOC_ARM_TLS_DTPMOD32, - BFD_RELOC_ARM_TLS_TPOFF32, - BFD_RELOC_ARM_TLS_IE32, - BFD_RELOC_ARM_TLS_LE32, /* Pc-relative or absolute relocation depending on target. Used for entries in .init_array sections. */ @@ -2797,7 +2793,7 @@ entries in .init_array sections. */ /* Data segment base relative address. */ BFD_RELOC_ARM_SBREL32, -/* This reloc is used for References to RTTI dta from exception handling +/* This reloc is used for references to RTTI data from exception handling tables. The actual definition depends on the target. It may be a pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_TARGET2, @@ -2805,6 +2801,48 @@ pc-relative or some form of GOT-indirect /* 31-bit PC relative address. */ BFD_RELOC_ARM_PREL31, +/* Relocations for setting up GOTs and PLTs for shared libraries. */ + BFD_RELOC_ARM_JUMP_SLOT, + BFD_RELOC_ARM_GLOB_DAT, + BFD_RELOC_ARM_GOT32, + BFD_RELOC_ARM_PLT32, + BFD_RELOC_ARM_RELATIVE, + BFD_RELOC_ARM_GOTOFF, + BFD_RELOC_ARM_GOTPC, + +/* ARM thread-local storage relocations. */ + BFD_RELOC_ARM_TLS_GD32, + BFD_RELOC_ARM_TLS_LDO32, + BFD_RELOC_ARM_TLS_LDM32, + BFD_RELOC_ARM_TLS_DTPOFF32, + BFD_RELOC_ARM_TLS_DTPMOD32, + BFD_RELOC_ARM_TLS_TPOFF32, + BFD_RELOC_ARM_TLS_IE32, + BFD_RELOC_ARM_TLS_LE32, + +/* These relocs are only used within the ARM assembler. They are not +(at present) written to any object files. */ + BFD_RELOC_ARM_IMMEDIATE, + BFD_RELOC_ARM_ADRL_IMMEDIATE, + BFD_RELOC_ARM_T32_IMMEDIATE, + BFD_RELOC_ARM_SHIFT_IMM, + BFD_RELOC_ARM_SMI, + BFD_RELOC_ARM_SWI, + BFD_RELOC_ARM_MULTI, + BFD_RELOC_ARM_CP_OFF_IMM, + BFD_RELOC_ARM_CP_OFF_IMM_S2, + BFD_RELOC_ARM_ADR_IMM, + BFD_RELOC_ARM_LDR_IMM, + BFD_RELOC_ARM_LITERAL, + BFD_RELOC_ARM_IN_POOL, + BFD_RELOC_ARM_OFFSET_IMM8, + BFD_RELOC_ARM_T32_OFFSET_U8, + BFD_RELOC_ARM_T32_OFFSET_IMM, + BFD_RELOC_ARM_HWLITERAL, + BFD_RELOC_ARM_THUMB_ADD, + BFD_RELOC_ARM_THUMB_IMM, + BFD_RELOC_ARM_THUMB_SHIFT, + /* Renesas / SuperH SH relocs. Not all of these appear in object files. */ BFD_RELOC_SH_PCDISP8BY2, BFD_RELOC_SH_PCDISP12BY2, @@ -2897,12 +2935,6 @@ pc-relative or some form of GOT-indirect BFD_RELOC_SH_TLS_DTPOFF32, BFD_RELOC_SH_TLS_TPOFF32, -/* Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must -be zero and is not stored in the instruction. */ - BFD_RELOC_THUMB_PCREL_BRANCH9, - BFD_RELOC_THUMB_PCREL_BRANCH12, - BFD_RELOC_THUMB_PCREL_BRANCH23, - /* ARC Cores relocs. ARC 22 bit pc-relative branch. The lowest two bits must be zero and are not stored in the instruction. The high 20 bits are installed in bits 26 @@ -4283,6 +4315,14 @@ bfd_boolean bfd_set_private_flags (bfd * BFD_SEND (abfd, _bfd_find_nearest_line, \ (abfd, sec, syms, off, file, func, line)) +#define bfd_find_line(abfd, syms, sym, file, line) \ + BFD_SEND (abfd, _bfd_find_line, \ + (abfd, syms, sym, file, line)) + +#define bfd_find_inliner_info(abfd, file, func, line) \ + BFD_SEND (abfd, _bfd_find_inliner_info, \ + (abfd, file, func, line)) + #define bfd_debug_info_start(abfd) \ BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) @@ -4619,6 +4659,8 @@ typedef struct bfd_target NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ + _bfd_generic_find_line, \ + NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol @@ -4640,6 +4682,11 @@ typedef struct bfd_target bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, const char **, const char **, unsigned int *); + bfd_boolean (*_bfd_find_line) + (bfd *, struct bfd_symbol **, struct bfd_symbol *, + const char **, unsigned int *); + bfd_boolean (*_bfd_find_inliner_info) + (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ diff -uprN binutils-2.16.90.0.3/bfd/binary.c binutils-2.16.91.0.1/bfd/binary.c --- binutils-2.16.90.0.3/bfd/binary.c 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/binary.c 2005-06-22 13:53:34.147442535 -0700 @@ -216,6 +216,7 @@ binary_get_symbol_info (bfd *ignore_abfd #define binary_bfd_is_local_label_name bfd_generic_is_local_label_name #define binary_get_lineno _bfd_nosymbols_get_lineno #define binary_find_nearest_line _bfd_nosymbols_find_nearest_line +#define binary_find_inliner_info _bfd_nosymbols_find_inliner_info #define binary_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define binary_read_minisymbols _bfd_generic_read_minisymbols #define binary_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol diff -uprN binutils-2.16.90.0.3/bfd/ChangeLog binutils-2.16.91.0.1/bfd/ChangeLog --- binutils-2.16.90.0.3/bfd/ChangeLog 2005-05-10 15:46:40.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/ChangeLog 2005-06-22 13:53:34.115447821 -0700 @@ -1,3 +1,824 @@ +2005-06-21 Carlos O'Donell + + * bfd/elf32-hppa.c (hppa_elf_hash_entry): Define. + (hppa_stub_hash_entry): Define. + (stub_hash_newfunc): Rename variables. + (hppa_link_hash_newfunc): Likewise. + (elf32_hppa_link_hash_table_free): Likewise. + (hppa_stub_name): Likewise. + (hppa_get_stub_entry): Likewise. + (hppa_add_stub): Likewise. + (hppa_type_of_stub): Likewise. + (hppa_build_one_stub): Likewise. + (hppa_size_one_stub): Likewise. + (elf32_hppa_create_dynamic_sections): Likewise. + (elf32_hppa_copy_indirect_symbol): Likewise. + (elf32_hppa_check_relocs): Likewise. + (elf32_hppa_gc_mark_hook): Likewise. + (elf32_hppa_gc_sweep_hook): Likewise. + (elf32_hppa_grok_psinfo): Likewise. + (elf32_hppa_hide_symbol): Likewise. + (elf32_hppa_adjust_dynamic_symbol): Likewise. + (allocate_dynrelocs): Likewise. + (clobber_millicode_symbols): Likewise. + (readonly_dynrelocs): Likewise. + (elf32_hppa_size_dynamic_sections): Likewise. + (get_local_syms): Likewise. + (elf32_hppa_size_stubs): Likewise. + (hppa_record_segment_addr): Likewise. + (final_link_relocate): Likewise. + (elf32_hppa_relocate_section): Likewise. + (elf32_hppa_finish_dynamic_symbol): Likewise. + +2005-06-20 H.J. Lu + + PR 1025 + * elf-m10300.c (mn10300_elf_check_relocs): Handle indirect + symbol. + * elf32-arm.c (elf32_arm_check_relocs): Likewise. + * elf32-avr.c (elf32_avr_check_relocs): Likewise. + * elf32-cris.c (cris_elf_check_relocs): Likewise. + * elf32-d10v.c (elf32_d10v_check_relocs): Likewise. + * elf32-dlx.c (elf32_dlx_check_relocs): Likewise. + * elf32-fr30.c (fr30_elf_check_relocs): Likewise. + * elf32-frv.c (elf32_frv_check_relocs): Likewise. + * elf32-i370.c (i370_elf_check_relocs): Likewise. + * elf32-iq2000.c (iq2000_elf_check_relocs): Likewise. + * elf32-m32r.c (m32r_elf_check_relocs): Likewise. + * elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise. + * elf32-m68k.c (elf_m68k_check_relocs): Likewise. + * elf32-mcore.c (mcore_elf_check_relocs): Likewise. + * elf32-ms1.c (ms1_elf_check_relocs): Likewise. + * elf32-msp430.c (elf32_msp430_check_relocs): Likewise. + * elf32-openrisc.c (openrisc_elf_check_relocs): Likewise. + * elf32-ppc.c (ppc_elf_check_relocs): Likewise. + * elf32-s390.c (elf_s390_check_relocs): Likewise. + * elf32-sh.c (sh_elf_check_relocs): Likewise. + * elf32-v850.c (v850_elf_check_relocs): Likewise. + * elf32-vax.c (elf_vax_check_relocs): Likewise. + * elf64-mmix.c (mmix_elf_check_relocs): Likewise. + * elf64-ppc.c (ppc64_elf_check_relocs): Likewise. + * elf64-s390.c (elf_s390_check_relocs): Likewise. + * elf64-sh64.c (sh_elf64_check_relocs): Likewise. + * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise. + +2005-06-20 H.J. Lu + + PR 1022 + * elf32-hppa.c (elf32_hppa_check_relocs): Handle indirect + symbol. + +2005-06-20 H.J. Lu + + PR 1025 + * elf32-i386.c (elf_i386_check_relocs): Handle indirect symbol. + * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise. + +2005-06-18 H.J. Lu + + * reloc.c: Add BFD_RELOC_X86_64_GOTOFF64 and + BFD_RELOC_X86_64_GOTPC32. + * bfd-in2.h: Regenerated. + +2005-06-17 Jakub Jelinek + + * elf.c (bfd_section_from_shdr): Kill bogus warning. + + * elf.c (bfd_section_from_shdr): Fail if sh_entsize is bogus for + symbol, relocation, group or versym sections. + + * coffcode.h (coff_slurp_reloc_table): Don't crash if native_relocs + is NULL. + * peXXigen.c (pe_print_idata): Don't crash if dll_name or start_address + doesn't point into the section. + +2005-06-17 Jan Beulich + + * bfd-in2.h (elf_x86_64_reloc_type): Add BFD_RELOC_X86_64_GOTOFF64 + and BFD_RELOC_X86_64_GOTPC32. + * libbfd.h (bfd_reloc_code_real_names): Likewise. + * elf64-x86-64.c (x86_64_elf_howto_table): Add entries for + R_X86_64_PC64, R_X86_64_GOTOFF64, and R_X86_64_GOTPC32. + (x86_64_reloc_map): Add entries for R_X86_64_PC64, R_X86_64_GOTOFF64, + and R_X86_64_GOTPC32. + (elf64_x86_64_info_to_howto): Adjust bounding relocation type. + (elf64_x86_64_check_relocs): Also handle R_X86_64_PC64, + R_X86_64_GOTOFF64, and R_X86_64_GOTPC32. + (elf64_x86_64_relocate_section): Likewise. + (elf64_x86_64_gc_sweep_hook): Also handle R_X86_64_PC64. + +2005-06-15 Mark Kettenis + + * archive.c: Include "libiberty.h". + +2005-06-15 Nick Clifton + + * elf32-v850.c (ELF_MACHINE_ALT2): Define so that binaries + produced by the GreenHills toolchain can be assimilated. + +2005-06-14 Steve Ellcey + + * som.c (som_find_inliner_info): New. + +2005-06-14 H.J. Lu + + * elflink.c (_bfd_elf_merge_symbol): Fix a typo in comment. + +2005-06-14 Jakub Jelinek + + * elf.c (bfd_section_from_shdr): Fail if name is NULL. + Prevent endless recursion on broken objects. + + * archive.c (do_slurp_coff_armap): Check for overflows. + +2005-06-10 Daniel Jacobowitz + + * elfcode.h (elf_write_relocs): Do nothing if there are no + relocations. + +2005-06-10 Alan Modra + + * dwarf2.c (decode_line_info): Revert last change. Instead set + initial low_pc to -1 to avoid need to test whether loc_pc has + been set. + +2005-06-09 Christopher Faylor + + * coffcode.h (sec_to_styp_flags): Set appropriate section flags when + either SEC_ALLOC OR SEC_LOAD. + +2005-06-09 Christopher Faylor + + * coffcode.h (sec_to_styp_flags): Remove read/write flags from noload + section header. Do not add STYP_NOLOAD since it does not appear to be + a valid PE flag. + +2005-06-09 H.J. Lu + + PR 1000 + * dwarf2.c (lookup_address_in_line_info_table): Restore code + handling NULL function info, removed with 2005-04-03 change. + +2005-06-08 Mark Mitchell + + * opncls.c (bfd_fopen): Mark returned BFD as cacheable if FD == -1. + +2005-06-09 Alan Modra + + * elflink.c (elf_mark_used_section): Delete. + (bfd_elf_gc_sections): Call bfd_generic_gc_sections. + * reloc.c (bfd_mark_used_section): New function. + (bfd_generic_gc_sections): Call bfd_mark_used_section. + +2005-06-08 Alan Modra + + * opncls.c (bfd_fopen): Don't set bfd_error unconditionally. + (bfd_fdopenr): Same. + +2005-06-07 Mark Mitchell + + * opncls.c (bfd_fdopenr): Add missing break statements. + +2005-06-07 Mark Mitchell + + * opncls.c (bfd_fopen): New API. + (bfd_openr): Use it. + (bfd_fdopenr): Likewise. + * bfd-in2.h: Regenerated. + +2005-06-07 Aldy Hernandez + Michael Snyder + Stan Cox + + * Makefile.am (ALL_MACHINES): Add ms1 support. + (ALL_MACHINES_CFILES): Same. + (BFD32_BACKENDS): Same. + (BFD32_BACKENDS_CFILES): Same. + + * Makefile.in: Regenerate. + + * archures.c (bfd_architecture): Add ms1 entries. + Externalize bfd_ms1_arch. + (bfd_archures_list): Add bfd_ms1_arch. + + * bfd-in2.h: Regenerate. + + * cpu-ms1.c: New file. + + * elf32-ms1.c: New file. + + * targets.c: Define extern of bfd_elf32_ms1_vec. + Add bfd_elf32_ms1_vec to _bfd_target_vector. + + * configure.in: Add bfd_elf32_ms1_vec case. + + * configure: Regenerate. + + * config.bfd: Add ms1-*-elf to table. + +2005-06-07 Zack Weinberg + + * coff-i386.c: Change md_apply_fix3 to md_apply_fix in comment. + +2005-06-07 Alan Modra + + * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Init _bfd_find_line. + * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise. + +2005-06-06 H.J. Lu + + PR 990 + * bfd.c (bfd_find_line): New. + + * dwarf2.c (comp_unit): Add variable_table. + (funcinfo): Add file, line, and sec. + (varinfo): New. + (lookup_symbol_in_function_table): New. + (lookup_symbol_in_variable_table): New. + (scan_unit_for_functions): Renamed to ... + (scan_unit_for_symbols): This. Handle DW_TAG_entry_point and + DW_TAG_variable. + (comp_unit_find_nearest_line): Updated. + (comp_unit_find_line): New. + (_bfd_dwarf2_find_line): New. + + * elf-bfd.h (_bfd_elf_find_line): New. + (_bfd_generic_find_line): New. Defined. + + * elf.c (_bfd_elf_find_line): New. + + * libbfd-in.h (_bfd_dwarf2_find_line): New. + (_bfd_generic_find_line): New. + + * bfd-in2.h: Regenerated. + * libbfd.h: Likewise. + + * libbfd.c (_bfd_generic_find_line): New. + + * targets.c (BFD_JUMP_TABLE_SYMBOLS): Initialize _bfd_find_line + with _bfd_generic_find_line. + (bfd_target): Add _bfd_find_line. + +2005-06-06 H.J. Lu + + * dwarf2.c (decode_line_info): Properly set low_pc. + +2005-06-06 Alan Modra + + * elf64-pcc.c (ppc64_elf_gc_mark_hook): For the local sym in .opd + case, include addend when indexing .opd section map. + (ppc64_elf_edit_opd): Add no_opd_opt param. Do nothing besides + clear opd_adjust array if no_opd_opt set. Tidy code. + Ignore zero size .opd. Check bfd_alloc return value. + (ppc_stub_name): Return immediately on bfd_malloc fail. + * elf64-ppc.h (ppc64_elf_edit_opd): Update prototype. + +2005-06-04 H.J. Lu + + * dwarf2.c (comp_unit): Fix a typo in comment. + +2005-06-03 Jan-Benedict Glaw + + * elf32-vax.c (rtype_to_howto): Remove PARAMS. + (reloc_type_lookup): Dito. + (elf_vax_discard_copies): Dito. + (elf_vax_instantiate_got_entries): Dito. + (elf_vax_link_hash_traverse): Dito. + (elf_vax_link_hash_newfunc): Dito. + (elf_vax_link_hash_table_create): Dito. + (elf32_vax_set_private_flags): Dito. + (elf32_vax_merge_private_bfd_data): Dito. + (elf32_vax_print_private_bfd_data): Dito. + (elf_vax_check_relocs): Dito. + (elf_vax_gc_mark_hook): Dito. + (elf_vax_gc_sweep_hook): Dito. + (elf_vax_size_dynamic_sections): Dito. + (elf_vax_discard_copies): Dito. + (elf_vax_instantiate_got_entries): Dito. + (elf_vax_relocate_section): Dito. + (elf_vax_finish_dynamic_symbol): Dito. + (elf_vax_finish_dynamic_sections): Dito. + (elf_vax_hash_table): Break-up of line isn't needed. + (elf_vax_check_relocs): Remove leading whitespace + (elf_vax_relocate_section): Remove redundant whitespace + (elf_vax_link_hash_newfunc): Don't cast NULL. + (elf_vax_link_hash_table_create): Dito. + * cpu-vax.c (bfd_vax_arch) Remove a trailing space. + +2005-06-03 Alan Modra + + PR 568 + * configure.in: Bump version + * configure: Regenerate. + * elflink.c (elf_link_input_bfd): Use einfo linker callback to print + discarded section sym refs and kill linker output. + * simple.c (simple_dummy_einfo): New function. + (bfd_simple_get_relocated_section_contents): Init callbacks.einfo. + + * elf32-i386.c (elf_i386_relocate_section): Handle zero symndx + for all reloc types. + +2005-06-02 Alan Modra + + * elf64-ppc.c (add_symbol_adjust): Set sym visibility to most + restrictive of func code and func descr for undefined syms as well + as defined. + +2005-05-31 Jim Blandy + + * Makefile.am: Regenerate dependencies with 'make dep-am'. + * Makefile.in: Regenerate. + +2005-05-31 Richard Henderson + + * elf64-alpha.c (ALPHA_ELF_LINK_HASH_LU_JSRDIRECT): New. + (ALPHA_ELF_LINK_HASH_TLS_IE): Renumber to 0x80. + (ALPHA_ELF_LINK_HASH_LU_PLT): Rename from ALPHA_ELF_LINK_HASH_LU_FUNC. + (elf64_alpha_want_plt): Update to match. + (elf64_alpha_check_relocs): Collect JSRDIRECT in gotent_flags. + (elf64_alpha_relax_with_lituse): Likewise. Handle JSRDIRECT. + +2005-05-31 Zack Weinberg + + * elf32-arm.c (elf32_arm_reloc_type_lookup) + (elf32_arm_nabi_grok_prstatus, elf32_arm_nabi_grok_psinfo): + Use ISO C90 function declaration style. + +2005-05-31 James E Wilson + + * elfcode.h (NAME(bfd_elf,bfd_from_remote_memory)): Check for program + header PF_R flag on PT_LOAD segments. + +2005-05-30 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relocate_section): Use dtp_base for + the zero index relocs produced by elf64_alpha_relax_tls_get_addr. + +2005-05-29 Richard Henderson + + * configure.in (--enable-secureplt): New. + * elf64-alpha.c (INSN_LDA, INSN_LDAH, INSN_LDQ, INSN_BR): New. + (INSN_SUBQ, INSN_S4SUBQ, INSN_JMP): New. + (INSN_A, INSN_AB, INSN_ABC, INSN_ABO, INSN_AD): New. + (elf64_alpha_use_secureplt): New. + (OLD_PLT_HEADER_SIZE, OLD_PLT_ENTRY_SIZE): New. + (NEW_PLT_HEADER_SIZE, NEW_PLT_ENTRY_SIZE): New. + (PLT_HEADER_SIZE, PLT_ENTRY_SIZE): Conditionalize on secureplt. + (ALPHA_ELF_LINK_HASH_PLT_LOC): Remove. + (struct alpha_elf_link_hash_entry): Add plt_offset. + (PLT_HEADER_WORD1, PLT_HEADER_WORD2, PLT_HEADER_WORD3): Remove. + (PLT_HEADER_WORD4, PLT_ENTRY_WORD1, PLT_ENTRY_WORD2): Remove. + (PLT_ENTRY_WORD3): Remove. + (elf64_alpha_create_dynamic_sections): If secureplt, set SEC_READONLY + on .plt and create .got.plt. + (elf64_alpha_output_extsym): Remove .plt frobbing for symbol values. + (get_got_entry): Initialize plt_offset. + (elf64_alpha_want_plt): New. + (elf64_alpha_check_relocs): Use it. + (elf64_alpha_adjust_dynamic_symbol): Likewise. Don't allocate + plt entries here. + (elf64_alpha_calc_got_offsets_for_symbol): Don't report internal + error as user error. + (elf64_alpha_size_plt_section_1): Allocate one plt entry per + got subsection. + (elf64_alpha_size_plt_section): Size .got.plt section. + (elf64_alpha_size_rela_got_1): Don't allocate relocations if + plt entries used. + (elf64_alpha_size_dynamic_sections): Call elf64_alpha_size_plt_section. + Add PLTRO DYNAMIC entry. + (elf64_alpha_finish_dynamic_symbol): Generate secureplt format. + (elf64_alpha_finish_dynamic_sections): Likewise. + +2005-05-28 David Daney + + * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Move + calculation of DT_RELSZ to occur after all dynamic relocations + are created. + +2005-05-28 Eli Zaretskii + + * configure.in: Add snprintf and vsnprintf to AC_CHECK_DECLS. + * config.in, configure: Regenerate. + +2005-05-26 Mark Kettenis + Maciej W. Rozycki + + * elfxx-mips.c (_bfd_mips_elf_section_processing): Warn and + stop processing of options if one of invalid size is + encountered. + (_bfd_mips_elf_section_from_shdr): Likewise. + (_bfd_mips_elf_fake_sections): Reset the type of empty special + sections. + +2005-05-26 Richard Henderson + + * elf64-alpha.c (struct alpha_elf_link_hash_entry): Remove + plt_old_section, plt_old_value. + (elf64_alpha_adjust_dynamic_symbol): Don't set it. + (elf64_alpha_size_plt_section_1): Don't use it. + +2005-05-26 Jakub Jelinek + + * elfcode.h (elf_object_p): Fail if e_shoff != 0, e_shnum == 0 and + first shdr has sh_size == 0. Fail if e_shnum is large to cause + arithmetic overflow when allocating the i_shdr array. + Sanity check sh_link and sh_info fields. Fix e_shstrndx sanity check. + +2005-05-25 Richard Henderson + + * elf64-alpha.c: Update all function definitions to ISO C. Remove + all function prototypes; rearrange functions into def-use order. + +2005-05-25 Richard Henderson + + * elf64-alpha.c (elf64_alpha_merge_gots): Fix gotent iteration + in the presence of deleting elements. + (elf64_alpha_size_got_sections): Zero dead got section size. + +2005-05-23 Fred Fish + + * dwarf2.c (struct dwarf2_debug): Add inliner_chain member. + (struct funcinfo): Add caller_func, caller_file, caller_line. + tag, and nesting_level members. + (lookup_address_in_function_table): Change first passed parameter + from "struct funcinfo *" to "struct comp_unit *". + (lookup_address_in_function_table): Dereference unit to find function + table. + (lookup_address_in_function_table): Traverse the function list to + create a chain of inlined functions back to the first non inlined + function. + (scan_unit_for_functions): Remember tag and nesting level. Handle + DW_AT_call_file and DW_AT_call_line. + (comp_unit_find_nearest_line): Adjust lookup_address_in_function_table + call to pass unit pointer instead of function table pointer. For + inlined functions, save pointer to the inliner chain. + (_bfd_dwarf2_find_nearest_line): Initialize inliner_chain to NULL. + (_bfd_dwarf2_find_inliner_info): New function that returns information + from the inliner chain after a call to bfd_find_nearest_line. + + * bfd.c (bfd_find_inliner_info): Define using BFD_SEND. + * targets.c (BFD_JUMP_TABLE_SYMBOLS): Add entry for + NAME##_find_inliner_info. + (bfd_target): Add _bfd_find_inliner_info. + * bfd-in2.h: Regenerate. + + * libbfd-in.h (_bfd_nosymbols_find_inliner_info): Define as + macro that always returns bfd_false. + (_bfd_dwarf2_find_inliner_info): Declare. + * libbfd.h: Regenerate. + + * elf32-arm.c (elf32_arm_find_inliner_info): New function + that calls _bfd_dwarf2_find_inliner_info. + (bfd_elf32_find_inliner_info): Define to elf32_arm_find_inliner_info. + + * elfxx-mips.c (_bfd_mips_elf_find_inliner_info): New function + that calls _bfd_dwarf2_find_inliner_info. + * elfxx-mips.h (_bfd_mips_elf_find_inliner_info): Declare. + * elfn32-mips.c (bfd_elf32_find_inliner_info): Define to + _bfd_mips_elf_find_inliner_info. + * elf64-mips.c (bfd_elf64_find_inliner_info): Ditto. + * elf32-mips.c (bfd_elf32_find_inliner_info): Ditto. + + * elf.c (_bfd_elf_find_inliner_info): New function that calls + _bfd_dwarf2_find_inliner_info. + * elf-bfd.h (_bfd_elf_find_inliner_info): Declare. + * elfxx-target.h (bfd_elfNN_find_inliner_info): Define to + _bfd_elf_find_inliner_info. + + * coffgen.c (coff_find_inliner_info): New function that + calls _bfd_dwarf2_find_inliner_info. + * libcoff-in.h (coff_find_inliner_info): Declare. + * libcoff.h: Regenerate. + * coff-rs6000.c (rs6000coff_vec): Add coff_find_inliner_info. + (pmac_xcoff_vec) Ditto. + * coff64-rs6000.c (rs6000coff64_vec): Ditto. + (aix5coff64_vec): Ditto. + + * aout-target.h (MY_find_inliner_info): Define as + _bfd_nosymbols_find_inliner_info. + * aout-tic30.c (MY_find_inliner_info): Ditto. + * binary.c (binary_find_inliner_info): Ditto. + * i386msdos.c (msdos_find_inliner_info): Ditto. + * ihex.c (ihex_find_inliner_info): Ditto. + * libaout.h (aout_32_find_inliner_info): Ditto. + * libecoff.h (_bfd_ecoff_find_inliner_info): Ditto. + * mach-o.c (bfd_mach_o_find_inliner_info): Ditto. + * mmo.c (mmo_find_inliner_info): Ditto. + * nlm-target.h (nlm_find_inliner_info): Ditto. + * pef.c (bfd_pef_find_inliner_info): Ditto. + * ppcboot.c (ppcboot_find_inliner_info): Ditto. + * srec.c (srec_find_inliner_info): Ditto. + * tekhex.c (tekhex_find_inliner_info): Ditto. + * versados.c (versados_find_inliner_info): Ditto. + * xsym.c (bfd_sym_find_inliner_info): Ditto. + + * ieee.c (ieee_find_inliner_info): New function that always + returns FALSE. + * oasys.c (oasys_find_inliner_info): Ditto. + * vms.c (vms_find_inliner_info): Ditto. + +2005-05-24 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): For old gcc -fPIC code + force old plt layout. + +2005-05-22 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relax_section): Ignore non-allocated + sections. + (elf64_alpha_check_relocs): Likewise. + (elf64_alpha_relocate_section): Don't emit dynamic relocations to + non-allocated sections. + +2005-05-22 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relax_with_lituse): Relax jsr to + undefweak to use zero register. Call elf64_alpha_relax_got_load + if not all uses removed. + (elf64_alpha_relax_got_load): Relax undefweak to lda zero. + (elf64_alpha_relax_section): Handle undefweak symbols. + (elf64_alpha_calc_dynrel_sizes): Don't add relocs for undefweak. + (elf64_alpha_size_rela_got_1): Likewise. + (elf64_alpha_relocate_section): Likewise. + +2005-05-22 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relax_section): Only operate + on SEC_CODE sections. + +2005-05-22 John David Anglin + + * som.c (try_prev_fixup): Changed type of subspace_reloc_sizep to + unsigned int *. + (som_write_space_strings): Change type of tmp_space and p to char *. + (som_write_symbol_strings): Likewise. Also change type of comp to + char *comp[4]. + (som_begin_writing): Change type of strings_size to unsigned int. + (som_finish_writing): Likewise. + (som_slurp_reloc_table): Change type of external_relocs to unsigned + char *. + * som.h (struct som_section_data_struct): Change type of reloc_stream + field to unsigned char *. + +2005-05-20 Daniel Jacobowitz + + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Don't eliminate + copy relocations for VxWorks. + +2005-05-20 Daniel Jacobowitz + + * bfd/elf32-ppc.c (struct ppc_elf_link_hash_entry): Add new field + has_sda_refs. + (ppc_elf_copy_indirect_symbol): Copy has_sda_refs. + (ppc_elf_check_relocs): Set has_sda_refs. + (ppc_elf_adjust_dynamic_symbol): Check has_sda_refs before eliminating + copy relocations. Use has_sda_refs to place variables in .sbss. + (ppc_elf_finish_dynamic_symbol): Use has_sda_refs to place variables in + .sbss. + +2005-05-20 Bob Wilson + + * elf32-xtensa.c (bfd_elf_xtensa_reloc): Make sure that + xtensa_default_isa is initialized. + +2005-05-20 Alan Modra + + * elf32-ppc.c (allocate_dynrelocs): Correct plt offset assigned + for second and subsequent list entries. Only allocate multiple + glink stubs when shared or pie. + (ppc_elf_finish_dynamic_symbol): Break out early when only one + glink stub is needed. + +2005-05-19 Zack Weinberg + + * Makefile.am: Have 'all' depend on 'info'. + * Makefile.in: Regenerate. + +2005-05-19 Alan Modra + + * elf-bfd.h (struct elf_link_hash_table): Delete init_refcount and + init_offset. Add init_got_refcount, init_plt_refcount, + init_got_offset and init_plt_offset. + * elf.c (_bfd_elf_link_hash_newfunc): Adjust for above change. + (_bfd_elf_link_hash_hide_symbol): Likewise. + (_bfd_elf_link_hash_table_init): Likewise. + * elf32-hppa.c (elf32_hppa_hide_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_link_hash_table_create): Likewise. + * elflink.c (_bfd_elf_adjust_dynamic_symbol): Likewise. + (bfd_elf_size_dynamic_sections): Likewise. + * elf32-ppc.c (GLINK_PLTRESOLVE): Now 16 insns. + (LWZU_0_X_12, LWZ_0_4_30, LWZ_0_X_12, LWZ_11_X_11, LWZ_11_X_30, + LWZ_12_4_12, LWZ_12_8_30, LWZ_12_X_12, SUB_11_11_30): Delete. + (ADDIS_12_12, BCL_20_31, LWZU_0_12, LWZ_0_12, LWZ_11_11, LWZ_11_30, + LWZ_12_12, MFLR_0, MFLR_12, MTLR_0, SUB_11_11_12): Define. + (struct plt_entry): New. + (ppc_elf_link_hash_table_create): Set new init_plt fields. + (ppc_elf_copy_indirect_symbol): Handle merge of plt plist. Don't + use _bfd_elf_link_hash_copy_indirect. + (update_plt_info, find_plt_ent): New functions. + (ppc_elf_check_relocs): Handle R_PPC_PLTREL24 with non-zero addend + and adjust for use of plt list rather than refcount. + (ppc_elf_gc_sweep_hook): Likewise. + (ppc_elf_tls_optimize): Likewise. + (ppc_elf_adjust_dynamic_symbol): Likewise. + (allocate_dynrelocs): Likewise. + (ppc_elf_relax_section): Likewise. + (ppc_elf_relocate_section): Likewise. Adjust R_PPC_PLTREL24 addends + when performing a relocatable link. + (ppc_elf_finish_dynamic_symbol): Likewise. Write .glink stubs here.. + (ppc_elf_finish_dynamic_sections): ..rather than here. Use new + pic resolver stub. + +2005-05-19 Alan Modra + + * elf.c (assign_file_positions_for_segments): Use maximum of + maxpagesize and section alignment when adjusting initial + segment offset and section offsets. + +2005-05-18 Zack Weinberg + + * elf32-arm.c: Make all #ifndef OLD_ARM_ABI blocks + unconditional. + +2005-05-18 H.J. Lu + + * elf.c (group_signature): Undo the last change. Check if the + symbol table section is correct. + +2005-05-17 Zack Weinberg + + * elf32-arm.c: Wherever possible, use official reloc names + from AAELF. + (elf32_arm_howto_table, elf32_arm_tls_gd32_howto) + (elf32_arm_tls_ldo32_howto, elf32_arm_tls_ldm32_howto) + (elf32_arm_tls_le32_howto, elf32_arm_tls_ie32_howto) + (elf32_arm_vtinherit_howto, elf32_arm_vtentry_howto) + (elf32_arm_pc11_howto, elf32_arm_thm_pc9_howto, elf32_arm_got_prel) + (elf32_arm_r_howto): Replace with elf32_arm_howto_table_1, + elf32_arm_howto_table_2, and elf32_arm_howto_table_3. + Add many new relocations from AAELF. + (elf32_arm_howto_from_type): Update to match. + (elf32_arm_reloc_map): Add entries for R_ARM_THM_JUMP24, + R_ARM_THM_JUMP11, R_ARM_THM_JUMP19, R_ARM_THM_JUMP8, + R_ARM_THM_JUMP6, R_ARM_GNU_VTINHERIT, and R_ARM_GNU_VTENTRY. + (elf32_arm_reloc_type_lookup): Use elf32_arm_howto_from_type. + (elf32_arm_final_link_relocate): Add support for + R_ARM_THM_JUMP24, R_ARM_THM_JUMP19, R_ARM_THM_JUMP6. Remove + case entries redundant with default. + + * reloc.c: Reorganize ARM relocations. Add Thumb + assembler-internal relocations BFD_RELOC_ARM_T32_OFFSET_U8, + BFD_RELOC_ARM_T32_OFFSET_IMM, BFD_RELOC_ARM_T32_IMMEDIATE. + Add visible relocations BFD_RELOC_THUMB_PCREL_BRANCH7, + BFD_RELOC_THUMB_BRANCH20, BFD_RELOC_THUMB_BRANCH25. + Delete unused relocations BFD_RELOC_ARM_GOT12, BFD_RELOC_ARM_COPY. + * bfd-in2.h, libbfd.h: Regenerate. + +2005-05-17 Daniel Jacobowitz + + * elf.c (_bfd_elf_write_object_contents): Check for non-NULL + elf_shstrtab. + * format.c (bfd_check_format_matches): Set output_has_begun + for both_direction. + * section.c (bfd_set_section_contents): Use bfd_write_p. Remove + special case for both_direction. + +2005-05-17 Nick Clifton + + * elf.c (group_signature): Check for a group section which is + actually a (corrupt) symbol table section in disguise and prevent + an infinite loop from occurring. + +2005-05-17 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_brl): Undo the change made on + 2005-02-16. + +2005-05-17 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_br): Keep the original + predicate on slot 0 only if slot 0 isn't br. + +2005-05-17 H.J. Lu + + PR 797 + * elf32-i386.c (elf_i386_size_dynamic_sections): Also remove + empty sdynbss section. + * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections): Likewise. + +2005-05-17 Tavis Ormandy + + * elf.c (bfd_section_from_shdr): Add sanity check when parsing + dynamic sections. + +2005-05-17 Alan Modra + + * elf32-ppc.c (LIS_11. LIS_12): Define. + (LWZU_0_X_12, LWZ_0_X_12, LWZ_12_4_12, LWZ_12_X_12): Define. + (ppc_elf_finish_dynamic_sections): Provide non-pic plt call stub + for --data-plt when building non-pie executables. + +2005-05-17 Nick Clifton + + * elf32-arm.c (elf32_arm_final_link_relocate): Gracefully handle + the situation where a symbols's section is not known but a section + relative R_ARM_RELATIVE reloc has to be generated for the Symbian + OS. + + * elf32-v850.c (v850_elf_relocate_section): Move code to test for + the presence of a symbol table to just before the symbol table is + actually used. + +2005-05-16 H.J. Lu + + PR 834 + * elfxx-ia64.c (elfNN_ia64_relax_br): New. + (elfNN_ia64_relax_section): Use it. + +2005-05-14 Mark Kettenis + + * elflink.c (bfd_elf_size_dynamic_sections): Use lbasename instead + of basename. + +2005-05-14 Alan Modra + + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Set DT_PPC_GOT, + not DT_PPC_GLINK. + (ppc_elf_finish_dynamic_sections): Likewise. + +2005-05-13 Fred Fish + + * libbfd-in.h: Fix a comment typo, 'neaderst' -> 'nearest' + * libbfd.h: Rebuilt. + +2005-05-13 Bob Wilson + + * elf32-xtensa.c (xtensa_get_property_section_name): Add missing + periods in linkonce_kind values. + +2005-05-12 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section): Allow R_386_GOTOFF + against protected function when building executable. + +2005-05-12 Alan Modra + + * elf32-ppc.c (LWZU_0_X_11): Delete. + (B, LWZ_11_X_11, LWZ_11_X_30, MTCTR_11): Define. + (ppc_elf_select_plt_layout): Set .got flags too. Formatting. + (ppc_elf_size_dynamic_sections): Allocate space for .glink branch + table. + (ppc_elf_finish_dynamic_symbol): Point .plt entries into the branch + table. + (ppc_elf_finish_dynamic_sections): Adjust DT_PPC_GLINK value. + Generate .glink branch table and updated stubs. + +2005-05-11 Alan Modra + + * reloc.c (BFD_RELOC_HI16_PCREL): Define. + (BFD_RELOC_HI16_S_PCREL, BFD_RELOC_LO16_PCREL): Define. + * elf32-ppc.c (GLINK_PLTRESOLVE, GLINK_ENTRY_SIZE): Define. + (CROR_151515, CROR_313131): Delete. + (ADDIS_11_11, ADDI_11_11, SUB_11_11_30, ADD_0_11_11, ADD_11_0_11, + LWZ_0_4_30, MTCTR_0, LWZ_12_8_30, BCTR, ADDIS_11_30, + LWZU_0_X_11): Define. + (ppc_elf_howto_raw): Add R_PPC_REL16, R_PPC_REL16_LO, R_PPC_REL16_HI + and R_PPC_REL16_HA entries. + (ppc_elf_reloc_type_lookup): Convert new bfd reloc types. + (ppc_elf_addr16_ha_reloc): Also handle R_PPC_REL16_HA. + (struct ppc_elf_link_hash_table): Add glink, glink_pltresolve, + new_plt, and old_plt. + (ppc_elf_create_dynamic_sections): Create .glink section. + (ppc_elf_check_relocs): Set new_plt and old_plt. + (ppc_elf_select_plt_layout): New function. + (ppc_elf_tls_setup): Set plt output section elf type and flags. + (allocate_got): Handle differences between old and new got layout. + (allocate_dynrelocs): Likewise for plt. + (ppc_elf_size_dynamic_sections): Likewise. Allocate memory for + .glink. Don't allocate memory for old bss .plt. Emit DT_PPC_GLINK. + (ppc_elf_relax_section): Rename ppc_info to htab. Handle .glink + destination of R_PPC_PLTREL24 relocs. + (ppc_elf_relocate_section): Handle new relocs and changed destination + of R_PPC_PLTREL24. + (ppc_elf_finish_dynamic_symbol): Init new style plt and handle + differences in layout. + (ppc_elf_finish_dynamic_sections): Set DT_PPC_GLINK value. Don't + put a blrl in new got. Write glink contents. + * elf32-ppc.h (ppc_elf_select_plt_layout): Declare. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2005-05-11 Andreas Schwab + + * elf32-i386.c (elf_i386_finish_dynamic_sections): Fix signedness + warning. + +2005-05-10 H.J. Lu + + * elf.c (_bfd_elf_make_section_from_shdr): Only check debug + section if SEC_ALLOC isn't set. + 2005-05-09 Kelley Cook * configure.in: Replace AC_COMPILE_CHECK_SIZEOF with AC_CHECK_SIZEOF. @@ -135,7 +956,7 @@ (allocate_dynrelocs): Allocate space for static PLT relocations. (elf_i386_size_dynamic_sections): Save shortcuts to PLT and GOT symbols. Give PLT symbols function type. Don't strip PLT sections - if we have exported symbols from them. + if we have exported symbols from them. (elf_i386_finish_dynamic_symbol): Fill in VxWorks PLT static relocation section. Don't mark _GLOBAL_OFFSET_TABLE_ as absolute on VxWorks. @@ -823,7 +1644,7 @@ * coffcode.h (STRING_SIZE_SIZE): Updated to match libcoff-in.h. 2005-04-11 Nick Clifton - + * aout-target.h: Convert to ISO C. * aoutf1.h: Convert to ISO C. * aoutx.h: Convert to ISO C. @@ -907,7 +1728,7 @@ 2005-04-04 H.J. Lu * elf.c (bfd_elf_set_group_contents): Ignore linker created - group section. + group section. (assign_section_numbers): Accept link_info. Check SHT_GROUP sections for relocatable files only. Remove the linker created group sections. @@ -1022,8 +1843,7 @@ * configure.in: Check for ffs decl and alphabetize. * config.in: Regenerate. * configure: Regenerate. - * sysdep.h [NEED_DECLARATION_FFS] (ffs): Prototype and - alphabetize. + * sysdep.h [NEED_DECLARATION_FFS] (ffs): Prototype and alphabetize. 2005-03-29 Fred Fish diff -uprN binutils-2.16.90.0.3/bfd/coff64-rs6000.c binutils-2.16.91.0.1/bfd/coff64-rs6000.c --- binutils-2.16.90.0.3/bfd/coff64-rs6000.c 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/coff64-rs6000.c 2005-06-22 13:53:34.158440718 -0700 @@ -2713,6 +2713,8 @@ const bfd_target rs6000coff64_vec = coff_bfd_is_target_special_symbol, coff_get_lineno, coff_find_nearest_line, + _bfd_generic_find_line, + coff_find_inliner_info, coff_bfd_make_debug_symbol, _bfd_generic_read_minisymbols, _bfd_generic_minisymbol_to_symbol, @@ -2961,6 +2963,8 @@ const bfd_target aix5coff64_vec = coff_bfd_is_target_special_symbol, coff_get_lineno, coff_find_nearest_line, + _bfd_generic_find_line, + coff_find_inliner_info, coff_bfd_make_debug_symbol, _bfd_generic_read_minisymbols, _bfd_generic_minisymbol_to_symbol, diff -uprN binutils-2.16.90.0.3/bfd/coffcode.h binutils-2.16.91.0.1/bfd/coffcode.h --- binutils-2.16.90.0.3/bfd/coffcode.h 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/coffcode.h 2005-06-22 13:53:34.162440057 -0700 @@ -531,7 +531,7 @@ sec_to_styp_flags (const char *sec_name, /* FIXME: There is no gas syntax to specify the debug section flag. */ if (strncmp (sec_name, DOT_DEBUG, sizeof (DOT_DEBUG) - 1) == 0 || strncmp (sec_name, GNU_LINKONCE_WI, sizeof (GNU_LINKONCE_WI) - 1) == 0) - sec_flags = SEC_READONLY | SEC_DEBUGGING; + sec_flags = SEC_DEBUGGING; /* skip LOAD */ /* READONLY later */ @@ -545,10 +545,6 @@ sec_to_styp_flags (const char *sec_name, /* skip ROM */ /* skip constRUCTOR */ /* skip CONTENTS */ -#ifdef STYP_NOLOAD - if ((sec_flags & (SEC_NEVER_LOAD | SEC_COFF_SHARED_LIBRARY)) != 0) - styp_flags |= STYP_NOLOAD; -#endif if ((sec_flags & SEC_IS_COMMON) != 0) styp_flags |= IMAGE_SCN_LNK_COMDAT; if ((sec_flags & SEC_DEBUGGING) != 0) @@ -564,17 +560,19 @@ sec_to_styp_flags (const char *sec_name, /* skip LINK_DUPLICATES */ /* skip LINKER_CREATED */ - /* For now, the read/write bits are mapped onto SEC_READONLY, even - though the semantics don't quite match. The bits from the input - are retained in pei_section_data(abfd, section)->pe_flags. */ - - styp_flags |= IMAGE_SCN_MEM_READ; /* Always readable. */ - if ((sec_flags & SEC_READONLY) == 0) - styp_flags |= IMAGE_SCN_MEM_WRITE; /* Invert READONLY for write. */ - if (sec_flags & SEC_CODE) - styp_flags |= IMAGE_SCN_MEM_EXECUTE; /* CODE->EXECUTE. */ - if (sec_flags & SEC_COFF_SHARED) - styp_flags |= IMAGE_SCN_MEM_SHARED; /* Shared remains meaningful. */ + if (sec_flags & (SEC_ALLOC | SEC_LOAD)) + { + /* For now, the read/write bits are mapped onto SEC_READONLY, even + though the semantics don't quite match. The bits from the input + are retained in pei_section_data(abfd, section)->pe_flags. */ + styp_flags |= IMAGE_SCN_MEM_READ; /* Always readable. */ + if ((sec_flags & SEC_READONLY) == 0) + styp_flags |= IMAGE_SCN_MEM_WRITE; /* Invert READONLY for write. */ + if (sec_flags & SEC_CODE) + styp_flags |= IMAGE_SCN_MEM_EXECUTE; /* CODE->EXECUTE. */ + if (sec_flags & SEC_COFF_SHARED) + styp_flags |= IMAGE_SCN_MEM_SHARED; /* Shared remains meaningful. */ + } return styp_flags; } @@ -4832,7 +4830,7 @@ coff_slurp_reloc_table (bfd * abfd, sec_ amt = (bfd_size_type) asect->reloc_count * sizeof (arelent); reloc_cache = bfd_alloc (abfd, amt); - if (reloc_cache == NULL) + if (reloc_cache == NULL || native_relocs == NULL) return FALSE; for (idx = 0; idx < asect->reloc_count; idx++) diff -uprN binutils-2.16.90.0.3/bfd/coffgen.c binutils-2.16.91.0.1/bfd/coffgen.c --- binutils-2.16.90.0.3/bfd/coffgen.c 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/coffgen.c 2005-06-22 13:53:34.164439727 -0700 @@ -2223,6 +2223,20 @@ coff_find_nearest_line (bfd *abfd, return TRUE; } +bfd_boolean +coff_find_inliner_info (bfd *abfd, + const char **filename_ptr, + const char **functionname_ptr, + unsigned int *line_ptr) +{ + bfd_boolean found; + + found = _bfd_dwarf2_find_inliner_info (abfd, filename_ptr, + functionname_ptr, line_ptr, + &coff_data(abfd)->dwarf2_find_line_info); + return (found); +} + int coff_sizeof_headers (bfd *abfd, bfd_boolean reloc) { diff -uprN binutils-2.16.90.0.3/bfd/coff-rs6000.c binutils-2.16.91.0.1/bfd/coff-rs6000.c --- binutils-2.16.90.0.3/bfd/coff-rs6000.c 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/coff-rs6000.c 2005-06-22 13:53:34.153441544 -0700 @@ -4166,6 +4166,8 @@ const bfd_target rs6000coff_vec = coff_bfd_is_target_special_symbol, coff_get_lineno, coff_find_nearest_line, + _bfd_generic_find_line, + coff_find_inliner_info, coff_bfd_make_debug_symbol, _bfd_generic_read_minisymbols, _bfd_generic_minisymbol_to_symbol, @@ -4413,6 +4415,8 @@ const bfd_target pmac_xcoff_vec = coff_bfd_is_target_special_symbol, coff_get_lineno, coff_find_nearest_line, + _bfd_generic_find_line, + coff_find_inliner_info, coff_bfd_make_debug_symbol, _bfd_generic_read_minisymbols, _bfd_generic_minisymbol_to_symbol, diff -uprN binutils-2.16.90.0.3/bfd/config.bfd binutils-2.16.91.0.1/bfd/config.bfd --- binutils-2.16.90.0.3/bfd/config.bfd 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/config.bfd 2005-06-22 13:53:34.165439561 -0700 @@ -920,6 +920,10 @@ case "${targ}" in targ_underscore=yes ;; + ms1-*-elf) + targ_defvec=bfd_elf32_ms1_vec + ;; + msp430-*-*) targ_defvec=bfd_elf32_msp430_vec ;; diff -uprN binutils-2.16.90.0.3/bfd/config.in binutils-2.16.91.0.1/bfd/config.in --- binutils-2.16.90.0.3/bfd/config.in 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/config.in 2005-06-22 13:53:34.170438735 -0700 @@ -63,6 +63,10 @@ don't. */ #undef HAVE_DECL_REALLOC +/* Define to 1 if you have the declaration of `snprintf', and to 0 if you + don't. */ +#undef HAVE_DECL_SNPRINTF + /* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't. */ #undef HAVE_DECL_STPCPY @@ -71,6 +75,10 @@ */ #undef HAVE_DECL_STRSTR +/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you + don't. */ +#undef HAVE_DECL_VSNPRINTF + /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H @@ -337,6 +345,9 @@ /* Use mmap if it's available? */ #undef USE_MMAP +/* Define if we should default to creating read-only plt entries */ +#undef USE_SECUREPLT + /* Version number of package */ #undef VERSION diff -uprN binutils-2.16.90.0.3/bfd/configure binutils-2.16.91.0.1/bfd/configure --- binutils-2.16.90.0.3/bfd/configure 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/configure 2005-06-22 13:53:34.187435927 -0700 @@ -859,6 +859,7 @@ Optional Features: --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) --enable-targets alternative target configurations --enable-commonbfdlib build shared BFD/opcodes/libiberty library + --enable-secureplt Default to creating read-only plt entries --enable-werror treat compile warnings as errors --enable-build-warnings Enable build-time compiler warnings --enable-maintainer-mode enable make rules and dependencies not useful @@ -2835,7 +2836,7 @@ fi # Define the identity of the package. PACKAGE=bfd - VERSION=2.16.90.0.3 + VERSION=2.16.91.0.1 cat >>confdefs.h <<_ACEOF @@ -3975,7 +3976,7 @@ test x"$pic_mode" = xno && libtool_flags case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 3978 "configure"' > conftest.$ac_ext + echo '#line 3979 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4263,6 +4264,26 @@ esac else want_mmap=false fi; +# Check whether --enable-secureplt or --disable-secureplt was given. +if test "${enable_secureplt+set}" = set; then + enableval="$enable_secureplt" + case "${enableval}" in + yes) use_secureplt=true ;; + no) use_secureplt=false ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for secureplt option" >&5 +echo "$as_me: error: bad value ${enableval} for secureplt option" >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + use_secureplt=false +fi; if test $use_secureplt = true; then + +cat >>confdefs.h <<\_ACEOF +#define USE_SECUREPLT 1 +_ACEOF + +fi + WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" @@ -11174,6 +11195,150 @@ _ACEOF fi +echo "$as_me:$LINENO: checking whether snprintf is declared" >&5 +echo $ECHO_N "checking whether snprintf is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_snprintf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef snprintf + char *p = (char *) snprintf; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_snprintf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_snprintf=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_snprintf" >&5 +echo "${ECHO_T}$ac_cv_have_decl_snprintf" >&6 +if test $ac_cv_have_decl_snprintf = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SNPRINTF 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SNPRINTF 0 +_ACEOF + + +fi + + +echo "$as_me:$LINENO: checking whether vsnprintf is declared" >&5 +echo $ECHO_N "checking whether vsnprintf is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_vsnprintf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef vsnprintf + char *p = (char *) vsnprintf; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_vsnprintf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_vsnprintf=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_vsnprintf" >&5 +echo "${ECHO_T}$ac_cv_have_decl_vsnprintf" >&6 +if test $ac_cv_have_decl_vsnprintf = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VSNPRINTF 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VSNPRINTF 0 +_ACEOF + + +fi + + # If we are configured native, pick a core file support file. COREFILE= @@ -12850,6 +13015,7 @@ do bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;; bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;; + bfd_elf32_ms1_vec) tb="$tb elf32-ms1.lo elf32.lo $elf" ;; bfd_elf32_msp430_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;; bfd_elf32_nbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf32_nlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; diff -uprN binutils-2.16.90.0.3/bfd/configure.in binutils-2.16.91.0.1/bfd/configure.in --- binutils-2.16.90.0.3/bfd/configure.in 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/configure.in 2005-06-22 13:53:34.192435101 -0700 @@ -8,7 +8,7 @@ AC_CONFIG_SRCDIR([libbfd.c]) AC_CANONICAL_TARGET AC_ISC_POSIX -AM_INIT_AUTOMAKE(bfd, 2.16.90.0.3) +AM_INIT_AUTOMAKE(bfd, 2.16.91.0.1) dnl These must be called before AM_PROG_LIBTOOL, because it may want dnl to call AC_CHECK_PROG. @@ -51,6 +51,18 @@ AC_ARG_WITH(mmap, *) AC_MSG_ERROR(bad value ${withval} for BFD with-mmap option) ;; esac],[want_mmap=false])dnl +AC_ARG_ENABLE(secureplt, +[ --enable-secureplt Default to creating read-only plt entries], +[case "${enableval}" in + yes) use_secureplt=true ;; + no) use_secureplt=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for secureplt option) ;; +esac],[use_secureplt=false])dnl +if test $use_secureplt = true; then + AC_DEFINE(USE_SECUREPLT, 1, + [Define if we should default to creating read-only plt entries]) +fi + AM_BINUTILS_WARNINGS AM_CONFIG_HEADER(config.h:config.in) @@ -144,6 +156,8 @@ AC_CHECK_DECLS(malloc) AC_CHECK_DECLS(realloc) AC_CHECK_DECLS(stpcpy) AC_CHECK_DECLS(strstr) +AC_CHECK_DECLS(snprintf) +AC_CHECK_DECLS(vsnprintf) # If we are configured native, pick a core file support file. COREFILE= @@ -622,6 +636,7 @@ do bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;; bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;; + bfd_elf32_ms1_vec) tb="$tb elf32-ms1.lo elf32.lo $elf" ;; bfd_elf32_msp430_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;; bfd_elf32_nbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf32_nlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; diff -uprN binutils-2.16.90.0.3/bfd/cpu-ms1.c binutils-2.16.91.0.1/bfd/cpu-ms1.c --- binutils-2.16.90.0.3/bfd/cpu-ms1.c 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/bfd/cpu-ms1.c 2005-06-22 13:53:34.193434936 -0700 @@ -0,0 +1,57 @@ +/* BFD support for the Morpho Technologies MS1 processor. + Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" + +const bfd_arch_info_type arch_info_struct[] = +{ +{ + 32, /* Bits per word - not really true. */ + 32, /* Bits per address. */ + 8, /* Bits per byte. */ + bfd_arch_ms1, /* Architecture. */ + bfd_mach_mrisc2, /* Machine. */ + "ms1", /* Architecture name. */ + "ms1-003", /* Printable name. */ + 1, /* Section align power. */ + FALSE, /* The default ? */ + bfd_default_compatible, /* Architecture comparison fn. */ + bfd_default_scan, /* String to architecture convert fn. */ + NULL /* Next in list. */ +} +}; + +const bfd_arch_info_type bfd_ms1_arch = +{ + 32, /* Bits per word - not really true. */ + 32, /* Bits per address. */ + 8, /* Bits per byte. */ + bfd_arch_ms1, /* Architecture. */ + bfd_mach_ms1, /* Machine. */ + "ms1", /* Architecture name. */ + "ms1", /* Printable name. */ + 1, /* Section align power. */ + TRUE, /* The default ? */ + bfd_default_compatible, /* Architecture comparison fn. */ + bfd_default_scan, /* String to architecture convert fn. */ + &arch_info_struct[0] /* Next in list. */ +}; + diff -uprN binutils-2.16.90.0.3/bfd/cpu-vax.c binutils-2.16.91.0.1/bfd/cpu-vax.c --- binutils-2.16.90.0.3/bfd/cpu-vax.c 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/cpu-vax.c 2005-06-22 13:53:34.196434440 -0700 @@ -34,6 +34,6 @@ const bfd_arch_info_type bfd_vax_arch = 3, TRUE, /* the one and only */ bfd_default_compatible, - bfd_default_scan , + bfd_default_scan, 0, }; diff -uprN binutils-2.16.90.0.3/bfd/dwarf2.c binutils-2.16.91.0.1/bfd/dwarf2.c --- binutils-2.16.90.0.3/bfd/dwarf2.c 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/dwarf2.c 2005-06-22 13:53:34.199433945 -0700 @@ -118,6 +118,12 @@ struct dwarf2_debug /* Length of the loaded .debug_ranges section. */ unsigned long dwarf_ranges_size; + + /* If the most recent call to bfd_find_nearest_line was given an + address in an inlined function, preserve a pointer into the + calling chain for subsequent calls to bfd_find_inliner_info to + use. */ + struct funcinfo *inliner_chain; }; struct arange @@ -135,7 +141,7 @@ struct comp_unit /* Chain the previously read compilation units. */ struct comp_unit *next_unit; - /* Keep the bdf convenient (for memory allocation). */ + /* Keep the bfd convenient (for memory allocation). */ bfd *abfd; /* The lowest and highest addresses contained in this compilation @@ -176,6 +182,9 @@ struct comp_unit /* A list of the functions found in this comp. unit. */ struct funcinfo *function_table; + /* A list of the variables found in this comp. unit. */ + struct varinfo *variable_table; + /* Pointer to dwarf2_debug structure. */ struct dwarf2_debug *stash; @@ -680,11 +689,40 @@ struct line_info_table struct line_info* lcl_head; /* local head; used in 'add_line_info' */ }; +/* Remember some information about each function. If the function is + inlined (DW_TAG_inlined_subroutine) it may have two additional + attributes, DW_AT_call_file and DW_AT_call_line, which specify the + source code location where this function was inlined. */ + struct funcinfo { - struct funcinfo *prev_func; + struct funcinfo *prev_func; /* Pointer to previous function in list of all functions */ + struct funcinfo *caller_func; /* Pointer to function one scope higher */ + char *caller_file; /* Source location file name where caller_func inlines this func */ + int caller_line; /* Source location line number where caller_func inlines this func */ + char *file; /* Source location file name */ + int line; /* Source location line number */ + int tag; + int nesting_level; char *name; struct arange arange; + asection *sec; /* Where the symbol is defined */ +}; + +struct varinfo +{ + /* Pointer to previous variable in list of all variables */ + struct varinfo *prev_var; + /* Source location file name */ + char *file; + /* Source location line number */ + int line; + int tag; + char *name; + /* Where the symbol is defined */ + asection *sec; + /* Is this a stack variable? */ + unsigned int stack: 1; }; /* Adds a new entry to the line_info list in the line_info_table, ensuring @@ -1052,7 +1090,7 @@ decode_line_info (struct comp_unit *unit order using DW_LNE_set_address (e.g. Intel C++ 6.0 compiler for ia64-Linux). Thus, to determine the low and high address, we must compare on every DW_LNS_copy, etc. */ - bfd_vma low_pc = 0; + bfd_vma low_pc = (bfd_vma) -1; bfd_vma high_pc = 0; /* Decode the table. */ @@ -1071,7 +1109,7 @@ decode_line_info (struct comp_unit *unit /* Append row to matrix using current values. */ add_line_info (table, address, filename, line, column, 0); basic_block = 1; - if (low_pc == 0 || address < low_pc) + if (address < low_pc) low_pc = address; if (address > high_pc) high_pc = address; @@ -1090,7 +1128,7 @@ decode_line_info (struct comp_unit *unit end_sequence = 1; add_line_info (table, address, filename, line, column, end_sequence); - if (low_pc == 0 || address < low_pc) + if (address < low_pc) low_pc = address; if (address > high_pc) high_pc = address; @@ -1143,7 +1181,7 @@ decode_line_info (struct comp_unit *unit case DW_LNS_copy: add_line_info (table, address, filename, line, column, 0); basic_block = 0; - if (low_pc == 0 || address < low_pc) + if (address < low_pc) low_pc = address; if (address > high_pc) high_pc = address; @@ -1278,6 +1316,11 @@ lookup_address_in_line_info_table (struc *linenumber_ptr = each_line->line; } } + else + { + *filename_ptr = each_line->filename; + *linenumber_ptr = each_line->line; + } } if (addr_match && !each_line->end_sequence) @@ -1340,7 +1383,7 @@ read_debug_ranges (struct comp_unit *uni depending upon them being ordered in TABLE by increasing range. */ static bfd_boolean -lookup_address_in_function_table (struct funcinfo *table, +lookup_address_in_function_table (struct comp_unit *unit, bfd_vma addr, struct funcinfo **function_ptr, const char **functionname_ptr) @@ -1349,7 +1392,7 @@ lookup_address_in_function_table (struct struct funcinfo* best_fit = NULL; struct arange *arange; - for (each_func = table; + for (each_func = unit->function_table; each_func; each_func = each_func->prev_func) { @@ -1368,8 +1411,28 @@ lookup_address_in_function_table (struct if (best_fit) { + struct funcinfo* curr_func = best_fit; + *functionname_ptr = best_fit->name; *function_ptr = best_fit; + + /* If we found a match and it is a function that was inlined, + traverse the function list looking for the function at the + next higher scope and save a pointer to it for future use. + Note that because of the way the DWARF info is generated, and + the way we build the function list, the first function at the + next higher level is the one we want. */ + + for (each_func = best_fit -> prev_func; + each_func && (curr_func->tag == DW_TAG_inlined_subroutine); + each_func = each_func->prev_func) + { + if (each_func->nesting_level < curr_func->nesting_level) + { + curr_func->caller_func = each_func; + curr_func = each_func; + } + } return TRUE; } else @@ -1378,6 +1441,84 @@ lookup_address_in_function_table (struct } } +/* If SYM at ADDR is within function table of UNIT, set FILENAME_PTR + and LINENUMBER_PTR, and return TRUE. */ + +static bfd_boolean +lookup_symbol_in_function_table (struct comp_unit *unit, + asymbol *sym, + bfd_vma addr, + const char **filename_ptr, + unsigned int *linenumber_ptr) +{ + struct funcinfo* each_func; + struct funcinfo* best_fit = NULL; + struct arange *arange; + const char *name = bfd_asymbol_name (sym); + asection *sec = bfd_get_section (sym); + + for (each_func = unit->function_table; + each_func; + each_func = each_func->prev_func) + { + for (arange = &each_func->arange; + arange; + arange = arange->next) + { + if ((!each_func->sec || each_func->sec == sec) + && addr >= arange->low + && addr < arange->high + && strcmp (name, each_func->name) == 0 + && (!best_fit + || ((arange->high - arange->low) + < (best_fit->arange.high - best_fit->arange.low)))) + best_fit = each_func; + } + } + + if (best_fit) + { + best_fit->sec = sec; + *filename_ptr = best_fit->file; + *linenumber_ptr = best_fit->line; + return TRUE; + } + else + return FALSE; +} + +/* Variable table functions. */ + +/* If SYM is within variable table of UNIT, set FILENAME_PTR and + LINENUMBER_PTR, and return TRUE. */ + +static bfd_boolean +lookup_symbol_in_variable_table (struct comp_unit *unit, + asymbol *sym, + const char **filename_ptr, + unsigned int *linenumber_ptr) +{ + const char *name = bfd_asymbol_name (sym); + asection *sec = bfd_get_section (sym); + struct varinfo* each; + + for (each = unit->variable_table; each; each = each->prev_var) + if (each->stack == 0 + && (!each->sec || each->sec == sec) + && strcmp (name, each->name) == 0) + break; + + if (each) + { + each->sec = sec; + *filename_ptr = each->file; + *linenumber_ptr = each->line; + return TRUE; + } + else + return FALSE; +} + static char * find_abstract_instance_name (struct comp_unit *unit, bfd_uint64_t die_ref) { @@ -1467,10 +1608,10 @@ read_rangelist (struct comp_unit *unit, /* DWARF2 Compilation unit functions. */ /* Scan over each die in a comp. unit looking for functions to add - to the function table. */ + to the function table and variables to the variable table. */ static bfd_boolean -scan_unit_for_functions (struct comp_unit *unit) +scan_unit_for_symbols (struct comp_unit *unit) { bfd *abfd = unit->abfd; bfd_byte *info_ptr = unit->first_child_die_ptr; @@ -1482,6 +1623,7 @@ scan_unit_for_functions (struct comp_uni struct abbrev_info *abbrev; struct attribute attr; struct funcinfo *func; + struct varinfo *var; bfd_vma low_pc = 0; bfd_vma high_pc = 0; @@ -1503,16 +1645,31 @@ scan_unit_for_functions (struct comp_uni return FALSE; } + var = NULL; if (abbrev->tag == DW_TAG_subprogram + || abbrev->tag == DW_TAG_entry_point || abbrev->tag == DW_TAG_inlined_subroutine) { bfd_size_type amt = sizeof (struct funcinfo); func = bfd_zalloc (abfd, amt); + func->tag = abbrev->tag; + func->nesting_level = nesting_level; func->prev_func = unit->function_table; unit->function_table = func; } else - func = NULL; + { + func = NULL; + if (abbrev->tag == DW_TAG_variable) + { + bfd_size_type amt = sizeof (struct varinfo); + var = bfd_zalloc (abfd, amt); + var->tag = abbrev->tag; + var->stack = 1; + var->prev_var = unit->variable_table; + unit->variable_table = var; + } + } for (i = 0; i < abbrev->num_attrs; ++i) { @@ -1522,6 +1679,14 @@ scan_unit_for_functions (struct comp_uni { switch (attr.name) { + case DW_AT_call_file: + func->caller_file = concat_filename (unit->line_table, attr.u.val); + break; + + case DW_AT_call_line: + func->caller_line = attr.u.val; + break; + case DW_AT_abstract_origin: func->name = find_abstract_instance_name (unit, attr.u.val); break; @@ -1548,6 +1713,60 @@ scan_unit_for_functions (struct comp_uni read_rangelist (unit, &func->arange, attr.u.val); break; + case DW_AT_decl_file: + func->file = concat_filename (unit->line_table, + attr.u.val); + break; + + case DW_AT_decl_line: + func->line = attr.u.val; + break; + + default: + break; + } + } + else if (var) + { + switch (attr.name) + { + case DW_AT_name: + var->name = attr.u.str; + break; + + case DW_AT_decl_file: + var->file = concat_filename (unit->line_table, + attr.u.val); + break; + + case DW_AT_decl_line: + var->line = attr.u.val; + break; + + case DW_AT_external: + if (attr.u.val != 0) + var->stack = 0; + break; + + case DW_AT_location: + if (var->stack) + { + switch (attr.form) + { + case DW_FORM_block: + case DW_FORM_block1: + case DW_FORM_block2: + case DW_FORM_block4: + if (*attr.u.blk->data == DW_OP_addr) + var->stack = 0; + break; + + default: + break; + } + } + break; + default: break; } @@ -1788,7 +2007,7 @@ comp_unit_find_nearest_line (struct comp } if (unit->first_child_die_ptr < unit->end_ptr - && ! scan_unit_for_functions (unit)) + && ! scan_unit_for_symbols (unit)) { unit->error = 1; return FALSE; @@ -1796,14 +2015,68 @@ comp_unit_find_nearest_line (struct comp } function = NULL; - func_p = lookup_address_in_function_table (unit->function_table, addr, + func_p = lookup_address_in_function_table (unit, addr, &function, functionname_ptr); + if (func_p && (function->tag == DW_TAG_inlined_subroutine)) + stash->inliner_chain = function; line_p = lookup_address_in_line_info_table (unit->line_table, addr, function, filename_ptr, linenumber_ptr); return line_p || func_p; } +/* If UNIT contains SYM at ADDR, set the output parameters to the + values for the line containing SYM. The output parameters, + FILENAME_PTR, and LINENUMBER_PTR, are pointers to the objects to be + filled in. + + Return TRUE if UNIT contains SYM, and no errors were encountered; + FALSE otherwise. */ + +static bfd_boolean +comp_unit_find_line (struct comp_unit *unit, + asymbol *sym, + bfd_vma addr, + const char **filename_ptr, + unsigned int *linenumber_ptr, + struct dwarf2_debug *stash) +{ + if (unit->error) + return FALSE; + + if (! unit->line_table) + { + if (! unit->stmtlist) + { + unit->error = 1; + return FALSE; + } + + unit->line_table = decode_line_info (unit, stash); + + if (! unit->line_table) + { + unit->error = 1; + return FALSE; + } + + if (unit->first_child_die_ptr < unit->end_ptr + && ! scan_unit_for_symbols (unit)) + { + unit->error = 1; + return FALSE; + } + } + + if (sym->flags & BSF_FUNCTION) + return lookup_symbol_in_function_table (unit, sym, addr, + filename_ptr, + linenumber_ptr); + else + return lookup_symbol_in_variable_table (unit, sym, filename_ptr, + linenumber_ptr); +} + /* Locate a section in a BFD containing debugging info. The search starts from the section after AFTER_SEC, or from the first section in the BFD if AFTER_SEC is NULL. The search works by examining the names of the @@ -1954,6 +2227,8 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd if (! stash->info_ptr) return FALSE; + stash->inliner_chain = NULL; + /* Check the previously read comp. units first. */ for (each = stash->all_comp_units; each; each = each->next_unit) if (comp_unit_contains_address (each, addr)) @@ -2047,6 +2322,236 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd return FALSE; } +/* The DWARF2 version of find_line. Return TRUE if the line is found + without error. */ + +bfd_boolean +_bfd_dwarf2_find_line (bfd *abfd, + asymbol **symbols, + asymbol *symbol, + const char **filename_ptr, + unsigned int *linenumber_ptr, + unsigned int addr_size, + void **pinfo) +{ + /* Read each compilation unit from the section .debug_info, and check + to see if it contains the address we are searching for. If yes, + lookup the address, and return the line number info. If no, go + on to the next compilation unit. + + We keep a list of all the previously read compilation units, and + a pointer to the next un-read compilation unit. Check the + previously read units before reading more. */ + struct dwarf2_debug *stash; + + /* What address are we looking for? */ + bfd_vma addr; + + struct comp_unit* each; + + asection *section; + + bfd_boolean found; + + section = bfd_get_section (symbol); + + addr = symbol->value; + if (section->output_section) + addr += section->output_section->vma + section->output_offset; + else + addr += section->vma; + + *filename_ptr = NULL; + stash = *pinfo; + *filename_ptr = NULL; + *linenumber_ptr = 0; + + if (! stash) + { + bfd_size_type total_size; + asection *msec; + bfd_size_type amt = sizeof (struct dwarf2_debug); + + stash = bfd_zalloc (abfd, amt); + if (! stash) + return FALSE; + + *pinfo = stash; + + msec = find_debug_info (abfd, NULL); + if (! msec) + /* No dwarf2 info. Note that at this point the stash + has been allocated, but contains zeros, this lets + future calls to this function fail quicker. */ + return FALSE; + + /* There can be more than one DWARF2 info section in a BFD these days. + Read them all in and produce one large stash. We do this in two + passes - in the first pass we just accumulate the section sizes. + In the second pass we read in the section's contents. The allows + us to avoid reallocing the data as we add sections to the stash. */ + for (total_size = 0; msec; msec = find_debug_info (abfd, msec)) + total_size += msec->size; + + stash->info_ptr = bfd_alloc (abfd, total_size); + if (stash->info_ptr == NULL) + return FALSE; + + stash->info_ptr_end = stash->info_ptr; + + for (msec = find_debug_info (abfd, NULL); + msec; + msec = find_debug_info (abfd, msec)) + { + bfd_size_type size; + bfd_size_type start; + + size = msec->size; + if (size == 0) + continue; + + start = stash->info_ptr_end - stash->info_ptr; + + if ((bfd_simple_get_relocated_section_contents + (abfd, msec, stash->info_ptr + start, symbols)) == NULL) + continue; + + stash->info_ptr_end = stash->info_ptr + start + size; + } + + BFD_ASSERT (stash->info_ptr_end == stash->info_ptr + total_size); + + stash->sec = find_debug_info (abfd, NULL); + stash->sec_info_ptr = stash->info_ptr; + stash->syms = symbols; + } + + /* A null info_ptr indicates that there is no dwarf2 info + (or that an error occured while setting up the stash). */ + if (! stash->info_ptr) + return FALSE; + + stash->inliner_chain = NULL; + + /* Check the previously read comp. units first. */ + for (each = stash->all_comp_units; each; each = each->next_unit) + if ((symbol->flags & BSF_FUNCTION) == 0 + || comp_unit_contains_address (each, addr)) + { + found = comp_unit_find_line (each, symbol, addr, filename_ptr, + linenumber_ptr, stash); + if (found) + return found; + } + + /* The DWARF2 spec says that the initial length field, and the + offset of the abbreviation table, should both be 4-byte values. + However, some compilers do things differently. */ + if (addr_size == 0) + addr_size = 4; + BFD_ASSERT (addr_size == 4 || addr_size == 8); + + /* Read each remaining comp. units checking each as they are read. */ + while (stash->info_ptr < stash->info_ptr_end) + { + bfd_vma length; + unsigned int offset_size = addr_size; + bfd_byte *info_ptr_unit = stash->info_ptr; + + length = read_4_bytes (abfd, stash->info_ptr); + /* A 0xffffff length is the DWARF3 way of indicating we use + 64-bit offsets, instead of 32-bit offsets. */ + if (length == 0xffffffff) + { + offset_size = 8; + length = read_8_bytes (abfd, stash->info_ptr + 4); + stash->info_ptr += 12; + } + /* A zero length is the IRIX way of indicating 64-bit offsets, + mostly because the 64-bit length will generally fit in 32 + bits, and the endianness helps. */ + else if (length == 0) + { + offset_size = 8; + length = read_4_bytes (abfd, stash->info_ptr + 4); + stash->info_ptr += 8; + } + /* In the absence of the hints above, we assume addr_size-sized + offsets, for backward-compatibility with pre-DWARF3 64-bit + platforms. */ + else if (addr_size == 8) + { + length = read_8_bytes (abfd, stash->info_ptr); + stash->info_ptr += 8; + } + else + stash->info_ptr += 4; + + if (length > 0) + { + each = parse_comp_unit (abfd, stash, length, info_ptr_unit, + offset_size); + stash->info_ptr += length; + + if ((bfd_vma) (stash->info_ptr - stash->sec_info_ptr) + == stash->sec->size) + { + stash->sec = find_debug_info (abfd, stash->sec); + stash->sec_info_ptr = stash->info_ptr; + } + + if (each) + { + each->next_unit = stash->all_comp_units; + stash->all_comp_units = each; + + /* DW_AT_low_pc and DW_AT_high_pc are optional for + compilation units. If we don't have them (i.e., + unit->high == 0), we need to consult the line info + table to see if a compilation unit contains the given + address. */ + found = (((symbol->flags & BSF_FUNCTION) == 0 + || each->arange.high <= 0 + || comp_unit_contains_address (each, addr)) + && comp_unit_find_line (each, symbol, addr, + filename_ptr, + linenumber_ptr, + stash)); + if (found) + return TRUE; + } + } + } + + return FALSE; +} + +bfd_boolean +_bfd_dwarf2_find_inliner_info (bfd *abfd ATTRIBUTE_UNUSED, + const char **filename_ptr, + const char **functionname_ptr, + unsigned int *linenumber_ptr, + void **pinfo) +{ + struct dwarf2_debug *stash; + + stash = *pinfo; + if (stash) + { + struct funcinfo *func = stash->inliner_chain; + if (func && func->caller_func) + { + *filename_ptr = func->caller_file; + *functionname_ptr = func->caller_func->name; + *linenumber_ptr = func->caller_line; + stash->inliner_chain = func->caller_func; + return (TRUE); + } + } + + return (FALSE); +} + void _bfd_dwarf2_cleanup_debug_info (bfd *abfd) { diff -uprN binutils-2.16.90.0.3/bfd/elf32-arm.c binutils-2.16.91.0.1/bfd/elf32-arm.c --- binutils-2.16.90.0.3/bfd/elf32-arm.c 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-arm.c 2005-06-22 13:53:34.229428989 -0700 @@ -34,18 +34,11 @@ #define ARM_ELF_ABI_VERSION 0 #define ARM_ELF_OS_ABI_VERSION ELFOSABI_ARM -static reloc_howto_type * elf32_arm_reloc_type_lookup - PARAMS ((bfd * abfd, bfd_reloc_code_real_type code)); -static bfd_boolean elf32_arm_nabi_grok_prstatus - PARAMS ((bfd *abfd, Elf_Internal_Note *note)); -static bfd_boolean elf32_arm_nabi_grok_psinfo - PARAMS ((bfd *abfd, Elf_Internal_Note *note)); - /* Note: code such as elf32_arm_reloc_type_lookup expect to use e.g. R_ARM_PC24 as an index into this, and find the R_ARM_PC24 HOWTO in that slot. */ -static reloc_howto_type elf32_arm_howto_table[] = +static reloc_howto_type elf32_arm_howto_table_1[] = { /* No relocation */ HOWTO (R_ARM_NONE, /* type */ @@ -106,7 +99,7 @@ static reloc_howto_type elf32_arm_howto_ 0xffffffff, /* dst_mask */ TRUE), /* pcrel_offset */ - /* 8 bit absolute */ + /* 8 bit absolute - R_ARM_LDR_PC_G0 in AAELF */ HOWTO (R_ARM_PC13, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ @@ -194,7 +187,8 @@ static reloc_howto_type elf32_arm_howto_ 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO (R_ARM_THM_PC22, /* type */ + /* FIXME: Has two more bits of offset in Thumb32. */ + HOWTO (R_ARM_THM_CALL, /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 23, /* bitsize */ @@ -202,7 +196,7 @@ static reloc_howto_type elf32_arm_howto_ 0, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_ARM_THM_PC22", /* name */ + "R_ARM_THM_CALL", /* name */ FALSE, /* partial_inplace */ 0x07ff07ff, /* src_mask */ 0x07ff07ff, /* dst_mask */ @@ -222,19 +216,19 @@ static reloc_howto_type elf32_arm_howto_ 0x000000ff, /* dst_mask */ TRUE), /* pcrel_offset */ - HOWTO (R_ARM_AMP_VCALL9, /* type */ + HOWTO (R_ARM_BREL_ADJ, /* type */ 1, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - TRUE, /* pc_relative */ + 32, /* bitsize */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_ARM_AMP_VCALL9", /* name */ + "R_ARM_BREL_ADJ", /* name */ FALSE, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - TRUE), /* pcrel_offset */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_SWI24, /* type */ 0, /* rightshift */ @@ -396,7 +390,7 @@ static reloc_howto_type elf32_arm_howto_ 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO (R_ARM_GOTOFF, /* type */ + HOWTO (R_ARM_GOTOFF32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ @@ -404,7 +398,7 @@ static reloc_howto_type elf32_arm_howto_ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_ARM_GOTOFF", /* name */ + "R_ARM_GOTOFF32", /* name */ TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ @@ -480,32 +474,32 @@ static reloc_howto_type elf32_arm_howto_ 0x00ffffff, /* dst_mask */ TRUE), /* pcrel_offset */ - HOWTO (R_ARM_NONE, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - FALSE, /* pc_relative */ + HOWTO (R_ARM_THM_JUMP24, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + TRUE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ + complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_ARM_unknown_30", /* name */ + "R_ARM_THM_JUMP24", /* name */ FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - FALSE), /* pcrel_offset */ + 0x07ff2fff, /* src_mask */ + 0x07ff2fff, /* dst_mask */ + TRUE), /* pcrel_offset */ - HOWTO (R_ARM_NONE, /* type */ + HOWTO (R_ARM_BASE_ABS, /* type */ 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_ARM_unknown_31", /* name */ + "R_ARM_BASE_ABS", /* name */ FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_ARM_ALU_PCREL7_0, /* type */ @@ -661,39 +655,446 @@ static reloc_howto_type elf32_arm_howto_ 0x7fffffff, /* src_mask */ 0x7fffffff, /* dst_mask */ TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_MOVW_ABS_NC, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_MOVW_ABS_NC", /* name */ + FALSE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_ARM_MOVT_ABS, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_MOVT_ABS", /* name */ + FALSE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_ARM_MOVW_PREL_NC, /* 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_elf_generic_reloc, /* special_function */ + "R_ARM_MOVW_PREL_NC", /* name */ + FALSE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_MOVT_PREL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_MOVT_PREL", /* name */ + FALSE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_THM_MOVW_ABS_NC, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_MOVW_ABS_NC",/* name */ + FALSE, /* partial_inplace */ + 0x040f70ff, /* src_mask */ + 0x040f70ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_ARM_THM_MOVT_ABS, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_MOVT_ABS", /* name */ + FALSE, /* partial_inplace */ + 0x040f70ff, /* src_mask */ + 0x040f70ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_ARM_THM_MOVW_PREL_NC,/* 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_elf_generic_reloc, /* special_function */ + "R_ARM_THM_MOVW_PREL_NC",/* name */ + FALSE, /* partial_inplace */ + 0x040f70ff, /* src_mask */ + 0x040f70ff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_THM_MOVT_PREL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_MOVT_PREL", /* name */ + FALSE, /* partial_inplace */ + 0x040f70ff, /* src_mask */ + 0x040f70ff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_THM_JUMP19, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_JUMP19", /* name */ + FALSE, /* partial_inplace */ + 0x043f2fff, /* src_mask */ + 0x043f2fff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_THM_JUMP6, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 6, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_JUMP6", /* name */ + FALSE, /* partial_inplace */ + 0x02f8, /* src_mask */ + 0x02f8, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* These are declared as 13-bit signed relocations because we can + address -4095 .. 4095(base) by altering ADDW to SUBW or vice + versa. */ + HOWTO (R_ARM_THM_ALU_PREL_11_0,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 13, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_ALU_PREL_11_0",/* name */ + FALSE, /* partial_inplace */ + 0x040070ff, /* src_mask */ + 0x040070ff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_THM_PC12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 13, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_PC12", /* name */ + FALSE, /* partial_inplace */ + 0x040070ff, /* src_mask */ + 0x040070ff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_ABS32_NOI, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ABS32_NOI", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_ARM_REL32_NOI, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_REL32_NOI", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ }; -static reloc_howto_type elf32_arm_tls_gd32_howto = - HOWTO (R_ARM_TLS_GD32, /* type */ +/* Relocations 57 .. 83 are the "group relocations" which we do not + support. */ + +static reloc_howto_type elf32_arm_howto_table_2[] = +{ + HOWTO (R_ARM_MOVW_BREL_NC, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_MOVW_BREL_NC", /* name */ + FALSE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_ARM_MOVT_BREL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_MOVT_BREL", /* name */ + FALSE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_ARM_MOVW_BREL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_MOVW_BREL", /* name */ + FALSE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_ARM_THM_MOVW_BREL_NC,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_MOVW_BREL_NC",/* name */ + FALSE, /* partial_inplace */ + 0x040f70ff, /* src_mask */ + 0x040f70ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_ARM_THM_MOVT_BREL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_MOVT_BREL", /* name */ + FALSE, /* partial_inplace */ + 0x040f70ff, /* src_mask */ + 0x040f70ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_ARM_THM_MOVW_BREL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_MOVW_BREL", /* name */ + FALSE, /* partial_inplace */ + 0x040f70ff, /* src_mask */ + 0x040f70ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + EMPTY_HOWTO (90), /* unallocated */ + EMPTY_HOWTO (91), + EMPTY_HOWTO (92), + EMPTY_HOWTO (93), + + HOWTO (R_ARM_PLT32_ABS, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_PLT32_ABS", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_ARM_GOT_ABS, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_GOT_ABS", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_ARM_GOT_PREL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_GOT_PREL", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_GOT_BREL12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_GOT_BREL12", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_ARM_GOTOFF12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_GOTOFF12", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + EMPTY_HOWTO (R_ARM_GOTRELAX), /* reserved for future GOT-load optimizations */ + + /* GNU extension to record C++ vtable member usage */ + HOWTO (R_ARM_GNU_VTENTRY, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ + 0, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_bitfield,/* complain_on_overflow */ - NULL, /* special_function */ - "R_ARM_TLS_GD32", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE); /* pcrel_offset */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_elf_rel_vtable_reloc_fn, /* special_function */ + "R_ARM_GNU_VTENTRY", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ -static reloc_howto_type elf32_arm_tls_ldo32_howto = - HOWTO (R_ARM_TLS_LDO32, /* type */ + /* GNU extension to record C++ vtable hierarchy */ + HOWTO (R_ARM_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_ARM_GNU_VTINHERIT", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_ARM_THM_JUMP11, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 11, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_JUMP11", /* name */ + FALSE, /* partial_inplace */ + 0x000007ff, /* src_mask */ + 0x000007ff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_THM_JUMP8, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_JUMP8", /* name */ + FALSE, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* TLS relocations */ + HOWTO (R_ARM_TLS_GD32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_TLS_LDO32", /* name */ + NULL, /* special_function */ + "R_ARM_TLS_GD32", /* name */ TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - FALSE); /* pcrel_offset */ + FALSE), /* pcrel_offset */ -static reloc_howto_type elf32_arm_tls_ldm32_howto = HOWTO (R_ARM_TLS_LDM32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -706,10 +1107,9 @@ static reloc_howto_type elf32_arm_tls_ld TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - FALSE); /* pcrel_offset */ + FALSE), /* pcrel_offset */ -static reloc_howto_type elf32_arm_tls_le32_howto = - HOWTO (R_ARM_TLS_LE32, /* type */ + HOWTO (R_ARM_TLS_LDO32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ @@ -717,13 +1117,12 @@ static reloc_howto_type elf32_arm_tls_le 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_ARM_TLS_LE32", /* name */ + "R_ARM_TLS_LDO32", /* name */ TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - FALSE); /* pcrel_offset */ + FALSE), /* pcrel_offset */ -static reloc_howto_type elf32_arm_tls_ie32_howto = HOWTO (R_ARM_TLS_IE32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -736,90 +1135,72 @@ static reloc_howto_type elf32_arm_tls_ie TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - FALSE); /* pcrel_offset */ - - /* GNU extension to record C++ vtable hierarchy */ -static reloc_howto_type elf32_arm_vtinherit_howto = - HOWTO (R_ARM_GNU_VTINHERIT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - NULL, /* special_function */ - "R_ARM_GNU_VTINHERIT", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - FALSE); /* pcrel_offset */ + FALSE), /* pcrel_offset */ - /* GNU extension to record C++ vtable member usage */ -static reloc_howto_type elf32_arm_vtentry_howto = - HOWTO (R_ARM_GNU_VTENTRY, /* type */ + HOWTO (R_ARM_TLS_LE32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ + 32, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - _bfd_elf_rel_vtable_reloc_fn, /* special_function */ - "R_ARM_GNU_VTENTRY", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - FALSE); /* pcrel_offset */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_TLS_LE32", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ - /* 12 bit pc relative */ -static reloc_howto_type elf32_arm_thm_pc11_howto = - HOWTO (R_ARM_THM_PC11, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 11, /* bitsize */ - TRUE, /* pc_relative */ + HOWTO (R_ARM_TLS_LDO12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ + complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_ARM_THM_PC11", /* name */ + "R_ARM_TLS_LDO12", /* name */ FALSE, /* partial_inplace */ - 0x000007ff, /* src_mask */ - 0x000007ff, /* dst_mask */ - TRUE); /* pcrel_offset */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ - /* 12 bit pc relative */ -static reloc_howto_type elf32_arm_thm_pc9_howto = - HOWTO (R_ARM_THM_PC9, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - TRUE, /* pc_relative */ + HOWTO (R_ARM_TLS_LE12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ + complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_ARM_THM_PC9", /* name */ + "R_ARM_TLS_LE12", /* name */ FALSE, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - TRUE); /* pcrel_offset */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ -/* Place relative GOT-indirect. */ -static reloc_howto_type elf32_arm_got_prel = - HOWTO (R_ARM_GOT_PREL, /* type */ + HOWTO (R_ARM_TLS_IE12GP, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - TRUE, /* pc_relative */ + 12, /* bitsize */ + FALSE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ + complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_ARM_GOT_PREL", /* name */ + "R_ARM_TLS_IE12GP", /* name */ FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - TRUE); /* pcrel_offset */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ +}; -/* Currently unused relocations. */ -static reloc_howto_type elf32_arm_r_howto[4] = +/* 112-127 private relocations + 128 R_ARM_ME_TOO, obsolete + 129-255 unallocated in AAELF. + + 249-255 extended, currently unused, relocations: */ + +static reloc_howto_type elf32_arm_howto_table_3[4] = { HOWTO (R_ARM_RREL32, /* type */ 0, /* rightshift */ @@ -881,55 +1262,18 @@ static reloc_howto_type elf32_arm_r_howt static reloc_howto_type * elf32_arm_howto_from_type (unsigned int r_type) { - if (r_type < NUM_ELEM (elf32_arm_howto_table)) - return &elf32_arm_howto_table[r_type]; - - switch (r_type) - { - case R_ARM_GOT_PREL: - return &elf32_arm_got_prel; - - case R_ARM_GNU_VTINHERIT: - return &elf32_arm_vtinherit_howto; - - case R_ARM_GNU_VTENTRY: - return &elf32_arm_vtentry_howto; - - case R_ARM_THM_PC11: - return &elf32_arm_thm_pc11_howto; - - case R_ARM_THM_PC9: - return &elf32_arm_thm_pc9_howto; - - case R_ARM_TLS_GD32: - return &elf32_arm_tls_gd32_howto; - break; - - case R_ARM_TLS_LDO32: - return &elf32_arm_tls_ldo32_howto; - break; - - case R_ARM_TLS_LDM32: - return &elf32_arm_tls_ldm32_howto; - break; - - case R_ARM_TLS_IE32: - return &elf32_arm_tls_ie32_howto; - break; + if (r_type < NUM_ELEM (elf32_arm_howto_table_1)) + return &elf32_arm_howto_table_1[r_type]; - case R_ARM_TLS_LE32: - return &elf32_arm_tls_le32_howto; - break; + if (r_type >= R_ARM_MOVW_BREL_NC + && r_type < R_ARM_MOVW_BREL_NC + NUM_ELEM (elf32_arm_howto_table_2)) + return &elf32_arm_howto_table_2[r_type - R_ARM_MOVW_BREL_NC]; + + if (r_type >= R_ARM_RREL32 + && r_type < R_ARM_RREL32 + NUM_ELEM (elf32_arm_howto_table_2)) + return &elf32_arm_howto_table_3[r_type - R_ARM_RREL32]; - case R_ARM_RREL32: - case R_ARM_RABS32: - case R_ARM_RPC24: - case R_ARM_RBASE: - return &elf32_arm_r_howto[r_type - R_ARM_RREL32]; - - default: - return NULL; - } + return NULL; } static void @@ -961,12 +1305,16 @@ static const struct elf32_arm_reloc_map {BFD_RELOC_16, R_ARM_ABS16}, {BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12}, {BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5}, - {BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22}, - {BFD_RELOC_ARM_COPY, R_ARM_COPY}, + {BFD_RELOC_THUMB_PCREL_BRANCH25, R_ARM_THM_JUMP24}, + {BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_CALL}, + {BFD_RELOC_THUMB_PCREL_BRANCH12, R_ARM_THM_JUMP11}, + {BFD_RELOC_THUMB_PCREL_BRANCH20, R_ARM_THM_JUMP19}, + {BFD_RELOC_THUMB_PCREL_BRANCH9, R_ARM_THM_JUMP8}, + {BFD_RELOC_THUMB_PCREL_BRANCH7, R_ARM_THM_JUMP6}, {BFD_RELOC_ARM_GLOB_DAT, R_ARM_GLOB_DAT}, {BFD_RELOC_ARM_JUMP_SLOT, R_ARM_JUMP_SLOT}, {BFD_RELOC_ARM_RELATIVE, R_ARM_RELATIVE}, - {BFD_RELOC_ARM_GOTOFF, R_ARM_GOTOFF}, + {BFD_RELOC_ARM_GOTOFF, R_ARM_GOTOFF32}, {BFD_RELOC_ARM_GOTPC, R_ARM_GOTPC}, {BFD_RELOC_ARM_GOT32, R_ARM_GOT32}, {BFD_RELOC_ARM_PLT32, R_ARM_PLT32}, @@ -984,58 +1332,25 @@ static const struct elf32_arm_reloc_map {BFD_RELOC_ARM_TLS_TPOFF32, R_ARM_TLS_TPOFF32}, {BFD_RELOC_ARM_TLS_IE32, R_ARM_TLS_IE32}, {BFD_RELOC_ARM_TLS_LE32, R_ARM_TLS_LE32}, + {BFD_RELOC_VTABLE_INHERIT, R_ARM_GNU_VTINHERIT}, + {BFD_RELOC_VTABLE_ENTRY, R_ARM_GNU_VTENTRY}, }; static reloc_howto_type * -elf32_arm_reloc_type_lookup (abfd, code) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_reloc_code_real_type code; +elf32_arm_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) { unsigned int i; + for (i = 0; i < NUM_ELEM (elf32_arm_reloc_map); i ++) + if (elf32_arm_reloc_map[i].bfd_reloc_val == code) + return elf32_arm_howto_from_type (elf32_arm_reloc_map[i].elf_reloc_val); - switch (code) - { - case BFD_RELOC_VTABLE_INHERIT: - return & elf32_arm_vtinherit_howto; - - case BFD_RELOC_VTABLE_ENTRY: - return & elf32_arm_vtentry_howto; - - case BFD_RELOC_THUMB_PCREL_BRANCH12: - return & elf32_arm_thm_pc11_howto; - - case BFD_RELOC_THUMB_PCREL_BRANCH9: - return & elf32_arm_thm_pc9_howto; - - case BFD_RELOC_ARM_TLS_GD32: - return & elf32_arm_tls_gd32_howto; - - case BFD_RELOC_ARM_TLS_LDO32: - return & elf32_arm_tls_ldo32_howto; - - case BFD_RELOC_ARM_TLS_LDM32: - return & elf32_arm_tls_ldm32_howto; - - case BFD_RELOC_ARM_TLS_IE32: - return & elf32_arm_tls_ie32_howto; - - case BFD_RELOC_ARM_TLS_LE32: - return & elf32_arm_tls_le32_howto; - - default: - for (i = 0; i < NUM_ELEM (elf32_arm_reloc_map); i ++) - if (elf32_arm_reloc_map[i].bfd_reloc_val == code) - return & elf32_arm_howto_table[elf32_arm_reloc_map[i].elf_reloc_val]; - - return NULL; - } + return NULL; } /* Support for core dump NOTE sections */ static bfd_boolean -elf32_arm_nabi_grok_prstatus (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +elf32_arm_nabi_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) { int offset; size_t size; @@ -1065,9 +1380,7 @@ elf32_arm_nabi_grok_prstatus (abfd, note } static bfd_boolean -elf32_arm_nabi_grok_psinfo (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +elf32_arm_nabi_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) { switch (note->descsz) { @@ -2030,11 +2343,9 @@ bfd_elf32_arm_process_before_allocation /* These are the only relocation types we care about. */ if ( r_type != R_ARM_PC24 && r_type != R_ARM_PLT32 -#ifndef OLD_ARM_ABI && r_type != R_ARM_CALL && r_type != R_ARM_JUMP24 -#endif - && r_type != R_ARM_THM_PC22) + && r_type != R_ARM_THM_CALL) continue; /* Get the section contents if we haven't done so already. */ @@ -2077,10 +2388,8 @@ bfd_elf32_arm_process_before_allocation { case R_ARM_PC24: case R_ARM_PLT32: -#ifndef OLD_ARM_ABI case R_ARM_CALL: case R_ARM_JUMP24: -#endif /* This one is a call from arm code. We need to look up the target of the call. If it is a thumb target, we insert glue. */ @@ -2088,7 +2397,7 @@ bfd_elf32_arm_process_before_allocation record_arm_to_thumb_glue (link_info, h); break; - case R_ARM_THM_PC22: + case R_ARM_THM_CALL: /* This one is a call from thumb code. We look up the target of the call. If it is not a thumb target, we insert glue. */ @@ -2127,7 +2436,6 @@ error_return: #endif -#ifndef OLD_ARM_ABI /* Set target relocation values needed during linking. */ void @@ -2156,7 +2464,6 @@ bfd_elf32_arm_set_target_relocs (struct globals->fix_v4bx = fix_v4bx; globals->use_blx |= use_blx; } -#endif /* The thumb form of a long branch is a bit finicky, because the offset encoding is split over two fields, each in it's own instruction. They @@ -2427,8 +2734,6 @@ elf32_arm_to_thumb_stub (struct bfd_link return TRUE; } - -#ifndef OLD_ARM_ABI /* Some relocations map to different relocations depending on the target. Return the real relocation. */ static int @@ -2450,8 +2755,6 @@ arm_real_reloc_type (struct elf32_arm_li return r_type; } } -#endif /* OLD_ARM_ABI */ - /* Return the base VMA address which should be subtracted from real addresses when resolving @dtpoff relocation. @@ -2515,13 +2818,11 @@ elf32_arm_final_link_relocate (reloc_how globals = elf32_arm_hash_table (info); -#ifndef OLD_ARM_ABI /* Some relocation type map to different relocations depending on the target. We pick the right one here. */ r_type = arm_real_reloc_type (globals, r_type); if (r_type != howto->type) howto = elf32_arm_howto_from_type (r_type); -#endif /* OLD_ARM_ABI */ /* If the start address has been set, then set the EF_ARM_HASENTRY flag. Setting this more than once is redundant, but the cost is @@ -2573,12 +2874,10 @@ elf32_arm_final_link_relocate (reloc_how case R_ARM_PC24: case R_ARM_ABS32: case R_ARM_REL32: -#ifndef OLD_ARM_ABI case R_ARM_CALL: case R_ARM_JUMP24: case R_ARM_XPC25: case R_ARM_PREL31: -#endif case R_ARM_PLT32: /* r_symndx will be zero only for relocs against symbols from removed linkonce sections, or sections discarded by @@ -2620,11 +2919,9 @@ elf32_arm_final_link_relocate (reloc_how || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT || h->root.type != bfd_link_hash_undefweak) && r_type != R_ARM_PC24 -#ifndef OLD_ARM_ABI && r_type != R_ARM_CALL && r_type != R_ARM_JUMP24 && r_type != R_ARM_PREL31 -#endif && r_type != R_ARM_PLT32) { Elf_Internal_Rela outrel; @@ -2692,7 +2989,10 @@ elf32_arm_final_link_relocate (reloc_how the section symbol as it is convenient. (We cannot use the symbol given by "h" directly as it will not appear in the dynamic symbol table.) */ - symbol = elf_section_data (sym_sec->output_section)->dynindx; + if (sym_sec) + symbol = elf_section_data (sym_sec->output_section)->dynindx; + else + symbol = elf_section_data (input_section->output_section)->dynindx; BFD_ASSERT (symbol != 0); } else @@ -2719,14 +3019,11 @@ elf32_arm_final_link_relocate (reloc_how } else switch (r_type) { -#ifndef OLD_ARM_ABI case R_ARM_XPC25: /* Arm BLX instruction. */ case R_ARM_CALL: case R_ARM_JUMP24: -#endif case R_ARM_PC24: /* Arm B/BL instruction */ case R_ARM_PLT32: -#ifndef OLD_ARM_ABI if (r_type == R_ARM_XPC25) { /* Check for Arm calling Arm function. */ @@ -2739,7 +3036,6 @@ elf32_arm_final_link_relocate (reloc_how h ? h->root.root.string : "(local)"); } else -#endif { /* Check for Arm calling Thumb function. */ if (sym_flags == STT_ARM_TFUNC) @@ -2795,14 +3091,12 @@ elf32_arm_final_link_relocate (reloc_how return bfd_reloc_overflow; } -#ifndef OLD_ARM_ABI /* If necessary set the H bit in the BLX instruction. */ if (r_type == R_ARM_XPC25 && ((value & 2) == 2)) value = (signed_addend & howto->dst_mask) | (bfd_get_32 (input_bfd, hit_data) & (~ howto->dst_mask)) | (1 << 24); else -#endif value = (signed_addend & howto->dst_mask) | (bfd_get_32 (input_bfd, hit_data) & (~ howto->dst_mask)); break; @@ -2819,7 +3113,6 @@ elf32_arm_final_link_relocate (reloc_how value += addend; break; -#ifndef OLD_ARM_ABI case R_ARM_PREL31: value -= (input_section->output_section->vma + input_section->output_offset + rel->r_offset); @@ -2835,7 +3128,6 @@ elf32_arm_final_link_relocate (reloc_how if (sym_flags == STT_ARM_TFUNC) value |= 1; break; -#endif } bfd_put_32 (input_bfd, value, hit_data); @@ -2890,10 +3182,8 @@ elf32_arm_final_link_relocate (reloc_how bfd_put_16 (input_bfd, value, hit_data); return bfd_reloc_ok; -#ifndef OLD_ARM_ABI case R_ARM_THM_XPC22: -#endif - case R_ARM_THM_PC22: + case R_ARM_THM_CALL: /* Thumb BL (branch long instruction). */ { bfd_vma relocation; @@ -2916,7 +3206,7 @@ elf32_arm_final_link_relocate (reloc_how addend = (upper << 12) | (lower << 1); signed_addend = addend; } -#ifndef OLD_ARM_ABI + if (r_type == R_ARM_THM_XPC22) { /* Check for Thumb to Thumb call. */ @@ -2929,7 +3219,6 @@ elf32_arm_final_link_relocate (reloc_how h ? h->root.root.string : "(local)"); } else -#endif { /* If it is not a call to Thumb, assume call to Arm. If it is a call relative to a section name, then it is not a @@ -2989,7 +3278,6 @@ elf32_arm_final_link_relocate (reloc_how if (signed_check > reloc_signed_max || signed_check < reloc_signed_min) overflow = TRUE; -#ifndef OLD_ARM_ABI if ((r_type == R_ARM_THM_XPC22 && ((lower_insn & 0x1800) == 0x0800)) || thumb_plt_call) @@ -2998,7 +3286,7 @@ elf32_arm_final_link_relocate (reloc_how which specifies that bit 1 of the target address will come from bit 1 of the base address. */ relocation = (relocation + 2) & ~ 3; -#endif + /* Put RELOCATION back into the insn. */ upper_insn = (upper_insn & ~(bfd_vma) 0x7ff) | ((relocation >> 12) & 0x7ff); lower_insn = (lower_insn & ~(bfd_vma) 0x7ff) | ((relocation >> 1) & 0x7ff); @@ -3011,8 +3299,153 @@ elf32_arm_final_link_relocate (reloc_how } break; - case R_ARM_THM_PC11: - case R_ARM_THM_PC9: + case R_ARM_THM_JUMP24: + /* Thumb32 unconditional branch instruction. */ + { + bfd_vma relocation; + bfd_boolean overflow = FALSE; + bfd_vma upper_insn = bfd_get_16 (input_bfd, hit_data); + bfd_vma lower_insn = bfd_get_16 (input_bfd, hit_data + 2); + bfd_signed_vma reloc_signed_max = ((1 << (howto->bitsize - 1)) - 1) >> howto->rightshift; + bfd_signed_vma reloc_signed_min = ~ reloc_signed_max; + bfd_vma check; + bfd_signed_vma signed_check; + + /* Need to refetch the addend, reconstruct the top three bits, and glue the + two pieces together. */ + if (globals->use_rel) + { + bfd_vma S = (upper_insn & 0x0400) >> 10; + bfd_vma hi = (upper_insn & 0x03ff); + bfd_vma I1 = (lower_insn & 0x2000) >> 13; + bfd_vma I2 = (lower_insn & 0x0800) >> 11; + bfd_vma lo = (lower_insn & 0x07ff); + + I1 = !(I1 ^ S); + I2 = !(I2 ^ S); + S = !S; + + signed_addend = (S << 24) | (I1 << 23) | (I2 << 22) | (hi << 12) | (lo << 1); + signed_addend -= (1 << 24); /* Sign extend. */ + } + + /* ??? Should handle interworking? GCC might someday try to + use this for tail calls. */ + + relocation = value + signed_addend; + relocation -= (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset); + + check = relocation >> howto->rightshift; + + /* If this is a signed value, the rightshift just dropped + leading 1 bits (assuming twos complement). */ + if ((bfd_signed_vma) relocation >= 0) + signed_check = check; + else + signed_check = check | ~((bfd_vma) -1 >> howto->rightshift); + + /* Assumes two's complement. */ + if (signed_check > reloc_signed_max || signed_check < reloc_signed_min) + overflow = TRUE; + + /* Put RELOCATION back into the insn. */ + { + bfd_vma S = (relocation & 0x01000000) >> 24; + bfd_vma I1 = (relocation & 0x00800000) >> 23; + bfd_vma I2 = (relocation & 0x00400000) >> 22; + bfd_vma hi = (relocation & 0x003ff000) >> 12; + bfd_vma lo = (relocation & 0x00000ffe) >> 1; + + I1 = !(I1 ^ S); + I2 = !(I2 ^ S); + + upper_insn = (upper_insn & (bfd_vma) 0xf800) | (S << 10) | hi; + lower_insn = (lower_insn & (bfd_vma) 0xd000) | (I1 << 13) | (I2 << 11) | lo; + } + + /* Put the relocated value back in the object file: */ + bfd_put_16 (input_bfd, upper_insn, hit_data); + bfd_put_16 (input_bfd, lower_insn, hit_data + 2); + + return (overflow ? bfd_reloc_overflow : bfd_reloc_ok); + } + + case R_ARM_THM_JUMP19: + /* Thumb32 conditional branch instruction. */ + { + bfd_vma relocation; + bfd_boolean overflow = FALSE; + bfd_vma upper_insn = bfd_get_16 (input_bfd, hit_data); + bfd_vma lower_insn = bfd_get_16 (input_bfd, hit_data + 2); + bfd_signed_vma reloc_signed_max = ((1 << (howto->bitsize - 1)) - 1) >> howto->rightshift; + bfd_signed_vma reloc_signed_min = ~ reloc_signed_max; + bfd_vma check; + bfd_signed_vma signed_check; + + /* Need to refetch the addend, reconstruct the top three bits, + and squish the two 11 bit pieces together. */ + if (globals->use_rel) + { + bfd_vma S = (upper_insn & 0x0400) >> 10; + bfd_vma upper = (upper_insn & 0x001f); + bfd_vma J1 = (lower_insn & 0x2000) >> 13; + bfd_vma J2 = (lower_insn & 0x0800) >> 11; + bfd_vma lower = (lower_insn & 0x07ff); + + upper |= J2 << 6; + upper |= J1 << 7; + upper |= ~S << 8; + upper -= 0x0100; /* Sign extend. */ + + addend = (upper << 12) | (lower << 1); + signed_addend = addend; + } + + /* ??? Should handle interworking? GCC might someday try to + use this for tail calls. */ + + relocation = value + signed_addend; + relocation -= (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset); + + check = relocation >> howto->rightshift; + + /* If this is a signed value, the rightshift just dropped + leading 1 bits (assuming twos complement). */ + if ((bfd_signed_vma) relocation >= 0) + signed_check = check; + else + signed_check = check | ~((bfd_vma) -1 >> howto->rightshift); + + /* Assumes two's complement. */ + if (signed_check > reloc_signed_max || signed_check < reloc_signed_min) + overflow = TRUE; + + /* Put RELOCATION back into the insn. */ + { + bfd_vma S = (relocation & 0x00100000) >> 20; + bfd_vma J2 = (relocation & 0x00080000) >> 19; + bfd_vma J1 = (relocation & 0x00040000) >> 18; + bfd_vma hi = (relocation & 0x0003f000) >> 12; + bfd_vma lo = (relocation & 0x00000ffe) >> 1; + + upper_insn = (upper_insn & 0xfb30) | (S << 10) | hi; + lower_insn = (lower_insn & 0xd000) | (J1 << 13) | (J2 << 11) | lo; + } + + /* Put the relocated value back in the object file: */ + bfd_put_16 (input_bfd, upper_insn, hit_data); + bfd_put_16 (input_bfd, lower_insn, hit_data + 2); + + return (overflow ? bfd_reloc_overflow : bfd_reloc_ok); + } + + case R_ARM_THM_JUMP11: + case R_ARM_THM_JUMP8: + case R_ARM_THM_JUMP6: /* Thumb B (branch) instruction). */ { bfd_signed_vma relocation; @@ -3020,6 +3453,10 @@ elf32_arm_final_link_relocate (reloc_how bfd_signed_vma reloc_signed_min = ~ reloc_signed_max; bfd_signed_vma signed_check; + /* CZB cannot jump backward. */ + if (r_type == R_ARM_THM_JUMP6) + reloc_signed_min = 0; + if (globals->use_rel) { /* Need to refetch addend. */ @@ -3045,7 +3482,11 @@ elf32_arm_final_link_relocate (reloc_how relocation >>= howto->rightshift; signed_check = relocation; - relocation &= howto->dst_mask; + + if (r_type == R_ARM_THM_JUMP6) + relocation = ((relocation & 0x0020) << 4) | ((relocation & 0x001f) << 3); + else + relocation &= howto->dst_mask; relocation |= (bfd_get_16 (input_bfd, hit_data) & (~ howto->dst_mask)); bfd_put_16 (input_bfd, relocation, hit_data); @@ -3057,7 +3498,6 @@ elf32_arm_final_link_relocate (reloc_how return bfd_reloc_ok; } -#ifndef OLD_ARM_ABI case R_ARM_ALU_PCREL7_0: case R_ARM_ALU_PCREL15_8: case R_ARM_ALU_PCREL23_15: @@ -3083,25 +3523,12 @@ elf32_arm_final_link_relocate (reloc_how bfd_put_32 (input_bfd, value, hit_data); } return bfd_reloc_ok; -#endif case R_ARM_GNU_VTINHERIT: case R_ARM_GNU_VTENTRY: return bfd_reloc_ok; - case R_ARM_COPY: - return bfd_reloc_notsupported; - - case R_ARM_GLOB_DAT: - return bfd_reloc_notsupported; - - case R_ARM_JUMP_SLOT: - return bfd_reloc_notsupported; - - case R_ARM_RELATIVE: - return bfd_reloc_notsupported; - - case R_ARM_GOTOFF: + case R_ARM_GOTOFF32: /* Relocation is relative to the start of the global offset table. */ @@ -3139,9 +3566,7 @@ elf32_arm_final_link_relocate (reloc_how (bfd_vma) 0); case R_ARM_GOT32: -#ifndef OLD_ARM_ABI case R_ARM_GOT_PREL: -#endif /* Relocation is to the entry for this symbol in the global offset table. */ if (sgot == NULL) @@ -3462,30 +3887,6 @@ elf32_arm_final_link_relocate (reloc_how return _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, value, (bfd_vma) 0); - case R_ARM_SBREL32: - return bfd_reloc_notsupported; - - case R_ARM_AMP_VCALL9: - return bfd_reloc_notsupported; - - case R_ARM_RSBREL32: - return bfd_reloc_notsupported; - - case R_ARM_THM_RPC22: - return bfd_reloc_notsupported; - - case R_ARM_RREL32: - return bfd_reloc_notsupported; - - case R_ARM_RABS32: - return bfd_reloc_notsupported; - - case R_ARM_RPC24: - return bfd_reloc_notsupported; - - case R_ARM_RBASE: - return bfd_reloc_notsupported; - case R_ARM_V4BX: if (globals->fix_v4bx) { @@ -3516,7 +3917,7 @@ arm_add_to_rel (bfd * abfd, { bfd_signed_vma addend; - if (howto->type == R_ARM_THM_PC22) + if (howto->type == R_ARM_THM_CALL) { int upper_insn, lower_insn; int upper, lower; @@ -3562,10 +3963,8 @@ arm_add_to_rel (bfd * abfd, case R_ARM_PC24: case R_ARM_PLT32: -#ifndef OLD_ARM_ABI case R_ARM_CALL: case R_ARM_JUMP24: -#endif addend <<= howto->size; addend += increment; @@ -4375,15 +4774,11 @@ elf32_arm_gc_sweep_hook (bfd * } r_type = ELF32_R_TYPE (rel->r_info); -#ifndef OLD_ARM_ABI r_type = arm_real_reloc_type (globals, r_type); -#endif switch (r_type) { case R_ARM_GOT32: -#ifndef OLD_ARM_ABI case R_ARM_GOT_PREL: -#endif case R_ARM_TLS_GD32: case R_ARM_TLS_IE32: if (h != NULL) @@ -4406,12 +4801,10 @@ elf32_arm_gc_sweep_hook (bfd * case R_ARM_REL32: case R_ARM_PC24: case R_ARM_PLT32: -#ifndef OLD_ARM_ABI case R_ARM_CALL: case R_ARM_JUMP24: case R_ARM_PREL31: -#endif - case R_ARM_THM_PC22: + case R_ARM_THM_CALL: /* Should the interworking branches be here also? */ if (h != NULL) @@ -4425,7 +4818,7 @@ elf32_arm_gc_sweep_hook (bfd * if (h->plt.refcount > 0) { h->plt.refcount -= 1; - if (ELF32_R_TYPE (rel->r_info) == R_ARM_THM_PC22) + if (ELF32_R_TYPE (rel->r_info) == R_ARM_THM_CALL) eh->plt_thumb_refcount--; } @@ -4507,9 +4900,7 @@ elf32_arm_check_relocs (bfd *abfd, struc r_symndx = ELF32_R_SYM (rel->r_info); r_type = ELF32_R_TYPE (rel->r_info); -#ifndef OLD_ARM_ABI r_type = arm_real_reloc_type (htab, r_type); -#endif if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) { @@ -4521,16 +4912,19 @@ elf32_arm_check_relocs (bfd *abfd, struc if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } eh = (struct elf32_arm_link_hash_entry *) h; switch (r_type) { case R_ARM_GOT32: -#ifndef OLD_ARM_ABI case R_ARM_GOT_PREL: -#endif case R_ARM_TLS_GD32: case R_ARM_TLS_IE32: /* This symbol requires a global offset table entry. */ @@ -4595,7 +4989,7 @@ elf32_arm_check_relocs (bfd *abfd, struc htab->tls_ldm_got.refcount++; /* Fall through */ - case R_ARM_GOTOFF: + case R_ARM_GOTOFF32: case R_ARM_GOTPC: if (htab->sgot == NULL) { @@ -4610,12 +5004,10 @@ elf32_arm_check_relocs (bfd *abfd, struc case R_ARM_REL32: case R_ARM_PC24: case R_ARM_PLT32: -#ifndef OLD_ARM_ABI case R_ARM_CALL: case R_ARM_JUMP24: case R_ARM_PREL31: -#endif - case R_ARM_THM_PC22: + case R_ARM_THM_CALL: /* Should the interworking branches be listed here? */ if (h != NULL) { @@ -4633,20 +5025,18 @@ elf32_arm_check_relocs (bfd *abfd, struc sure yet, because something later might force the symbol local. */ if (r_type == R_ARM_PC24 -#ifndef OLD_ARM_ABI || r_type == R_ARM_CALL || r_type == R_ARM_JUMP24 || r_type == R_ARM_PREL31 -#endif || r_type == R_ARM_PLT32 - || r_type == R_ARM_THM_PC22) + || r_type == R_ARM_THM_CALL) h->needs_plt = 1; /* If we create a PLT entry, this relocation will reference it, even if it's an ABS32 relocation. */ h->plt.refcount += 1; - if (r_type == R_ARM_THM_PC22) + if (r_type == R_ARM_THM_CALL) eh->plt_thumb_refcount += 1; } @@ -4892,6 +5282,19 @@ elf32_arm_find_nearest_line (bfd * return TRUE; } +static bfd_boolean +elf32_arm_find_inliner_info (bfd * abfd, + const char ** filename_ptr, + const char ** functionname_ptr, + unsigned int * line_ptr) +{ + bfd_boolean found; + found = _bfd_dwarf2_find_inliner_info (abfd, filename_ptr, + functionname_ptr, line_ptr, + & elf_tdata (abfd)->dwarf2_find_line_info); + return found; +} + /* Adjust a symbol defined by a dynamic object and referenced by a regular object. The current definition is in some section of the dynamic object, but we're not including those sections. We have to @@ -6413,6 +6816,7 @@ const struct elf_size_info elf32_arm_siz #define bfd_elf32_bfd_link_hash_table_create elf32_arm_link_hash_table_create #define bfd_elf32_bfd_reloc_type_lookup elf32_arm_reloc_type_lookup #define bfd_elf32_find_nearest_line elf32_arm_find_nearest_line +#define bfd_elf32_find_inliner_info elf32_arm_find_inliner_info #define bfd_elf32_new_section_hook elf32_arm_new_section_hook #define bfd_elf32_bfd_is_target_special_symbol elf32_arm_is_target_special_symbol diff -uprN binutils-2.16.90.0.3/bfd/elf32-avr.c binutils-2.16.91.0.1/bfd/elf32-avr.c --- binutils-2.16.90.0.3/bfd/elf32-avr.c 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-avr.c 2005-06-22 13:53:34.230428824 -0700 @@ -523,7 +523,12 @@ elf32_avr_check_relocs (abfd, info, sec, if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } } return TRUE; diff -uprN binutils-2.16.90.0.3/bfd/elf32-cris.c binutils-2.16.91.0.1/bfd/elf32-cris.c --- binutils-2.16.90.0.3/bfd/elf32-cris.c 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-cris.c 2005-06-22 13:53:34.233428328 -0700 @@ -2479,7 +2479,12 @@ cris_elf_check_relocs (abfd, info, sec, if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } r_type = ELF32_R_TYPE (rel->r_info); diff -uprN binutils-2.16.90.0.3/bfd/elf32-d10v.c binutils-2.16.91.0.1/bfd/elf32-d10v.c --- binutils-2.16.90.0.3/bfd/elf32-d10v.c 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-d10v.c 2005-06-22 13:53:34.233428328 -0700 @@ -327,7 +327,12 @@ elf32_d10v_check_relocs (abfd, info, sec if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } switch (ELF32_R_TYPE (rel->r_info)) { diff -uprN binutils-2.16.90.0.3/bfd/elf32-dlx.c binutils-2.16.91.0.1/bfd/elf32-dlx.c --- binutils-2.16.90.0.3/bfd/elf32-dlx.c 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-dlx.c 2005-06-22 13:53:34.240427172 -0700 @@ -477,7 +477,12 @@ elf32_dlx_check_relocs (abfd, info, sec, if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } switch (ELF32_R_TYPE (rel->r_info)) { diff -uprN binutils-2.16.90.0.3/bfd/elf32-fr30.c binutils-2.16.91.0.1/bfd/elf32-fr30.c --- binutils-2.16.90.0.3/bfd/elf32-fr30.c 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-fr30.c 2005-06-22 13:53:34.244426511 -0700 @@ -707,7 +707,12 @@ fr30_elf_check_relocs (abfd, info, sec, if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } switch (ELF32_R_TYPE (rel->r_info)) { diff -uprN binutils-2.16.90.0.3/bfd/elf32-frv.c binutils-2.16.91.0.1/bfd/elf32-frv.c --- binutils-2.16.90.0.3/bfd/elf32-frv.c 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-frv.c 2005-06-22 13:53:34.256424528 -0700 @@ -6127,7 +6127,12 @@ elf32_frv_check_relocs (abfd, info, sec, if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } switch (ELF32_R_TYPE (rel->r_info)) { diff -uprN binutils-2.16.90.0.3/bfd/elf32-hppa.c binutils-2.16.91.0.1/bfd/elf32-hppa.c --- binutils-2.16.90.0.3/bfd/elf32-hppa.c 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-hppa.c 2005-06-22 13:53:34.268422546 -0700 @@ -113,6 +113,27 @@ : mtsp %r1,%sr0 : be,n 0(%sr0,%rp) ; inter-space return. */ + +/* Variable names follow a coding style. + Please follow this (Apps Hungarian) style: + + Structure/Variable Prefix + elf_link_hash_table "etab" + elf_link_hash_entry "eh" + + elf32_hppa_link_hash_table "htab" + elf32_hppa_link_hash_entry "hh" + + bfd_hash_table "btab" + bfd_hash_entry "bh" + + bfd_hash_table containing stubs "bstab" + elf32_hppa_stub_hash_entry "hsh" + + elf32_hppa_dyn_reloc_entry "hdh" + + Always remember to use GNU Coding Style. */ + #define PLT_ENTRY_SIZE 8 #define GOT_ENTRY_SIZE 4 #define ELF_DYNAMIC_INTERPRETER "/lib/ld.so.1" @@ -277,6 +298,12 @@ struct elf32_hppa_link_hash_table { #define hppa_link_hash_table(p) \ ((struct elf32_hppa_link_hash_table *) ((p)->hash)) +#define hppa_elf_hash_entry(ent) \ + ((struct elf32_hppa_link_hash_entry *)(ent)) + +#define hppa_stub_hash_entry(ent) \ + ((struct elf32_hppa_stub_hash_entry *)(ent)) + #define hppa_stub_hash_lookup(table, string, create, copy) \ ((struct elf32_hppa_stub_hash_entry *) \ bfd_hash_lookup ((table), (string), (create), (copy))) @@ -304,17 +331,17 @@ stub_hash_newfunc (struct bfd_hash_entry entry = bfd_hash_newfunc (entry, table, string); if (entry != NULL) { - struct elf32_hppa_stub_hash_entry *eh; + struct elf32_hppa_stub_hash_entry *hsh; /* Initialize the local fields. */ - eh = (struct elf32_hppa_stub_hash_entry *) entry; - eh->stub_sec = NULL; - eh->stub_offset = 0; - eh->target_value = 0; - eh->target_section = NULL; - eh->stub_type = hppa_stub_long_branch; - eh->h = NULL; - eh->id_sec = NULL; + hsh = hppa_stub_hash_entry (entry); + hsh->stub_sec = NULL; + hsh->stub_offset = 0; + hsh->target_value = 0; + hsh->target_section = NULL; + hsh->stub_type = hppa_stub_long_branch; + hsh->h = NULL; + hsh->id_sec = NULL; } return entry; @@ -341,13 +368,13 @@ hppa_link_hash_newfunc (struct bfd_hash_ entry = _bfd_elf_link_hash_newfunc (entry, table, string); if (entry != NULL) { - struct elf32_hppa_link_hash_entry *eh; + struct elf32_hppa_link_hash_entry *hh; /* Initialize the local fields. */ - eh = (struct elf32_hppa_link_hash_entry *) entry; - eh->stub_cache = NULL; - eh->dyn_relocs = NULL; - eh->plabel = 0; + hh = hppa_elf_hash_entry (entry); + hh->stub_cache = NULL; + hh->dyn_relocs = NULL; + hh->plabel = 0; } return entry; @@ -360,55 +387,55 @@ hppa_link_hash_newfunc (struct bfd_hash_ static struct bfd_link_hash_table * elf32_hppa_link_hash_table_create (bfd *abfd) { - struct elf32_hppa_link_hash_table *ret; - bfd_size_type amt = sizeof (*ret); + struct elf32_hppa_link_hash_table *htab; + bfd_size_type amt = sizeof (*htab); - ret = bfd_malloc (amt); - if (ret == NULL) + htab = (struct elf32_hppa_link_hash_table *) bfd_malloc (amt); + if (htab == NULL) return NULL; - if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd, hppa_link_hash_newfunc)) + if (!_bfd_elf_link_hash_table_init (&htab->elf, abfd, hppa_link_hash_newfunc)) { - free (ret); + free (htab); return NULL; } /* Init the stub hash table too. */ - if (!bfd_hash_table_init (&ret->stub_hash_table, stub_hash_newfunc)) + if (!bfd_hash_table_init (&htab->stub_hash_table, stub_hash_newfunc)) return NULL; - ret->stub_bfd = NULL; - ret->add_stub_section = NULL; - ret->layout_sections_again = NULL; - ret->stub_group = NULL; - ret->sgot = NULL; - ret->srelgot = NULL; - ret->splt = NULL; - ret->srelplt = NULL; - ret->sdynbss = NULL; - ret->srelbss = NULL; - ret->text_segment_base = (bfd_vma) -1; - ret->data_segment_base = (bfd_vma) -1; - ret->multi_subspace = 0; - ret->has_12bit_branch = 0; - ret->has_17bit_branch = 0; - ret->has_22bit_branch = 0; - ret->need_plt_stub = 0; - ret->sym_sec.abfd = NULL; + htab->stub_bfd = NULL; + htab->add_stub_section = NULL; + htab->layout_sections_again = NULL; + htab->stub_group = NULL; + htab->sgot = NULL; + htab->srelgot = NULL; + htab->splt = NULL; + htab->srelplt = NULL; + htab->sdynbss = NULL; + htab->srelbss = NULL; + htab->text_segment_base = (bfd_vma) -1; + htab->data_segment_base = (bfd_vma) -1; + htab->multi_subspace = 0; + htab->has_12bit_branch = 0; + htab->has_17bit_branch = 0; + htab->has_22bit_branch = 0; + htab->need_plt_stub = 0; + htab->sym_sec.abfd = NULL; - return &ret->elf.root; + return &htab->elf.root; } /* Free the derived linker hash table. */ static void -elf32_hppa_link_hash_table_free (struct bfd_link_hash_table *hash) +elf32_hppa_link_hash_table_free (struct bfd_link_hash_table *btab) { - struct elf32_hppa_link_hash_table *ret - = (struct elf32_hppa_link_hash_table *) hash; + struct elf32_hppa_link_hash_table *htab + = (struct elf32_hppa_link_hash_table *) btab; - bfd_hash_table_free (&ret->stub_hash_table); - _bfd_generic_link_hash_table_free (hash); + bfd_hash_table_free (&htab->stub_hash_table); + _bfd_generic_link_hash_table_free (btab); } /* Build a name for an entry in the stub hash table. */ @@ -416,22 +443,22 @@ elf32_hppa_link_hash_table_free (struct static char * hppa_stub_name (const asection *input_section, const asection *sym_sec, - const struct elf32_hppa_link_hash_entry *hash, - const Elf_Internal_Rela *rel) + const struct elf32_hppa_link_hash_entry *hh, + const Elf_Internal_Rela *rela) { char *stub_name; bfd_size_type len; - if (hash) + if (hh) { - len = 8 + 1 + strlen (hash->elf.root.root.string) + 1 + 8 + 1; + len = 8 + 1 + strlen (hh->elf.root.root.string) + 1 + 8 + 1; stub_name = bfd_malloc (len); if (stub_name != NULL) { sprintf (stub_name, "%08x_%s+%x", input_section->id & 0xffffffff, - hash->elf.root.root.string, - (int) rel->r_addend & 0xffffffff); + hh->elf.root.root.string, + (int) rela->r_addend & 0xffffffff); } } else @@ -443,8 +470,8 @@ hppa_stub_name (const asection *input_se sprintf (stub_name, "%08x_%x:%x+%x", input_section->id & 0xffffffff, sym_sec->id & 0xffffffff, - (int) ELF32_R_SYM (rel->r_info) & 0xffffffff, - (int) rel->r_addend & 0xffffffff); + (int) ELF32_R_SYM (rela->r_info) & 0xffffffff, + (int) rela->r_addend & 0xffffffff); } } return stub_name; @@ -456,8 +483,8 @@ hppa_stub_name (const asection *input_se static struct elf32_hppa_stub_hash_entry * hppa_get_stub_entry (const asection *input_section, const asection *sym_sec, - struct elf32_hppa_link_hash_entry *hash, - const Elf_Internal_Rela *rel, + struct elf32_hppa_link_hash_entry *hh, + const Elf_Internal_Rela *rela, struct elf32_hppa_link_hash_table *htab) { struct elf32_hppa_stub_hash_entry *stub_entry; @@ -470,24 +497,24 @@ hppa_get_stub_entry (const asection *inp distinguish between them. */ id_sec = htab->stub_group[input_section->id].link_sec; - if (hash != NULL && hash->stub_cache != NULL - && hash->stub_cache->h == hash - && hash->stub_cache->id_sec == id_sec) + if (hh != NULL && hh->stub_cache != NULL + && hh->stub_cache->h == hh + && hh->stub_cache->id_sec == id_sec) { - stub_entry = hash->stub_cache; + stub_entry = hh->stub_cache; } else { char *stub_name; - stub_name = hppa_stub_name (id_sec, sym_sec, hash, rel); + stub_name = hppa_stub_name (id_sec, sym_sec, hh, rela); if (stub_name == NULL) return NULL; stub_entry = hppa_stub_hash_lookup (&htab->stub_hash_table, stub_name, FALSE, FALSE); - if (hash != NULL) - hash->stub_cache = stub_entry; + if (hh != NULL) + hh->stub_cache = stub_entry; free (stub_name); } @@ -505,7 +532,7 @@ hppa_add_stub (const char *stub_name, { asection *link_sec; asection *stub_sec; - struct elf32_hppa_stub_hash_entry *stub_entry; + struct elf32_hppa_stub_hash_entry *hsh; link_sec = htab->stub_group[section->id].link_sec; stub_sec = htab->stub_group[section->id].stub_sec; @@ -535,9 +562,9 @@ hppa_add_stub (const char *stub_name, } /* Enter this entry into the linker stub hash table. */ - stub_entry = hppa_stub_hash_lookup (&htab->stub_hash_table, stub_name, + hsh = hppa_stub_hash_lookup (&htab->stub_hash_table, stub_name, TRUE, FALSE); - if (stub_entry == NULL) + if (hsh == NULL) { (*_bfd_error_handler) (_("%B: cannot create stub entry %s"), section->owner, @@ -545,18 +572,18 @@ hppa_add_stub (const char *stub_name, return NULL; } - stub_entry->stub_sec = stub_sec; - stub_entry->stub_offset = 0; - stub_entry->id_sec = link_sec; - return stub_entry; + hsh->stub_sec = stub_sec; + hsh->stub_offset = 0; + hsh->id_sec = link_sec; + return hsh; } /* Determine the type of stub needed, if any, for a call. */ static enum elf32_hppa_stub_type hppa_type_of_stub (asection *input_sec, - const Elf_Internal_Rela *rel, - struct elf32_hppa_link_hash_entry *hash, + const Elf_Internal_Rela *rela, + struct elf32_hppa_link_hash_entry *hh, bfd_vma destination, struct bfd_link_info *info) { @@ -565,13 +592,13 @@ hppa_type_of_stub (asection *input_sec, bfd_vma max_branch_offset; unsigned int r_type; - if (hash != NULL - && hash->elf.plt.offset != (bfd_vma) -1 - && hash->elf.dynindx != -1 - && !hash->plabel + if (hh != NULL + && hh->elf.plt.offset != (bfd_vma) -1 + && hh->elf.dynindx != -1 + && !hh->plabel && (info->shared - || !hash->elf.def_regular - || hash->elf.root.type == bfd_link_hash_defweak)) + || !hh->elf.def_regular + || hh->elf.root.type == bfd_link_hash_defweak)) { /* We need an import stub. Decide between hppa_stub_import and hppa_stub_import_shared later. */ @@ -581,10 +608,10 @@ hppa_type_of_stub (asection *input_sec, /* Determine where the call point is. */ location = (input_sec->output_offset + input_sec->output_section->vma - + rel->r_offset); + + rela->r_offset); branch_offset = destination - location - 8; - r_type = ELF32_R_TYPE (rel->r_info); + r_type = ELF32_R_TYPE (rela->r_info); /* Determine if a long branch stub is needed. parisc branch offsets are relative to the second instruction past the branch, ie. +8 @@ -650,9 +677,9 @@ hppa_type_of_stub (asection *input_sec, #endif static bfd_boolean -hppa_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) +hppa_build_one_stub (struct bfd_hash_entry *bh, void *in_arg) { - struct elf32_hppa_stub_hash_entry *stub_entry; + struct elf32_hppa_stub_hash_entry *hsh; struct bfd_link_info *info; struct elf32_hppa_link_hash_table *htab; asection *stub_sec; @@ -665,28 +692,28 @@ hppa_build_one_stub (struct bfd_hash_ent int size; /* Massage our args to the form they really have. */ - stub_entry = (struct elf32_hppa_stub_hash_entry *) gen_entry; - info = in_arg; + hsh = hppa_stub_hash_entry (bh); + info = (struct bfd_link_info *)in_arg; htab = hppa_link_hash_table (info); - stub_sec = stub_entry->stub_sec; + stub_sec = hsh->stub_sec; /* Make a note of the offset within the stubs for this entry. */ - stub_entry->stub_offset = stub_sec->size; - loc = stub_sec->contents + stub_entry->stub_offset; + hsh->stub_offset = stub_sec->size; + loc = stub_sec->contents + hsh->stub_offset; stub_bfd = stub_sec->owner; - switch (stub_entry->stub_type) + switch (hsh->stub_type) { case hppa_stub_long_branch: /* Create the long branch. A long branch is formed with "ldil" loading the upper bits of the target address into a register, then branching with "be" which adds in the lower bits. The "be" has its delay slot nullified. */ - sym_value = (stub_entry->target_value - + stub_entry->target_section->output_offset - + stub_entry->target_section->output_section->vma); + sym_value = (hsh->target_value + + hsh->target_section->output_offset + + hsh->target_section->output_section->vma); val = hppa_field_adjust (sym_value, 0, e_lrsel); insn = hppa_rebuild_insn ((int) LDIL_R1, val, 21); @@ -701,12 +728,12 @@ hppa_build_one_stub (struct bfd_hash_ent case hppa_stub_long_branch_shared: /* Branches are relative. This is where we are going to. */ - sym_value = (stub_entry->target_value - + stub_entry->target_section->output_offset - + stub_entry->target_section->output_section->vma); + sym_value = (hsh->target_value + + hsh->target_section->output_offset + + hsh->target_section->output_section->vma); /* And this is where we are coming from, more or less. */ - sym_value -= (stub_entry->stub_offset + sym_value -= (hsh->stub_offset + stub_sec->output_offset + stub_sec->output_section->vma); @@ -723,7 +750,7 @@ hppa_build_one_stub (struct bfd_hash_ent case hppa_stub_import: case hppa_stub_import_shared: - off = stub_entry->h->elf.plt.offset; + off = hsh->h->elf.plt.offset; if (off >= (bfd_vma) -2) abort (); @@ -735,7 +762,7 @@ hppa_build_one_stub (struct bfd_hash_ent insn = ADDIL_DP; #if R19_STUBS - if (stub_entry->stub_type == hppa_stub_import_shared) + if (hsh->stub_type == hppa_stub_import_shared) insn = ADDIL_R19; #endif val = hppa_field_adjust (sym_value, 0, e_lrsel), @@ -778,12 +805,12 @@ hppa_build_one_stub (struct bfd_hash_ent case hppa_stub_export: /* Branches are relative. This is where we are going to. */ - sym_value = (stub_entry->target_value - + stub_entry->target_section->output_offset - + stub_entry->target_section->output_section->vma); + sym_value = (hsh->target_value + + hsh->target_section->output_offset + + hsh->target_section->output_section->vma); /* And this is where we are coming from. */ - sym_value -= (stub_entry->stub_offset + sym_value -= (hsh->stub_offset + stub_sec->output_offset + stub_sec->output_section->vma); @@ -793,10 +820,10 @@ hppa_build_one_stub (struct bfd_hash_ent { (*_bfd_error_handler) (_("%B(%A+0x%lx): cannot reach %s, recompile with -ffunction-sections"), - stub_entry->target_section->owner, + hsh->target_section->owner, stub_sec, - (long) stub_entry->stub_offset, - stub_entry->root.string); + (long) hsh->stub_offset, + hsh->root.string); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -815,8 +842,8 @@ hppa_build_one_stub (struct bfd_hash_ent bfd_put_32 (stub_bfd, (bfd_vma) BE_SR0_RP, loc + 20); /* Point the function symbol at the stub. */ - stub_entry->h->elf.root.u.def.section = stub_sec; - stub_entry->h->elf.root.u.def.value = stub_sec->size; + hsh->h->elf.root.u.def.section = stub_sec; + hsh->h->elf.root.u.def.value = stub_sec->size; size = 24; break; @@ -855,21 +882,21 @@ hppa_build_one_stub (struct bfd_hash_ent we know stub section sizes. */ static bfd_boolean -hppa_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) +hppa_size_one_stub (struct bfd_hash_entry *bh, void *in_arg) { - struct elf32_hppa_stub_hash_entry *stub_entry; + struct elf32_hppa_stub_hash_entry *hsh; struct elf32_hppa_link_hash_table *htab; int size; /* Massage our args to the form they really have. */ - stub_entry = (struct elf32_hppa_stub_hash_entry *) gen_entry; + hsh = hppa_stub_hash_entry (bh); htab = in_arg; - if (stub_entry->stub_type == hppa_stub_long_branch) + if (hsh->stub_type == hppa_stub_long_branch) size = 8; - else if (stub_entry->stub_type == hppa_stub_long_branch_shared) + else if (hsh->stub_type == hppa_stub_long_branch_shared) size = 12; - else if (stub_entry->stub_type == hppa_stub_export) + else if (hsh->stub_type == hppa_stub_export) size = 24; else /* hppa_stub_import or hppa_stub_import_shared. */ { @@ -879,7 +906,7 @@ hppa_size_one_stub (struct bfd_hash_entr size = 16; } - stub_entry->stub_sec->size += size; + hsh->stub_sec->size += size; return TRUE; } @@ -937,7 +964,7 @@ static bfd_boolean elf32_hppa_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) { struct elf32_hppa_link_hash_table *htab; - struct elf_link_hash_entry *h; + struct elf_link_hash_entry *eh; /* Don't try to create the .plt and .got twice. */ htab = hppa_link_hash_table (info); @@ -968,74 +995,74 @@ elf32_hppa_create_dynamic_sections (bfd /* hppa-linux needs _GLOBAL_OFFSET_TABLE_ to be visible from the main application, because __canonicalize_funcptr_for_compare needs it. */ - h = elf_hash_table (info)->hgot; - h->forced_local = 0; - h->other = STV_DEFAULT; - return bfd_elf_link_record_dynamic_symbol (info, h); + eh = elf_hash_table (info)->hgot; + eh->forced_local = 0; + eh->other = STV_DEFAULT; + return bfd_elf_link_record_dynamic_symbol (info, eh); } /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void elf32_hppa_copy_indirect_symbol (const struct elf_backend_data *bed, - struct elf_link_hash_entry *dir, - struct elf_link_hash_entry *ind) + struct elf_link_hash_entry *eh_dir, + struct elf_link_hash_entry *eh_ind) { - struct elf32_hppa_link_hash_entry *edir, *eind; + struct elf32_hppa_link_hash_entry *hh_dir, *hh_ind; - edir = (struct elf32_hppa_link_hash_entry *) dir; - eind = (struct elf32_hppa_link_hash_entry *) ind; + hh_dir = hppa_elf_hash_entry (eh_dir); + hh_ind = hppa_elf_hash_entry (eh_ind); - if (eind->dyn_relocs != NULL) + if (hh_ind->dyn_relocs != NULL) { - if (edir->dyn_relocs != NULL) + if (hh_dir->dyn_relocs != NULL) { - struct elf32_hppa_dyn_reloc_entry **pp; - struct elf32_hppa_dyn_reloc_entry *p; + struct elf32_hppa_dyn_reloc_entry **hdh_pp; + struct elf32_hppa_dyn_reloc_entry *hdh_p; - if (ind->root.type == bfd_link_hash_indirect) + if (eh_ind->root.type == bfd_link_hash_indirect) abort (); /* Add reloc counts against the weak sym to the strong sym list. Merge any entries against the same section. */ - for (pp = &eind->dyn_relocs; (p = *pp) != NULL; ) + for (hdh_pp = &hh_ind->dyn_relocs; (hdh_p = *hdh_pp) != NULL; ) { - struct elf32_hppa_dyn_reloc_entry *q; + struct elf32_hppa_dyn_reloc_entry *hdh_q; - for (q = edir->dyn_relocs; q != NULL; q = q->next) - if (q->sec == p->sec) + for (hdh_q = hh_dir->dyn_relocs; hdh_q != NULL; hdh_q = hdh_q->next) + if (hdh_q->sec == hdh_p->sec) { #if RELATIVE_DYNRELOCS - q->relative_count += p->relative_count; + hdh_q->relative_count += hdh_p->relative_count; #endif - q->count += p->count; - *pp = p->next; + hdh_q->count += hdh_p->count; + *hdh_pp = hdh_p->next; break; } - if (q == NULL) - pp = &p->next; + if (hdh_q == NULL) + hdh_pp = &hdh_p->next; } - *pp = edir->dyn_relocs; + *hdh_pp = hh_dir->dyn_relocs; } - edir->dyn_relocs = eind->dyn_relocs; - eind->dyn_relocs = NULL; + hh_dir->dyn_relocs = hh_ind->dyn_relocs; + hh_ind->dyn_relocs = NULL; } if (ELIMINATE_COPY_RELOCS - && ind->root.type != bfd_link_hash_indirect - && dir->dynamic_adjusted) + && eh_ind->root.type != bfd_link_hash_indirect + && eh_dir->dynamic_adjusted) { /* If called to transfer flags for a weakdef during processing of elf_adjust_dynamic_symbol, don't copy non_got_ref. We clear it ourselves for ELIMINATE_COPY_RELOCS. */ - dir->ref_dynamic |= ind->ref_dynamic; - dir->ref_regular |= ind->ref_regular; - dir->ref_regular_nonweak |= ind->ref_regular_nonweak; - dir->needs_plt |= ind->needs_plt; + eh_dir->ref_dynamic |= eh_ind->ref_dynamic; + eh_dir->ref_regular |= eh_ind->ref_regular; + eh_dir->ref_regular_nonweak |= eh_ind->ref_regular_nonweak; + eh_dir->needs_plt |= eh_ind->needs_plt; } else - _bfd_elf_link_hash_copy_indirect (bed, dir, ind); + _bfd_elf_link_hash_copy_indirect (bed, eh_dir, eh_ind); } /* Look through the relocs for a section during the first phase, and @@ -1050,9 +1077,9 @@ elf32_hppa_check_relocs (bfd *abfd, const Elf_Internal_Rela *relocs) { Elf_Internal_Shdr *symtab_hdr; - struct elf_link_hash_entry **sym_hashes; - const Elf_Internal_Rela *rel; - const Elf_Internal_Rela *rel_end; + struct elf_link_hash_entry **eh_syms; + const Elf_Internal_Rela *rela; + const Elf_Internal_Rela *rela_end; struct elf32_hppa_link_hash_table *htab; asection *sreloc; asection *stubreloc; @@ -1062,12 +1089,12 @@ elf32_hppa_check_relocs (bfd *abfd, htab = hppa_link_hash_table (info); symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - sym_hashes = elf_sym_hashes (abfd); + eh_syms = elf_sym_hashes (abfd); sreloc = NULL; stubreloc = NULL; - rel_end = relocs + sec->reloc_count; - for (rel = relocs; rel < rel_end; rel++) + rela_end = relocs + sec->reloc_count; + for (rela = relocs; rela < rela_end; rela++) { enum { NEED_GOT = 1, @@ -1077,18 +1104,22 @@ elf32_hppa_check_relocs (bfd *abfd, }; unsigned int r_symndx, r_type; - struct elf32_hppa_link_hash_entry *h; - int need_entry; + struct elf32_hppa_link_hash_entry *hh; + int need_entry = 0; - r_symndx = ELF32_R_SYM (rel->r_info); + r_symndx = ELF32_R_SYM (rela->r_info); if (r_symndx < symtab_hdr->sh_info) - h = NULL; + hh = NULL; else - h = ((struct elf32_hppa_link_hash_entry *) - sym_hashes[r_symndx - symtab_hdr->sh_info]); + { + hh = hppa_elf_hash_entry (eh_syms[r_symndx - symtab_hdr->sh_info]); + while (hh->elf.root.type == bfd_link_hash_indirect + || hh->elf.root.type == bfd_link_hash_warning) + hh = hppa_elf_hash_entry (hh->elf.root.u.i.link); + } - r_type = ELF32_R_TYPE (rel->r_info); + r_type = ELF32_R_TYPE (rela->r_info); switch (r_type) { @@ -1103,7 +1134,7 @@ elf32_hppa_check_relocs (bfd *abfd, case R_PARISC_PLABEL21L: case R_PARISC_PLABEL32: /* If the addend is non-zero, we break badly. */ - if (rel->r_addend != 0) + if (rela->r_addend != 0) abort (); /* If we are creating a shared library, then we need to @@ -1111,6 +1142,7 @@ elf32_hppa_check_relocs (bfd *abfd, local symbols may be passed via a pointer to another object. Additionally, output a dynamic relocation pointing to the PLT entry. + For executables, the original 32-bit ABI allowed two different styles of PLABELs (function pointers): For global functions, the PLABEL word points into the .plt @@ -1139,7 +1171,7 @@ elf32_hppa_check_relocs (bfd *abfd, branch_common: /* Function calls might need to go through the .plt, and might require long branch stubs. */ - if (h == NULL) + if (hh == NULL) { /* We know local syms won't need a .plt entry, and if they need a long branch stub we can't guarantee that @@ -1156,7 +1188,7 @@ elf32_hppa_check_relocs (bfd *abfd, where a symbol is forced local by versioning, or due to symbolic linking, and we lose the .plt entry. */ need_entry = NEED_PLT; - if (h->elf.type == STT_PARISC_MILLI) + if (hh->elf.type == STT_PARISC_MILLI) need_entry = 0; } break; @@ -1199,14 +1231,14 @@ elf32_hppa_check_relocs (bfd *abfd, /* This relocation describes the C++ object vtable hierarchy. Reconstruct it for later use during GC. */ case R_PARISC_GNU_VTINHERIT: - if (!bfd_elf_gc_record_vtinherit (abfd, sec, &h->elf, rel->r_offset)) + if (!bfd_elf_gc_record_vtinherit (abfd, sec, &hh->elf, rela->r_offset)) return FALSE; continue; /* This relocation describes which C++ vtable entries are actually used. Record for later use during GC. */ case R_PARISC_GNU_VTENTRY: - if (!bfd_elf_gc_record_vtentry (abfd, sec, &h->elf, rel->r_addend)) + if (!bfd_elf_gc_record_vtentry (abfd, sec, &hh->elf, rela->r_addend)) return FALSE; continue; @@ -1227,15 +1259,14 @@ elf32_hppa_check_relocs (bfd *abfd, return FALSE; } - if (h != NULL) + if (hh != NULL) { - h->elf.got.refcount += 1; + hh->elf.got.refcount += 1; } else { bfd_signed_vma *local_got_refcounts; - - /* This is a global offset table entry for a local symbol. */ + /* This is a global offset table entry for a local symbol. */ local_got_refcounts = elf_local_got_refcounts (abfd); if (local_got_refcounts == NULL) { @@ -1268,16 +1299,16 @@ elf32_hppa_check_relocs (bfd *abfd, clean up later in adjust_dynamic_symbol. */ if ((sec->flags & SEC_ALLOC) != 0) { - if (h != NULL) + if (hh != NULL) { - h->elf.needs_plt = 1; - h->elf.plt.refcount += 1; + hh->elf.needs_plt = 1; + hh->elf.plt.refcount += 1; /* If this .plt entry is for a plabel, mark it so that adjust_dynamic_symbol will keep the entry even if it appears to be local. */ if (need_entry & PLT_PLABEL) - h->plabel = 1; + hh->plabel = 1; } else if (need_entry & PLT_PLABEL) { @@ -1310,8 +1341,8 @@ elf32_hppa_check_relocs (bfd *abfd, /* Flag this symbol as having a non-got, non-plt reference so that we generate copy relocs if it turns out to be dynamic. */ - if (h != NULL && !info->shared) - h->elf.non_got_ref = 1; + if (hh != NULL && !info->shared) + hh->elf.non_got_ref = 1; /* If we are creating a shared library then we need to copy the reloc into the shared library. However, if we are @@ -1344,19 +1375,19 @@ elf32_hppa_check_relocs (bfd *abfd, if ((info->shared && (sec->flags & SEC_ALLOC) != 0 && (IS_ABSOLUTE_RELOC (r_type) - || (h != NULL + || (hh != NULL && (!info->symbolic - || h->elf.root.type == bfd_link_hash_defweak - || !h->elf.def_regular)))) + || hh->elf.root.type == bfd_link_hash_defweak + || !hh->elf.def_regular)))) || (ELIMINATE_COPY_RELOCS && !info->shared && (sec->flags & SEC_ALLOC) != 0 - && h != NULL - && (h->elf.root.type == bfd_link_hash_defweak - || !h->elf.def_regular))) + && hh != NULL + && (hh->elf.root.type == bfd_link_hash_defweak + || !hh->elf.def_regular))) { - struct elf32_hppa_dyn_reloc_entry *p; - struct elf32_hppa_dyn_reloc_entry **head; + struct elf32_hppa_dyn_reloc_entry *hdh_p; + struct elf32_hppa_dyn_reloc_entry **hdh_head; /* Create a reloc section in dynobj and make room for this reloc. */ @@ -1404,9 +1435,9 @@ elf32_hppa_check_relocs (bfd *abfd, /* If this is a global symbol, we count the number of relocations we need for this symbol. */ - if (h != NULL) + if (hh != NULL) { - head = &h->dyn_relocs; + hdh_head = &hh->dyn_relocs; } else { @@ -1414,35 +1445,35 @@ elf32_hppa_check_relocs (bfd *abfd, We really need local syms available to do this easily. Oh well. */ - asection *s; - s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, - sec, r_symndx); - if (s == NULL) + asection *sr; + sr = bfd_section_from_r_symndx (abfd, &htab->sym_sec, + sec, r_symndx); + if (sr == NULL) return FALSE; - head = ((struct elf32_hppa_dyn_reloc_entry **) - &elf_section_data (s)->local_dynrel); + hdh_head = ((struct elf32_hppa_dyn_reloc_entry **) + &elf_section_data (sr)->local_dynrel); } - p = *head; - if (p == NULL || p->sec != sec) + hdh_p = *hdh_head; + if (hdh_p == NULL || hdh_p->sec != sec) { - p = bfd_alloc (htab->elf.dynobj, sizeof *p); - if (p == NULL) + hdh_p = bfd_alloc (htab->elf.dynobj, sizeof *hdh_p); + if (hdh_p == NULL) return FALSE; - p->next = *head; - *head = p; - p->sec = sec; - p->count = 0; + hdh_p->next = *hdh_head; + *hdh_head = hdh_p; + hdh_p->sec = sec; + hdh_p->count = 0; #if RELATIVE_DYNRELOCS - p->relative_count = 0; + hdh_p->relative_count = 0; #endif } - p->count += 1; + hdh_p->count += 1; #if RELATIVE_DYNRELOCS if (!IS_ABSOLUTE_RELOC (rtype)) - p->relative_count += 1; + hdh_p->relative_count += 1; #endif } } @@ -1457,27 +1488,27 @@ elf32_hppa_check_relocs (bfd *abfd, static asection * elf32_hppa_gc_mark_hook (asection *sec, struct bfd_link_info *info ATTRIBUTE_UNUSED, - Elf_Internal_Rela *rel, - struct elf_link_hash_entry *h, + Elf_Internal_Rela *rela, + struct elf_link_hash_entry *hh, Elf_Internal_Sym *sym) { - if (h != NULL) + if (hh != NULL) { - switch ((unsigned int) ELF32_R_TYPE (rel->r_info)) + switch ((unsigned int) ELF32_R_TYPE (rela->r_info)) { case R_PARISC_GNU_VTINHERIT: case R_PARISC_GNU_VTENTRY: break; default: - switch (h->root.type) + switch (hh->root.type) { case bfd_link_hash_defined: case bfd_link_hash_defweak: - return h->root.u.def.section; + return hh->root.u.def.section; case bfd_link_hash_common: - return h->root.u.c.p->section; + return hh->root.u.c.p->section; default: break; @@ -1500,59 +1531,59 @@ elf32_hppa_gc_sweep_hook (bfd *abfd, const Elf_Internal_Rela *relocs) { Elf_Internal_Shdr *symtab_hdr; - struct elf_link_hash_entry **sym_hashes; + struct elf_link_hash_entry **eh_syms; bfd_signed_vma *local_got_refcounts; bfd_signed_vma *local_plt_refcounts; - const Elf_Internal_Rela *rel, *relend; + const Elf_Internal_Rela *rela, *relend; elf_section_data (sec)->local_dynrel = NULL; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - sym_hashes = elf_sym_hashes (abfd); + eh_syms = elf_sym_hashes (abfd); local_got_refcounts = elf_local_got_refcounts (abfd); local_plt_refcounts = local_got_refcounts; if (local_plt_refcounts != NULL) local_plt_refcounts += symtab_hdr->sh_info; relend = relocs + sec->reloc_count; - for (rel = relocs; rel < relend; rel++) + for (rela = relocs; rela < relend; rela++) { unsigned long r_symndx; unsigned int r_type; - struct elf_link_hash_entry *h = NULL; + struct elf_link_hash_entry *eh = NULL; - r_symndx = ELF32_R_SYM (rel->r_info); + r_symndx = ELF32_R_SYM (rela->r_info); if (r_symndx >= symtab_hdr->sh_info) { - struct elf32_hppa_link_hash_entry *eh; - struct elf32_hppa_dyn_reloc_entry **pp; - struct elf32_hppa_dyn_reloc_entry *p; - - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - while (h->root.type == bfd_link_hash_indirect - || h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - eh = (struct elf32_hppa_link_hash_entry *) h; + struct elf32_hppa_link_hash_entry *hh; + struct elf32_hppa_dyn_reloc_entry **hdh_pp; + struct elf32_hppa_dyn_reloc_entry *hdh_p; + + eh = eh_syms[r_symndx - symtab_hdr->sh_info]; + while (eh->root.type == bfd_link_hash_indirect + || eh->root.type == bfd_link_hash_warning) + eh = (struct elf_link_hash_entry *) eh->root.u.i.link; + hh = hppa_elf_hash_entry (eh); - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) + for (hdh_pp = &hh->dyn_relocs; (hdh_p = *hdh_pp) != NULL; hdh_pp = &hdh_p->next) + if (hdh_p->sec == sec) { /* Everything must go for SEC. */ - *pp = p->next; + *hdh_pp = hdh_p->next; break; } } - r_type = ELF32_R_TYPE (rel->r_info); + r_type = ELF32_R_TYPE (rela->r_info); switch (r_type) { case R_PARISC_DLTIND14F: case R_PARISC_DLTIND14R: case R_PARISC_DLTIND21L: - if (h != NULL) + if (eh != NULL) { - if (h->got.refcount > 0) - h->got.refcount -= 1; + if (eh->got.refcount > 0) + eh->got.refcount -= 1; } else if (local_got_refcounts != NULL) { @@ -1565,20 +1596,20 @@ elf32_hppa_gc_sweep_hook (bfd *abfd, case R_PARISC_PCREL17C: case R_PARISC_PCREL17F: case R_PARISC_PCREL22F: - if (h != NULL) + if (eh != NULL) { - if (h->plt.refcount > 0) - h->plt.refcount -= 1; + if (eh->plt.refcount > 0) + eh->plt.refcount -= 1; } break; case R_PARISC_PLABEL14R: case R_PARISC_PLABEL21L: case R_PARISC_PLABEL32: - if (h != NULL) + if (eh != NULL) { - if (h->plt.refcount > 0) - h->plt.refcount -= 1; + if (eh->plt.refcount > 0) + eh->plt.refcount -= 1; } else if (local_plt_refcounts != NULL) { @@ -1661,24 +1692,24 @@ elf32_hppa_grok_psinfo (bfd *abfd, Elf_I static void elf32_hppa_hide_symbol (struct bfd_link_info *info, - struct elf_link_hash_entry *h, + struct elf_link_hash_entry *eh, bfd_boolean force_local) { if (force_local) { - h->forced_local = 1; - if (h->dynindx != -1) + eh->forced_local = 1; + if (eh->dynindx != -1) { - h->dynindx = -1; + eh->dynindx = -1; _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr, - h->dynstr_index); + eh->dynstr_index); } } - if (! ((struct elf32_hppa_link_hash_entry *) h)->plabel) + if (! hppa_elf_hash_entry(eh)->plabel) { - h->needs_plt = 0; - h->plt = elf_hash_table (info)->init_refcount; + eh->needs_plt = 0; + eh->plt = elf_hash_table (info)->init_plt_refcount; } } @@ -1690,21 +1721,21 @@ elf32_hppa_hide_symbol (struct bfd_link_ static bfd_boolean elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info, - struct elf_link_hash_entry *h) + struct elf_link_hash_entry *eh) { struct elf32_hppa_link_hash_table *htab; - asection *s; + asection *sec; unsigned int power_of_two; /* If this is a function, put it in the procedure linkage table. We will fill in the contents of the procedure linkage table later. */ - if (h->type == STT_FUNC - || h->needs_plt) + if (eh->type == STT_FUNC + || eh->needs_plt) { - if (h->plt.refcount <= 0 - || (h->def_regular - && h->root.type != bfd_link_hash_defweak - && ! ((struct elf32_hppa_link_hash_entry *) h)->plabel + if (eh->plt.refcount <= 0 + || (eh->def_regular + && eh->root.type != bfd_link_hash_defweak + && ! hppa_elf_hash_entry (eh)->plabel && (!info->shared || info->symbolic))) { /* The .plt entry is not needed when: @@ -1715,27 +1746,27 @@ elf32_hppa_adjust_dynamic_symbol (struct used by a plabel relocation. Either this object is the application or we are doing a shared symbolic link. */ - h->plt.offset = (bfd_vma) -1; - h->needs_plt = 0; + eh->plt.offset = (bfd_vma) -1; + eh->needs_plt = 0; } return TRUE; } else - h->plt.offset = (bfd_vma) -1; + eh->plt.offset = (bfd_vma) -1; /* If this is a weak symbol, and there is a real definition, the processor independent code will have arranged for us to see the real definition first, and we can just use the same value. */ - if (h->u.weakdef != NULL) + if (eh->u.weakdef != NULL) { - if (h->u.weakdef->root.type != bfd_link_hash_defined - && h->u.weakdef->root.type != bfd_link_hash_defweak) + if (eh->u.weakdef->root.type != bfd_link_hash_defined + && eh->u.weakdef->root.type != bfd_link_hash_defweak) abort (); - h->root.u.def.section = h->u.weakdef->root.u.def.section; - h->root.u.def.value = h->u.weakdef->root.u.def.value; + eh->root.u.def.section = eh->u.weakdef->root.u.def.section; + eh->root.u.def.value = eh->u.weakdef->root.u.def.value; if (ELIMINATE_COPY_RELOCS) - h->non_got_ref = h->u.weakdef->non_got_ref; + eh->non_got_ref = eh->u.weakdef->non_got_ref; return TRUE; } @@ -1751,27 +1782,27 @@ elf32_hppa_adjust_dynamic_symbol (struct /* If there are no references to this symbol that do not use the GOT, we don't need to generate a copy reloc. */ - if (!h->non_got_ref) + if (!eh->non_got_ref) return TRUE; if (ELIMINATE_COPY_RELOCS) { - struct elf32_hppa_link_hash_entry *eh; - struct elf32_hppa_dyn_reloc_entry *p; + struct elf32_hppa_link_hash_entry *hh; + struct elf32_hppa_dyn_reloc_entry *hdh_p; - eh = (struct elf32_hppa_link_hash_entry *) h; - for (p = eh->dyn_relocs; p != NULL; p = p->next) + hh = hppa_elf_hash_entry (eh); + for (hdh_p = hh->dyn_relocs; hdh_p != NULL; hdh_p = hdh_p->next) { - s = p->sec->output_section; - if (s != NULL && (s->flags & SEC_READONLY) != 0) + sec = hdh_p->sec->output_section; + if (sec != NULL && (sec->flags & SEC_READONLY) != 0) break; } /* If we didn't find any dynamic relocs in read-only sections, then we'll be keeping the dynamic relocs and avoiding the copy reloc. */ - if (p == NULL) + if (hdh_p == NULL) { - h->non_got_ref = 0; + eh->non_got_ref = 0; return TRUE; } } @@ -1791,34 +1822,34 @@ elf32_hppa_adjust_dynamic_symbol (struct /* We must generate a COPY reloc to tell the dynamic linker to copy the initial value out of the dynamic object and into the runtime process image. */ - if ((h->root.u.def.section->flags & SEC_ALLOC) != 0) + if ((eh->root.u.def.section->flags & SEC_ALLOC) != 0) { htab->srelbss->size += sizeof (Elf32_External_Rela); - h->needs_copy = 1; + eh->needs_copy = 1; } /* We need to figure out the alignment required for this symbol. I have no idea how other ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); + power_of_two = bfd_log2 (eh->size); if (power_of_two > 3) power_of_two = 3; /* Apply the required alignment. */ - s = htab->sdynbss; - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) + sec = htab->sdynbss; + sec->size = BFD_ALIGN (sec->size, (bfd_size_type) (1 << power_of_two)); + if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, sec)) { - if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) + if (! bfd_set_section_alignment (htab->elf.dynobj, sec, power_of_two)) return FALSE; } /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; + eh->root.u.def.section = sec; + eh->root.u.def.value = sec->size; /* Increment the section size to make room for the symbol. */ - s->size += h->size; + sec->size += eh->size; return TRUE; } @@ -1827,60 +1858,63 @@ elf32_hppa_adjust_dynamic_symbol (struct ie. plabel entries. */ static bfd_boolean -allocate_plt_static (struct elf_link_hash_entry *h, void *inf) +allocate_plt_static (struct elf_link_hash_entry *eh, void *inf) { struct bfd_link_info *info; struct elf32_hppa_link_hash_table *htab; - asection *s; + struct elf32_hppa_link_hash_entry *hh; + asection *sec; - if (h->root.type == bfd_link_hash_indirect) + if (eh->root.type == bfd_link_hash_indirect) return TRUE; - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; + if (eh->root.type == bfd_link_hash_warning) + eh = (struct elf_link_hash_entry *) eh->root.u.i.link; - info = inf; + info = (struct bfd_link_info *) inf; + hh = hppa_elf_hash_entry(eh); htab = hppa_link_hash_table (info); if (htab->elf.dynamic_sections_created - && h->plt.refcount > 0) + && eh->plt.refcount > 0) { /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ - if (h->dynindx == -1 - && !h->forced_local - && h->type != STT_PARISC_MILLI) + if (eh->dynindx == -1 + && !eh->forced_local + && eh->type != STT_PARISC_MILLI) { - if (! bfd_elf_link_record_dynamic_symbol (info, h)) + if (! bfd_elf_link_record_dynamic_symbol (info, eh)) return FALSE; } - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h)) + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, eh)) { /* Allocate these later. From this point on, h->plabel means that the plt entry is only used by a plabel. We'll be using a normal plt entry for this symbol, so clear the plabel indicator. */ - ((struct elf32_hppa_link_hash_entry *) h)->plabel = 0; + + hh->plabel = 0; } - else if (((struct elf32_hppa_link_hash_entry *) h)->plabel) + else if (hh->plabel) { /* Make an entry in the .plt section for plabel references that won't have a .plt entry for other reasons. */ - s = htab->splt; - h->plt.offset = s->size; - s->size += PLT_ENTRY_SIZE; + sec = htab->splt; + eh->plt.offset = sec->size; + sec->size += PLT_ENTRY_SIZE; } else { /* No .plt entry needed. */ - h->plt.offset = (bfd_vma) -1; - h->needs_plt = 0; + eh->plt.offset = (bfd_vma) -1; + eh->needs_plt = 0; } } else { - h->plt.offset = (bfd_vma) -1; - h->needs_plt = 0; + eh->plt.offset = (bfd_vma) -1; + eh->needs_plt = 0; } return TRUE; @@ -1890,64 +1924,66 @@ allocate_plt_static (struct elf_link_has global syms. */ static bfd_boolean -allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) +allocate_dynrelocs (struct elf_link_hash_entry *eh, void *inf) { struct bfd_link_info *info; struct elf32_hppa_link_hash_table *htab; - asection *s; - struct elf32_hppa_link_hash_entry *eh; - struct elf32_hppa_dyn_reloc_entry *p; + asection *sec; + struct elf32_hppa_link_hash_entry *hh; + struct elf32_hppa_dyn_reloc_entry *hdh_p; - if (h->root.type == bfd_link_hash_indirect) + if (eh->root.type == bfd_link_hash_indirect) return TRUE; - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; + if (eh->root.type == bfd_link_hash_warning) + eh = (struct elf_link_hash_entry *) eh->root.u.i.link; info = inf; htab = hppa_link_hash_table (info); + hh = hppa_elf_hash_entry (eh); + if (htab->elf.dynamic_sections_created - && h->plt.offset != (bfd_vma) -1 - && !((struct elf32_hppa_link_hash_entry *) h)->plabel) + && eh->plt.offset != (bfd_vma) -1 + && !hh->plabel + && eh->plt.refcount > 0) { /* Make an entry in the .plt section. */ - s = htab->splt; - h->plt.offset = s->size; - s->size += PLT_ENTRY_SIZE; + sec = htab->splt; + eh->plt.offset = sec->size; + sec->size += PLT_ENTRY_SIZE; /* We also need to make an entry in the .rela.plt section. */ htab->srelplt->size += sizeof (Elf32_External_Rela); htab->need_plt_stub = 1; } - if (h->got.refcount > 0) + if (eh->got.refcount > 0) { /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ - if (h->dynindx == -1 - && !h->forced_local - && h->type != STT_PARISC_MILLI) + if (eh->dynindx == -1 + && !eh->forced_local + && eh->type != STT_PARISC_MILLI) { - if (! bfd_elf_link_record_dynamic_symbol (info, h)) + if (! bfd_elf_link_record_dynamic_symbol (info, eh)) return FALSE; } - s = htab->sgot; - h->got.offset = s->size; - s->size += GOT_ENTRY_SIZE; + sec = htab->sgot; + eh->got.offset = sec->size; + sec->size += GOT_ENTRY_SIZE; if (htab->elf.dynamic_sections_created && (info->shared - || (h->dynindx != -1 - && !h->forced_local))) + || (eh->dynindx != -1 + && !eh->forced_local))) { htab->srelgot->size += sizeof (Elf32_External_Rela); } } else - h->got.offset = (bfd_vma) -1; + eh->got.offset = (bfd_vma) -1; - eh = (struct elf32_hppa_link_hash_entry *) h; - if (eh->dyn_relocs == NULL) + if (hh->dyn_relocs == NULL) return TRUE; /* If this is a -Bsymbolic shared link, then we need to discard all @@ -1958,68 +1994,69 @@ allocate_dynrelocs (struct elf_link_hash if (info->shared) { #if RELATIVE_DYNRELOCS - if (SYMBOL_CALLS_LOCAL (info, h)) + if (SYMBOL_CALLS_LOCAL (info, eh)) { - struct elf32_hppa_dyn_reloc_entry **pp; + struct elf32_hppa_dyn_reloc_entry **hdh_pp; - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; ) + for (hdh_pp = &hh->dyn_relocs; (hdh_p = *hdh_pp) != NULL; ) { - p->count -= p->relative_count; - p->relative_count = 0; - if (p->count == 0) - *pp = p->next; + hdh_p->count -= hdh_p->relative_count; + hdh_p->relative_count = 0; + if (hdh_p->count == 0) + *hdh_pp = hdh_p->next; else - pp = &p->next; + hdh_pp = &hdh_p->next; } } #endif /* Also discard relocs on undefined weak syms with non-default visibility. */ - if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT - && h->root.type == bfd_link_hash_undefweak) - eh->dyn_relocs = NULL; + if (ELF_ST_VISIBILITY (eh->other) != STV_DEFAULT + && eh->root.type == bfd_link_hash_undefweak) + hh->dyn_relocs = NULL; } else { /* For the non-shared case, discard space for relocs against symbols which turn out to need copy relocs or are not dynamic. */ - if (!h->non_got_ref + + if (!eh->non_got_ref && ((ELIMINATE_COPY_RELOCS - && h->def_dynamic - && !h->def_regular) - || (htab->elf.dynamic_sections_created - && (h->root.type == bfd_link_hash_undefweak - || h->root.type == bfd_link_hash_undefined)))) + && eh->def_dynamic + && !eh->def_regular) + || (htab->elf.dynamic_sections_created + && (eh->root.type == bfd_link_hash_undefweak + || eh->root.type == bfd_link_hash_undefined)))) { /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ - if (h->dynindx == -1 - && !h->forced_local - && h->type != STT_PARISC_MILLI) + if (eh->dynindx == -1 + && !eh->forced_local + && eh->type != STT_PARISC_MILLI) { - if (! bfd_elf_link_record_dynamic_symbol (info, h)) + if (! bfd_elf_link_record_dynamic_symbol (info, eh)) return FALSE; } /* If that succeeded, we know we'll be keeping all the relocs. */ - if (h->dynindx != -1) + if (eh->dynindx != -1) goto keep; } - eh->dyn_relocs = NULL; + hh->dyn_relocs = NULL; return TRUE; keep: ; } /* Finally, allocate space. */ - for (p = eh->dyn_relocs; p != NULL; p = p->next) + for (hdh_p = hh->dyn_relocs; hdh_p != NULL; hdh_p = hdh_p->next) { - asection *sreloc = elf_section_data (p->sec)->sreloc; - sreloc->size += p->count * sizeof (Elf32_External_Rela); + asection *sreloc = elf_section_data (hdh_p->sec)->sreloc; + sreloc->size += hdh_p->count * sizeof (Elf32_External_Rela); } return TRUE; @@ -2033,16 +2070,16 @@ allocate_dynrelocs (struct elf_link_hash elf_adjust_dynamic_symbol. */ static bfd_boolean -clobber_millicode_symbols (struct elf_link_hash_entry *h, +clobber_millicode_symbols (struct elf_link_hash_entry *eh, struct bfd_link_info *info) { - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; + if (eh->root.type == bfd_link_hash_warning) + eh = (struct elf_link_hash_entry *) eh->root.u.i.link; - if (h->type == STT_PARISC_MILLI - && !h->forced_local) + if (eh->type == STT_PARISC_MILLI + && !eh->forced_local) { - elf32_hppa_hide_symbol (info, h, TRUE); + elf32_hppa_hide_symbol (info, eh, TRUE); } return TRUE; } @@ -2050,20 +2087,20 @@ clobber_millicode_symbols (struct elf_li /* Find any dynamic relocs that apply to read-only sections. */ static bfd_boolean -readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf) +readonly_dynrelocs (struct elf_link_hash_entry *eh, void *inf) { - struct elf32_hppa_link_hash_entry *eh; - struct elf32_hppa_dyn_reloc_entry *p; + struct elf32_hppa_link_hash_entry *hh; + struct elf32_hppa_dyn_reloc_entry *hdh_p; - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; + if (eh->root.type == bfd_link_hash_warning) + eh = (struct elf_link_hash_entry *) eh->root.u.i.link; - eh = (struct elf32_hppa_link_hash_entry *) h; - for (p = eh->dyn_relocs; p != NULL; p = p->next) + hh = hppa_elf_hash_entry (eh); + for (hdh_p = hh->dyn_relocs; hdh_p != NULL; hdh_p = hdh_p->next) { - asection *s = p->sec->output_section; + asection *sec = hdh_p->sec->output_section; - if (s != NULL && (s->flags & SEC_READONLY) != 0) + if (sec != NULL && (sec->flags & SEC_READONLY) != 0) { struct bfd_link_info *info = inf; @@ -2085,7 +2122,7 @@ elf32_hppa_size_dynamic_sections (bfd *o struct elf32_hppa_link_hash_table *htab; bfd *dynobj; bfd *ibfd; - asection *s; + asection *sec; bfd_boolean relocs; htab = hppa_link_hash_table (info); @@ -2098,11 +2135,11 @@ elf32_hppa_size_dynamic_sections (bfd *o /* Set the contents of the .interp section to the interpreter. */ if (info->executable) { - s = bfd_get_section_by_name (dynobj, ".interp"); - if (s == NULL) + sec = bfd_get_section_by_name (dynobj, ".interp"); + if (sec == NULL) abort (); - s->size = sizeof ELF_DYNAMIC_INTERPRETER; - s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER; + sec->size = sizeof ELF_DYNAMIC_INTERPRETER; + sec->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER; } /* Force millicode symbols local. */ @@ -2126,28 +2163,28 @@ elf32_hppa_size_dynamic_sections (bfd *o if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour) continue; - for (s = ibfd->sections; s != NULL; s = s->next) + for (sec = ibfd->sections; sec != NULL; sec = sec->next) { - struct elf32_hppa_dyn_reloc_entry *p; + struct elf32_hppa_dyn_reloc_entry *hdh_p; - for (p = ((struct elf32_hppa_dyn_reloc_entry *) - elf_section_data (s)->local_dynrel); - p != NULL; - p = p->next) + for (hdh_p = ((struct elf32_hppa_dyn_reloc_entry *) + elf_section_data (sec)->local_dynrel); + hdh_p != NULL; + hdh_p = hdh_p->next) { - if (!bfd_is_abs_section (p->sec) - && bfd_is_abs_section (p->sec->output_section)) + if (!bfd_is_abs_section (hdh_p->sec) + && bfd_is_abs_section (hdh_p->sec->output_section)) { /* Input section has been discarded, either because it is a copy of a linkonce section or due to linker script /DISCARD/, so we'll be discarding the relocs too. */ } - else if (p->count != 0) + else if (hdh_p->count != 0) { - srel = elf_section_data (p->sec)->sreloc; - srel->size += p->count * sizeof (Elf32_External_Rela); - if ((p->sec->output_section->flags & SEC_READONLY) != 0) + srel = elf_section_data (hdh_p->sec)->sreloc; + srel->size += hdh_p->count * sizeof (Elf32_External_Rela); + if ((hdh_p->sec->output_section->flags & SEC_READONLY) != 0) info->flags |= DF_TEXTREL; } } @@ -2160,15 +2197,15 @@ elf32_hppa_size_dynamic_sections (bfd *o symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; locsymcount = symtab_hdr->sh_info; end_local_got = local_got + locsymcount; - s = htab->sgot; + sec = htab->sgot; srel = htab->srelgot; for (; local_got < end_local_got; ++local_got) { if (*local_got > 0) { - *local_got = s->size; - s->size += GOT_ENTRY_SIZE; - if (info->shared) + *local_got = sec->size; + sec->size += GOT_ENTRY_SIZE; + if (info->shared) srel->size += sizeof (Elf32_External_Rela); } else @@ -2185,14 +2222,14 @@ elf32_hppa_size_dynamic_sections (bfd *o } else { - s = htab->splt; + sec = htab->splt; srel = htab->srelplt; for (; local_plt < end_local_plt; ++local_plt) { if (*local_plt > 0) { - *local_plt = s->size; - s->size += PLT_ENTRY_SIZE; + *local_plt = sec->size; + sec->size += PLT_ENTRY_SIZE; if (info->shared) srel->size += sizeof (Elf32_External_Rela); } @@ -2215,12 +2252,12 @@ elf32_hppa_size_dynamic_sections (bfd *o determined the sizes of the various dynamic sections. Allocate memory for them. */ relocs = FALSE; - for (s = dynobj->sections; s != NULL; s = s->next) + for (sec = dynobj->sections; sec != NULL; sec = sec->next) { - if ((s->flags & SEC_LINKER_CREATED) == 0) + if ((sec->flags & SEC_LINKER_CREATED) == 0) continue; - if (s == htab->splt) + if (sec == htab->splt) { if (htab->need_plt_stub) { @@ -2228,29 +2265,29 @@ elf32_hppa_size_dynamic_sections (bfd *o section. We want this stub right at the end, up against the .got section. */ int gotalign = bfd_section_alignment (dynobj, htab->sgot); - int pltalign = bfd_section_alignment (dynobj, s); + int pltalign = bfd_section_alignment (dynobj, sec); bfd_size_type mask; if (gotalign > pltalign) - bfd_set_section_alignment (dynobj, s, gotalign); + bfd_set_section_alignment (dynobj, sec, gotalign); mask = ((bfd_size_type) 1 << gotalign) - 1; - s->size = (s->size + sizeof (plt_stub) + mask) & ~mask; + sec->size = (sec->size + sizeof (plt_stub) + mask) & ~mask; } } - else if (s == htab->sgot) + else if (sec == htab->sgot) ; - else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) + else if (strncmp (bfd_get_section_name (dynobj, sec), ".rela", 5) == 0) { - if (s->size != 0) + if (sec->size != 0) { /* Remember whether there are any reloc sections other than .rela.plt. */ - if (s != htab->srelplt) + if (sec != htab->srelplt) relocs = TRUE; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ - s->reloc_count = 0; + sec->reloc_count = 0; } } else @@ -2259,7 +2296,7 @@ elf32_hppa_size_dynamic_sections (bfd *o continue; } - if (s->size == 0) + if (sec->size == 0) { /* If we don't need this section, strip it from the output file. This is mostly to handle .rela.bss and @@ -2270,14 +2307,14 @@ elf32_hppa_size_dynamic_sections (bfd *o adjust_dynamic_symbol is called, and it is that function which decides whether anything needs to go into these sections. */ - s->flags |= SEC_EXCLUDE; + sec->flags |= SEC_EXCLUDE; continue; } /* Allocate memory for the section contents. Zero it, because we may not fill in all the reloc sections. */ - s->contents = bfd_zalloc (dynobj, s->size); - if (s->contents == NULL && s->size != 0) + sec->contents = bfd_zalloc (dynobj, sec->size); + if (sec->contents == NULL && sec->size != 0) return FALSE; } @@ -2567,61 +2604,60 @@ get_local_syms (bfd *output_bfd, bfd *in if (info->shared && htab->multi_subspace) { - struct elf_link_hash_entry **sym_hashes; - struct elf_link_hash_entry **end_hashes; + struct elf_link_hash_entry **eh_syms; + struct elf_link_hash_entry **eh_symend; unsigned int symcount; symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym) - symtab_hdr->sh_info); - sym_hashes = elf_sym_hashes (input_bfd); - end_hashes = sym_hashes + symcount; + eh_syms = (struct elf_link_hash_entry **) elf_sym_hashes (input_bfd); + eh_symend = (struct elf_link_hash_entry **) (eh_syms + symcount); /* Look through the global syms for functions; We need to build export stubs for all globally visible functions. */ - for (; sym_hashes < end_hashes; sym_hashes++) + for (; eh_syms < eh_symend; eh_syms++) { - struct elf32_hppa_link_hash_entry *hash; + struct elf32_hppa_link_hash_entry *hh; - hash = (struct elf32_hppa_link_hash_entry *) *sym_hashes; + hh = hppa_elf_hash_entry (*eh_syms); - while (hash->elf.root.type == bfd_link_hash_indirect - || hash->elf.root.type == bfd_link_hash_warning) - hash = ((struct elf32_hppa_link_hash_entry *) - hash->elf.root.u.i.link); + while (hh->elf.root.type == bfd_link_hash_indirect + || hh->elf.root.type == bfd_link_hash_warning) + hh = hppa_elf_hash_entry (hh->elf.root.u.i.link); /* At this point in the link, undefined syms have been resolved, so we need to check that the symbol was defined in this BFD. */ - if ((hash->elf.root.type == bfd_link_hash_defined - || hash->elf.root.type == bfd_link_hash_defweak) - && hash->elf.type == STT_FUNC - && hash->elf.root.u.def.section->output_section != NULL - && (hash->elf.root.u.def.section->output_section->owner + if ((hh->elf.root.type == bfd_link_hash_defined + || hh->elf.root.type == bfd_link_hash_defweak) + && hh->elf.type == STT_FUNC + && hh->elf.root.u.def.section->output_section != NULL + && (hh->elf.root.u.def.section->output_section->owner == output_bfd) - && hash->elf.root.u.def.section->owner == input_bfd - && hash->elf.def_regular - && !hash->elf.forced_local - && ELF_ST_VISIBILITY (hash->elf.other) == STV_DEFAULT) + && hh->elf.root.u.def.section->owner == input_bfd + && hh->elf.def_regular + && !hh->elf.forced_local + && ELF_ST_VISIBILITY (hh->elf.other) == STV_DEFAULT) { asection *sec; const char *stub_name; - struct elf32_hppa_stub_hash_entry *stub_entry; + struct elf32_hppa_stub_hash_entry *hsh; - sec = hash->elf.root.u.def.section; - stub_name = hash->elf.root.root.string; - stub_entry = hppa_stub_hash_lookup (&htab->stub_hash_table, + sec = hh->elf.root.u.def.section; + stub_name = hh->elf.root.root.string; + hsh = hppa_stub_hash_lookup (&htab->stub_hash_table, stub_name, FALSE, FALSE); - if (stub_entry == NULL) + if (hsh == NULL) { - stub_entry = hppa_add_stub (stub_name, sec, htab); - if (!stub_entry) + hsh = hppa_add_stub (stub_name, sec, htab); + if (!hsh) return -1; - stub_entry->target_value = hash->elf.root.u.def.value; - stub_entry->target_section = hash->elf.root.u.def.section; - stub_entry->stub_type = hppa_stub_export; - stub_entry->h = hash; + hsh->target_value = hh->elf.root.u.def.value; + hsh->target_section = hh->elf.root.u.def.section; + hsh->stub_type = hppa_stub_export; + hsh->h = hh; stub_changed = 1; } else @@ -2759,11 +2795,11 @@ elf32_hppa_size_stubs { unsigned int r_type, r_indx; enum elf32_hppa_stub_type stub_type; - struct elf32_hppa_stub_hash_entry *stub_entry; + struct elf32_hppa_stub_hash_entry *hsh; asection *sym_sec; bfd_vma sym_value; bfd_vma destination; - struct elf32_hppa_link_hash_entry *hash; + struct elf32_hppa_link_hash_entry *hh; char *stub_name; const asection *id_sec; @@ -2790,7 +2826,7 @@ elf32_hppa_size_stubs sym_sec = NULL; sym_value = 0; destination = 0; - hash = NULL; + hh = NULL; if (r_indx < symtab_hdr->sh_info) { /* It's a local symbol. */ @@ -2812,35 +2848,33 @@ elf32_hppa_size_stubs int e_indx; e_indx = r_indx - symtab_hdr->sh_info; - hash = ((struct elf32_hppa_link_hash_entry *) - elf_sym_hashes (input_bfd)[e_indx]); + hh = hppa_elf_hash_entry (elf_sym_hashes (input_bfd)[e_indx]); - while (hash->elf.root.type == bfd_link_hash_indirect - || hash->elf.root.type == bfd_link_hash_warning) - hash = ((struct elf32_hppa_link_hash_entry *) - hash->elf.root.u.i.link); + while (hh->elf.root.type == bfd_link_hash_indirect + || hh->elf.root.type == bfd_link_hash_warning) + hh = hppa_elf_hash_entry (hh->elf.root.u.i.link); - if (hash->elf.root.type == bfd_link_hash_defined - || hash->elf.root.type == bfd_link_hash_defweak) + if (hh->elf.root.type == bfd_link_hash_defined + || hh->elf.root.type == bfd_link_hash_defweak) { - sym_sec = hash->elf.root.u.def.section; - sym_value = hash->elf.root.u.def.value; + sym_sec = hh->elf.root.u.def.section; + sym_value = hh->elf.root.u.def.value; if (sym_sec->output_section != NULL) destination = (sym_value + irela->r_addend + sym_sec->output_offset + sym_sec->output_section->vma); } - else if (hash->elf.root.type == bfd_link_hash_undefweak) + else if (hh->elf.root.type == bfd_link_hash_undefweak) { if (! info->shared) continue; } - else if (hash->elf.root.type == bfd_link_hash_undefined) + else if (hh->elf.root.type == bfd_link_hash_undefined) { if (! (info->unresolved_syms_in_objects == RM_IGNORE - && (ELF_ST_VISIBILITY (hash->elf.other) + && (ELF_ST_VISIBILITY (hh->elf.other) == STV_DEFAULT) - && hash->elf.type != STT_PARISC_MILLI)) + && hh->elf.type != STT_PARISC_MILLI)) continue; } else @@ -2851,7 +2885,7 @@ elf32_hppa_size_stubs } /* Determine what (if any) linker stub is needed. */ - stub_type = hppa_type_of_stub (section, irela, hash, + stub_type = hppa_type_of_stub (section, irela, hh, destination, info); if (stub_type == hppa_stub_none) continue; @@ -2860,38 +2894,38 @@ elf32_hppa_size_stubs id_sec = htab->stub_group[section->id].link_sec; /* Get the name of this stub. */ - stub_name = hppa_stub_name (id_sec, sym_sec, hash, irela); + stub_name = hppa_stub_name (id_sec, sym_sec, hh, irela); if (!stub_name) goto error_ret_free_internal; - stub_entry = hppa_stub_hash_lookup (&htab->stub_hash_table, + hsh = hppa_stub_hash_lookup (&htab->stub_hash_table, stub_name, FALSE, FALSE); - if (stub_entry != NULL) + if (hsh != NULL) { /* The proper stub has already been created. */ free (stub_name); continue; } - stub_entry = hppa_add_stub (stub_name, section, htab); - if (stub_entry == NULL) + hsh = hppa_add_stub (stub_name, section, htab); + if (hsh == NULL) { free (stub_name); goto error_ret_free_internal; } - stub_entry->target_value = sym_value; - stub_entry->target_section = sym_sec; - stub_entry->stub_type = stub_type; + hsh->target_value = sym_value; + hsh->target_section = sym_sec; + hsh->stub_type = stub_type; if (info->shared) { if (stub_type == hppa_stub_import) - stub_entry->stub_type = hppa_stub_import_shared; + hsh->stub_type = hppa_stub_import_shared; else if (stub_type == hppa_stub_long_branch) - stub_entry->stub_type = hppa_stub_long_branch_shared; + hsh->stub_type = hppa_stub_long_branch_shared; } - stub_entry->h = hash; + hsh->h = hh; stub_changed = TRUE; } @@ -3067,7 +3101,7 @@ hppa_record_segment_addr (bfd *abfd ATTR { struct elf32_hppa_link_hash_table *htab; - htab = (struct elf32_hppa_link_hash_table *) data; + htab = (struct elf32_hppa_link_hash_table*) data; if ((section->flags & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD)) { @@ -3091,27 +3125,27 @@ hppa_record_segment_addr (bfd *abfd ATTR static bfd_reloc_status_type final_link_relocate (asection *input_section, bfd_byte *contents, - const Elf_Internal_Rela *rel, + const Elf_Internal_Rela *rela, bfd_vma value, struct elf32_hppa_link_hash_table *htab, asection *sym_sec, - struct elf32_hppa_link_hash_entry *h, + struct elf32_hppa_link_hash_entry *hh, struct bfd_link_info *info) { int insn; - unsigned int r_type = ELF32_R_TYPE (rel->r_info); + unsigned int r_type = ELF32_R_TYPE (rela->r_info); unsigned int orig_r_type = r_type; reloc_howto_type *howto = elf_hppa_howto_table + r_type; int r_format = howto->bitsize; enum hppa_reloc_field_selector_type_alt r_field; bfd *input_bfd = input_section->owner; - bfd_vma offset = rel->r_offset; + bfd_vma offset = rela->r_offset; bfd_vma max_branch_offset = 0; bfd_byte *hit_data = contents + offset; - bfd_signed_vma addend = rel->r_addend; + bfd_signed_vma addend = rela->r_addend; bfd_vma location; - struct elf32_hppa_stub_hash_entry *stub_entry = NULL; - int val; + struct elf32_hppa_stub_hash_entry *hsh = NULL; + int val; if (r_type == R_PARISC_NONE) return bfd_reloc_ok; @@ -3152,25 +3186,25 @@ final_link_relocate (asection *input_sec the stub hash. */ if (sym_sec == NULL || sym_sec->output_section == NULL - || (h != NULL - && h->elf.plt.offset != (bfd_vma) -1 - && h->elf.dynindx != -1 - && !h->plabel + || (hh != NULL + && hh->elf.plt.offset != (bfd_vma) -1 + && hh->elf.dynindx != -1 + && !hh->plabel && (info->shared - || !h->elf.def_regular - || h->elf.root.type == bfd_link_hash_defweak))) + || !hh->elf.def_regular + || hh->elf.root.type == bfd_link_hash_defweak))) { - stub_entry = hppa_get_stub_entry (input_section, sym_sec, - h, rel, htab); - if (stub_entry != NULL) + hsh = hppa_get_stub_entry (input_section, sym_sec, + hh, rela, htab); + if (hsh != NULL) { - value = (stub_entry->stub_offset - + stub_entry->stub_sec->output_offset - + stub_entry->stub_sec->output_section->vma); + value = (hsh->stub_offset + + hsh->stub_sec->output_offset + + hsh->stub_sec->output_section->vma); addend = 0; } - else if (sym_sec == NULL && h != NULL - && h->elf.root.type == bfd_link_hash_undefweak) + else if (sym_sec == NULL && hh != NULL + && hh->elf.root.type == bfd_link_hash_undefweak) { /* It's OK if undefined weak. Calls to undefined weak symbols behave as if the "called" function @@ -3220,7 +3254,7 @@ final_link_relocate (asection *input_sec (_("%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"), input_bfd, input_section, - (long) rel->r_offset, + offset, howto->name, insn); } @@ -3337,16 +3371,16 @@ final_link_relocate (asection *input_sec call to the local stub for this function. */ if (value + addend + max_branch_offset >= 2*max_branch_offset) { - stub_entry = hppa_get_stub_entry (input_section, sym_sec, - h, rel, htab); - if (stub_entry == NULL) + hsh = hppa_get_stub_entry (input_section, sym_sec, + hh, rela, htab); + if (hsh == NULL) return bfd_reloc_undefined; /* Munge up the value and addend so that we call the stub rather than the procedure directly. */ - value = (stub_entry->stub_offset - + stub_entry->stub_sec->output_offset - + stub_entry->stub_sec->output_section->vma + value = (hsh->stub_offset + + hsh->stub_sec->output_offset + + hsh->stub_sec->output_section->vma - location); addend = -8; } @@ -3365,8 +3399,8 @@ final_link_relocate (asection *input_sec (_("%B(%A+0x%lx): cannot reach %s, recompile with -ffunction-sections"), input_bfd, input_section, - (long) rel->r_offset, - stub_entry->root.string); + offset, + hsh->root.string); bfd_set_error (bfd_error_bad_value); return bfd_reloc_notsupported; } @@ -3415,7 +3449,7 @@ elf32_hppa_relocate_section (bfd *output bfd_vma *local_got_offsets; struct elf32_hppa_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Rela *rel; + Elf_Internal_Rela *rela; Elf_Internal_Rela *relend; if (info->relocatable) @@ -3426,23 +3460,23 @@ elf32_hppa_relocate_section (bfd *output htab = hppa_link_hash_table (info); local_got_offsets = elf_local_got_offsets (input_bfd); - rel = relocs; + rela = relocs; relend = relocs + input_section->reloc_count; - for (; rel < relend; rel++) + for (; rela < relend; rela++) { unsigned int r_type; reloc_howto_type *howto; unsigned int r_symndx; - struct elf32_hppa_link_hash_entry *h; + struct elf32_hppa_link_hash_entry *hh; Elf_Internal_Sym *sym; asection *sym_sec; bfd_vma relocation; - bfd_reloc_status_type r; + bfd_reloc_status_type rstatus; const char *sym_name; bfd_boolean plabel; bfd_boolean warned_undef; - r_type = ELF32_R_TYPE (rel->r_info); + r_type = ELF32_R_TYPE (rela->r_info); if (r_type >= (unsigned int) R_PARISC_UNIMPLEMENTED) { bfd_set_error (bfd_error_bad_value); @@ -3453,8 +3487,8 @@ elf32_hppa_relocate_section (bfd *output continue; /* This is a final link. */ - r_symndx = ELF32_R_SYM (rel->r_info); - h = NULL; + r_symndx = ELF32_R_SYM (rela->r_info); + hh = NULL; sym = NULL; sym_sec = NULL; warned_undef = FALSE; @@ -3463,36 +3497,36 @@ elf32_hppa_relocate_section (bfd *output /* This is a local symbol, h defaults to NULL. */ sym = local_syms + r_symndx; sym_sec = local_sections[r_symndx]; - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sym_sec, rel); + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sym_sec, rela); } else { - struct elf_link_hash_entry *hh; + struct elf_link_hash_entry *eh; bfd_boolean unresolved_reloc; struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd); - RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rela, r_symndx, symtab_hdr, sym_hashes, - hh, sym_sec, relocation, + eh, sym_sec, relocation, unresolved_reloc, warned_undef); if (relocation == 0 - && hh->root.type != bfd_link_hash_defined - && hh->root.type != bfd_link_hash_defweak - && hh->root.type != bfd_link_hash_undefweak) + && eh->root.type != bfd_link_hash_defined + && eh->root.type != bfd_link_hash_defweak + && eh->root.type != bfd_link_hash_undefweak) { if (info->unresolved_syms_in_objects == RM_IGNORE - && ELF_ST_VISIBILITY (hh->other) == STV_DEFAULT - && hh->type == STT_PARISC_MILLI) + && ELF_ST_VISIBILITY (eh->other) == STV_DEFAULT + && eh->type == STT_PARISC_MILLI) { if (! info->callbacks->undefined_symbol - (info, hh->root.root.string, input_bfd, - input_section, rel->r_offset, FALSE)) + (info, eh->root.root.string, input_bfd, + input_section, rela->r_offset, FALSE)) return FALSE; warned_undef = TRUE; } } - h = (struct elf32_hppa_link_hash_entry *) hh; + hh = hppa_elf_hash_entry (eh); } /* Do any required modifications to the relocation value, and @@ -3510,14 +3544,14 @@ elf32_hppa_relocate_section (bfd *output /* Relocation is to the entry for this symbol in the global offset table. */ - if (h != NULL) + if (hh != NULL) { bfd_boolean dyn; - off = h->elf.got.offset; + off = hh->elf.got.offset; dyn = htab->elf.dynamic_sections_created; if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, - &h->elf)) + &hh->elf)) { /* If we aren't going to call finish_dynamic_symbol, then we need to handle initialisation of the .got @@ -3529,7 +3563,7 @@ elf32_hppa_relocate_section (bfd *output off &= ~1; else { - h->elf.got.offset |= 1; + hh->elf.got.offset |= 1; do_got = 1; } } @@ -3563,15 +3597,15 @@ elf32_hppa_relocate_section (bfd *output object because the symbol index is zero. */ Elf_Internal_Rela outrel; bfd_byte *loc; - asection *s = htab->srelgot; + asection *sec = htab->srelgot; outrel.r_offset = (off + htab->sgot->output_offset + htab->sgot->output_section->vma); outrel.r_info = ELF32_R_INFO (0, R_PARISC_DIR32); outrel.r_addend = relocation; - loc = s->contents; - loc += s->reloc_count++ * sizeof (Elf32_External_Rela); + loc = sec->contents; + loc += sec->reloc_count++ * sizeof (Elf32_External_Rela); bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); } else @@ -3603,14 +3637,13 @@ elf32_hppa_relocate_section (bfd *output { bfd_vma off; bfd_boolean do_plt = 0; - /* If we have a global symbol with a PLT slot, then redirect this relocation to it. */ - if (h != NULL) + if (hh != NULL) { - off = h->elf.plt.offset; + off = hh->elf.plt.offset; if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, - &h->elf)) + &hh->elf)) { /* In a non-shared link, adjust_dynamic_symbols isn't called for symbols forced local. We @@ -3619,7 +3652,7 @@ elf32_hppa_relocate_section (bfd *output off &= ~1; else { - h->elf.plt.offset |= 1; + hh->elf.plt.offset |= 1; do_plt = 1; } } @@ -3685,9 +3718,9 @@ elf32_hppa_relocate_section (bfd *output is in the .plt and thus has a gp pointer too. Exception: Undefined PLABELs should have a value of zero. */ - if (h == NULL - || (h->elf.root.type != bfd_link_hash_undefweak - && h->elf.root.type != bfd_link_hash_undefined)) + if (hh == NULL + || (hh->elf.root.type != bfd_link_hash_undefweak + && hh->elf.root.type != bfd_link_hash_undefined)) { relocation = (off + htab->splt->output_offset @@ -3727,20 +3760,20 @@ elf32_hppa_relocate_section (bfd *output Conversely, DEF_DYNAMIC can't be used in check_relocs as there all files have not been loaded. */ if ((info->shared - && (h == NULL - || ELF_ST_VISIBILITY (h->elf.other) == STV_DEFAULT - || h->elf.root.type != bfd_link_hash_undefweak) + && (hh == NULL + || ELF_ST_VISIBILITY (hh->elf.other) == STV_DEFAULT + || hh->elf.root.type != bfd_link_hash_undefweak) && (IS_ABSOLUTE_RELOC (r_type) - || !SYMBOL_CALLS_LOCAL (info, &h->elf))) + || !SYMBOL_CALLS_LOCAL (info, &hh->elf))) || (!info->shared - && h != NULL - && h->elf.dynindx != -1 - && !h->elf.non_got_ref + && hh != NULL + && hh->elf.dynindx != -1 + && !hh->elf.non_got_ref && ((ELIMINATE_COPY_RELOCS - && h->elf.def_dynamic - && !h->elf.def_regular) - || h->elf.root.type == bfd_link_hash_undefweak - || h->elf.root.type == bfd_link_hash_undefined))) + && hh->elf.def_dynamic + && !hh->elf.def_regular) + || hh->elf.root.type == bfd_link_hash_undefweak + || hh->elf.root.type == bfd_link_hash_undefined))) { Elf_Internal_Rela outrel; bfd_boolean skip; @@ -3751,28 +3784,28 @@ elf32_hppa_relocate_section (bfd *output are copied into the output file to be resolved at run time. */ - outrel.r_addend = rel->r_addend; + outrel.r_addend = rela->r_addend; outrel.r_offset = _bfd_elf_section_offset (output_bfd, info, input_section, - rel->r_offset); + rela->r_offset); skip = (outrel.r_offset == (bfd_vma) -1 || outrel.r_offset == (bfd_vma) -2); outrel.r_offset += (input_section->output_offset + input_section->output_section->vma); - + if (skip) { memset (&outrel, 0, sizeof (outrel)); } - else if (h != NULL - && h->elf.dynindx != -1 + else if (hh != NULL + && hh->elf.dynindx != -1 && (plabel || !IS_ABSOLUTE_RELOC (r_type) || !info->shared || !info->symbolic - || !h->elf.def_regular)) + || !hh->elf.def_regular)) { - outrel.r_info = ELF32_R_INFO (h->elf.dynindx, r_type); + outrel.r_info = ELF32_R_INFO (hh->elf.dynindx, r_type); } else /* It's a local symbol, or one marked to become local. */ { @@ -3821,14 +3854,14 @@ elf32_hppa_relocate_section (bfd *output break; } - r = final_link_relocate (input_section, contents, rel, relocation, - htab, sym_sec, h, info); + rstatus = final_link_relocate (input_section, contents, rela, relocation, + htab, sym_sec, hh, info); - if (r == bfd_reloc_ok) + if (rstatus == bfd_reloc_ok) continue; - if (h != NULL) - sym_name = h->elf.root.root.string; + if (hh != NULL) + sym_name = hh->elf.root.root.string; else { sym_name = bfd_elf_string_from_elf_section (input_bfd, @@ -3842,15 +3875,15 @@ elf32_hppa_relocate_section (bfd *output howto = elf_hppa_howto_table + r_type; - if (r == bfd_reloc_undefined || r == bfd_reloc_notsupported) + if (rstatus == bfd_reloc_undefined || rstatus == bfd_reloc_notsupported) { - if (r == bfd_reloc_notsupported || !warned_undef) + if (rstatus == bfd_reloc_notsupported || !warned_undef) { (*_bfd_error_handler) (_("%B(%A+0x%lx): cannot handle %s for %s"), input_bfd, input_section, - (long) rel->r_offset, + (long) rela->r_offset, howto->name, sym_name); bfd_set_error (bfd_error_bad_value); @@ -3860,8 +3893,8 @@ elf32_hppa_relocate_section (bfd *output else { if (!((*info->callbacks->reloc_overflow) - (info, (h ? &h->elf.root : NULL), sym_name, howto->name, - (bfd_vma) 0, input_bfd, input_section, rel->r_offset))) + (info, (hh ? &hh->elf.root : NULL), sym_name, howto->name, + (bfd_vma) 0, input_bfd, input_section, rela->r_offset))) return FALSE; } } @@ -3875,20 +3908,20 @@ elf32_hppa_relocate_section (bfd *output static bfd_boolean elf32_hppa_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, - struct elf_link_hash_entry *h, + struct elf_link_hash_entry *eh, Elf_Internal_Sym *sym) { struct elf32_hppa_link_hash_table *htab; - Elf_Internal_Rela rel; + Elf_Internal_Rela rela; bfd_byte *loc; htab = hppa_link_hash_table (info); - if (h->plt.offset != (bfd_vma) -1) + if (eh->plt.offset != (bfd_vma) -1) { bfd_vma value; - if (h->plt.offset & 1) + if (eh->plt.offset & 1) abort (); /* This symbol has an entry in the procedure linkage table. Set @@ -3899,37 +3932,37 @@ elf32_hppa_finish_dynamic_symbol (bfd *o <__gp> */ value = 0; - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) + if (eh->root.type == bfd_link_hash_defined + || eh->root.type == bfd_link_hash_defweak) { - value = h->root.u.def.value; - if (h->root.u.def.section->output_section != NULL) - value += (h->root.u.def.section->output_offset - + h->root.u.def.section->output_section->vma); + value = eh->root.u.def.value; + if (eh->root.u.def.section->output_section != NULL) + value += (eh->root.u.def.section->output_offset + + eh->root.u.def.section->output_section->vma); } /* Create a dynamic IPLT relocation for this entry. */ - rel.r_offset = (h->plt.offset + rela.r_offset = (eh->plt.offset + htab->splt->output_offset + htab->splt->output_section->vma); - if (h->dynindx != -1) + if (eh->dynindx != -1) { - rel.r_info = ELF32_R_INFO (h->dynindx, R_PARISC_IPLT); - rel.r_addend = 0; + rela.r_info = ELF32_R_INFO (eh->dynindx, R_PARISC_IPLT); + rela.r_addend = 0; } else { /* This symbol has been marked to become local, and is used by a plabel so must be kept in the .plt. */ - rel.r_info = ELF32_R_INFO (0, R_PARISC_IPLT); - rel.r_addend = value; + rela.r_info = ELF32_R_INFO (0, R_PARISC_IPLT); + rela.r_addend = value; } loc = htab->srelplt->contents; loc += htab->srelplt->reloc_count++ * sizeof (Elf32_External_Rela); - bfd_elf32_swap_reloca_out (htab->splt->output_section->owner, &rel, loc); + bfd_elf32_swap_reloca_out (htab->splt->output_section->owner, &rela, loc); - if (!h->def_regular) + if (!eh->def_regular) { /* Mark the symbol as undefined, rather than as defined in the .plt section. Leave the value alone. */ @@ -3937,12 +3970,12 @@ elf32_hppa_finish_dynamic_symbol (bfd *o } } - if (h->got.offset != (bfd_vma) -1) + if (eh->got.offset != (bfd_vma) -1) { /* This symbol has an entry in the global offset table. Set it up. */ - rel.r_offset = ((h->got.offset &~ (bfd_vma) 1) + rela.r_offset = ((eh->got.offset &~ (bfd_vma) 1) + htab->sgot->output_offset + htab->sgot->output_section->vma); @@ -3952,54 +3985,55 @@ elf32_hppa_finish_dynamic_symbol (bfd *o global offset table will already have been initialized in the relocate_section function. */ if (info->shared - && (info->symbolic || h->dynindx == -1) - && h->def_regular) + && (info->symbolic || eh->dynindx == -1) + && eh->def_regular) { - rel.r_info = ELF32_R_INFO (0, R_PARISC_DIR32); - rel.r_addend = (h->root.u.def.value - + h->root.u.def.section->output_offset - + h->root.u.def.section->output_section->vma); + rela.r_info = ELF32_R_INFO (0, R_PARISC_DIR32); + rela.r_addend = (eh->root.u.def.value + + eh->root.u.def.section->output_offset + + eh->root.u.def.section->output_section->vma); } else { - if ((h->got.offset & 1) != 0) + if ((eh->got.offset & 1) != 0) abort (); - bfd_put_32 (output_bfd, 0, htab->sgot->contents + h->got.offset); - rel.r_info = ELF32_R_INFO (h->dynindx, R_PARISC_DIR32); - rel.r_addend = 0; + + bfd_put_32 (output_bfd, 0, htab->sgot->contents + (eh->got.offset & ~1)); + rela.r_info = ELF32_R_INFO (eh->dynindx, R_PARISC_DIR32); + rela.r_addend = 0; } loc = htab->srelgot->contents; loc += htab->srelgot->reloc_count++ * sizeof (Elf32_External_Rela); - bfd_elf32_swap_reloca_out (output_bfd, &rel, loc); + bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); } - if (h->needs_copy) + if (eh->needs_copy) { - asection *s; + asection *sec; /* This symbol needs a copy reloc. Set it up. */ - if (! (h->dynindx != -1 - && (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak))) + if (! (eh->dynindx != -1 + && (eh->root.type == bfd_link_hash_defined + || eh->root.type == bfd_link_hash_defweak))) abort (); - s = htab->srelbss; + sec = htab->srelbss; - rel.r_offset = (h->root.u.def.value - + h->root.u.def.section->output_offset - + h->root.u.def.section->output_section->vma); - rel.r_addend = 0; - rel.r_info = ELF32_R_INFO (h->dynindx, R_PARISC_COPY); - loc = s->contents + s->reloc_count++ * sizeof (Elf32_External_Rela); - bfd_elf32_swap_reloca_out (output_bfd, &rel, loc); + rela.r_offset = (eh->root.u.def.value + + eh->root.u.def.section->output_offset + + eh->root.u.def.section->output_section->vma); + rela.r_addend = 0; + rela.r_info = ELF32_R_INFO (eh->dynindx, R_PARISC_COPY); + loc = sec->contents + sec->reloc_count++ * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); } /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ - if (h->root.root.string[0] == '_' - && (strcmp (h->root.root.string, "_DYNAMIC") == 0 - || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)) + if (eh->root.root.string[0] == '_' + && (strcmp (eh->root.root.string, "_DYNAMIC") == 0 + || strcmp (eh->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)) { sym->st_shndx = SHN_ABS; } diff -uprN binutils-2.16.90.0.3/bfd/elf32-i370.c binutils-2.16.91.0.1/bfd/elf32-i370.c --- binutils-2.16.90.0.3/bfd/elf32-i370.c 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-i370.c 2005-06-22 13:53:34.269422381 -0700 @@ -901,7 +901,12 @@ i370_elf_check_relocs (abfd, info, sec, if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } if (info->shared) { diff -uprN binutils-2.16.90.0.3/bfd/elf32-i386.c binutils-2.16.91.0.1/bfd/elf32-i386.c --- binutils-2.16.90.0.3/bfd/elf32-i386.c 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-i386.c 2005-06-22 13:53:34.272421885 -0700 @@ -602,7 +602,7 @@ struct elf_i386_link_hash_table asection *srelplt; asection *sdynbss; asection *srelbss; - + /* The (unloaded but important) .rel.plt.unloaded section on VxWorks. */ asection *srelplt2; @@ -614,7 +614,7 @@ struct elf_i386_link_hash_table /* Value used to fill the last word of the first plt entry. */ bfd_byte plt0_pad_byte; - + union { bfd_signed_vma refcount; bfd_vma offset; @@ -911,7 +911,12 @@ elf_i386_check_relocs (bfd *abfd, if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } r_type = elf_i386_tls_transition (info, r_type, h == NULL); @@ -1431,7 +1436,13 @@ elf_i386_adjust_dynamic_symbol (struct b return TRUE; } - if (ELIMINATE_COPY_RELOCS) + htab = elf_i386_hash_table (info); + + /* If there aren't any dynamic relocs in read-only sections, then + we can keep the dynamic relocs and avoid the copy reloc. This + doesn't work on VxWorks, where we can not have dynamic relocations + (other than copy and jump slot relocations) in an executable. */ + if (ELIMINATE_COPY_RELOCS && !htab->is_vxworks) { struct elf_i386_link_hash_entry * eh; struct elf_i386_dyn_relocs *p; @@ -1444,8 +1455,6 @@ elf_i386_adjust_dynamic_symbol (struct b break; } - /* If we didn't find any dynamic relocs in read-only sections, then - we'll be keeping the dynamic relocs and avoiding the copy reloc. */ if (p == NULL) { h->non_got_ref = 0; @@ -1463,8 +1472,6 @@ elf_i386_adjust_dynamic_symbol (struct b both the dynamic object and the regular object will refer to the same memory location for the variable. */ - htab = elf_i386_hash_table (info); - /* We must generate a R_386_COPY reloc to tell the dynamic linker to copy the initial value out of the dynamic object and into the runtime process image. */ @@ -1914,7 +1921,8 @@ elf_i386_size_dynamic_sections (bfd *out if (s == htab->splt || s == htab->sgot - || s == htab->sgotplt) + || s == htab->sgotplt + || s == htab->sdynbss) { /* Strip this section if we don't need it; see the comment below. */ @@ -2267,6 +2275,21 @@ elf_i386_relocate_section (bfd *output_b unresolved_reloc, warned); } + if (r_symndx == 0) + { + /* r_symndx will be zero only for relocs against symbols from + removed linkonce sections, or sections discarded by a linker + script. For these relocs, we just want the section contents + zeroed. Avoid any special processing in the switch below. */ + r_type = R_386_NONE; + + relocation = 0; + if (howto->pc_relative) + relocation = (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset); + } + switch (r_type) { case R_386_GOT32: @@ -2368,6 +2391,7 @@ elf_i386_relocate_section (bfd *output_b for shared library since it may not be local when used as function address. */ if (info->shared + && !info->executable && h && h->def_regular && h->type == STT_FUNC @@ -2422,21 +2446,6 @@ elf_i386_relocate_section (bfd *output_b case R_386_32: case R_386_PC32: - /* r_symndx will be zero only for relocs against symbols - from removed linkonce sections, or sections discarded by - a linker script. */ - if (r_symndx == 0) - { - /* Zero the section contents. eh_frame generated by old - versions of gcc isn't edited by elf-eh-frame.c, so - FDEs for discarded linkonce functions might remain. - Putting zeros here will zero such FDE's address range. - This is a hint to unwinders and other consumers of - exception handling info that the FDE is invalid. */ - bfd_put_32 (input_bfd, 0, contents + rel->r_offset); - break; - } - if ((input_section->flags & SEC_ALLOC) == 0) break; @@ -3155,7 +3164,6 @@ elf_i386_finish_dynamic_symbol (bfd *out bfd_elf32_swap_reloc_out (output_bfd, &rel, loc + sizeof (Elf32_External_Rel)); } - } else { @@ -3443,7 +3451,7 @@ elf_i386_finish_dynamic_sections (bfd *o if (htab->is_vxworks && !info->shared) { int num_plts = (htab->splt->size / PLT_ENTRY_SIZE) - 1; - char *p; + unsigned char *p; p = htab->srelplt2->contents; if (info->shared) diff -uprN binutils-2.16.90.0.3/bfd/elf32-iq2000.c binutils-2.16.91.0.1/bfd/elf32-iq2000.c --- binutils-2.16.90.0.3/bfd/elf32-iq2000.c 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-iq2000.c 2005-06-22 13:53:34.278420894 -0700 @@ -427,7 +427,12 @@ iq2000_elf_check_relocs (bfd *abfd, if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } switch (ELF32_R_TYPE (rel->r_info)) { diff -uprN binutils-2.16.90.0.3/bfd/elf32-m32r.c binutils-2.16.91.0.1/bfd/elf32-m32r.c --- binutils-2.16.90.0.3/bfd/elf32-m32r.c 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-m32r.c 2005-06-22 13:53:34.291418746 -0700 @@ -3947,7 +3947,12 @@ m32r_elf_check_relocs (abfd, info, sec, if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } /* Some relocs require a global offset table. */ if (htab->sgot == NULL) diff -uprN binutils-2.16.90.0.3/bfd/elf32-m68hc1x.c binutils-2.16.91.0.1/bfd/elf32-m68hc1x.c --- binutils-2.16.90.0.3/bfd/elf32-m68hc1x.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-m68hc1x.c 2005-06-22 13:53:34.293418416 -0700 @@ -885,7 +885,12 @@ elf32_m68hc11_check_relocs (bfd *abfd, s if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes [r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes [r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } switch (ELF32_R_TYPE (rel->r_info)) { diff -uprN binutils-2.16.90.0.3/bfd/elf32-m68k.c binutils-2.16.91.0.1/bfd/elf32-m68k.c --- binutils-2.16.90.0.3/bfd/elf32-m68k.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-m68k.c 2005-06-22 13:53:34.299417425 -0700 @@ -481,7 +481,12 @@ elf_m68k_check_relocs (abfd, info, sec, if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } switch (ELF32_R_TYPE (rel->r_info)) { diff -uprN binutils-2.16.90.0.3/bfd/elf32-mcore.c binutils-2.16.91.0.1/bfd/elf32-mcore.c --- binutils-2.16.90.0.3/bfd/elf32-mcore.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-mcore.c 2005-06-22 13:53:34.299417425 -0700 @@ -639,7 +639,12 @@ mcore_elf_check_relocs (abfd, info, sec, if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes [r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes [r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } switch (ELF32_R_TYPE (rel->r_info)) { diff -uprN binutils-2.16.90.0.3/bfd/elf32-mips.c binutils-2.16.91.0.1/bfd/elf32-mips.c --- binutils-2.16.90.0.3/bfd/elf32-mips.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-mips.c 2005-06-22 13:53:34.301417094 -0700 @@ -1573,6 +1573,7 @@ static const struct ecoff_debug_swap mip #define bfd_elf32_bfd_is_local_label_name \ mips_elf_is_local_label_name #define bfd_elf32_find_nearest_line _bfd_mips_elf_find_nearest_line +#define bfd_elf32_find_inliner_info _bfd_mips_elf_find_inliner_info #define bfd_elf32_new_section_hook _bfd_mips_elf_new_section_hook #define bfd_elf32_set_section_contents _bfd_mips_elf_set_section_contents #define bfd_elf32_bfd_get_relocated_section_contents \ diff -uprN binutils-2.16.90.0.3/bfd/elf32-ms1.c binutils-2.16.91.0.1/bfd/elf32-ms1.c --- binutils-2.16.90.0.3/bfd/elf32-ms1.c 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/bfd/elf32-ms1.c 2005-06-22 13:53:34.302416929 -0700 @@ -0,0 +1,638 @@ +/* Morpho Technologies MS1 specific support for 32-bit ELF + Copyright 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "elf-bfd.h" +#include "elf/ms1.h" + +/* Prototypes. */ +static reloc_howto_type * ms1_reloc_type_lookup + (bfd *, bfd_reloc_code_real_type); + +static void ms1_info_to_howto_rela + (bfd *, arelent *, Elf_Internal_Rela *); + +static bfd_reloc_status_type ms1_elf_relocate_hi16 + (bfd *, Elf_Internal_Rela *, bfd_byte *, bfd_vma); + +static bfd_reloc_status_type ms1_final_link_relocate + (reloc_howto_type *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, bfd_vma); + +static bfd_boolean ms1_elf_relocate_section + (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, Elf_Internal_Sym *, asection **); + +/* Relocation tables. */ +static reloc_howto_type ms1_elf_howto_table [] = +{ + /* This reloc does nothing. */ + HOWTO (R_MS1_NONE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_MS1_NONE", /* name */ + FALSE, /* partial_inplace */ + 0 , /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A 16 bit absolute relocation. */ + HOWTO (R_MS1_16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_MS1_16", /* name */ + FALSE, /* partial_inplace */ + 0 , /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A 32 bit absolute relocation. */ + HOWTO (R_MS1_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_MS1_32", /* name */ + FALSE, /* partial_inplace */ + 0 , /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A 32 bit pc-relative relocation. */ + HOWTO (R_MS1_32_PCREL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_MS1_32_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0 , /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* A 16 bit pc-relative relocation. */ + HOWTO (R_MS1_PC16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_MS1_PC16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* high 16 bits of symbol value. */ + HOWTO (R_MS1_HI16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_MS1_HI16", /* name */ + FALSE, /* partial_inplace */ + 0xffff0000, /* src_mask */ + 0xffff0000, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Low 16 bits of symbol value. */ + HOWTO (R_MS1_LO16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_MS1_LO16", /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ +}; + +/* Map BFD reloc types to MS1 ELF reloc types. */ + +static reloc_howto_type * +ms1_reloc_type_lookup + (bfd * abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) +{ + /* Note that the ms1_elf_howto_table is indxed by the R_ + constants. Thus, the order that the howto records appear in the + table *must* match the order of the relocation types defined in + include/elf/ms1.h. */ + + switch (code) + { + case BFD_RELOC_NONE: + return &ms1_elf_howto_table[ (int) R_MS1_NONE]; + case BFD_RELOC_16: + return &ms1_elf_howto_table[ (int) R_MS1_16]; + case BFD_RELOC_32: + return &ms1_elf_howto_table[ (int) R_MS1_32]; + case BFD_RELOC_32_PCREL: + return &ms1_elf_howto_table[ (int) R_MS1_32_PCREL]; + case BFD_RELOC_16_PCREL: + return &ms1_elf_howto_table[ (int) R_MS1_PC16]; + case BFD_RELOC_HI16: + return &ms1_elf_howto_table[ (int) R_MS1_HI16]; + case BFD_RELOC_LO16: + return &ms1_elf_howto_table[ (int) R_MS1_LO16]; + + default: + /* Pacify gcc -Wall. */ + return NULL; + } + return NULL; +} + +bfd_reloc_status_type +ms1_elf_relocate_hi16 + (bfd * input_bfd, + Elf_Internal_Rela * relhi, + bfd_byte * contents, + bfd_vma value) +{ + bfd_vma insn; + + insn = bfd_get_32 (input_bfd, contents + relhi->r_offset); + + value += relhi->r_addend; + value >>= 16; + insn = ((insn & ~0xFFFF) | value); + + bfd_put_32 (input_bfd, insn, contents + relhi->r_offset); + return bfd_reloc_ok; +} + +/* XXX: The following code is the result of a cut&paste. This unfortunate + practice is very widespread in the various target back-end files. */ + +/* Set the howto pointer for a MS1 ELF reloc. */ + +static void +ms1_info_to_howto_rela + (bfd * abfd ATTRIBUTE_UNUSED, + arelent * cache_ptr, + Elf_Internal_Rela * dst) +{ + unsigned int r_type; + + r_type = ELF32_R_TYPE (dst->r_info); + cache_ptr->howto = & ms1_elf_howto_table [r_type]; +} + +/* Perform a single relocation. By default we use the standard BFD + routines. */ + +static bfd_reloc_status_type +ms1_final_link_relocate + (reloc_howto_type * howto, + bfd * input_bfd, + asection * input_section, + bfd_byte * contents, + Elf_Internal_Rela * rel, + bfd_vma relocation) +{ + return _bfd_final_link_relocate (howto, input_bfd, input_section, + contents, rel->r_offset, + relocation, rel->r_addend); +} + +/* Relocate a MS1 ELF section. + There is some attempt to make this function usable for many architectures, + both USE_REL and USE_RELA ['twould be nice if such a critter existed], + if only to serve as a learning tool. + + The RELOCATE_SECTION function is called by the new ELF backend linker + to handle the relocations for a section. + + The relocs are always passed as Rela structures; if the section + actually uses Rel structures, the r_addend field will always be + zero. + + This function is responsible for adjusting the section contents as + necessary, and (if using Rela relocs and generating a relocatable + output file) adjusting the reloc addend as necessary. + + This function does not have to worry about setting the reloc + address or the reloc symbol index. + + LOCAL_SYMS is a pointer to the swapped in local symbols. + + LOCAL_SECTIONS is an array giving the section in the input file + corresponding to the st_shndx field of each local symbol. + + The global hash table entry for the global symbols can be found + via elf_sym_hashes (input_bfd). + + When generating relocatable output, this function must handle + STB_LOCAL/STT_SECTION symbols specially. The output symbol is + going to be the section symbol corresponding to the output + section, which means that the addend must be adjusted + accordingly. */ + +static bfd_boolean +ms1_elf_relocate_section + (bfd * output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info * info, + bfd * input_bfd, + asection * input_section, + bfd_byte * contents, + Elf_Internal_Rela * relocs, + Elf_Internal_Sym * local_syms, + asection ** local_sections) +{ + Elf_Internal_Shdr * symtab_hdr; + struct elf_link_hash_entry ** sym_hashes; + Elf_Internal_Rela * rel; + Elf_Internal_Rela * relend; + + symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (input_bfd); + relend = relocs + input_section->reloc_count; + + for (rel = relocs; rel < relend; rel ++) + { + reloc_howto_type * howto; + unsigned long r_symndx; + Elf_Internal_Sym * sym; + asection * sec; + struct elf_link_hash_entry * h; + bfd_vma relocation; + bfd_reloc_status_type r; + const char * name = NULL; + int r_type; + + r_type = ELF32_R_TYPE (rel->r_info); + + r_symndx = ELF32_R_SYM (rel->r_info); + + /* This is a final link. */ + howto = ms1_elf_howto_table + ELF32_R_TYPE (rel->r_info); + h = NULL; + sym = NULL; + sec = NULL; + + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + sec = local_sections [r_symndx]; + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); + + name = bfd_elf_string_from_elf_section + (input_bfd, symtab_hdr->sh_link, sym->st_name); + name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name; + } + else + { + bfd_boolean unresolved_reloc; + bfd_boolean warned; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, + unresolved_reloc, warned); + + name = h->root.root.string; + } + + + /* Finally, the sole MS1-specific part. */ + switch (r_type) + { + case R_MS1_HI16: + r = ms1_elf_relocate_hi16 (input_bfd, rel, contents, relocation); + break; + default: + r = ms1_final_link_relocate (howto, input_bfd, input_section, + contents, rel, relocation); + break; + } + + + if (r != bfd_reloc_ok) + { + const char * msg = (const char *) NULL; + + switch (r) + { + case bfd_reloc_overflow: + r = info->callbacks->reloc_overflow + (info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, + input_bfd, input_section, rel->r_offset); + break; + + case bfd_reloc_undefined: + r = info->callbacks->undefined_symbol + (info, name, input_bfd, input_section, rel->r_offset, TRUE); + break; + + case bfd_reloc_outofrange: + msg = _("internal error: out of range error"); + break; + + case bfd_reloc_dangerous: + msg = _("internal error: dangerous relocation"); + break; + + default: + msg = _("internal error: unknown error"); + break; + } + + if (msg) + r = info->callbacks->warning + (info, msg, name, input_bfd, input_section, rel->r_offset); + + if (! r) + return FALSE; + } + } + + return TRUE; +} + +/* Return the section that should be marked against GC for a given + relocation. */ + +static asection * +ms1_elf_gc_mark_hook + (asection * sec, + struct bfd_link_info * info ATTRIBUTE_UNUSED, + Elf_Internal_Rela * rel ATTRIBUTE_UNUSED, + struct elf_link_hash_entry * h, + Elf_Internal_Sym * sym) +{ + if (h != NULL) + { + switch (h->root.type) + { + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + return h->root.u.def.section; + + case bfd_link_hash_common: + return h->root.u.c.p->section; + + default: + break; + } + } + else + { + if (!(elf_bad_symtab (sec->owner) + && ELF_ST_BIND (sym->st_info) != STB_LOCAL) + && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE) + && sym->st_shndx != SHN_COMMON)) + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); + } + + return NULL; +} + +/* Update the got entry reference counts for the section being + removed. */ + +static bfd_boolean +ms1_elf_gc_sweep_hook + (bfd * abfd ATTRIBUTE_UNUSED, + struct bfd_link_info * info ATTRIBUTE_UNUSED, + asection * sec ATTRIBUTE_UNUSED, + const Elf_Internal_Rela * relocs ATTRIBUTE_UNUSED) +{ + return TRUE; +} + +/* Look through the relocs for a section during the first phase. + Since we don't do .gots or .plts, we just need to consider the + virtual table relocs for gc. */ + +static bfd_boolean +ms1_elf_check_relocs + (bfd * abfd, + struct bfd_link_info * info, + asection * sec, + const Elf_Internal_Rela * relocs) +{ + Elf_Internal_Shdr * symtab_hdr; + struct elf_link_hash_entry ** sym_hashes; + struct elf_link_hash_entry ** sym_hashes_end; + const Elf_Internal_Rela * rel; + const Elf_Internal_Rela * rel_end; + + if (info->relocatable) + return TRUE; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + sym_hashes_end = sym_hashes + symtab_hdr->sh_size / sizeof (Elf32_External_Sym); + if (!elf_bad_symtab (abfd)) + sym_hashes_end -= symtab_hdr->sh_info; + + rel_end = relocs + sec->reloc_count; + for (rel = relocs; rel < rel_end; rel++) + { + struct elf_link_hash_entry *h; + unsigned long r_symndx; + + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx < symtab_hdr->sh_info) + h = NULL; + else + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } + } + + return TRUE; +} + +/* Return the MACH for an e_flags value. */ + +static int +elf32_ms1_machine (bfd *abfd) +{ + switch (elf_elfheader (abfd)->e_flags & EF_MS1_CPU_MASK) + { + case EF_MS1_CPU_MRISC: return bfd_mach_ms1; + case EF_MS1_CPU_MRISC2: return bfd_mach_mrisc2; + } + + return bfd_mach_ms1; +} + +static bfd_boolean +ms1_elf_object_p (bfd * abfd) +{ + bfd_default_set_arch_mach (abfd, bfd_arch_ms1, elf32_ms1_machine (abfd)); + + return TRUE; +} + +/* Function to set the ELF flag bits. */ + +static bfd_boolean +ms1_elf_set_private_flags (bfd * abfd, + flagword flags) +{ + elf_elfheader (abfd)->e_flags = flags; + elf_flags_init (abfd) = TRUE; + return TRUE; +} + +static bfd_boolean +ms1_elf_copy_private_bfd_data (bfd * ibfd, bfd * obfd) +{ + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour + || bfd_get_flavour (obfd) != bfd_target_elf_flavour) + return TRUE; + + BFD_ASSERT (!elf_flags_init (obfd) + || elf_elfheader (obfd)->e_flags == elf_elfheader (ibfd)->e_flags); + + elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; + elf_flags_init (obfd) = TRUE; + return TRUE; +} + +/* Merge backend specific data from an object file to the output + object file when linking. */ + +static bfd_boolean +ms1_elf_merge_private_bfd_data (bfd * ibfd, bfd * obfd) +{ + flagword old_flags, new_flags; + bfd_boolean error = FALSE; + static bfd * last_ibfd = 0; + + /* Check if we have the same endianess. */ + if (_bfd_generic_verify_endian_match (ibfd, obfd) == FALSE) + return FALSE; + + /* If they're not both ms1, then merging is meaningless, so just + don't do it. */ + if (strcmp (ibfd->arch_info->arch_name, "ms1") != 0) + return TRUE; + if (strcmp (obfd->arch_info->arch_name, "ms1") != 0) + return TRUE; + + new_flags = elf_elfheader (ibfd)->e_flags; + old_flags = elf_elfheader (obfd)->e_flags; + +#ifdef DEBUG + _bfd_error_handler ("%B: old_flags = 0x%.8lx, new_flags = 0x%.8lx, init = %s", + ibfd, old_flags, new_flags, elf_flags_init (obfd) ? "yes" : "no"); +#endif + + elf_flags_init (obfd) = TRUE; + + if ((new_flags & EF_MS1_CPU_MASK) == EF_MS1_CPU_MRISC2) + { + elf_elfheader (obfd)->e_flags = new_flags; + last_ibfd = ibfd; + obfd->arch_info = ibfd->arch_info; + } + + return !error; +} + +static bfd_boolean +ms1_elf_print_private_bfd_data (bfd * abfd, void * ptr) +{ + FILE * file = (FILE *) ptr; + flagword flags; + + BFD_ASSERT (abfd != NULL && ptr != NULL); + + /* Print normal ELF private data. */ + _bfd_elf_print_private_bfd_data (abfd, ptr); + + flags = elf_elfheader (abfd)->e_flags; + fprintf (file, _("private flags = 0x%lx:"), (long)flags); + + switch (flags & EF_MS1_CPU_MASK) + { + default: + case EF_MS1_CPU_MRISC: fprintf (file, " ms1-16-002"); break; + case EF_MS1_CPU_MRISC2: fprintf (file, " ms1-16-003"); break; + } + + fputc ('\n', file); + + return TRUE; +} + + +#define TARGET_BIG_SYM bfd_elf32_ms1_vec +#define TARGET_BIG_NAME "elf32-ms1" + +#define ELF_ARCH bfd_arch_ms1 +#define ELF_MACHINE_CODE EM_MS1 +#define ELF_MAXPAGESIZE 1 /* No pages on the MS1. */ + +#define elf_info_to_howto_rel NULL +#define elf_info_to_howto ms1_info_to_howto_rela + +#define elf_backend_relocate_section ms1_elf_relocate_section + +#define bfd_elf32_bfd_reloc_type_lookup ms1_reloc_type_lookup + +#define elf_backend_gc_mark_hook ms1_elf_gc_mark_hook +#define elf_backend_gc_sweep_hook ms1_elf_gc_sweep_hook +#define elf_backend_check_relocs ms1_elf_check_relocs +#define elf_backend_object_p ms1_elf_object_p +#define elf_backend_rela_normal 1 + +#define elf_backend_can_gc_sections 1 + +#define bfd_elf32_bfd_set_private_flags ms1_elf_set_private_flags +#define bfd_elf32_bfd_copy_private_bfd_data ms1_elf_copy_private_bfd_data +#define bfd_elf32_bfd_merge_private_bfd_data ms1_elf_merge_private_bfd_data +#define bfd_elf32_bfd_print_private_bfd_data ms1_elf_print_private_bfd_data + +#include "elf32-target.h" diff -uprN binutils-2.16.90.0.3/bfd/elf32-msp430.c binutils-2.16.91.0.1/bfd/elf32-msp430.c --- binutils-2.16.90.0.3/bfd/elf32-msp430.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-msp430.c 2005-06-22 13:53:34.310415608 -0700 @@ -288,7 +288,12 @@ elf32_msp430_check_relocs (bfd * abfd, s if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } } return TRUE; diff -uprN binutils-2.16.90.0.3/bfd/elf32-openrisc.c binutils-2.16.91.0.1/bfd/elf32-openrisc.c --- binutils-2.16.90.0.3/bfd/elf32-openrisc.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-openrisc.c 2005-06-22 13:53:34.310415608 -0700 @@ -528,7 +528,12 @@ openrisc_elf_check_relocs (abfd, info, s if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } switch (ELF32_R_TYPE (rel->r_info)) { diff -uprN binutils-2.16.90.0.3/bfd/elf32-ppc.c binutils-2.16.91.0.1/bfd/elf32-ppc.c --- binutils-2.16.90.0.3/bfd/elf32-ppc.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-ppc.c 2005-06-22 13:53:34.326412965 -0700 @@ -51,6 +51,7 @@ static bfd_reloc_status_type ppc_elf_unh section. */ #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" +/* For old-style PLT. */ /* The size in bytes of an entry in the procedure linkage table. */ #define PLT_ENTRY_SIZE 12 /* The initial size of the plt reserved for the dynamic linker. */ @@ -60,10 +61,34 @@ static bfd_reloc_status_type ppc_elf_unh /* The number of single-slot PLT entries (the rest use two slots). */ #define PLT_NUM_SINGLE_ENTRIES 8192 -/* Some nop instructions. */ +/* For new-style .glink and .plt. */ +#define GLINK_PLTRESOLVE 16*4 +#define GLINK_ENTRY_SIZE 4*4 + +/* Some instructions. */ +#define ADDIS_11_11 0x3d6b0000 +#define ADDIS_11_30 0x3d7e0000 +#define ADDIS_12_12 0x3d8c0000 +#define ADDI_11_11 0x396b0000 +#define ADD_0_11_11 0x7c0b5a14 +#define ADD_11_0_11 0x7d605a14 +#define B 0x48000000 +#define BCL_20_31 0x429f0005 +#define BCTR 0x4e800420 +#define LIS_11 0x3d600000 +#define LIS_12 0x3d800000 +#define LWZU_0_12 0x840c0000 +#define LWZ_0_12 0x800c0000 +#define LWZ_11_11 0x816b0000 +#define LWZ_11_30 0x817e0000 +#define LWZ_12_12 0x818c0000 +#define MFLR_0 0x7c0802a6 +#define MFLR_12 0x7d8802a6 +#define MTCTR_0 0x7c0903a6 +#define MTCTR_11 0x7d6903a6 +#define MTLR_0 0x7c0803a6 #define NOP 0x60000000 -#define CROR_151515 0x4def7b82 -#define CROR_313131 0x4ffffb82 +#define SUB_11_11_12 0x7d6c5850 /* Offset of tp and dtp pointers from start of TLS block. */ #define TP_OFFSET 0x7000 @@ -1259,6 +1284,67 @@ static reloc_howto_type ppc_elf_howto_ra 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ + /* A 16 bit relative relocation. */ + HOWTO (R_PPC_REL16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC_REL16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* A 16 bit relative relocation without overflow. */ + HOWTO (R_PPC_REL16_LO, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC_REL16_LO", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* The high order 16 bits of a relative address. */ + HOWTO (R_PPC_REL16_HI, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC_REL16_HI", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* The high order 16 bits of a relative address, plus 1 if the contents of + the low 16 bits, treated as a signed number, is negative. */ + HOWTO (R_PPC_REL16_HA, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_addr16_ha_reloc, /* special_function */ + "R_PPC_REL16_HA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + /* GNU extension to record C++ vtable hierarchy. */ HOWTO (R_PPC_GNU_VTINHERIT, /* type */ 0, /* rightshift */ @@ -1418,6 +1504,10 @@ ppc_elf_reloc_type_lookup (bfd *abfd ATT case BFD_RELOC_PPC_EMB_RELST_HA: r = R_PPC_EMB_RELST_HA; break; case BFD_RELOC_PPC_EMB_BIT_FLD: r = R_PPC_EMB_BIT_FLD; break; case BFD_RELOC_PPC_EMB_RELSDA: r = R_PPC_EMB_RELSDA; break; + case BFD_RELOC_16_PCREL: r = R_PPC_REL16; break; + case BFD_RELOC_LO16_PCREL: r = R_PPC_REL16_LO; break; + case BFD_RELOC_HI16_PCREL: r = R_PPC_REL16_HI; break; + case BFD_RELOC_HI16_S_PCREL: r = R_PPC_REL16_HA; break; case BFD_RELOC_VTABLE_INHERIT: r = R_PPC_GNU_VTINHERIT; break; case BFD_RELOC_VTABLE_ENTRY: r = R_PPC_GNU_VTENTRY; break; } @@ -1440,7 +1530,7 @@ ppc_elf_info_to_howto (bfd *abfd ATTRIBU cache_ptr->howto = ppc_elf_howto_table[ELF32_R_TYPE (dst->r_info)]; } -/* Handle the R_PPC_ADDR16_HA reloc. */ +/* Handle the R_PPC_ADDR16_HA and R_PPC_REL16_HA relocs. */ static bfd_reloc_status_type ppc_elf_addr16_ha_reloc (bfd *abfd ATTRIBUTE_UNUSED, @@ -1470,6 +1560,8 @@ ppc_elf_addr16_ha_reloc (bfd *abfd ATTRI relocation += symbol->section->output_section->vma; relocation += symbol->section->output_offset; relocation += reloc_entry->addend; + if (reloc_entry->howto->pc_relative) + relocation -= reloc_entry->address; reloc_entry->addend += (relocation & 0x8000) << 1; @@ -2108,6 +2200,32 @@ struct ppc_elf_dyn_relocs bfd_size_type pc_count; }; +/* Track PLT entries needed for a given symbol. We might need more + than one glink entry per symbol. */ +struct plt_entry +{ + struct plt_entry *next; + + /* -fPIC uses multiple GOT sections, one per file, called ".got2". + This field stores the offset into .got2 used to initialise the + GOT pointer reg. It will always be at least 32768 (and for + current gcc this is the only offset used). */ + bfd_vma addend; + + /* The .got2 section. */ + asection *sec; + + /* PLT refcount or offset. */ + union + { + bfd_signed_vma refcount; + bfd_vma offset; + } plt; + + /* .glink stub offset. */ + bfd_vma glink_offset; +}; + /* Of those relocs that might be copied as dynamic relocs, this macro selects those that must be copied when linking a shared library, even when the symbol is local. */ @@ -2151,6 +2269,10 @@ struct ppc_elf_link_hash_entry #define TLS_TLS 16 /* Any TLS reloc. */ #define TLS_TPRELGD 32 /* TPREL reloc resulting from GD->IE. */ char tls_mask; + + /* Nonzero if we have seen a small data relocation referring to this + symbol. */ + unsigned char has_sda_refs; }; #define ppc_elf_hash_entry(ent) ((struct ppc_elf_link_hash_entry *) (ent)) @@ -2164,6 +2286,7 @@ struct ppc_elf_link_hash_table /* Short-cuts to get to dynamic linker sections. */ asection *got; asection *relgot; + asection *glink; asection *plt; asection *relplt; asection *dynbss; @@ -2182,11 +2305,18 @@ struct ppc_elf_link_hash_table bfd_vma offset; } tlsld_got; + /* Offset of PltResolve function in glink. */ + bfd_vma glink_pltresolve; + /* Size of reserved GOT entries. */ unsigned int got_header_size; /* Non-zero if allocating the header left a gap. */ unsigned int got_gap; + /* Whether to use new plt/got layout or not. */ + unsigned int new_plt:1; + unsigned int old_plt:1; + /* Small local sym to section mapping cache. */ struct sym_sec_cache sym_sec; }; @@ -2243,6 +2373,11 @@ ppc_elf_link_hash_table_create (bfd *abf return NULL; } + ret->elf.init_plt_refcount.refcount = 0; + ret->elf.init_plt_refcount.glist = NULL; + ret->elf.init_plt_offset.offset = 0; + ret->elf.init_plt_offset.glist = NULL; + ret->sdata[0].name = ".sdata"; ret->sdata[0].sym_name = "_SDA_BASE_"; ret->sdata[0].bss_name = ".sbss"; @@ -2306,8 +2441,14 @@ ppc_elf_create_dynamic_sections (bfd *ab if (!_bfd_elf_create_dynamic_sections (abfd, info)) return FALSE; - flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY - | SEC_LINKER_CREATED); + flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_LINKER_CREATED); + + s = bfd_make_section_anyway_with_flags (abfd, ".glink", flags | SEC_CODE); + htab->glink = s; + if (s == NULL + || !bfd_set_section_alignment (abfd, s, 4)) + return FALSE; htab->dynbss = bfd_get_section_by_name (abfd, ".dynbss"); s = bfd_make_section_with_flags (abfd, ".dynsbss", @@ -2319,8 +2460,7 @@ ppc_elf_create_dynamic_sections (bfd *ab if (! info->shared) { htab->relbss = bfd_get_section_by_name (abfd, ".rela.bss"); - s = bfd_make_section_with_flags (abfd, ".rela.sbss", - flags | SEC_READONLY); + s = bfd_make_section_with_flags (abfd, ".rela.sbss", flags); htab->relsbss = s; if (s == NULL || ! bfd_set_section_alignment (abfd, s, 2)) @@ -2339,11 +2479,12 @@ ppc_elf_create_dynamic_sections (bfd *ab /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -ppc_elf_copy_indirect_symbol (const struct elf_backend_data *bed, +ppc_elf_copy_indirect_symbol (const struct elf_backend_data *bed ATTRIBUTE_UNUSED, struct elf_link_hash_entry *dir, struct elf_link_hash_entry *ind) { struct ppc_elf_link_hash_entry *edir, *eind; + bfd_signed_vma tmp; edir = (struct ppc_elf_link_hash_entry *) dir; eind = (struct ppc_elf_link_hash_entry *) ind; @@ -2383,21 +2524,74 @@ ppc_elf_copy_indirect_symbol (const stru } edir->tls_mask |= eind->tls_mask; + edir->has_sda_refs |= eind->has_sda_refs; - if (ELIMINATE_COPY_RELOCS - && ind->root.type != bfd_link_hash_indirect - && dir->dynamic_adjusted) + /* If called to transfer flags for a weakdef during processing + of elf_adjust_dynamic_symbol, don't copy non_got_ref. + We clear it ourselves for ELIMINATE_COPY_RELOCS. */ + if (!(ELIMINATE_COPY_RELOCS + && eind->elf.root.type != bfd_link_hash_indirect + && edir->elf.dynamic_adjusted)) + edir->elf.non_got_ref |= eind->elf.non_got_ref; + + edir->elf.ref_dynamic |= eind->elf.ref_dynamic; + edir->elf.ref_regular |= eind->elf.ref_regular; + edir->elf.ref_regular_nonweak |= eind->elf.ref_regular_nonweak; + edir->elf.needs_plt |= eind->elf.needs_plt; + + /* If we were called to copy over info for a weak sym, that's all. */ + if (eind->elf.root.type != bfd_link_hash_indirect) + return; + + /* Copy over the GOT refcount entries that we may have already seen to + the symbol which just became indirect. */ + tmp = edir->elf.got.refcount; + if (tmp < 1) { - /* If called to transfer flags for a weakdef during processing - of elf_adjust_dynamic_symbol, don't copy non_got_ref. - We clear it ourselves for ELIMINATE_COPY_RELOCS. */ - dir->ref_dynamic |= ind->ref_dynamic; - dir->ref_regular |= ind->ref_regular; - dir->ref_regular_nonweak |= ind->ref_regular_nonweak; - dir->needs_plt |= ind->needs_plt; + edir->elf.got.refcount = eind->elf.got.refcount; + eind->elf.got.refcount = tmp; } else - _bfd_elf_link_hash_copy_indirect (bed, dir, ind); + BFD_ASSERT (eind->elf.got.refcount < 1); + + /* And plt entries. */ + if (eind->elf.plt.plist != NULL) + { + if (edir->elf.plt.plist != NULL) + { + struct plt_entry **entp; + struct plt_entry *ent; + + for (entp = &eind->elf.plt.plist; (ent = *entp) != NULL; ) + { + struct plt_entry *dent; + + for (dent = edir->elf.plt.plist; dent != NULL; dent = dent->next) + if (dent->sec == ent->sec && dent->addend == ent->addend) + { + dent->plt.refcount += ent->plt.refcount; + *entp = ent->next; + break; + } + if (dent == NULL) + entp = &ent->next; + } + *entp = edir->elf.plt.plist; + } + + edir->elf.plt.plist = eind->elf.plt.plist; + eind->elf.plt.plist = NULL; + } + + if (edir->elf.dynindx == -1) + { + edir->elf.dynindx = eind->elf.dynindx; + edir->elf.dynstr_index = eind->elf.dynstr_index; + eind->elf.dynindx = -1; + eind->elf.dynstr_index = 0; + } + else + BFD_ASSERT (eind->elf.dynindx == -1); } /* Return 1 if target is one of ours. */ @@ -2609,6 +2803,46 @@ update_local_sym_info (bfd *abfd, return TRUE; } +static bfd_boolean +update_plt_info (bfd *abfd, struct elf_link_hash_entry *h, + asection *sec, bfd_vma addend) +{ + struct plt_entry *ent; + + if (addend < 32768) + sec = NULL; + for (ent = h->plt.plist; ent != NULL; ent = ent->next) + if (ent->sec == sec && ent->addend == addend) + break; + if (ent == NULL) + { + bfd_size_type amt = sizeof (*ent); + ent = bfd_alloc (abfd, amt); + if (ent == NULL) + return FALSE; + ent->next = h->plt.plist; + ent->sec = sec; + ent->addend = addend; + ent->plt.refcount = 0; + h->plt.plist = ent; + } + ent->plt.refcount += 1; + return TRUE; +} + +static struct plt_entry * +find_plt_ent (struct elf_link_hash_entry *h, asection *sec, bfd_vma addend) +{ + struct plt_entry *ent; + + if (addend < 32768) + sec = NULL; + for (ent = h->plt.plist; ent != NULL; ent = ent->next) + if (ent->sec == sec && ent->addend == addend) + break; + return ent; +} + static void bad_shared_reloc (bfd *abfd, enum elf_ppc_reloc_type r_type) { @@ -2634,7 +2868,7 @@ ppc_elf_check_relocs (bfd *abfd, struct elf_link_hash_entry **sym_hashes; const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; - asection *sreloc; + asection *got2, *sreloc; if (info->relocatable) return TRUE; @@ -2660,6 +2894,7 @@ ppc_elf_check_relocs (bfd *abfd, htab = ppc_elf_hash_table (info); symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); + got2 = bfd_get_section_by_name (abfd, ".got2"); sreloc = NULL; rel_end = relocs + sec->reloc_count; @@ -2674,7 +2909,12 @@ ppc_elf_check_relocs (bfd *abfd, if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } /* If a relocation refers to _GLOBAL_OFFSET_TABLE_, create the .got. This shows up in particular in an R_PPC_ADDR32 in the eabi @@ -2796,6 +3036,12 @@ ppc_elf_check_relocs (bfd *abfd, bad_shared_reloc (abfd, r_type); return FALSE; } + if (h != NULL) + { + ppc_elf_hash_entry (h)->has_sda_refs = TRUE; + /* We may need a copy reloc. */ + h->non_got_ref = TRUE; + } break; case R_PPC_PLT32: @@ -2826,9 +3072,14 @@ ppc_elf_check_relocs (bfd *abfd, bfd_set_error (bfd_error_bad_value); return FALSE; } + else + { + bfd_vma addend = r_type == R_PPC_PLTREL24 ? rel->r_addend : 0; - h->needs_plt = 1; - h->plt.refcount++; + h->needs_plt = 1; + if (!update_plt_info (abfd, h, got2, addend)) + return FALSE; + } break; /* The following relocations don't need to propagate the @@ -2845,7 +3096,14 @@ ppc_elf_check_relocs (bfd *abfd, case R_PPC_TOC16: break; - /* This are just markers. */ + case R_PPC_REL16: + case R_PPC_REL16_LO: + case R_PPC_REL16_HI: + case R_PPC_REL16_HA: + htab->new_plt = 1; + break; + + /* These are just markers. */ case R_PPC_TLS: case R_PPC_EMB_MRKREF: case R_PPC_NONE: @@ -2870,6 +3128,8 @@ ppc_elf_check_relocs (bfd *abfd, /* This refers only to functions defined in the shared library. */ case R_PPC_LOCAL24PC: + if (h && h == htab->elf.hgot) + htab->old_plt = 1; break; /* This relocation describes the C++ object vtable hierarchy. @@ -2905,16 +3165,39 @@ ppc_elf_check_relocs (bfd *abfd, info->flags |= DF_STATIC_TLS; goto dodyn; - /* When creating a shared object, we must copy these - relocs into the output file. We create a reloc - section in dynobj and make room for the reloc. */ + case R_PPC_REL32: + if (h == NULL + && got2 != NULL + && (sec->flags & SEC_CODE) != 0 + && (info->shared || info->pie) + && !htab->old_plt) + { + /* Old -fPIC gcc code has .long LCTOC1-LCFx just before + the start of a function, which assembles to a REL32 + reference to .got2. If we detect one of these, then + force the old PLT layout because the linker cannot + reliably deduce the GOT pointer value needed for + PLT call stubs. */ + asection *s; + + s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, sec, + r_symndx); + if (s == got2) + htab->old_plt = 1; + } + /* fall through */ + case R_PPC_REL24: case R_PPC_REL14: case R_PPC_REL14_BRTAKEN: case R_PPC_REL14_BRNTAKEN: - case R_PPC_REL32: - if (h == NULL || h == htab->elf.hgot) + if (h == NULL) break; + if (h == htab->elf.hgot) + { + htab->old_plt = 1; + break; + } /* fall through */ case R_PPC_ADDR32: @@ -2932,7 +3215,8 @@ ppc_elf_check_relocs (bfd *abfd, { /* We may need a plt entry if the symbol turns out to be a function defined in a dynamic object. */ - h->plt.refcount++; + if (!update_plt_info (abfd, h, NULL, 0)) + return FALSE; /* We may need a copy reloc too. */ h->non_got_ref = 1; @@ -3157,6 +3441,44 @@ ppc_elf_merge_private_bfd_data (bfd *ibf return TRUE; } +/* Choose which PLT scheme to use, and set .plt flags appropriately. + Returns -1 on error, 0 for old PLT, 1 for new PLT. */ +int +ppc_elf_select_plt_layout (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info, + int force_old_plt) +{ + struct ppc_elf_link_hash_table *htab; + + htab = ppc_elf_hash_table (info); + if (force_old_plt || !htab->new_plt) + htab->old_plt = 1; + + if (!htab->old_plt) + { + flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_LINKER_CREATED); + + /* The new PLT is a loaded section. */ + if (htab->plt != NULL + && !bfd_set_section_flags (htab->elf.dynobj, htab->plt, flags)) + return -1; + + /* The new GOT is not executable. */ + if (htab->got != NULL + && !bfd_set_section_flags (htab->elf.dynobj, htab->got, flags)) + return -1; + } + else + { + /* Stop an unused .glink section from affecting .text alignment. */ + if (htab->glink != NULL + && !bfd_set_section_alignment (htab->elf.dynobj, htab->glink, 0)) + return -1; + } + return !htab->old_plt; +} + /* Return the section that should be marked against GC for a given relocation. */ @@ -3210,6 +3532,7 @@ ppc_elf_gc_sweep_hook (bfd *abfd, struct elf_link_hash_entry **sym_hashes; bfd_signed_vma *local_got_refcounts; const Elf_Internal_Rela *rel, *relend; + asection *got2; if ((sec->flags & SEC_ALLOC) == 0) return TRUE; @@ -3220,6 +3543,7 @@ ppc_elf_gc_sweep_hook (bfd *abfd, symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); local_got_refcounts = elf_local_got_refcounts (abfd); + got2 = bfd_get_section_by_name (abfd, ".got2"); relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) @@ -3314,8 +3638,10 @@ ppc_elf_gc_sweep_hook (bfd *abfd, case R_PPC_PLT16_HA: if (h != NULL) { - if (h->plt.refcount > 0) - h->plt.refcount--; + bfd_vma addend = r_type == R_PPC_PLTREL24 ? rel->r_addend : 0; + struct plt_entry *ent = find_plt_ent (h, got2, addend); + if (ent->plt.refcount > 0) + ent->plt.refcount -= 1; } break; @@ -3334,9 +3660,16 @@ ppc_elf_tls_setup (bfd *obfd, struct bfd struct ppc_elf_link_hash_table *htab; htab = ppc_elf_hash_table (info); + if (!htab->old_plt + && htab->plt != NULL + && htab->plt->output_section != NULL) + { + elf_section_type (htab->plt->output_section) = SHT_PROGBITS; + elf_section_flags (htab->plt->output_section) = SHF_ALLOC + SHF_WRITE; + } + htab->tls_get_addr = elf_link_hash_lookup (&htab->elf, "__tls_get_addr", FALSE, FALSE, TRUE); - return _bfd_elf_tls_setup (obfd, info); } @@ -3458,8 +3791,9 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUT && h != NULL && h == htab->tls_get_addr) { - if (h->plt.refcount > 0) - h->plt.refcount -= 1; + struct plt_entry *ent = find_plt_ent (h, NULL, 0); + if (ent != NULL && ent->plt.refcount > 0) + ent->plt.refcount -= 1; } expecting_tls_get_addr = 0; continue; @@ -3567,7 +3901,11 @@ ppc_elf_adjust_dynamic_symbol (struct bf { /* Clear procedure linkage table information for any symbol that won't need a .plt entry. */ - if (h->plt.refcount <= 0 + struct plt_entry *ent; + for (ent = h->plt.plist; ent != NULL; ent = ent->next) + if (ent->plt.refcount > 0) + break; + if (ent == NULL || SYMBOL_CALLS_LOCAL (info, h) || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT && h->root.type == bfd_link_hash_undefweak)) @@ -3582,13 +3920,13 @@ ppc_elf_adjust_dynamic_symbol (struct bf 3. We know for certain that a call to this symbol will go to this object, or will remain undefined. */ - h->plt.offset = (bfd_vma) -1; + h->plt.plist = NULL; h->needs_plt = 0; } return TRUE; } else - h->plt.offset = (bfd_vma) -1; + h->plt.plist = NULL; /* If this is a weak symbol, and there is a real definition, the processor independent code will have arranged for us to see the @@ -3619,7 +3957,11 @@ ppc_elf_adjust_dynamic_symbol (struct bf if (!h->non_got_ref) return TRUE; - if (ELIMINATE_COPY_RELOCS) + /* If we didn't find any dynamic relocs in read-only sections, then we'll + be keeping the dynamic relocs and avoiding the copy reloc. We can't + do this if there are any small data relocations. */ + if (ELIMINATE_COPY_RELOCS + && !ppc_elf_hash_entry (h)->has_sda_refs) { struct ppc_elf_dyn_relocs *p; for (p = ppc_elf_hash_entry (h)->dyn_relocs; p != NULL; p = p->next) @@ -3629,8 +3971,6 @@ ppc_elf_adjust_dynamic_symbol (struct bf break; } - /* If we didn't find any dynamic relocs in read-only sections, then - we'll be keeping the dynamic relocs and avoiding the copy reloc. */ if (p == NULL) { h->non_got_ref = 0; @@ -3648,11 +3988,10 @@ ppc_elf_adjust_dynamic_symbol (struct bf both the dynamic object and the regular object will refer to the same memory location for the variable. - Of course, if the symbol is sufficiently small, we must instead - allocate it in .sbss. FIXME: It would be better to do this if and - only if there were actually SDAREL relocs for that symbol. */ + Of course, if the symbol is referenced using SDAREL relocs, we + must instead allocate it in .sbss. */ - if (h->size <= elf_gp_size (htab->elf.dynobj)) + if (ppc_elf_hash_entry (h)->has_sda_refs) s = htab->dynsbss; else s = htab->dynbss; @@ -3666,7 +4005,7 @@ ppc_elf_adjust_dynamic_symbol (struct bf { asection *srel; - if (h->size <= elf_gp_size (htab->elf.dynobj)) + if (ppc_elf_hash_entry (h)->has_sda_refs) srel = htab->relsbss; else srel = htab->relbss; @@ -3706,7 +4045,10 @@ static bfd_vma allocate_got (struct ppc_elf_link_hash_table *htab, unsigned int need) { bfd_vma where; - unsigned int max_before_header = 32764; + unsigned int max_before_header = 32768; + + if (htab->old_plt) + max_before_header = 32764; if (need <= htab->got_gap) { @@ -3747,66 +4089,113 @@ allocate_dynrelocs (struct elf_link_hash h = (struct elf_link_hash_entry *) h->root.u.i.link; htab = ppc_elf_hash_table (info); - if (htab->elf.dynamic_sections_created - && h->plt.refcount > 0) + if (htab->elf.dynamic_sections_created) { - /* Make sure this symbol is output as a dynamic symbol. */ - if (h->dynindx == -1 - && !h->forced_local) - { - if (! bfd_elf_link_record_dynamic_symbol (info, h)) - return FALSE; - } + struct plt_entry *ent; + bfd_boolean doneone = FALSE; + bfd_vma plt_offset = 0, glink_offset = 0; - if (info->shared - || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h)) - { - asection *s = htab->plt; + for (ent = h->plt.plist; ent != NULL; ent = ent->next) + if (ent->plt.refcount > 0) + { + /* Make sure this symbol is output as a dynamic symbol. */ + if (h->dynindx == -1 + && !h->forced_local) + { + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } - /* If this is the first .plt entry, make room for the special - first entry. */ - if (s->size == 0) - s->size += PLT_INITIAL_ENTRY_SIZE; + if (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h)) + { + asection *s = htab->plt; - /* The PowerPC PLT is actually composed of two parts, the - first part is 2 words (for a load and a jump), and then - there is a remaining word available at the end. */ - h->plt.offset = (PLT_INITIAL_ENTRY_SIZE - + (PLT_SLOT_SIZE - * ((s->size - PLT_INITIAL_ENTRY_SIZE) - / PLT_ENTRY_SIZE))); - - /* If this symbol is not defined in a regular file, and we - are not generating a shared library, then set the symbol - to this location in the .plt. This is required to make - function pointers compare as equal between the normal - executable and the shared library. */ - if (! info->shared - && !h->def_regular) - { - h->root.u.def.section = s; - h->root.u.def.value = h->plt.offset; - } - - /* Make room for this entry. After the 8192nd entry, room - for two entries is allocated. */ - s->size += PLT_ENTRY_SIZE; - if ((s->size - PLT_INITIAL_ENTRY_SIZE) / PLT_ENTRY_SIZE - > PLT_NUM_SINGLE_ENTRIES) - s->size += PLT_ENTRY_SIZE; + if (!htab->old_plt) + { + if (!doneone) + { + plt_offset = s->size; + s->size += 4; + } + ent->plt.offset = plt_offset; - /* We also need to make an entry in the .rela.plt section. */ - htab->relplt->size += sizeof (Elf32_External_Rela); - } - else - { - h->plt.offset = (bfd_vma) -1; - h->needs_plt = 0; - } + s = htab->glink; + if (!doneone || info->shared || info->pie) + { + glink_offset = s->size; + s->size += GLINK_ENTRY_SIZE; + } + if (!doneone + && !info->shared + && !h->def_regular) + { + h->root.u.def.section = s; + h->root.u.def.value = glink_offset; + } + ent->glink_offset = glink_offset; + } + else + { + if (!doneone) + { + /* If this is the first .plt entry, make room + for the special first entry. */ + if (s->size == 0) + s->size += PLT_INITIAL_ENTRY_SIZE; + + /* The PowerPC PLT is actually composed of two + parts, the first part is 2 words (for a load + and a jump), and then there is a remaining + word available at the end. */ + plt_offset = (PLT_INITIAL_ENTRY_SIZE + + (PLT_SLOT_SIZE + * ((s->size - PLT_INITIAL_ENTRY_SIZE) + / PLT_ENTRY_SIZE))); + + /* If this symbol is not defined in a regular + file, and we are not generating a shared + library, then set the symbol to this location + in the .plt. This is required to make + function pointers compare as equal between + the normal executable and the shared library. */ + if (! info->shared + && !h->def_regular) + { + h->root.u.def.section = s; + h->root.u.def.value = plt_offset; + } + + /* Make room for this entry. After the 8192nd + entry, room for two entries is allocated. */ + s->size += PLT_ENTRY_SIZE; + if ((s->size - PLT_INITIAL_ENTRY_SIZE) / PLT_ENTRY_SIZE + > PLT_NUM_SINGLE_ENTRIES) + s->size += PLT_ENTRY_SIZE; + } + ent->plt.offset = plt_offset; + } + + /* We also need to make an entry in the .rela.plt section. */ + if (!doneone) + { + htab->relplt->size += sizeof (Elf32_External_Rela); + doneone = TRUE; + } + } + else + ent->plt.offset = (bfd_vma) -1; + + if (!doneone) + { + h->plt.plist = NULL; + h->needs_plt = 0; + } + } } else { - h->plt.offset = (bfd_vma) -1; + h->plt.plist = NULL; h->needs_plt = 0; } @@ -4010,7 +4399,10 @@ ppc_elf_size_dynamic_sections (bfd *outp } } - htab->got_header_size = 16; + if (htab->old_plt) + htab->got_header_size = 16; + else + htab->got_header_size = 12; /* Set up .got offsets for local syms, and space for local dynamic relocs. */ @@ -4118,11 +4510,22 @@ ppc_elf_size_dynamic_sections (bfd *outp g_o_t = htab->got->size; htab->got->size += htab->got_header_size; } - g_o_t += 4; + if (htab->old_plt) + g_o_t += 4; htab->elf.hgot->root.u.def.value = g_o_t; } + if (htab->glink != NULL && htab->glink->size != 0) + { + htab->glink_pltresolve = htab->glink->size; + /* Space for the branch table. */ + htab->glink->size += htab->glink->size / (GLINK_ENTRY_SIZE / 4) - 4; + /* Pad out to align the start of PLTresolve. */ + htab->glink->size += -htab->glink->size & 15; + htab->glink->size += GLINK_PLTRESOLVE; + } + /* We've now determined the sizes of the various dynamic sections. Allocate memory for them. */ relocs = FALSE; @@ -4132,6 +4535,7 @@ ppc_elf_size_dynamic_sections (bfd *outp continue; if (s == htab->plt + || s == htab->glink || s == htab->got || s == htab->sbss) { @@ -4179,7 +4583,7 @@ ppc_elf_size_dynamic_sections (bfd *outp continue; } - if (s == htab->sbss) + if ((s->flags & SEC_HAS_CONTENTS) == 0) continue; /* Allocate memory for the section contents. */ @@ -4213,6 +4617,12 @@ ppc_elf_size_dynamic_sections (bfd *outp return FALSE; } + if (htab->glink != NULL && htab->glink->size != 0) + { + if (!add_dynamic_entry (DT_PPC_GOT, 0)) + return FALSE; + } + if (relocs) { if (!add_dynamic_entry (DT_RELA, 0) @@ -4281,8 +4691,9 @@ ppc_elf_relax_section (bfd *abfd, Elf_Internal_Rela *irel, *irelend; struct one_fixup *fixups = NULL; bfd_boolean changed; - struct ppc_elf_link_hash_table *ppc_info; + struct ppc_elf_link_hash_table *htab; bfd_size_type trampoff; + asection *got2; *again = FALSE; @@ -4305,9 +4716,10 @@ ppc_elf_relax_section (bfd *abfd, if (internal_relocs == NULL) goto error_return; - ppc_info = ppc_elf_hash_table (link_info); - irelend = internal_relocs + isec->reloc_count; + htab = ppc_elf_hash_table (link_info); + got2 = bfd_get_section_by_name (abfd, ".got2"); + irelend = internal_relocs + isec->reloc_count; for (irel = internal_relocs; irel < irelend; irel++) { unsigned long r_type = ELF32_R_TYPE (irel->r_info); @@ -4381,13 +4793,29 @@ ppc_elf_relax_section (bfd *abfd, || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; + tsec = NULL; + toff = 0; if (r_type == R_PPC_PLTREL24 - && ppc_info->plt != NULL - && h->plt.offset != (bfd_vma) -1) + && htab->plt != NULL) { - tsec = ppc_info->plt; - toff = h->plt.offset; + struct plt_entry *ent = find_plt_ent (h, got2, irel->r_addend); + + if (ent != NULL) + { + if (!htab->old_plt) + { + tsec = htab->glink; + toff = ent->glink_offset; + } + else + { + tsec = htab->plt; + toff = ent->plt.offset; + } + } } + if (tsec != NULL) + ; else if (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) { @@ -4439,7 +4867,8 @@ ppc_elf_relax_section (bfd *abfd, if (sym_type != STT_SECTION) toff += irel->r_addend; } - else + /* PLTREL24 addends are special. */ + else if (r_type != R_PPC_PLTREL24) toff += irel->r_addend; symaddr = tsec->output_section->vma + tsec->output_offset + toff; @@ -4483,7 +4912,8 @@ ppc_elf_relax_section (bfd *abfd, if (R_PPC_RELAX32_PLT - R_PPC_RELAX32 != R_PPC_RELAX32PC_PLT - R_PPC_RELAX32PC) abort (); - if (tsec == ppc_info->plt) + if (tsec == htab->plt + || tsec == htab->glink) stub_rtype += R_PPC_RELAX32_PLT - R_PPC_RELAX32; /* Hijack the old relocation. Since we need two @@ -4806,7 +5236,7 @@ ppc_elf_relocate_section (bfd *output_bf Elf_Internal_Rela *relend; Elf_Internal_Rela outrel; bfd_byte *loc; - asection *sreloc = NULL; + asection *got2, *sreloc = NULL; bfd_vma *local_got_offsets; bfd_boolean ret = TRUE; @@ -4818,8 +5248,30 @@ ppc_elf_relocate_section (bfd *output_bf (info->relocatable) ? " (relocatable)" : ""); #endif + got2 = bfd_get_section_by_name (input_bfd, ".got2"); + if (info->relocatable) - return TRUE; + { + if (got2 == NULL) + return TRUE; + + rel = relocs; + relend = relocs + input_section->reloc_count; + for (; rel < relend; rel++) + { + enum elf_ppc_reloc_type r_type; + + r_type = ELF32_R_TYPE (rel->r_info); + if (r_type == R_PPC_PLTREL24 + && rel->r_addend >= 32768) + { + /* R_PPC_PLTREL24 is rather special. If non-zero, the + addend specifies the GOT pointer offset within .got2. */ + rel->r_addend += got2->output_offset; + } + } + return TRUE; + } /* Initialize howto table if not already done. */ if (!ppc_elf_howto_table[R_PPC_ADDR32]) @@ -5426,6 +5878,12 @@ ppc_elf_relocate_section (bfd *output_bf addend = 0; goto dodyn; + case R_PPC_REL16: + case R_PPC_REL16_LO: + case R_PPC_REL16_HI: + case R_PPC_REL16_HA: + break; + case R_PPC_REL24: case R_PPC_REL32: case R_PPC_REL14: @@ -5591,13 +6049,19 @@ ppc_elf_relocate_section (bfd *output_bf case R_PPC_RELAX32PC_PLT: case R_PPC_RELAX32_PLT: - BFD_ASSERT (h != NULL - && h->plt.offset != (bfd_vma) -1 - && htab->plt != NULL); - - relocation = (htab->plt->output_section->vma - + htab->plt->output_offset - + h->plt.offset); + { + struct plt_entry *ent = find_plt_ent (h, got2, addend); + + if (!htab->old_plt) + relocation = (htab->glink->output_section->vma + + htab->glink->output_offset + + ent->glink_offset); + else + relocation = (htab->plt->output_section->vma + + htab->plt->output_offset + + ent->plt.offset); + addend = 0; + } if (r_type == R_PPC_RELAX32_PLT) goto relax32; /* Fall thru */ @@ -5664,21 +6128,29 @@ ppc_elf_relocate_section (bfd *output_bf case R_PPC_PLTREL24: /* Relocation is to the entry for this symbol in the procedure linkage table. */ - BFD_ASSERT (h != NULL); + { + struct plt_entry *ent = find_plt_ent (h, got2, addend); - if (h->plt.offset == (bfd_vma) -1 - || htab->plt == NULL) - { - /* We didn't make a PLT entry for this symbol. This - happens when statically linking PIC code, or when - using -Bsymbolic. */ - break; - } + addend = 0; + if (ent == NULL + || htab->plt == NULL) + { + /* We didn't make a PLT entry for this symbol. This + happens when statically linking PIC code, or when + using -Bsymbolic. */ + break; + } - unresolved_reloc = FALSE; - relocation = (htab->plt->output_section->vma - + htab->plt->output_offset - + h->plt.offset); + unresolved_reloc = FALSE; + if (!htab->old_plt) + relocation = (htab->glink->output_section->vma + + htab->glink->output_offset + + ent->glink_offset); + else + relocation = (htab->plt->output_section->vma + + htab->plt->output_offset + + ent->plt.offset); + } break; /* Relocate against _SDA_BASE_. */ @@ -5837,6 +6309,7 @@ ppc_elf_relocate_section (bfd *output_bf break; case R_PPC_ADDR16_HA: + case R_PPC_REL16_HA: case R_PPC_GOT16_HA: case R_PPC_PLT16_HA: case R_PPC_SECTOFF_HA: @@ -5939,6 +6412,10 @@ ppc_elf_relocate_section (bfd *output_bf return ret; } +#define PPC_LO(v) ((v) & 0xffff) +#define PPC_HI(v) (((v) >> 16) & 0xffff) +#define PPC_HA(v) PPC_HI ((v) + 0x8000) + /* Finish up dynamic symbol handling. We set the contents of various dynamic sections here. */ @@ -5949,6 +6426,8 @@ ppc_elf_finish_dynamic_symbol (bfd *outp Elf_Internal_Sym *sym) { struct ppc_elf_link_hash_table *htab; + struct plt_entry *ent; + bfd_boolean doneone; #ifdef DEBUG fprintf (stderr, "ppc_elf_finish_dynamic_symbol called for %s", @@ -5958,52 +6437,133 @@ ppc_elf_finish_dynamic_symbol (bfd *outp htab = ppc_elf_hash_table (info); BFD_ASSERT (htab->elf.dynobj != NULL); - if (h->plt.offset != (bfd_vma) -1) - { - Elf_Internal_Rela rela; - bfd_byte *loc; - bfd_vma reloc_index; + doneone = FALSE; + for (ent = h->plt.plist; ent != NULL; ent = ent->next) + if (ent->plt.offset != (bfd_vma) -1) + { + if (!doneone) + { + Elf_Internal_Rela rela; + bfd_byte *loc; + bfd_vma reloc_index; + + /* This symbol has an entry in the procedure linkage table. + Set it up. */ + if (htab->old_plt) + { + /* We don't need to fill in the .plt. The ppc dynamic + linker will fill it in. */ + } + else + { + bfd_vma val = (htab->glink_pltresolve + ent->plt.offset + + htab->glink->output_section->vma + + htab->glink->output_offset); + bfd_put_32 (output_bfd, val, + htab->plt->contents + ent->plt.offset); + } -#ifdef DEBUG - fprintf (stderr, ", plt_offset = %d", h->plt.offset); -#endif + /* Fill in the entry in the .rela.plt section. */ + rela.r_offset = (htab->plt->output_section->vma + + htab->plt->output_offset + + ent->plt.offset); + rela.r_info = ELF32_R_INFO (h->dynindx, R_PPC_JMP_SLOT); + rela.r_addend = 0; + + if (!htab->old_plt) + reloc_index = ent->plt.offset / 4; + else + { + reloc_index = ((ent->plt.offset - PLT_INITIAL_ENTRY_SIZE) + / PLT_SLOT_SIZE); + if (reloc_index > PLT_NUM_SINGLE_ENTRIES) + reloc_index -= (reloc_index - PLT_NUM_SINGLE_ENTRIES) / 2; + } + loc = (htab->relplt->contents + + reloc_index * sizeof (Elf32_External_Rela)); + bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); - /* This symbol has an entry in the procedure linkage table. Set - it up. */ + if (!h->def_regular) + { + /* Mark the symbol as undefined, rather than as defined in + the .plt section. Leave the value alone. */ + sym->st_shndx = SHN_UNDEF; + /* If the symbol is weak, we do need to clear the value. + Otherwise, the PLT entry would provide a definition for + the symbol even if the symbol wasn't defined anywhere, + and so the symbol would never be NULL. */ + if (!h->ref_regular_nonweak) + sym->st_value = 0; + } + doneone = TRUE; + } - BFD_ASSERT (h->dynindx != -1); - BFD_ASSERT (htab->plt != NULL && htab->relplt != NULL); + if (!htab->old_plt) + { + bfd_vma plt; + unsigned char *p; - /* We don't need to fill in the .plt. The ppc dynamic linker - will fill it in. */ + plt = (ent->plt.offset + + htab->plt->output_section->vma + + htab->plt->output_offset); + p = (unsigned char *) htab->glink->contents + ent->glink_offset; - /* Fill in the entry in the .rela.plt section. */ - rela.r_offset = (htab->plt->output_section->vma - + htab->plt->output_offset - + h->plt.offset); - rela.r_info = ELF32_R_INFO (h->dynindx, R_PPC_JMP_SLOT); - rela.r_addend = 0; + if (info->shared || info->pie) + { + bfd_vma got = 0; - reloc_index = (h->plt.offset - PLT_INITIAL_ENTRY_SIZE) / PLT_SLOT_SIZE; - if (reloc_index > PLT_NUM_SINGLE_ENTRIES) - reloc_index -= (reloc_index - PLT_NUM_SINGLE_ENTRIES) / 2; - loc = (htab->relplt->contents - + reloc_index * sizeof (Elf32_External_Rela)); - bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); + if (ent->addend >= 32768) + got = (ent->addend + + ent->sec->output_section->vma + + ent->sec->output_offset); + else if (htab->elf.hgot != NULL) + got = (htab->elf.hgot->root.u.def.value + + htab->elf.hgot->root.u.def.section->output_section->vma + + htab->elf.hgot->root.u.def.section->output_offset); - if (!h->def_regular) - { - /* Mark the symbol as undefined, rather than as defined in - the .plt section. Leave the value alone. */ - sym->st_shndx = SHN_UNDEF; - /* If the symbol is weak, we do need to clear the value. - Otherwise, the PLT entry would provide a definition for - the symbol even if the symbol wasn't defined anywhere, - and so the symbol would never be NULL. */ - if (!h->ref_regular_nonweak) - sym->st_value = 0; - } - } + plt -= got; + + if (plt + 0x8000 < 0x10000) + { + bfd_put_32 (output_bfd, LWZ_11_30 + PPC_LO (plt), p); + p += 4; + bfd_put_32 (output_bfd, MTCTR_11, p); + p += 4; + bfd_put_32 (output_bfd, BCTR, p); + p += 4; + bfd_put_32 (output_bfd, NOP, p); + p += 4; + } + else + { + bfd_put_32 (output_bfd, ADDIS_11_30 + PPC_HA (plt), p); + p += 4; + bfd_put_32 (output_bfd, LWZ_11_11 + PPC_LO (plt), p); + p += 4; + bfd_put_32 (output_bfd, MTCTR_11, p); + p += 4; + bfd_put_32 (output_bfd, BCTR, p); + p += 4; + } + } + else + { + bfd_put_32 (output_bfd, LIS_11 + PPC_HA (plt), p); + p += 4; + bfd_put_32 (output_bfd, LWZ_11_11 + PPC_LO (plt), p); + p += 4; + bfd_put_32 (output_bfd, MTCTR_11, p); + p += 4; + bfd_put_32 (output_bfd, BCTR, p); + p += 4; + + /* We only need one non-PIC glink stub. */ + break; + } + } + else + break; + } if (h->needs_copy) { @@ -6019,7 +6579,7 @@ ppc_elf_finish_dynamic_symbol (bfd *outp BFD_ASSERT (h->dynindx != -1); - if (h->size <= elf_gp_size (htab->elf.dynobj)) + if (ppc_elf_hash_entry (h)->has_sda_refs) s = htab->relsbss; else s = htab->relbss; @@ -6073,6 +6633,7 @@ ppc_elf_finish_dynamic_sections (bfd *ou { asection *sdyn; struct ppc_elf_link_hash_table *htab; + bfd_vma got; #ifdef DEBUG fprintf (stderr, "ppc_elf_finish_dynamic_sections called\n"); @@ -6081,6 +6642,12 @@ ppc_elf_finish_dynamic_sections (bfd *ou htab = ppc_elf_hash_table (info); sdyn = bfd_get_section_by_name (htab->elf.dynobj, ".dynamic"); + got = 0; + if (htab->elf.hgot != NULL) + got = (htab->elf.hgot->root.u.def.value + + htab->elf.hgot->root.u.def.section->output_section->vma + + htab->elf.hgot->root.u.def.section->output_offset); + if (htab->elf.dynamic_sections_created) { Elf32_External_Dyn *dyncon, *dynconend; @@ -6112,6 +6679,10 @@ ppc_elf_finish_dynamic_sections (bfd *ou dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; break; + case DT_PPC_GOT: + dyn.d_un.d_ptr = got; + break; + default: continue; } @@ -6128,7 +6699,8 @@ ppc_elf_finish_dynamic_sections (bfd *ou bfd_vma val; p += elf_hash_table (info)->hgot->root.u.def.value; - bfd_put_32 (output_bfd, 0x4e800021 /* blrl */, p - 4); + if (htab->old_plt) + bfd_put_32 (output_bfd, 0x4e800021 /* blrl */, p - 4); val = 0; if (sdyn != NULL) @@ -6138,6 +6710,184 @@ ppc_elf_finish_dynamic_sections (bfd *ou elf_section_data (htab->got->output_section)->this_hdr.sh_entsize = 4; } + if (htab->glink != NULL && htab->glink->contents != NULL) + { + unsigned char *p; + unsigned char *endp; + bfd_vma res0; + unsigned int i; + + /* + * PIC glink code is the following: + * + * # ith PLT code stub. + * addis 11,30,(plt+(i-1)*4-got)@ha + * lwz 11,(plt+(i-1)*4-got)@l(11) + * mtctr 11 + * bctr + * + * # A table of branches, one for each plt entry. + * # The idea is that the plt call stub loads ctr (and r11) with these + * # addresses, so (r11 - res_0) gives the plt index * 4. + * res_0: b PLTresolve + * res_1: b PLTresolve + * . + * # Some number of entries towards the end can be nops + * res_n_m3: nop + * res_n_m2: nop + * res_n_m1: + * + * PLTresolve: + * addis 11,11,(1f-res_0)@ha + * mflr 0 + * bcl 20,31,1f + * 1: addi 11,11,(1b-res_0)@l + * mflr 12 + * mtlr 0 + * sub 11,11,12 # r11 = index * 4 + * addis 12,12,(got+4-1b)@ha + * lwz 0,(got+4-1b)@l(12) # got[1] address of dl_runtime_resolve + * lwz 12,(got+8-1b)@l(12) # got[2] contains the map address + * mtctr 0 + * add 0,11,11 + * add 11,0,11 # r11 = index * 12 = reloc offset. + * bctr + */ + static const unsigned int pic_plt_resolve[] = + { + ADDIS_11_11, + MFLR_0, + BCL_20_31, + ADDI_11_11, + MFLR_12, + MTLR_0, + SUB_11_11_12, + ADDIS_12_12, + LWZ_0_12, + LWZ_12_12, + MTCTR_0, + ADD_0_11_11, + ADD_11_0_11, + BCTR, + NOP, + NOP + }; + + static const unsigned int plt_resolve[] = + { + LIS_12, + ADDIS_11_11, + LWZ_0_12, + ADDI_11_11, + MTCTR_0, + ADD_0_11_11, + LWZ_12_12, + ADD_11_0_11, + BCTR, + NOP, + NOP, + NOP, + NOP, + NOP, + NOP, + NOP + }; + + if (ARRAY_SIZE (pic_plt_resolve) != GLINK_PLTRESOLVE / 4) + abort (); + if (ARRAY_SIZE (plt_resolve) != GLINK_PLTRESOLVE / 4) + abort (); + + /* Build the branch table, one for each plt entry (less one), + and perhaps some padding. */ + p = htab->glink->contents; + p += htab->glink_pltresolve; + endp = htab->glink->contents; + endp += htab->glink->size - GLINK_PLTRESOLVE; + while (p < endp - 8 * 4) + { + bfd_put_32 (output_bfd, B + endp - p, p); + p += 4; + } + while (p < endp) + { + bfd_put_32 (output_bfd, NOP, p); + p += 4; + } + + res0 = (htab->glink_pltresolve + + htab->glink->output_section->vma + + htab->glink->output_offset); + + /* Last comes the PLTresolve stub. */ + if (info->shared || info->pie) + { + bfd_vma bcl; + + for (i = 0; i < ARRAY_SIZE (pic_plt_resolve); i++) + { + bfd_put_32 (output_bfd, pic_plt_resolve[i], p); + p += 4; + } + p -= 4 * ARRAY_SIZE (pic_plt_resolve); + + bcl = (htab->glink->size - GLINK_PLTRESOLVE + 3*4 + + htab->glink->output_section->vma + + htab->glink->output_offset); + + bfd_put_32 (output_bfd, + ADDIS_11_11 + PPC_HA (bcl - res0), p + 0*4); + bfd_put_32 (output_bfd, + ADDI_11_11 + PPC_LO (bcl - res0), p + 3*4); + bfd_put_32 (output_bfd, + ADDIS_12_12 + PPC_HA (got + 4 - bcl), p + 7*4); + if (PPC_HA (got + 4 - bcl) == PPC_HA (got + 8 - bcl)) + { + bfd_put_32 (output_bfd, + LWZ_0_12 + PPC_LO (got + 4 - bcl), p + 8*4); + bfd_put_32 (output_bfd, + LWZ_12_12 + PPC_LO (got + 8 - bcl), p + 9*4); + } + else + { + bfd_put_32 (output_bfd, + LWZU_0_12 + PPC_LO (got + 4 - bcl), p + 8*4); + bfd_put_32 (output_bfd, + LWZ_12_12 + 4, p + 9*4); + } + } + else + { + for (i = 0; i < ARRAY_SIZE (plt_resolve); i++) + { + bfd_put_32 (output_bfd, plt_resolve[i], p); + p += 4; + } + p -= 4 * ARRAY_SIZE (plt_resolve); + + bfd_put_32 (output_bfd, + LIS_12 + PPC_HA (got + 4), p + 0*4); + bfd_put_32 (output_bfd, + ADDIS_11_11 + PPC_HA (-res0), p + 1*4); + bfd_put_32 (output_bfd, + ADDI_11_11 + PPC_LO (-res0), p + 3*4); + if (PPC_HA (got + 4) == PPC_HA (got + 8)) + { + bfd_put_32 (output_bfd, + LWZ_0_12 + PPC_LO (got + 4), p + 2*4); + bfd_put_32 (output_bfd, + LWZ_12_12 + PPC_LO (got + 8), p + 6*4); + } + else + { + bfd_put_32 (output_bfd, + LWZU_0_12 + PPC_LO (got + 4), p + 2*4); + bfd_put_32 (output_bfd, + LWZ_12_12 + 4, p + 6*4); + } + } + } + return TRUE; } diff -uprN binutils-2.16.90.0.3/bfd/elf32-ppc.h binutils-2.16.91.0.1/bfd/elf32-ppc.h --- binutils-2.16.90.0.3/bfd/elf32-ppc.h 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-ppc.h 2005-06-22 13:53:34.328412634 -0700 @@ -17,6 +17,7 @@ You should have received a copy of the G along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +int ppc_elf_select_plt_layout (bfd *, struct bfd_link_info *, int); asection *ppc_elf_tls_setup (bfd *, struct bfd_link_info *); bfd_boolean ppc_elf_tls_optimize (bfd *, struct bfd_link_info *); bfd_boolean ppc_elf_set_sdata_syms (bfd *, struct bfd_link_info *); diff -uprN binutils-2.16.90.0.3/bfd/elf32-s390.c binutils-2.16.91.0.1/bfd/elf32-s390.c --- binutils-2.16.90.0.3/bfd/elf32-s390.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-s390.c 2005-06-22 13:53:34.330412304 -0700 @@ -991,7 +991,12 @@ elf_s390_check_relocs (abfd, info, sec, if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } /* Create got section and local_got_refcounts array if they are needed. */ diff -uprN binutils-2.16.90.0.3/bfd/elf32-sh.c binutils-2.16.91.0.1/bfd/elf32-sh.c --- binutils-2.16.90.0.3/bfd/elf32-sh.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-sh.c 2005-06-22 13:53:34.343410156 -0700 @@ -6201,14 +6201,14 @@ sh_elf_check_relocs (bfd *abfd, struct b else { h = sym_hashes[r_symndx - symtab_hdr->sh_info]; -#ifdef INCLUDE_SHMEDIA while (h->root.type == bfd_link_hash_indirect || h->root.type == bfd_link_hash_warning) { +#ifdef INCLUDE_SHMEDIA seen_stt_datalabel |= h->type == STT_DATALABEL; +#endif h = (struct elf_link_hash_entry *) h->root.u.i.link; } -#endif } r_type = sh_elf_optimized_tls_reloc (info, r_type, h == NULL); diff -uprN binutils-2.16.90.0.3/bfd/elf32-v850.c binutils-2.16.91.0.1/bfd/elf32-v850.c --- binutils-2.16.90.0.3/bfd/elf32-v850.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-v850.c 2005-06-22 13:53:34.346409661 -0700 @@ -689,7 +689,12 @@ v850_elf_check_relocs (abfd, info, sec, if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } r_type = (enum v850_reloc_type) ELF32_R_TYPE (rel->r_info); switch (r_type) @@ -1649,15 +1654,6 @@ v850_elf_relocate_section (output_bfd, i symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); - if (sym_hashes == NULL) - { - info->callbacks->warning - (info, "no hash table available", - NULL, input_bfd, input_section, (bfd_vma) 0); - - return FALSE; - } - /* Reset the list of remembered HI16S relocs to empty. */ free_hi16s = previous_hi16s; previous_hi16s = NULL; @@ -1698,6 +1694,18 @@ v850_elf_relocate_section (output_bfd, i { bfd_boolean unresolved_reloc, warned; + /* Note - this check is delayed until now as it is possible and valid + to have a file without any symbols but with relocs that can be + processed. */ + if (sym_hashes == NULL) + { + info->callbacks->warning + (info, "no hash table available", + NULL, input_bfd, input_section, (bfd_vma) 0); + + return FALSE; + } + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, r_symndx, symtab_hdr, sym_hashes, h, sec, relocation, @@ -3214,6 +3222,7 @@ static struct bfd_elf_special_section co #define ELF_ARCH bfd_arch_v850 #define ELF_MACHINE_CODE EM_V850 #define ELF_MACHINE_ALT1 EM_CYGNUS_V850 +#define ELF_MACHINE_ALT2 EM_V800 /* This is the value used by the GreenHills toolchain. */ #define ELF_MAXPAGESIZE 0x1000 #define elf_info_to_howto v850_elf_info_to_howto_rela diff -uprN binutils-2.16.90.0.3/bfd/elf32-vax.c binutils-2.16.91.0.1/bfd/elf32-vax.c --- binutils-2.16.90.0.3/bfd/elf32-vax.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-vax.c 2005-06-22 13:53:34.351408835 -0700 @@ -26,42 +26,37 @@ #include "elf-bfd.h" #include "elf/vax.h" -static reloc_howto_type *reloc_type_lookup - PARAMS ((bfd *, bfd_reloc_code_real_type)); -static void rtype_to_howto - PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); -static struct bfd_hash_entry *elf_vax_link_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static struct bfd_link_hash_table *elf_vax_link_hash_table_create - PARAMS ((bfd *)); -static bfd_boolean elf_vax_check_relocs - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); -static asection *elf_vax_gc_mark_hook - PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)); -static bfd_boolean elf_vax_gc_sweep_hook - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); -static bfd_boolean elf_vax_adjust_dynamic_symbol - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); -static bfd_boolean elf_vax_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -static bfd_boolean elf_vax_relocate_section - PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, - Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); -static bfd_boolean elf_vax_finish_dynamic_symbol - PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, - Elf_Internal_Sym *)); -static bfd_boolean elf_vax_finish_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); - -static bfd_boolean elf32_vax_set_private_flags - PARAMS ((bfd *, flagword)); -static bfd_boolean elf32_vax_merge_private_bfd_data - PARAMS ((bfd *, bfd *)); -static bfd_boolean elf32_vax_print_private_bfd_data - PARAMS ((bfd *, PTR)); +static reloc_howto_type *reloc_type_lookup (bfd *, bfd_reloc_code_real_type); +static void rtype_to_howto (bfd *, arelent *, Elf_Internal_Rela *); +static struct bfd_hash_entry *elf_vax_link_hash_newfunc (struct bfd_hash_entry *, + struct bfd_hash_table *, + const char *); +static struct bfd_link_hash_table *elf_vax_link_hash_table_create (bfd *); +static bfd_boolean elf_vax_check_relocs (bfd *, struct bfd_link_info *, + asection *, const Elf_Internal_Rela *); +static asection *elf_vax_gc_mark_hook (asection *, struct bfd_link_info *, + Elf_Internal_Rela *, + struct elf_link_hash_entry *, + Elf_Internal_Sym *); +static bfd_boolean elf_vax_gc_sweep_hook (bfd *, struct bfd_link_info *, + asection *, + const Elf_Internal_Rela *); +static bfd_boolean elf_vax_adjust_dynamic_symbol (struct bfd_link_info *, + struct elf_link_hash_entry *); +static bfd_boolean elf_vax_size_dynamic_sections (bfd *, struct bfd_link_info *); +static bfd_boolean elf_vax_relocate_section (bfd *, struct bfd_link_info *, + bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, + Elf_Internal_Sym *, asection **); +static bfd_boolean elf_vax_finish_dynamic_symbol (bfd *, struct bfd_link_info *, + struct elf_link_hash_entry *, + Elf_Internal_Sym *); +static bfd_boolean elf_vax_finish_dynamic_sections (bfd *, + struct bfd_link_info *); + +static bfd_boolean elf32_vax_set_private_flags (bfd *, flagword); +static bfd_boolean elf32_vax_merge_private_bfd_data (bfd *, bfd *); +static bfd_boolean elf32_vax_print_private_bfd_data (bfd *, PTR); static reloc_howto_type howto_table[] = { HOWTO (R_VAX_NONE, /* type */ @@ -290,10 +285,8 @@ static reloc_howto_type howto_table[] = }; static void -rtype_to_howto (abfd, cache_ptr, dst) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *cache_ptr; - Elf_Internal_Rela *dst; +rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, + Elf_Internal_Rela *dst) { BFD_ASSERT (ELF32_R_TYPE(dst->r_info) < (unsigned int) R_VAX_max); cache_ptr->howto = &howto_table[ELF32_R_TYPE(dst->r_info)]; @@ -325,9 +318,7 @@ static const struct }; static reloc_howto_type * -reloc_type_lookup (abfd, code) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_reloc_code_real_type code; +reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_type code) { unsigned int i; for (i = 0; i < sizeof (reloc_map) / sizeof (reloc_map[0]); i++) @@ -414,52 +405,50 @@ struct elf_vax_link_hash_table /* Declare this now that the above structures are defined. */ -static bfd_boolean elf_vax_discard_copies - PARAMS ((struct elf_vax_link_hash_entry *, PTR)); +static bfd_boolean elf_vax_discard_copies (struct elf_vax_link_hash_entry *, + PTR); /* Declare this now that the above structures are defined. */ -static bfd_boolean elf_vax_instantiate_got_entries - PARAMS ((struct elf_link_hash_entry *, PTR)); +static bfd_boolean elf_vax_instantiate_got_entries (struct elf_link_hash_entry *, + PTR); /* Traverse an VAX ELF linker hash table. */ #define elf_vax_link_hash_traverse(table, func, info) \ (elf_link_hash_traverse \ (&(table)->root, \ - (bfd_boolean (*) PARAMS ((struct elf_link_hash_entry *, PTR))) (func), \ + (bfd_boolean (*) (struct elf_link_hash_entry *, PTR)) (func), \ (info))) /* Get the VAX ELF linker hash table from a link_info structure. */ -#define elf_vax_hash_table(p) \ - ((struct elf_vax_link_hash_table *) (p)->hash) +#define elf_vax_hash_table(p) ((struct elf_vax_link_hash_table *) (p)->hash) /* Create an entry in an VAX ELF linker hash table. */ static struct bfd_hash_entry * -elf_vax_link_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +elf_vax_link_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { struct elf_vax_link_hash_entry *ret = (struct elf_vax_link_hash_entry *) entry; /* Allocate the structure if it has not already been allocated by a subclass. */ - if (ret == (struct elf_vax_link_hash_entry *) NULL) + if (ret == NULL) ret = ((struct elf_vax_link_hash_entry *) bfd_hash_allocate (table, sizeof (struct elf_vax_link_hash_entry))); - if (ret == (struct elf_vax_link_hash_entry *) NULL) + if (ret == NULL) return (struct bfd_hash_entry *) ret; /* Call the allocation method of the superclass. */ ret = ((struct elf_vax_link_hash_entry *) _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret, table, string)); - if (ret != (struct elf_vax_link_hash_entry *) NULL) + if (ret != NULL) { ret->pcrel_relocs_copied = NULL; } @@ -470,14 +459,13 @@ elf_vax_link_hash_newfunc (entry, table, /* Create an VAX ELF linker hash table. */ static struct bfd_link_hash_table * -elf_vax_link_hash_table_create (abfd) - bfd *abfd; +elf_vax_link_hash_table_create (bfd *abfd) { struct elf_vax_link_hash_table *ret; bfd_size_type amt = sizeof (struct elf_vax_link_hash_table); - ret = (struct elf_vax_link_hash_table *) bfd_malloc (amt); - if (ret == (struct elf_vax_link_hash_table *) NULL) + ret = bfd_malloc (amt); + if (ret == NULL) return NULL; if (! _bfd_elf_link_hash_table_init (&ret->root, abfd, @@ -492,9 +480,7 @@ elf_vax_link_hash_table_create (abfd) /* Keep vax-specific flags in the ELF header */ static bfd_boolean -elf32_vax_set_private_flags (abfd, flags) - bfd *abfd; - flagword flags; +elf32_vax_set_private_flags (bfd *abfd, flagword flags) { elf_elfheader (abfd)->e_flags = flags; elf_flags_init (abfd) = TRUE; @@ -504,9 +490,7 @@ elf32_vax_set_private_flags (abfd, flags /* Merge backend specific data from an object file to the output object file when linking. */ static bfd_boolean -elf32_vax_merge_private_bfd_data (ibfd, obfd) - bfd *ibfd; - bfd *obfd; +elf32_vax_merge_private_bfd_data (bfd *ibfd, bfd *obfd) { flagword out_flags; flagword in_flags; @@ -529,9 +513,7 @@ elf32_vax_merge_private_bfd_data (ibfd, /* Display the flags field */ static bfd_boolean -elf32_vax_print_private_bfd_data (abfd, ptr) - bfd *abfd; - PTR ptr; +elf32_vax_print_private_bfd_data (bfd *abfd, PTR ptr) { FILE *file = (FILE *) ptr; @@ -563,11 +545,8 @@ elf32_vax_print_private_bfd_data (abfd, table. */ static bfd_boolean -elf_vax_check_relocs (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; +elf_vax_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, + const Elf_Internal_Rela *relocs) { bfd *dynobj; Elf_Internal_Shdr *symtab_hdr; @@ -600,7 +579,12 @@ elf_vax_check_relocs (abfd, info, sec, r if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } switch (ELF32_R_TYPE (rel->r_info)) { @@ -786,8 +770,8 @@ elf_vax_check_relocs (abfd, info, sec, r which means that h is really a pointer to an elf_vax_link_hash_entry. */ if ((ELF32_R_TYPE (rel->r_info) == R_VAX_PC8 - || ELF32_R_TYPE (rel->r_info) == R_VAX_PC16 - || ELF32_R_TYPE (rel->r_info) == R_VAX_PC32) + || ELF32_R_TYPE (rel->r_info) == R_VAX_PC16 + || ELF32_R_TYPE (rel->r_info) == R_VAX_PC32) && info->symbolic) { struct elf_vax_link_hash_entry *eh; @@ -843,12 +827,11 @@ elf_vax_check_relocs (abfd, info, sec, r relocation. */ static asection * -elf_vax_gc_mark_hook (sec, info, rel, h, sym) - asection *sec; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +elf_vax_gc_mark_hook (asection *sec, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { if (h != NULL) { @@ -882,11 +865,8 @@ elf_vax_gc_mark_hook (sec, info, rel, h, /* Update the got entry reference counts for the section being removed. */ static bfd_boolean -elf_vax_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; +elf_vax_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info, asection *sec, + const Elf_Internal_Rela *relocs) { Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; @@ -1128,9 +1108,7 @@ elf_vax_adjust_dynamic_symbol (info, h) /* Set the sizes of the dynamic sections. */ static bfd_boolean -elf_vax_size_dynamic_sections (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; +elf_vax_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) { bfd *dynobj; asection *s; @@ -1177,7 +1155,7 @@ elf_vax_size_dynamic_sections (output_bf if (info->shared && info->symbolic) elf_vax_link_hash_traverse (elf_vax_hash_table (info), elf_vax_discard_copies, - (PTR) NULL); + NULL); /* If this is a -Bsymbolic shared link or a static link, we need to discard all the got entries we've recorded. Otherwise, we need to @@ -1334,9 +1312,8 @@ elf_vax_size_dynamic_sections (output_bf routine, but we won't fill them in in the relocate_section routine. */ static bfd_boolean -elf_vax_discard_copies (h, ignore) - struct elf_vax_link_hash_entry *h; - PTR ignore ATTRIBUTE_UNUSED; +elf_vax_discard_copies (struct elf_vax_link_hash_entry *h, + PTR ignore ATTRIBUTE_UNUSED) { struct elf_vax_pcrel_relocs_copied *s; @@ -1361,9 +1338,7 @@ elf_vax_discard_copies (h, ignore) will be reserved for the symbol. */ static bfd_boolean -elf_vax_instantiate_got_entries (h, infoptr) - struct elf_link_hash_entry *h; - PTR infoptr; +elf_vax_instantiate_got_entries (struct elf_link_hash_entry *h, PTR infoptr) { struct bfd_link_info *info = (struct bfd_link_info *) infoptr; bfd *dynobj; @@ -1409,16 +1384,14 @@ elf_vax_instantiate_got_entries (h, info /* Relocate an VAX ELF section. */ static bfd_boolean -elf_vax_relocate_section (output_bfd, info, input_bfd, input_section, - contents, relocs, local_syms, local_sections) - bfd *output_bfd; - struct bfd_link_info *info; - bfd *input_bfd; - asection *input_section; - bfd_byte *contents; - Elf_Internal_Rela *relocs; - Elf_Internal_Sym *local_syms; - asection **local_sections; +elf_vax_relocate_section (bfd *output_bfd, + struct bfd_link_info *info, + bfd *input_bfd, + asection *input_section, + bfd_byte *contents, + Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, + asection **local_sections) { bfd *dynobj; Elf_Internal_Shdr *symtab_hdr; @@ -1487,7 +1460,7 @@ elf_vax_relocate_section (output_bfd, in r_symndx, symtab_hdr, sym_hashes, h, sec, relocation, unresolved_reloc, warned); - + if ((h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) && ((r_type == R_VAX_PLT32 @@ -1842,11 +1815,9 @@ elf_vax_relocate_section (output_bfd, in dynamic sections here. */ static bfd_boolean -elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym) - bfd *output_bfd; - struct bfd_link_info *info; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +elf_vax_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { bfd *dynobj; @@ -1997,9 +1968,7 @@ elf_vax_finish_dynamic_symbol (output_bf /* Finish up the dynamic sections. */ static bfd_boolean -elf_vax_finish_dynamic_sections (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; +elf_vax_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) { bfd *dynobj; asection *sgot; diff -uprN binutils-2.16.90.0.3/bfd/elf32-xtensa.c binutils-2.16.91.0.1/bfd/elf32-xtensa.c --- binutils-2.16.90.0.3/bfd/elf32-xtensa.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf32-xtensa.c 2005-06-22 13:53:34.358407678 -0700 @@ -1855,6 +1855,9 @@ bfd_elf_xtensa_reloc (bfd *abfd, asection *reloc_target_output_section; bfd_boolean is_weak_undef; + if (!xtensa_default_isa) + xtensa_default_isa = xtensa_isa_init (0, 0); + /* ELF relocs are against symbols. If we are producing relocatable output, and the reloc is against an external symbol, the resulting reloc will also be against the same symbol. In such a case, we @@ -9338,9 +9341,9 @@ xtensa_get_property_section_name (asecti char *linkonce_kind = 0; if (strcmp (base_name, XTENSA_INSN_SEC_NAME) == 0) - linkonce_kind = "x"; + linkonce_kind = "x."; else if (strcmp (base_name, XTENSA_LIT_SEC_NAME) == 0) - linkonce_kind = "p"; + linkonce_kind = "p."; else if (strcmp (base_name, XTENSA_PROP_SEC_NAME) == 0) linkonce_kind = "prop."; else diff -uprN binutils-2.16.90.0.3/bfd/elf64-alpha.c binutils-2.16.91.0.1/bfd/elf64-alpha.c --- binutils-2.16.90.0.3/bfd/elf64-alpha.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf64-alpha.c 2005-06-22 13:53:34.368406026 -0700 @@ -47,114 +47,59 @@ #define ECOFF_64 #include "ecoffswap.h" -static bfd_boolean alpha_elf_dynamic_symbol_p - PARAMS ((struct elf_link_hash_entry *, struct bfd_link_info *)); -static struct bfd_hash_entry * elf64_alpha_link_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static struct bfd_link_hash_table * elf64_alpha_bfd_link_hash_table_create - PARAMS ((bfd *)); - -static bfd_reloc_status_type elf64_alpha_reloc_nil - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static bfd_reloc_status_type elf64_alpha_reloc_bad - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static bfd_reloc_status_type elf64_alpha_do_reloc_gpdisp - PARAMS ((bfd *, bfd_vma, bfd_byte *, bfd_byte *)); -static bfd_reloc_status_type elf64_alpha_reloc_gpdisp - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); - -static reloc_howto_type * elf64_alpha_bfd_reloc_type_lookup - PARAMS ((bfd *, bfd_reloc_code_real_type)); -static void elf64_alpha_info_to_howto - PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); - -static bfd_boolean elf64_alpha_mkobject - PARAMS ((bfd *)); -static bfd_boolean elf64_alpha_object_p - PARAMS ((bfd *)); -static bfd_boolean elf64_alpha_section_flags - PARAMS ((flagword *, const Elf_Internal_Shdr *)); -static bfd_boolean elf64_alpha_fake_sections - PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); -static bfd_boolean elf64_alpha_create_got_section - PARAMS ((bfd *, struct bfd_link_info *)); -static bfd_boolean elf64_alpha_create_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); - -static bfd_boolean elf64_alpha_read_ecoff_info - PARAMS ((bfd *, asection *, struct ecoff_debug_info *)); -static bfd_boolean elf64_alpha_is_local_label_name - PARAMS ((bfd *, const char *)); -static bfd_boolean elf64_alpha_find_nearest_line - PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, - const char **, unsigned int *)); + +/* Instruction data for plt generation and relaxation. */ + +#define OP_LDA 0x08 +#define OP_LDAH 0x09 +#define OP_LDQ 0x29 +#define OP_BR 0x30 +#define OP_BSR 0x34 + +#define INSN_LDA (OP_LDA << 26) +#define INSN_LDAH (OP_LDAH << 26) +#define INSN_LDQ (OP_LDQ << 26) +#define INSN_BR (OP_BR << 26) + +#define INSN_ADDQ 0x40000400 +#define INSN_RDUNIQ 0x0000009e +#define INSN_SUBQ 0x40000520 +#define INSN_S4SUBQ 0x40000560 +#define INSN_UNOP 0x2ffe0000 + +#define INSN_JSR 0x68004000 +#define INSN_JMP 0x68000000 +#define INSN_JSR_MASK 0xfc00c000 + +#define INSN_A(I,A) (I | (A << 21)) +#define INSN_AB(I,A,B) (I | (A << 21) | (B << 16)) +#define INSN_ABC(I,A,B,C) (I | (A << 21) | (B << 16) | C) +#define INSN_ABO(I,A,B,O) (I | (A << 21) | (B << 16) | ((O) & 0xffff)) +#define INSN_AD(I,A,D) (I | (A << 21) | (((D) >> 2) & 0x1fffff)) -#if defined(__STDC__) || defined(ALMOST_STDC) -struct alpha_elf_link_hash_entry; +/* PLT/GOT Stuff */ + +/* Set by ld emulation. Putting this into the link_info or hash structure + is simply working too hard. */ +#ifdef USE_SECUREPLT +bfd_boolean elf64_alpha_use_secureplt = TRUE; +#else +bfd_boolean elf64_alpha_use_secureplt = FALSE; #endif -static bfd_boolean elf64_alpha_output_extsym - PARAMS ((struct alpha_elf_link_hash_entry *, PTR)); +#define OLD_PLT_HEADER_SIZE 32 +#define OLD_PLT_ENTRY_SIZE 12 +#define NEW_PLT_HEADER_SIZE 36 +#define NEW_PLT_ENTRY_SIZE 4 + +#define PLT_HEADER_SIZE \ + (elf64_alpha_use_secureplt ? NEW_PLT_HEADER_SIZE : OLD_PLT_HEADER_SIZE) +#define PLT_ENTRY_SIZE \ + (elf64_alpha_use_secureplt ? NEW_PLT_ENTRY_SIZE : OLD_PLT_ENTRY_SIZE) + +#define MAX_GOT_SIZE (64*1024) -static bfd_boolean elf64_alpha_can_merge_gots - PARAMS ((bfd *, bfd *)); -static void elf64_alpha_merge_gots - PARAMS ((bfd *, bfd *)); -static bfd_boolean elf64_alpha_calc_got_offsets_for_symbol - PARAMS ((struct alpha_elf_link_hash_entry *, PTR)); -static void elf64_alpha_calc_got_offsets - PARAMS ((struct bfd_link_info *)); -static bfd_boolean elf64_alpha_size_got_sections - PARAMS ((struct bfd_link_info *)); -static bfd_boolean elf64_alpha_size_plt_section - PARAMS ((struct bfd_link_info *)); -static bfd_boolean elf64_alpha_size_plt_section_1 - PARAMS ((struct alpha_elf_link_hash_entry *, PTR)); -static bfd_boolean elf64_alpha_always_size_sections - PARAMS ((bfd *, struct bfd_link_info *)); -static int alpha_dynamic_entries_for_reloc - PARAMS ((int, int, int)); -static bfd_boolean elf64_alpha_calc_dynrel_sizes - PARAMS ((struct alpha_elf_link_hash_entry *, struct bfd_link_info *)); -static bfd_boolean elf64_alpha_size_rela_got_section - PARAMS ((struct bfd_link_info *)); -static bfd_boolean elf64_alpha_size_rela_got_1 - PARAMS ((struct alpha_elf_link_hash_entry *, struct bfd_link_info *)); -static bfd_boolean elf64_alpha_add_symbol_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Sym *, - const char **, flagword *, asection **, bfd_vma *)); -static struct alpha_elf_got_entry *get_got_entry - PARAMS ((bfd *, struct alpha_elf_link_hash_entry *, unsigned long, - unsigned long, bfd_vma)); -static bfd_boolean elf64_alpha_check_relocs - PARAMS ((bfd *, struct bfd_link_info *, asection *sec, - const Elf_Internal_Rela *)); -static bfd_boolean elf64_alpha_adjust_dynamic_symbol - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); -static bfd_boolean elf64_alpha_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -static void elf64_alpha_emit_dynrel - PARAMS ((bfd *, struct bfd_link_info *, asection *, asection *, - bfd_vma, long, long, bfd_vma)); -static bfd_boolean elf64_alpha_relocate_section_r - PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, - Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); -static bfd_boolean elf64_alpha_relocate_section - PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, - Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); -static bfd_boolean elf64_alpha_finish_dynamic_symbol - PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, - Elf_Internal_Sym *)); -static bfd_boolean elf64_alpha_finish_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -static bfd_boolean elf64_alpha_final_link - PARAMS ((bfd *, struct bfd_link_info *)); -static bfd_boolean elf64_alpha_merge_ind_symbols - PARAMS ((struct alpha_elf_link_hash_entry *, PTR)); -static Elf_Internal_Rela * elf64_alpha_find_reloc_at_ofs - PARAMS ((Elf_Internal_Rela *, Elf_Internal_Rela *, bfd_vma, int)); -static enum elf_reloc_type_class elf64_alpha_reloc_type_class - PARAMS ((const Elf_Internal_Rela *)); +#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so" struct alpha_elf_link_hash_entry { @@ -167,19 +112,15 @@ struct alpha_elf_link_hash_entry int flags; /* Contexts in which a literal was referenced. */ -#define ALPHA_ELF_LINK_HASH_LU_ADDR 0x01 -#define ALPHA_ELF_LINK_HASH_LU_MEM 0x02 -#define ALPHA_ELF_LINK_HASH_LU_BYTE 0x04 -#define ALPHA_ELF_LINK_HASH_LU_JSR 0x08 -#define ALPHA_ELF_LINK_HASH_LU_TLSGD 0x10 -#define ALPHA_ELF_LINK_HASH_LU_TLSLDM 0x20 -#define ALPHA_ELF_LINK_HASH_LU_FUNC 0x38 -#define ALPHA_ELF_LINK_HASH_TLS_IE 0x40 -#define ALPHA_ELF_LINK_HASH_PLT_LOC 0x80 - - /* Used to undo the localization of a plt symbol. */ - asection *plt_old_section; - bfd_vma plt_old_value; +#define ALPHA_ELF_LINK_HASH_LU_ADDR 0x01 +#define ALPHA_ELF_LINK_HASH_LU_MEM 0x02 +#define ALPHA_ELF_LINK_HASH_LU_BYTE 0x04 +#define ALPHA_ELF_LINK_HASH_LU_JSR 0x08 +#define ALPHA_ELF_LINK_HASH_LU_TLSGD 0x10 +#define ALPHA_ELF_LINK_HASH_LU_TLSLDM 0x20 +#define ALPHA_ELF_LINK_HASH_LU_JSRDIRECT 0x40 +#define ALPHA_ELF_LINK_HASH_LU_PLT 0x38 +#define ALPHA_ELF_LINK_HASH_TLS_IE 0x80 /* Used to implement multiple .got subsections. */ struct alpha_elf_got_entry @@ -195,6 +136,9 @@ struct alpha_elf_link_hash_entry /* The .got offset for this entry. */ int got_offset; + /* The .plt offset for this entry. */ + int plt_offset; + /* How many references to this entry? */ int use_count; @@ -254,7 +198,7 @@ struct alpha_elf_link_hash_table #define alpha_elf_link_hash_traverse(table, func, info) \ (elf_link_hash_traverse \ (&(table)->root, \ - (bfd_boolean (*) PARAMS ((struct elf_link_hash_entry *, PTR))) (func), \ + (bfd_boolean (*) (struct elf_link_hash_entry *, PTR)) (func), \ (info))) /* Get the Alpha ELF linker hash table from a link_info structure. */ @@ -273,9 +217,8 @@ struct alpha_elf_link_hash_table address is ever taken. */ static inline bfd_boolean -alpha_elf_dynamic_symbol_p (h, info) - struct elf_link_hash_entry *h; - struct bfd_link_info *info; +alpha_elf_dynamic_symbol_p (struct elf_link_hash_entry *h, + struct bfd_link_info *info) { return _bfd_elf_dynamic_symbol_p (h, info, 0); } @@ -283,10 +226,9 @@ alpha_elf_dynamic_symbol_p (h, info) /* Create an entry in a Alpha ELF linker hash table. */ static struct bfd_hash_entry * -elf64_alpha_link_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +elf64_alpha_link_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { struct alpha_elf_link_hash_entry *ret = (struct alpha_elf_link_hash_entry *) entry; @@ -322,8 +264,7 @@ elf64_alpha_link_hash_newfunc (entry, ta /* Create a Alpha ELF linker hash table. */ static struct bfd_link_hash_table * -elf64_alpha_bfd_link_hash_table_create (abfd) - bfd *abfd; +elf64_alpha_bfd_link_hash_table_create (bfd *abfd) { struct alpha_elf_link_hash_table *ret; bfd_size_type amt = sizeof (struct alpha_elf_link_hash_table); @@ -377,8 +318,7 @@ struct alpha_elf_obj_tdata ((struct alpha_elf_obj_tdata *) (abfd)->tdata.any) static bfd_boolean -elf64_alpha_mkobject (abfd) - bfd *abfd; +elf64_alpha_mkobject (bfd *abfd) { bfd_size_type amt = sizeof (struct alpha_elf_obj_tdata); abfd->tdata.any = bfd_zalloc (abfd, amt); @@ -388,13 +328,123 @@ elf64_alpha_mkobject (abfd) } static bfd_boolean -elf64_alpha_object_p (abfd) - bfd *abfd; +elf64_alpha_object_p (bfd *abfd) { /* Set the right machine number for an Alpha ELF file. */ return bfd_default_set_arch_mach (abfd, bfd_arch_alpha, 0); } +/* A relocation function which doesn't do anything. */ + +static bfd_reloc_status_type +elf64_alpha_reloc_nil (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc, + asymbol *sym ATTRIBUTE_UNUSED, + PTR data ATTRIBUTE_UNUSED, asection *sec, + bfd *output_bfd, char **error_message ATTRIBUTE_UNUSED) +{ + if (output_bfd) + reloc->address += sec->output_offset; + return bfd_reloc_ok; +} + +/* A relocation function used for an unsupported reloc. */ + +static bfd_reloc_status_type +elf64_alpha_reloc_bad (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc, + asymbol *sym ATTRIBUTE_UNUSED, + PTR data ATTRIBUTE_UNUSED, asection *sec, + bfd *output_bfd, char **error_message ATTRIBUTE_UNUSED) +{ + if (output_bfd) + reloc->address += sec->output_offset; + return bfd_reloc_notsupported; +} + +/* Do the work of the GPDISP relocation. */ + +static bfd_reloc_status_type +elf64_alpha_do_reloc_gpdisp (bfd *abfd, bfd_vma gpdisp, bfd_byte *p_ldah, + bfd_byte *p_lda) +{ + bfd_reloc_status_type ret = bfd_reloc_ok; + bfd_vma addend; + unsigned long i_ldah, i_lda; + + i_ldah = bfd_get_32 (abfd, p_ldah); + i_lda = bfd_get_32 (abfd, p_lda); + + /* Complain if the instructions are not correct. */ + if (((i_ldah >> 26) & 0x3f) != 0x09 + || ((i_lda >> 26) & 0x3f) != 0x08) + ret = bfd_reloc_dangerous; + + /* Extract the user-supplied offset, mirroring the sign extensions + that the instructions perform. */ + addend = ((i_ldah & 0xffff) << 16) | (i_lda & 0xffff); + addend = (addend ^ 0x80008000) - 0x80008000; + + gpdisp += addend; + + if ((bfd_signed_vma) gpdisp < -(bfd_signed_vma) 0x80000000 + || (bfd_signed_vma) gpdisp >= (bfd_signed_vma) 0x7fff8000) + ret = bfd_reloc_overflow; + + /* compensate for the sign extension again. */ + i_ldah = ((i_ldah & 0xffff0000) + | (((gpdisp >> 16) + ((gpdisp >> 15) & 1)) & 0xffff)); + i_lda = (i_lda & 0xffff0000) | (gpdisp & 0xffff); + + bfd_put_32 (abfd, (bfd_vma) i_ldah, p_ldah); + bfd_put_32 (abfd, (bfd_vma) i_lda, p_lda); + + return ret; +} + +/* The special function for the GPDISP reloc. */ + +static bfd_reloc_status_type +elf64_alpha_reloc_gpdisp (bfd *abfd, arelent *reloc_entry, + asymbol *sym ATTRIBUTE_UNUSED, PTR data, + asection *input_section, bfd *output_bfd, + char **err_msg) +{ + bfd_reloc_status_type ret; + bfd_vma gp, relocation; + bfd_vma high_address; + bfd_byte *p_ldah, *p_lda; + + /* Don't do anything if we're not doing a final link. */ + if (output_bfd) + { + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + + high_address = bfd_get_section_limit (abfd, input_section); + if (reloc_entry->address > high_address + || reloc_entry->address + reloc_entry->addend > high_address) + return bfd_reloc_outofrange; + + /* The gp used in the portion of the output object to which this + input object belongs is cached on the input bfd. */ + gp = _bfd_get_gp_value (abfd); + + relocation = (input_section->output_section->vma + + input_section->output_offset + + reloc_entry->address); + + p_ldah = (bfd_byte *) data + reloc_entry->address; + p_lda = p_ldah + reloc_entry->addend; + + ret = elf64_alpha_do_reloc_gpdisp (abfd, gp - relocation, p_ldah, p_lda); + + /* Complain if the instructions are not correct. */ + if (ret == bfd_reloc_dangerous) + *err_msg = _("GPDISP relocation did not find ldah and lda instructions"); + + return ret; +} + /* In case we're on a 32-bit machine, construct a 64-bit "-1" value from smaller values. Start with zero, widen, *then* decrement. */ #define MINUS_ONE (((bfd_vma)0) - 1) @@ -942,133 +992,6 @@ static reloc_howto_type elf64_alpha_howt FALSE), /* pcrel_offset */ }; -/* A relocation function which doesn't do anything. */ - -static bfd_reloc_status_type -elf64_alpha_reloc_nil (abfd, reloc, sym, data, sec, output_bfd, error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc; - asymbol *sym ATTRIBUTE_UNUSED; - PTR data ATTRIBUTE_UNUSED; - asection *sec; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; -{ - if (output_bfd) - reloc->address += sec->output_offset; - return bfd_reloc_ok; -} - -/* A relocation function used for an unsupported reloc. */ - -static bfd_reloc_status_type -elf64_alpha_reloc_bad (abfd, reloc, sym, data, sec, output_bfd, error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc; - asymbol *sym ATTRIBUTE_UNUSED; - PTR data ATTRIBUTE_UNUSED; - asection *sec; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; -{ - if (output_bfd) - reloc->address += sec->output_offset; - return bfd_reloc_notsupported; -} - -/* Do the work of the GPDISP relocation. */ - -static bfd_reloc_status_type -elf64_alpha_do_reloc_gpdisp (abfd, gpdisp, p_ldah, p_lda) - bfd *abfd; - bfd_vma gpdisp; - bfd_byte *p_ldah; - bfd_byte *p_lda; -{ - bfd_reloc_status_type ret = bfd_reloc_ok; - bfd_vma addend; - unsigned long i_ldah, i_lda; - - i_ldah = bfd_get_32 (abfd, p_ldah); - i_lda = bfd_get_32 (abfd, p_lda); - - /* Complain if the instructions are not correct. */ - if (((i_ldah >> 26) & 0x3f) != 0x09 - || ((i_lda >> 26) & 0x3f) != 0x08) - ret = bfd_reloc_dangerous; - - /* Extract the user-supplied offset, mirroring the sign extensions - that the instructions perform. */ - addend = ((i_ldah & 0xffff) << 16) | (i_lda & 0xffff); - addend = (addend ^ 0x80008000) - 0x80008000; - - gpdisp += addend; - - if ((bfd_signed_vma) gpdisp < -(bfd_signed_vma) 0x80000000 - || (bfd_signed_vma) gpdisp >= (bfd_signed_vma) 0x7fff8000) - ret = bfd_reloc_overflow; - - /* compensate for the sign extension again. */ - i_ldah = ((i_ldah & 0xffff0000) - | (((gpdisp >> 16) + ((gpdisp >> 15) & 1)) & 0xffff)); - i_lda = (i_lda & 0xffff0000) | (gpdisp & 0xffff); - - bfd_put_32 (abfd, (bfd_vma) i_ldah, p_ldah); - bfd_put_32 (abfd, (bfd_vma) i_lda, p_lda); - - return ret; -} - -/* The special function for the GPDISP reloc. */ - -static bfd_reloc_status_type -elf64_alpha_reloc_gpdisp (abfd, reloc_entry, sym, data, input_section, - output_bfd, err_msg) - bfd *abfd; - arelent *reloc_entry; - asymbol *sym ATTRIBUTE_UNUSED; - PTR data; - asection *input_section; - bfd *output_bfd; - char **err_msg; -{ - bfd_reloc_status_type ret; - bfd_vma gp, relocation; - bfd_vma high_address; - bfd_byte *p_ldah, *p_lda; - - /* Don't do anything if we're not doing a final link. */ - if (output_bfd) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - high_address = bfd_get_section_limit (abfd, input_section); - if (reloc_entry->address > high_address - || reloc_entry->address + reloc_entry->addend > high_address) - return bfd_reloc_outofrange; - - /* The gp used in the portion of the output object to which this - input object belongs is cached on the input bfd. */ - gp = _bfd_get_gp_value (abfd); - - relocation = (input_section->output_section->vma - + input_section->output_offset - + reloc_entry->address); - - p_ldah = (bfd_byte *) data + reloc_entry->address; - p_lda = p_ldah + reloc_entry->addend; - - ret = elf64_alpha_do_reloc_gpdisp (abfd, gp - relocation, p_ldah, p_lda); - - /* Complain if the instructions are not correct. */ - if (ret == bfd_reloc_dangerous) - *err_msg = _("GPDISP relocation did not find ldah and lda instructions"); - - return ret; -} - /* A mapping from BFD reloc types to Alpha ELF reloc types. */ struct elf_reloc_map @@ -1114,9 +1037,8 @@ static const struct elf_reloc_map elf64_ /* Given a BFD reloc type, return a HOWTO structure. */ static reloc_howto_type * -elf64_alpha_bfd_reloc_type_lookup (abfd, code) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_reloc_code_real_type code; +elf64_alpha_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) { const struct elf_reloc_map *i, *e; i = e = elf64_alpha_reloc_map; @@ -1132,14 +1054,10 @@ elf64_alpha_bfd_reloc_type_lookup (abfd, /* Given an Alpha ELF reloc type, fill in an arelent structure. */ static void -elf64_alpha_info_to_howto (abfd, cache_ptr, dst) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *cache_ptr; - Elf_Internal_Rela *dst; +elf64_alpha_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, + Elf_Internal_Rela *dst) { - unsigned r_type; - - r_type = ELF64_R_TYPE(dst->r_info); + unsigned r_type = ELF64_R_TYPE(dst->r_info); BFD_ASSERT (r_type < (unsigned int) R_ALPHA_max); cache_ptr->howto = &elf64_alpha_howto_table[r_type]; } @@ -1159,2966 +1077,2823 @@ elf64_alpha_info_to_howto (abfd, cache_p - align_power ((bfd_vma) 16, \ elf_hash_table (info)->tls_sec->alignment_power)) -/* These functions do relaxation for Alpha ELF. +/* Handle an Alpha specific section when reading an object file. This + is called when bfd_section_from_shdr finds a section with an unknown + type. + FIXME: We need to handle the SHF_ALPHA_GPREL flag, but I'm not sure + how to. */ - Currently I'm only handling what I can do with existing compiler - and assembler support, which means no instructions are removed, - though some may be nopped. At this time GCC does not emit enough - information to do all of the relaxing that is possible. It will - take some not small amount of work for that to happen. +static bfd_boolean +elf64_alpha_section_from_shdr (bfd *abfd, + Elf_Internal_Shdr *hdr, + const char *name, + int shindex) +{ + asection *newsect; - There are a couple of interesting papers that I once read on this - subject, that I cannot find references to at the moment, that - related to Alpha in particular. They are by David Wall, then of - DEC WRL. */ + /* There ought to be a place to keep ELF backend specific flags, but + at the moment there isn't one. We just keep track of the + sections by their name, instead. Fortunately, the ABI gives + suggested names for all the MIPS specific sections, so we will + probably get away with this. */ + switch (hdr->sh_type) + { + case SHT_ALPHA_DEBUG: + if (strcmp (name, ".mdebug") != 0) + return FALSE; + break; + default: + return FALSE; + } -#define OP_LDA 0x08 -#define OP_LDAH 0x09 -#define INSN_JSR 0x68004000 -#define INSN_JSR_MASK 0xfc00c000 -#define OP_LDQ 0x29 -#define OP_BR 0x30 -#define OP_BSR 0x34 -#define INSN_UNOP 0x2ffe0000 -#define INSN_ADDQ 0x40000400 -#define INSN_RDUNIQ 0x0000009e - -struct alpha_relax_info -{ - bfd *abfd; - asection *sec; - bfd_byte *contents; - Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Rela *relocs, *relend; - struct bfd_link_info *link_info; - bfd_vma gp; - bfd *gotobj; - asection *tsec; - struct alpha_elf_link_hash_entry *h; - struct alpha_elf_got_entry **first_gotent; - struct alpha_elf_got_entry *gotent; - bfd_boolean changed_contents; - bfd_boolean changed_relocs; - unsigned char other; -}; - -static bfd_boolean elf64_alpha_relax_with_lituse - PARAMS((struct alpha_relax_info *info, bfd_vma symval, - Elf_Internal_Rela *irel)); -static bfd_vma elf64_alpha_relax_opt_call - PARAMS((struct alpha_relax_info *info, bfd_vma symval)); -static bfd_boolean elf64_alpha_relax_got_load - PARAMS((struct alpha_relax_info *info, bfd_vma symval, - Elf_Internal_Rela *irel, unsigned long)); -static bfd_boolean elf64_alpha_relax_gprelhilo - PARAMS((struct alpha_relax_info *info, bfd_vma symval, - Elf_Internal_Rela *irel, bfd_boolean)); -static bfd_boolean elf64_alpha_relax_tls_get_addr - PARAMS((struct alpha_relax_info *info, bfd_vma symval, - Elf_Internal_Rela *irel, bfd_boolean)); -static bfd_boolean elf64_alpha_relax_section - PARAMS((bfd *abfd, asection *sec, struct bfd_link_info *link_info, - bfd_boolean *again)); + if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex)) + return FALSE; + newsect = hdr->bfd_section; -static Elf_Internal_Rela * -elf64_alpha_find_reloc_at_ofs (rel, relend, offset, type) - Elf_Internal_Rela *rel, *relend; - bfd_vma offset; - int type; -{ - while (rel < relend) + if (hdr->sh_type == SHT_ALPHA_DEBUG) { - if (rel->r_offset == offset - && ELF64_R_TYPE (rel->r_info) == (unsigned int) type) - return rel; - ++rel; + if (! bfd_set_section_flags (abfd, newsect, + (bfd_get_section_flags (abfd, newsect) + | SEC_DEBUGGING))) + return FALSE; } - return NULL; + + return TRUE; } +/* Convert Alpha specific section flags to bfd internal section flags. */ + static bfd_boolean -elf64_alpha_relax_with_lituse (info, symval, irel) - struct alpha_relax_info *info; - bfd_vma symval; - Elf_Internal_Rela *irel; +elf64_alpha_section_flags (flagword *flags, const Elf_Internal_Shdr *hdr) { - Elf_Internal_Rela *urel, *irelend = info->relend; - int flags, count, i; - bfd_signed_vma disp; - bfd_boolean fits16; - bfd_boolean fits32; - bfd_boolean lit_reused = FALSE; - bfd_boolean all_optimized = TRUE; - unsigned int lit_insn; + if (hdr->sh_flags & SHF_ALPHA_GPREL) + *flags |= SEC_SMALL_DATA; - lit_insn = bfd_get_32 (info->abfd, info->contents + irel->r_offset); - if (lit_insn >> 26 != OP_LDQ) - { - ((*_bfd_error_handler) - ("%B: %A+0x%lx: warning: LITERAL relocation against unexpected insn", - info->abfd, info->sec, - (unsigned long) irel->r_offset)); - return TRUE; - } + return TRUE; +} - /* Can't relax dynamic symbols. */ - if (alpha_elf_dynamic_symbol_p (&info->h->root, info->link_info)) - return TRUE; +/* Set the correct type for an Alpha ELF section. We do this by the + section name, which is a hack, but ought to work. */ - /* Summarize how this particular LITERAL is used. */ - for (urel = irel+1, flags = count = 0; urel < irelend; ++urel, ++count) +static bfd_boolean +elf64_alpha_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec) +{ + register const char *name; + + name = bfd_get_section_name (abfd, sec); + + if (strcmp (name, ".mdebug") == 0) { - if (ELF64_R_TYPE (urel->r_info) != R_ALPHA_LITUSE) - break; - if (urel->r_addend <= 3) - flags |= 1 << urel->r_addend; + hdr->sh_type = SHT_ALPHA_DEBUG; + /* In a shared object on Irix 5.3, the .mdebug section has an + entsize of 0. FIXME: Does this matter? */ + if ((abfd->flags & DYNAMIC) != 0 ) + hdr->sh_entsize = 0; + else + hdr->sh_entsize = 1; } + else if ((sec->flags & SEC_SMALL_DATA) + || strcmp (name, ".sdata") == 0 + || strcmp (name, ".sbss") == 0 + || strcmp (name, ".lit4") == 0 + || strcmp (name, ".lit8") == 0) + hdr->sh_flags |= SHF_ALPHA_GPREL; - /* A little preparation for the loop... */ - disp = symval - info->gp; + return TRUE; +} - for (urel = irel+1, i = 0; i < count; ++i, ++urel) +/* Hook called by the linker routine which adds symbols from an object + file. We use it to put .comm items in .sbss, and not .bss. */ + +static bfd_boolean +elf64_alpha_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, + Elf_Internal_Sym *sym, + const char **namep ATTRIBUTE_UNUSED, + flagword *flagsp ATTRIBUTE_UNUSED, + asection **secp, bfd_vma *valp) +{ + if (sym->st_shndx == SHN_COMMON + && !info->relocatable + && sym->st_size <= elf_gp_size (abfd)) { - unsigned int insn; - int insn_disp; - bfd_signed_vma xdisp; + /* Common symbols less than or equal to -G nn bytes are + automatically put into .sbss. */ - insn = bfd_get_32 (info->abfd, info->contents + urel->r_offset); + asection *scomm = bfd_get_section_by_name (abfd, ".scommon"); - switch (urel->r_addend) + if (scomm == NULL) { - case LITUSE_ALPHA_ADDR: - default: - /* This type is really just a placeholder to note that all - uses cannot be optimized, but to still allow some. */ - all_optimized = FALSE; - break; + scomm = bfd_make_section_with_flags (abfd, ".scommon", + (SEC_ALLOC + | SEC_IS_COMMON + | SEC_LINKER_CREATED)); + if (scomm == NULL) + return FALSE; + } - case LITUSE_ALPHA_BASE: - /* We can always optimize 16-bit displacements. */ + *secp = scomm; + *valp = sym->st_size; + } - /* Extract the displacement from the instruction, sign-extending - it if necessary, then test whether it is within 16 or 32 bits - displacement from GP. */ - insn_disp = insn & 0x0000ffff; - if (insn_disp & 0x8000) - insn_disp |= ~0xffff; /* Negative: sign-extend. */ + return TRUE; +} - xdisp = disp + insn_disp; - fits16 = (xdisp >= - (bfd_signed_vma) 0x8000 && xdisp < 0x8000); - fits32 = (xdisp >= - (bfd_signed_vma) 0x80000000 - && xdisp < 0x7fff8000); +/* Create the .got section. */ - if (fits16) - { - /* Take the op code and dest from this insn, take the base - register from the literal insn. Leave the offset alone. */ - insn = (insn & 0xffe0ffff) | (lit_insn & 0x001f0000); - urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), - R_ALPHA_GPREL16); - urel->r_addend = irel->r_addend; - info->changed_relocs = TRUE; +static bfd_boolean +elf64_alpha_create_got_section (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) +{ + asection *s; - bfd_put_32 (info->abfd, (bfd_vma) insn, - info->contents + urel->r_offset); - info->changed_contents = TRUE; - } + if ((s = bfd_get_section_by_name (abfd, ".got"))) + { + /* Check for a non-linker created .got? */ + if (alpha_elf_tdata (abfd)->got == NULL) + alpha_elf_tdata (abfd)->got = s; + return TRUE; + } - /* If all mem+byte, we can optimize 32-bit mem displacements. */ - else if (fits32 && !(flags & ~6)) - { - /* FIXME: sanity check that lit insn Ra is mem insn Rb. */ + s = bfd_make_section_with_flags (abfd, ".got", (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED)); + if (s == NULL + || !bfd_set_section_alignment (abfd, s, 3)) + return FALSE; - irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), - R_ALPHA_GPRELHIGH); - lit_insn = (OP_LDAH << 26) | (lit_insn & 0x03ff0000); - bfd_put_32 (info->abfd, (bfd_vma) lit_insn, - info->contents + irel->r_offset); - lit_reused = TRUE; - info->changed_contents = TRUE; + alpha_elf_tdata (abfd)->got = s; - urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), - R_ALPHA_GPRELLOW); - urel->r_addend = irel->r_addend; - info->changed_relocs = TRUE; - } - else - all_optimized = FALSE; - break; + return TRUE; +} - case LITUSE_ALPHA_BYTOFF: - /* We can always optimize byte instructions. */ +/* Create all the dynamic sections. */ - /* FIXME: sanity check the insn for byte op. Check that the - literal dest reg is indeed Rb in the byte insn. */ +static bfd_boolean +elf64_alpha_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) +{ + asection *s; + struct elf_link_hash_entry *h; + struct bfd_link_hash_entry *bh; - insn &= ~ (unsigned) 0x001ff000; - insn |= ((symval & 7) << 13) | 0x1000; + /* We need to create .plt, .rela.plt, .got, and .rela.got sections. */ - urel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); - urel->r_addend = 0; - info->changed_relocs = TRUE; + s = bfd_make_section_with_flags (abfd, ".plt", + (SEC_ALLOC | SEC_LOAD | SEC_CODE + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | (elf64_alpha_use_secureplt + ? SEC_READONLY : 0))); + if (s == NULL || ! bfd_set_section_alignment (abfd, s, 4)) + return FALSE; - bfd_put_32 (info->abfd, (bfd_vma) insn, - info->contents + urel->r_offset); - info->changed_contents = TRUE; - break; + /* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the + .plt section. */ + bh = NULL; + if (! (_bfd_generic_link_add_one_symbol + (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s, + (bfd_vma) 0, (const char *) NULL, FALSE, + get_elf_backend_data (abfd)->collect, &bh))) + return FALSE; + h = (struct elf_link_hash_entry *) bh; + h->def_regular = 1; + h->type = STT_OBJECT; - case LITUSE_ALPHA_JSR: - case LITUSE_ALPHA_TLSGD: - case LITUSE_ALPHA_TLSLDM: - { - bfd_vma optdest, org; - bfd_signed_vma odisp; + if (info->shared && ! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; - /* If not zero, place to jump without needing pv. */ - optdest = elf64_alpha_relax_opt_call (info, symval); - org = (info->sec->output_section->vma - + info->sec->output_offset - + urel->r_offset + 4); - odisp = (optdest ? optdest : symval) - org; + s = bfd_make_section_with_flags (abfd, ".rela.plt", + (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | SEC_READONLY)); + if (s == NULL || ! bfd_set_section_alignment (abfd, s, 3)) + return FALSE; - if (odisp >= -0x400000 && odisp < 0x400000) - { - Elf_Internal_Rela *xrel; - - /* Preserve branch prediction call stack when possible. */ - if ((insn & INSN_JSR_MASK) == INSN_JSR) - insn = (OP_BSR << 26) | (insn & 0x03e00000); - else - insn = (OP_BR << 26) | (insn & 0x03e00000); - - urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), - R_ALPHA_BRADDR); - urel->r_addend = irel->r_addend; - - if (optdest) - urel->r_addend += optdest - symval; - else - all_optimized = FALSE; - - bfd_put_32 (info->abfd, (bfd_vma) insn, - info->contents + urel->r_offset); - - /* Kill any HINT reloc that might exist for this insn. */ - xrel = (elf64_alpha_find_reloc_at_ofs - (info->relocs, info->relend, urel->r_offset, - R_ALPHA_HINT)); - if (xrel) - xrel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); - - info->changed_contents = TRUE; - info->changed_relocs = TRUE; - } - else - all_optimized = FALSE; + if (elf64_alpha_use_secureplt) + { + s = bfd_make_section_with_flags (abfd, ".got.plt", + SEC_ALLOC | SEC_LINKER_CREATED); + if (s == NULL || ! bfd_set_section_alignment (abfd, s, 3)) + return FALSE; + } - /* Even if the target is not in range for a direct branch, - if we share a GP, we can eliminate the gp reload. */ - if (optdest) - { - Elf_Internal_Rela *gpdisp - = (elf64_alpha_find_reloc_at_ofs - (info->relocs, irelend, urel->r_offset + 4, - R_ALPHA_GPDISP)); - if (gpdisp) - { - bfd_byte *p_ldah = info->contents + gpdisp->r_offset; - bfd_byte *p_lda = p_ldah + gpdisp->r_addend; - unsigned int ldah = bfd_get_32 (info->abfd, p_ldah); - unsigned int lda = bfd_get_32 (info->abfd, p_lda); + /* We may or may not have created a .got section for this object, but + we definitely havn't done the rest of the work. */ - /* Verify that the instruction is "ldah $29,0($26)". - Consider a function that ends in a noreturn call, - and that the next function begins with an ldgp, - and that by accident there is no padding between. - In that case the insn would use $27 as the base. */ - if (ldah == 0x27ba0000 && lda == 0x23bd0000) - { - bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, p_ldah); - bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, p_lda); + if (!elf64_alpha_create_got_section (abfd, info)) + return FALSE; - gpdisp->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); - info->changed_contents = TRUE; - info->changed_relocs = TRUE; - } - } - } - } - break; - } - } + s = bfd_make_section_with_flags (abfd, ".rela.got", + (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | SEC_READONLY)); + if (s == NULL + || !bfd_set_section_alignment (abfd, s, 3)) + return FALSE; - /* If all cases were optimized, we can reduce the use count on this - got entry by one, possibly eliminating it. */ - if (all_optimized) - { - if (--info->gotent->use_count == 0) - { - int sz = alpha_got_entry_size (R_ALPHA_LITERAL); - alpha_elf_tdata (info->gotobj)->total_got_size -= sz; - if (!info->h) - alpha_elf_tdata (info->gotobj)->local_got_size -= sz; - } + /* Define the symbol _GLOBAL_OFFSET_TABLE_ at the start of the + dynobj's .got section. We don't do this in the linker script + because we don't want to define the symbol if we are not creating + a global offset table. */ + bh = NULL; + if (!(_bfd_generic_link_add_one_symbol + (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, + alpha_elf_tdata(abfd)->got, (bfd_vma) 0, (const char *) NULL, + FALSE, get_elf_backend_data (abfd)->collect, &bh))) + return FALSE; + h = (struct elf_link_hash_entry *) bh; + h->def_regular = 1; + h->type = STT_OBJECT; - /* If the literal instruction is no longer needed (it may have been - reused. We can eliminate it. */ - /* ??? For now, I don't want to deal with compacting the section, - so just nop it out. */ - if (!lit_reused) - { - irel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); - info->changed_relocs = TRUE; + if (info->shared + && ! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; - bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, - info->contents + irel->r_offset); - info->changed_contents = TRUE; - } - } + elf_hash_table (info)->hgot = h; return TRUE; } + +/* Read ECOFF debugging information from a .mdebug section into a + ecoff_debug_info structure. */ -static bfd_vma -elf64_alpha_relax_opt_call (info, symval) - struct alpha_relax_info *info; - bfd_vma symval; +static bfd_boolean +elf64_alpha_read_ecoff_info (bfd *abfd, asection *section, + struct ecoff_debug_info *debug) { - /* If the function has the same gp, and we can identify that the - function does not use its function pointer, we can eliminate the - address load. */ + HDRR *symhdr; + const struct ecoff_debug_swap *swap; + char *ext_hdr = NULL; - /* If the symbol is marked NOPV, we are being told the function never - needs its procedure value. */ - if ((info->other & STO_ALPHA_STD_GPLOAD) == STO_ALPHA_NOPV) - return symval; + swap = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap; + memset (debug, 0, sizeof (*debug)); - /* If the symbol is marked STD_GP, we are being told the function does - a normal ldgp in the first two words. */ - else if ((info->other & STO_ALPHA_STD_GPLOAD) == STO_ALPHA_STD_GPLOAD) - ; + ext_hdr = (char *) bfd_malloc (swap->external_hdr_size); + if (ext_hdr == NULL && swap->external_hdr_size != 0) + goto error_return; - /* Otherwise, we may be able to identify a GP load in the first two - words, which we can then skip. */ - else - { - Elf_Internal_Rela *tsec_relocs, *tsec_relend, *tsec_free, *gpdisp; - bfd_vma ofs; + if (! bfd_get_section_contents (abfd, section, ext_hdr, (file_ptr) 0, + swap->external_hdr_size)) + goto error_return; - /* Load the relocations from the section that the target symbol is in. */ - if (info->sec == info->tsec) - { - tsec_relocs = info->relocs; - tsec_relend = info->relend; - tsec_free = NULL; - } - else - { - tsec_relocs = (_bfd_elf_link_read_relocs - (info->abfd, info->tsec, (PTR) NULL, - (Elf_Internal_Rela *) NULL, - info->link_info->keep_memory)); - if (tsec_relocs == NULL) - return 0; - tsec_relend = tsec_relocs + info->tsec->reloc_count; - tsec_free = (info->link_info->keep_memory ? NULL : tsec_relocs); - } + symhdr = &debug->symbolic_header; + (*swap->swap_hdr_in) (abfd, ext_hdr, symhdr); - /* Recover the symbol's offset within the section. */ - ofs = (symval - info->tsec->output_section->vma - - info->tsec->output_offset); + /* The symbolic header contains absolute file offsets and sizes to + read. */ +#define READ(ptr, offset, count, size, type) \ + if (symhdr->count == 0) \ + debug->ptr = NULL; \ + else \ + { \ + bfd_size_type amt = (bfd_size_type) size * symhdr->count; \ + debug->ptr = (type) bfd_malloc (amt); \ + if (debug->ptr == NULL) \ + goto error_return; \ + if (bfd_seek (abfd, (file_ptr) symhdr->offset, SEEK_SET) != 0 \ + || bfd_bread (debug->ptr, amt, abfd) != amt) \ + goto error_return; \ + } - /* Look for a GPDISP reloc. */ - gpdisp = (elf64_alpha_find_reloc_at_ofs - (tsec_relocs, tsec_relend, ofs, R_ALPHA_GPDISP)); + READ (line, cbLineOffset, cbLine, sizeof (unsigned char), unsigned char *); + READ (external_dnr, cbDnOffset, idnMax, swap->external_dnr_size, PTR); + READ (external_pdr, cbPdOffset, ipdMax, swap->external_pdr_size, PTR); + READ (external_sym, cbSymOffset, isymMax, swap->external_sym_size, PTR); + READ (external_opt, cbOptOffset, ioptMax, swap->external_opt_size, PTR); + READ (external_aux, cbAuxOffset, iauxMax, sizeof (union aux_ext), + union aux_ext *); + READ (ss, cbSsOffset, issMax, sizeof (char), char *); + READ (ssext, cbSsExtOffset, issExtMax, sizeof (char), char *); + READ (external_fdr, cbFdOffset, ifdMax, swap->external_fdr_size, PTR); + READ (external_rfd, cbRfdOffset, crfd, swap->external_rfd_size, PTR); + READ (external_ext, cbExtOffset, iextMax, swap->external_ext_size, PTR); +#undef READ - if (!gpdisp || gpdisp->r_addend != 4) - { - if (tsec_free) - free (tsec_free); - return 0; - } - if (tsec_free) - free (tsec_free); - } + debug->fdr = NULL; - /* We've now determined that we can skip an initial gp load. Verify - that the call and the target use the same gp. */ - if (info->link_info->hash->creator != info->tsec->owner->xvec - || info->gotobj != alpha_elf_tdata (info->tsec->owner)->gotobj) - return 0; + return TRUE; - return symval + 8; + error_return: + if (ext_hdr != NULL) + free (ext_hdr); + if (debug->line != NULL) + free (debug->line); + if (debug->external_dnr != NULL) + free (debug->external_dnr); + if (debug->external_pdr != NULL) + free (debug->external_pdr); + if (debug->external_sym != NULL) + free (debug->external_sym); + if (debug->external_opt != NULL) + free (debug->external_opt); + if (debug->external_aux != NULL) + free (debug->external_aux); + if (debug->ss != NULL) + free (debug->ss); + if (debug->ssext != NULL) + free (debug->ssext); + if (debug->external_fdr != NULL) + free (debug->external_fdr); + if (debug->external_rfd != NULL) + free (debug->external_rfd); + if (debug->external_ext != NULL) + free (debug->external_ext); + return FALSE; } +/* Alpha ELF local labels start with '$'. */ + static bfd_boolean -elf64_alpha_relax_got_load (info, symval, irel, r_type) - struct alpha_relax_info *info; - bfd_vma symval; - Elf_Internal_Rela *irel; - unsigned long r_type; +elf64_alpha_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED, const char *name) { - unsigned int insn; - bfd_signed_vma disp; + return name[0] == '$'; +} - /* Get the instruction. */ - insn = bfd_get_32 (info->abfd, info->contents + irel->r_offset); +/* Alpha ELF follows MIPS ELF in using a special find_nearest_line + routine in order to handle the ECOFF debugging information. We + still call this mips_elf_find_line because of the slot + find_line_info in elf_obj_tdata is declared that way. */ - if (insn >> 26 != OP_LDQ) - { - reloc_howto_type *howto = elf64_alpha_howto_table + r_type; - ((*_bfd_error_handler) - ("%B: %A+0x%lx: warning: %s relocation against unexpected insn", - info->abfd, info->sec, - (unsigned long) irel->r_offset, howto->name)); - return TRUE; - } +struct mips_elf_find_line +{ + struct ecoff_debug_info d; + struct ecoff_find_line i; +}; - /* Can't relax dynamic symbols. */ - if (alpha_elf_dynamic_symbol_p (&info->h->root, info->link_info)) - return TRUE; +static bfd_boolean +elf64_alpha_find_nearest_line (bfd *abfd, asection *section, asymbol **symbols, + bfd_vma offset, const char **filename_ptr, + const char **functionname_ptr, + unsigned int *line_ptr) +{ + asection *msec; - /* Can't use local-exec relocations in shared libraries. */ - if (r_type == R_ALPHA_GOTTPREL && info->link_info->shared) + if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, + filename_ptr, functionname_ptr, + line_ptr, 0, + &elf_tdata (abfd)->dwarf2_find_line_info)) return TRUE; - if (r_type == R_ALPHA_LITERAL) - disp = symval - info->gp; - else + msec = bfd_get_section_by_name (abfd, ".mdebug"); + if (msec != NULL) { - bfd_vma dtp_base, tp_base; + flagword origflags; + struct mips_elf_find_line *fi; + const struct ecoff_debug_swap * const swap = + get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap; - BFD_ASSERT (elf_hash_table (info->link_info)->tls_sec != NULL); - dtp_base = alpha_get_dtprel_base (info->link_info); - tp_base = alpha_get_tprel_base (info->link_info); - disp = symval - (r_type == R_ALPHA_GOTDTPREL ? dtp_base : tp_base); - } + /* If we are called during a link, alpha_elf_final_link may have + cleared the SEC_HAS_CONTENTS field. We force it back on here + if appropriate (which it normally will be). */ + origflags = msec->flags; + if (elf_section_data (msec)->this_hdr.sh_type != SHT_NOBITS) + msec->flags |= SEC_HAS_CONTENTS; - if (disp < -0x8000 || disp >= 0x8000) - return TRUE; + fi = elf_tdata (abfd)->find_line_info; + if (fi == NULL) + { + bfd_size_type external_fdr_size; + char *fraw_src; + char *fraw_end; + struct fdr *fdr_ptr; + bfd_size_type amt = sizeof (struct mips_elf_find_line); - /* Exchange LDQ for LDA. In the case of the TLS relocs, we're loading - a constant, so force the base register to be $31. */ - if (r_type == R_ALPHA_LITERAL) - insn = (OP_LDA << 26) | (insn & 0x03ff0000); - else - insn = (OP_LDA << 26) | (insn & (31 << 21)) | (31 << 16); - bfd_put_32 (info->abfd, (bfd_vma) insn, info->contents + irel->r_offset); - info->changed_contents = TRUE; + fi = (struct mips_elf_find_line *) bfd_zalloc (abfd, amt); + if (fi == NULL) + { + msec->flags = origflags; + return FALSE; + } - /* Reduce the use count on this got entry by one, possibly - eliminating it. */ - if (--info->gotent->use_count == 0) - { - int sz = alpha_got_entry_size (r_type); - alpha_elf_tdata (info->gotobj)->total_got_size -= sz; - if (!info->h) - alpha_elf_tdata (info->gotobj)->local_got_size -= sz; - } + if (!elf64_alpha_read_ecoff_info (abfd, msec, &fi->d)) + { + msec->flags = origflags; + return FALSE; + } - /* Smash the existing GOT relocation for its 16-bit immediate pair. */ - switch (r_type) - { - case R_ALPHA_LITERAL: - r_type = R_ALPHA_GPREL16; - break; - case R_ALPHA_GOTDTPREL: - r_type = R_ALPHA_DTPREL16; - break; - case R_ALPHA_GOTTPREL: - r_type = R_ALPHA_TPREL16; - break; - default: - BFD_ASSERT (0); - return FALSE; - } + /* Swap in the FDR information. */ + amt = fi->d.symbolic_header.ifdMax * sizeof (struct fdr); + fi->d.fdr = (struct fdr *) bfd_alloc (abfd, amt); + if (fi->d.fdr == NULL) + { + msec->flags = origflags; + return FALSE; + } + external_fdr_size = swap->external_fdr_size; + fdr_ptr = fi->d.fdr; + fraw_src = (char *) fi->d.external_fdr; + fraw_end = (fraw_src + + fi->d.symbolic_header.ifdMax * external_fdr_size); + for (; fraw_src < fraw_end; fraw_src += external_fdr_size, fdr_ptr++) + (*swap->swap_fdr_in) (abfd, (PTR) fraw_src, fdr_ptr); - irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), r_type); - info->changed_relocs = TRUE; + elf_tdata (abfd)->find_line_info = fi; - /* ??? Search forward through this basic block looking for insns - that use the target register. Stop after an insn modifying the - register is seen, or after a branch or call. + /* Note that we don't bother to ever free this information. + find_nearest_line is either called all the time, as in + objdump -l, so the information should be saved, or it is + rarely called, as in ld error messages, so the memory + wasted is unimportant. Still, it would probably be a + good idea for free_cached_info to throw it away. */ + } - Any such memory load insn may be substituted by a load directly - off the GP. This allows the memory load insn to be issued before - the calculated GP register would otherwise be ready. + if (_bfd_ecoff_locate_line (abfd, section, offset, &fi->d, swap, + &fi->i, filename_ptr, functionname_ptr, + line_ptr)) + { + msec->flags = origflags; + return TRUE; + } - Any such jsr insn can be replaced by a bsr if it is in range. + msec->flags = origflags; + } - This would mean that we'd have to _add_ relocations, the pain of - which gives one pause. */ + /* Fall back on the generic ELF find_nearest_line routine. */ - return TRUE; + return _bfd_elf_find_nearest_line (abfd, section, symbols, offset, + filename_ptr, functionname_ptr, + line_ptr); } + +/* Structure used to pass information to alpha_elf_output_extsym. */ -static bfd_boolean -elf64_alpha_relax_gprelhilo (info, symval, irel, hi) - struct alpha_relax_info *info; - bfd_vma symval; - Elf_Internal_Rela *irel; - bfd_boolean hi; +struct extsym_info { - unsigned int insn; - bfd_signed_vma disp; - bfd_byte *pos = info->contents + irel->r_offset; - - /* ??? This assumes that the compiler doesn't render - - array[i] - as - ldah t, array(gp) !gprelhigh - s8addl i, t, t - ldq r, array(t) !gprellow - - which would indeed be the most efficient way to implement this. */ - - return TRUE; - - disp = symval - info->gp; - if (disp < -0x8000 || disp >= 0x8000) - return TRUE; - - if (hi) - { - /* Nop out the high instruction. */ - - bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, pos); - info->changed_contents = TRUE; - - irel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); - irel->r_addend = 0; - info->changed_relocs = TRUE; - } - else - { - /* Adjust the low instruction to reference GP directly. */ - - insn = bfd_get_32 (info->abfd, pos); - insn = (insn & 0xffe00000) | (29 << 16); - bfd_put_32 (info->abfd, (bfd_vma) insn, pos); - info->changed_contents = TRUE; - - irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), - R_ALPHA_GPREL16); - info->changed_relocs = TRUE; - } - - return TRUE; -} + bfd *abfd; + struct bfd_link_info *info; + struct ecoff_debug_info *debug; + const struct ecoff_debug_swap *swap; + bfd_boolean failed; +}; static bfd_boolean -elf64_alpha_relax_tls_get_addr (info, symval, irel, is_gd) - struct alpha_relax_info *info; - bfd_vma symval; - Elf_Internal_Rela *irel; - bfd_boolean is_gd; +elf64_alpha_output_extsym (struct alpha_elf_link_hash_entry *h, PTR data) { - bfd_byte *pos[5]; - unsigned int insn; - Elf_Internal_Rela *gpdisp, *hint; - bfd_boolean dynamic, use_gottprel, pos1_unusable; - unsigned long new_symndx; - - dynamic = alpha_elf_dynamic_symbol_p (&info->h->root, info->link_info); - - /* If a TLS symbol is accessed using IE at least once, there is no point - to use dynamic model for it. */ - if (is_gd && info->h && (info->h->flags & ALPHA_ELF_LINK_HASH_TLS_IE)) - ; - - /* If the symbol is local, and we've already committed to DF_STATIC_TLS, - then we might as well relax to IE. */ - else if (info->link_info->shared && !dynamic - && (info->link_info->flags & DF_STATIC_TLS)) - ; - - /* Otherwise we must be building an executable to do anything. */ - else if (info->link_info->shared) - return TRUE; - - /* The TLSGD/TLSLDM relocation must be followed by a LITERAL and - the matching LITUSE_TLS relocations. */ - if (irel + 2 >= info->relend) - return TRUE; - if (ELF64_R_TYPE (irel[1].r_info) != R_ALPHA_LITERAL - || ELF64_R_TYPE (irel[2].r_info) != R_ALPHA_LITUSE - || irel[2].r_addend != (is_gd ? LITUSE_ALPHA_TLSGD : LITUSE_ALPHA_TLSLDM)) - return TRUE; + struct extsym_info *einfo = (struct extsym_info *) data; + bfd_boolean strip; + asection *sec, *output_section; - /* There must be a GPDISP relocation positioned immediately after the - LITUSE relocation. */ - gpdisp = elf64_alpha_find_reloc_at_ofs (info->relocs, info->relend, - irel[2].r_offset + 4, R_ALPHA_GPDISP); - if (!gpdisp) - return TRUE; + if (h->root.root.type == bfd_link_hash_warning) + h = (struct alpha_elf_link_hash_entry *) h->root.root.u.i.link; - pos[0] = info->contents + irel[0].r_offset; - pos[1] = info->contents + irel[1].r_offset; - pos[2] = info->contents + irel[2].r_offset; - pos[3] = info->contents + gpdisp->r_offset; - pos[4] = pos[3] + gpdisp->r_addend; - pos1_unusable = FALSE; + if (h->root.indx == -2) + strip = FALSE; + else if ((h->root.def_dynamic + || h->root.ref_dynamic + || h->root.root.type == bfd_link_hash_new) + && !h->root.def_regular + && !h->root.ref_regular) + strip = TRUE; + else if (einfo->info->strip == strip_all + || (einfo->info->strip == strip_some + && bfd_hash_lookup (einfo->info->keep_hash, + h->root.root.root.string, + FALSE, FALSE) == NULL)) + strip = TRUE; + else + strip = FALSE; - /* Generally, the positions are not allowed to be out of order, lest the - modified insn sequence have different register lifetimes. We can make - an exception when pos 1 is adjacent to pos 0. */ - if (pos[1] + 4 == pos[0]) - { - bfd_byte *tmp = pos[0]; - pos[0] = pos[1]; - pos[1] = tmp; - } - else if (pos[1] < pos[0]) - pos1_unusable = TRUE; - if (pos[1] >= pos[2] || pos[2] >= pos[3]) + if (strip) return TRUE; - /* Reduce the use count on the LITERAL relocation. Do this before we - smash the symndx when we adjust the relocations below. */ - { - struct alpha_elf_got_entry *lit_gotent; - struct alpha_elf_link_hash_entry *lit_h; - unsigned long indx; - - BFD_ASSERT (ELF64_R_SYM (irel[1].r_info) >= info->symtab_hdr->sh_info); - indx = ELF64_R_SYM (irel[1].r_info) - info->symtab_hdr->sh_info; - lit_h = alpha_elf_sym_hashes (info->abfd)[indx]; - - while (lit_h->root.root.type == bfd_link_hash_indirect - || lit_h->root.root.type == bfd_link_hash_warning) - lit_h = (struct alpha_elf_link_hash_entry *) lit_h->root.root.u.i.link; - - for (lit_gotent = lit_h->got_entries; lit_gotent ; - lit_gotent = lit_gotent->next) - if (lit_gotent->gotobj == info->gotobj - && lit_gotent->reloc_type == R_ALPHA_LITERAL - && lit_gotent->addend == irel[1].r_addend) - break; - BFD_ASSERT (lit_gotent); - - if (--lit_gotent->use_count == 0) - { - int sz = alpha_got_entry_size (R_ALPHA_LITERAL); - alpha_elf_tdata (info->gotobj)->total_got_size -= sz; - } - } - - /* Change - - lda $16,x($gp) !tlsgd!1 - ldq $27,__tls_get_addr($gp) !literal!1 - jsr $26,($27)__tls_get_addr !lituse_tlsgd!1 - ldah $29,0($26) !gpdisp!2 - lda $29,0($29) !gpdisp!2 - to - ldq $16,x($gp) !gottprel - unop - call_pal rduniq - addq $16,$0,$0 - unop - or the first pair to - lda $16,x($gp) !tprel - unop - or - ldah $16,x($gp) !tprelhi - lda $16,x($16) !tprello - - as appropriate. */ - - use_gottprel = FALSE; - new_symndx = is_gd ? ELF64_R_SYM (irel->r_info) : 0; - switch (!dynamic && !info->link_info->shared) + if (h->esym.ifd == -2) { - case 1: - { - bfd_vma tp_base; - bfd_signed_vma disp; - - BFD_ASSERT (elf_hash_table (info->link_info)->tls_sec != NULL); - tp_base = alpha_get_tprel_base (info->link_info); - disp = symval - tp_base; - - if (disp >= -0x8000 && disp < 0x8000) - { - insn = (OP_LDA << 26) | (16 << 21) | (31 << 16); - bfd_put_32 (info->abfd, (bfd_vma) insn, pos[0]); - bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, pos[1]); - - irel[0].r_offset = pos[0] - info->contents; - irel[0].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_TPREL16); - irel[1].r_info = ELF64_R_INFO (0, R_ALPHA_NONE); - break; - } - else if (disp >= -(bfd_signed_vma) 0x80000000 - && disp < (bfd_signed_vma) 0x7fff8000 - && !pos1_unusable) - { - insn = (OP_LDAH << 26) | (16 << 21) | (31 << 16); - bfd_put_32 (info->abfd, (bfd_vma) insn, pos[0]); - insn = (OP_LDA << 26) | (16 << 21) | (16 << 16); - bfd_put_32 (info->abfd, (bfd_vma) insn, pos[1]); - - irel[0].r_offset = pos[0] - info->contents; - irel[0].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_TPRELHI); - irel[1].r_offset = pos[1] - info->contents; - irel[1].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_TPRELLO); - break; - } - } - /* FALLTHRU */ - - default: - use_gottprel = TRUE; - - insn = (OP_LDQ << 26) | (16 << 21) | (29 << 16); - bfd_put_32 (info->abfd, (bfd_vma) insn, pos[0]); - bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, pos[1]); - - irel[0].r_offset = pos[0] - info->contents; - irel[0].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_GOTTPREL); - irel[1].r_info = ELF64_R_INFO (0, R_ALPHA_NONE); - break; - } - - bfd_put_32 (info->abfd, (bfd_vma) INSN_RDUNIQ, pos[2]); - - insn = INSN_ADDQ | (16 << 21) | (0 << 16) | (0 << 0); - bfd_put_32 (info->abfd, (bfd_vma) insn, pos[3]); + h->esym.jmptbl = 0; + h->esym.cobol_main = 0; + h->esym.weakext = 0; + h->esym.reserved = 0; + h->esym.ifd = ifdNil; + h->esym.asym.value = 0; + h->esym.asym.st = stGlobal; - bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, pos[4]); + if (h->root.root.type != bfd_link_hash_defined + && h->root.root.type != bfd_link_hash_defweak) + h->esym.asym.sc = scAbs; + else + { + const char *name; - irel[2].r_info = ELF64_R_INFO (0, R_ALPHA_NONE); - gpdisp->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); + sec = h->root.root.u.def.section; + output_section = sec->output_section; - hint = elf64_alpha_find_reloc_at_ofs (info->relocs, info->relend, - irel[2].r_offset, R_ALPHA_HINT); - if (hint) - hint->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); + /* When making a shared library and symbol h is the one from + the another shared library, OUTPUT_SECTION may be null. */ + if (output_section == NULL) + h->esym.asym.sc = scUndefined; + else + { + name = bfd_section_name (output_section->owner, output_section); - info->changed_contents = TRUE; - info->changed_relocs = TRUE; + if (strcmp (name, ".text") == 0) + h->esym.asym.sc = scText; + else if (strcmp (name, ".data") == 0) + h->esym.asym.sc = scData; + else if (strcmp (name, ".sdata") == 0) + h->esym.asym.sc = scSData; + else if (strcmp (name, ".rodata") == 0 + || strcmp (name, ".rdata") == 0) + h->esym.asym.sc = scRData; + else if (strcmp (name, ".bss") == 0) + h->esym.asym.sc = scBss; + else if (strcmp (name, ".sbss") == 0) + h->esym.asym.sc = scSBss; + else if (strcmp (name, ".init") == 0) + h->esym.asym.sc = scInit; + else if (strcmp (name, ".fini") == 0) + h->esym.asym.sc = scFini; + else + h->esym.asym.sc = scAbs; + } + } - /* Reduce the use count on the TLSGD/TLSLDM relocation. */ - if (--info->gotent->use_count == 0) - { - int sz = alpha_got_entry_size (info->gotent->reloc_type); - alpha_elf_tdata (info->gotobj)->total_got_size -= sz; - if (!info->h) - alpha_elf_tdata (info->gotobj)->local_got_size -= sz; + h->esym.asym.reserved = 0; + h->esym.asym.index = indexNil; } - /* If we've switched to a GOTTPREL relocation, increment the reference - count on that got entry. */ - if (use_gottprel) + if (h->root.root.type == bfd_link_hash_common) + h->esym.asym.value = h->root.root.u.c.size; + else if (h->root.root.type == bfd_link_hash_defined + || h->root.root.type == bfd_link_hash_defweak) { - struct alpha_elf_got_entry *tprel_gotent; + if (h->esym.asym.sc == scCommon) + h->esym.asym.sc = scBss; + else if (h->esym.asym.sc == scSCommon) + h->esym.asym.sc = scSBss; - for (tprel_gotent = *info->first_gotent; tprel_gotent ; - tprel_gotent = tprel_gotent->next) - if (tprel_gotent->gotobj == info->gotobj - && tprel_gotent->reloc_type == R_ALPHA_GOTTPREL - && tprel_gotent->addend == irel->r_addend) - break; - if (tprel_gotent) - tprel_gotent->use_count++; + sec = h->root.root.u.def.section; + output_section = sec->output_section; + if (output_section != NULL) + h->esym.asym.value = (h->root.root.u.def.value + + sec->output_offset + + output_section->vma); else - { - if (info->gotent->use_count == 0) - tprel_gotent = info->gotent; - else - { - tprel_gotent = (struct alpha_elf_got_entry *) - bfd_alloc (info->abfd, sizeof (struct alpha_elf_got_entry)); - if (!tprel_gotent) - return FALSE; - - tprel_gotent->next = *info->first_gotent; - *info->first_gotent = tprel_gotent; - - tprel_gotent->gotobj = info->gotobj; - tprel_gotent->addend = irel->r_addend; - tprel_gotent->got_offset = -1; - tprel_gotent->reloc_done = 0; - tprel_gotent->reloc_xlated = 0; - } + h->esym.asym.value = 0; + } - tprel_gotent->use_count = 1; - tprel_gotent->reloc_type = R_ALPHA_GOTTPREL; - } + if (! bfd_ecoff_debug_one_external (einfo->abfd, einfo->debug, einfo->swap, + h->root.root.root.string, + &h->esym)) + { + einfo->failed = TRUE; + return FALSE; } return TRUE; } + +/* Search for and possibly create a got entry. */ -static bfd_boolean -elf64_alpha_relax_section (abfd, sec, link_info, again) - bfd *abfd; - asection *sec; - struct bfd_link_info *link_info; - bfd_boolean *again; +static struct alpha_elf_got_entry * +get_got_entry (bfd *abfd, struct alpha_elf_link_hash_entry *h, + unsigned long r_type, unsigned long r_symndx, + bfd_vma r_addend) { - Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Rela *internal_relocs; - Elf_Internal_Rela *irel, *irelend; - Elf_Internal_Sym *isymbuf = NULL; - struct alpha_elf_got_entry **local_got_entries; - struct alpha_relax_info info; + struct alpha_elf_got_entry *gotent; + struct alpha_elf_got_entry **slot; - /* We are not currently changing any sizes, so only one pass. */ - *again = FALSE; + if (h) + slot = &h->got_entries; + else + { + /* This is a local .got entry -- record for merge. */ - if (link_info->relocatable - || (sec->flags & SEC_RELOC) == 0 - || sec->reloc_count == 0) - return TRUE; + struct alpha_elf_got_entry **local_got_entries; - symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - local_got_entries = alpha_elf_tdata(abfd)->local_got_entries; + local_got_entries = alpha_elf_tdata(abfd)->local_got_entries; + if (!local_got_entries) + { + bfd_size_type size; + Elf_Internal_Shdr *symtab_hdr; - /* Load the relocations for this section. */ - internal_relocs = (_bfd_elf_link_read_relocs - (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, - link_info->keep_memory)); - if (internal_relocs == NULL) - return FALSE; + symtab_hdr = &elf_tdata(abfd)->symtab_hdr; + size = symtab_hdr->sh_info; + size *= sizeof (struct alpha_elf_got_entry *); - memset(&info, 0, sizeof (info)); - info.abfd = abfd; - info.sec = sec; - info.link_info = link_info; - info.symtab_hdr = symtab_hdr; - info.relocs = internal_relocs; - info.relend = irelend = internal_relocs + sec->reloc_count; + local_got_entries + = (struct alpha_elf_got_entry **) bfd_zalloc (abfd, size); + if (!local_got_entries) + return NULL; - /* Find the GP for this object. Do not store the result back via - _bfd_set_gp_value, since this could change again before final. */ - info.gotobj = alpha_elf_tdata (abfd)->gotobj; - if (info.gotobj) - { - asection *sgot = alpha_elf_tdata (info.gotobj)->got; - info.gp = (sgot->output_section->vma - + sgot->output_offset - + 0x8000); + alpha_elf_tdata (abfd)->local_got_entries = local_got_entries; + } + + slot = &local_got_entries[r_symndx]; } - /* Get the section contents. */ - if (elf_section_data (sec)->this_hdr.contents != NULL) - info.contents = elf_section_data (sec)->this_hdr.contents; - else + for (gotent = *slot; gotent ; gotent = gotent->next) + if (gotent->gotobj == abfd + && gotent->reloc_type == r_type + && gotent->addend == r_addend) + break; + + if (!gotent) { - if (!bfd_malloc_and_get_section (abfd, sec, &info.contents)) - goto error_return; + int entry_size; + bfd_size_type amt; + + amt = sizeof (struct alpha_elf_got_entry); + gotent = (struct alpha_elf_got_entry *) bfd_alloc (abfd, amt); + if (!gotent) + return NULL; + + gotent->gotobj = abfd; + gotent->addend = r_addend; + gotent->got_offset = -1; + gotent->plt_offset = -1; + gotent->use_count = 1; + gotent->reloc_type = r_type; + gotent->reloc_done = 0; + gotent->reloc_xlated = 0; + + gotent->next = *slot; + *slot = gotent; + + entry_size = alpha_got_entry_size (r_type); + alpha_elf_tdata (abfd)->total_got_size += entry_size; + if (!h) + alpha_elf_tdata(abfd)->local_got_size += entry_size; } + else + gotent->use_count += 1; - for (irel = internal_relocs; irel < irelend; irel++) - { - bfd_vma symval; - struct alpha_elf_got_entry *gotent; - unsigned long r_type = ELF64_R_TYPE (irel->r_info); - unsigned long r_symndx = ELF64_R_SYM (irel->r_info); + return gotent; +} - /* Early exit for unhandled or unrelaxable relocations. */ - switch (r_type) - { - case R_ALPHA_LITERAL: - case R_ALPHA_GPRELHIGH: - case R_ALPHA_GPRELLOW: - case R_ALPHA_GOTDTPREL: - case R_ALPHA_GOTTPREL: - case R_ALPHA_TLSGD: - break; +static bfd_boolean +elf64_alpha_want_plt (struct alpha_elf_link_hash_entry *ah) +{ + return ((ah->root.type == STT_FUNC + || ah->root.root.type == bfd_link_hash_undefweak + || ah->root.root.type == bfd_link_hash_undefined) + && (ah->flags & ALPHA_ELF_LINK_HASH_LU_PLT) != 0 + && (ah->flags & ~ALPHA_ELF_LINK_HASH_LU_PLT) == 0); +} - case R_ALPHA_TLSLDM: - /* The symbol for a TLSLDM reloc is ignored. Collapse the - reloc to the 0 symbol so that they all match. */ - r_symndx = 0; - break; +/* Handle dynamic relocations when doing an Alpha ELF link. */ - default: - continue; - } +static bfd_boolean +elf64_alpha_check_relocs (bfd *abfd, struct bfd_link_info *info, + asection *sec, const Elf_Internal_Rela *relocs) +{ + bfd *dynobj; + asection *sreloc; + const char *rel_sec_name; + Elf_Internal_Shdr *symtab_hdr; + struct alpha_elf_link_hash_entry **sym_hashes; + const Elf_Internal_Rela *rel, *relend; + bfd_boolean got_created; + bfd_size_type amt; - /* Get the value of the symbol referred to by the reloc. */ - if (r_symndx < symtab_hdr->sh_info) - { - /* A local symbol. */ - Elf_Internal_Sym *isym; + if (info->relocatable) + return TRUE; - /* Read this BFD's local symbols. */ - if (isymbuf == NULL) - { - isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; - if (isymbuf == NULL) - isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, - symtab_hdr->sh_info, 0, - NULL, NULL, NULL); - if (isymbuf == NULL) - goto error_return; - } + /* Don't do anything special with non-loaded, non-alloced sections. + In particular, any relocs in such sections should not affect GOT + and PLT reference counting (ie. we don't allow them to create GOT + or PLT entries), there's no possibility or desire to optimize TLS + relocs, and there's not much point in propagating relocs to shared + libs that the dynamic linker won't relocate. */ + if ((sec->flags & SEC_ALLOC) == 0) + return TRUE; - isym = isymbuf + r_symndx; + dynobj = elf_hash_table(info)->dynobj; + if (dynobj == NULL) + elf_hash_table(info)->dynobj = dynobj = abfd; - /* Given the symbol for a TLSLDM reloc is ignored, this also - means forcing the symbol value to the tp base. */ - if (r_type == R_ALPHA_TLSLDM) - { - info.tsec = bfd_abs_section_ptr; - symval = alpha_get_tprel_base (info.link_info); - } - else - { - symval = isym->st_value; - if (isym->st_shndx == SHN_UNDEF) - continue; - else if (isym->st_shndx == SHN_ABS) - info.tsec = bfd_abs_section_ptr; - else if (isym->st_shndx == SHN_COMMON) - info.tsec = bfd_com_section_ptr; - else - info.tsec = bfd_section_from_elf_index (abfd, isym->st_shndx); - } + sreloc = NULL; + rel_sec_name = NULL; + symtab_hdr = &elf_tdata(abfd)->symtab_hdr; + sym_hashes = alpha_elf_sym_hashes(abfd); + got_created = FALSE; + + relend = relocs + sec->reloc_count; + for (rel = relocs; rel < relend; ++rel) + { + enum { + NEED_GOT = 1, + NEED_GOT_ENTRY = 2, + NEED_DYNREL = 4 + }; - info.h = NULL; - info.other = isym->st_other; - if (local_got_entries) - info.first_gotent = &local_got_entries[r_symndx]; - else - { - info.first_gotent = &info.gotent; - info.gotent = NULL; - } - } + unsigned long r_symndx, r_type; + struct alpha_elf_link_hash_entry *h; + unsigned int gotent_flags; + bfd_boolean maybe_dynamic; + unsigned int need; + bfd_vma addend; + + r_symndx = ELF64_R_SYM (rel->r_info); + if (r_symndx < symtab_hdr->sh_info) + h = NULL; else { - unsigned long indx; - struct alpha_elf_link_hash_entry *h; - - indx = r_symndx - symtab_hdr->sh_info; - h = alpha_elf_sym_hashes (abfd)[indx]; - BFD_ASSERT (h != NULL); + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; while (h->root.root.type == bfd_link_hash_indirect || h->root.root.type == bfd_link_hash_warning) h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link; - /* If the symbol is undefined, we can't do anything with it. */ - if (h->root.root.type == bfd_link_hash_undefweak - || h->root.root.type == bfd_link_hash_undefined) - continue; - - /* If the symbol isn't defined in the current module, again - we can't do anything. */ - if (!h->root.def_regular) - { - /* Except for TLSGD relocs, which can sometimes be - relaxed to GOTTPREL relocs. */ - if (r_type != R_ALPHA_TLSGD) - continue; - info.tsec = bfd_abs_section_ptr; - symval = 0; - } - else - { - info.tsec = h->root.root.u.def.section; - symval = h->root.root.u.def.value; - } - - info.h = h; - info.other = h->root.other; - info.first_gotent = &h->got_entries; + h->root.ref_regular = 1; } - /* Search for the got entry to be used by this relocation. */ - for (gotent = *info.first_gotent; gotent ; gotent = gotent->next) - if (gotent->gotobj == info.gotobj - && gotent->reloc_type == r_type - && gotent->addend == irel->r_addend) - break; - info.gotent = gotent; + /* We can only get preliminary data on whether a symbol is + locally or externally defined, as not all of the input files + have yet been processed. Do something with what we know, as + this may help reduce memory usage and processing time later. */ + maybe_dynamic = FALSE; + if (h && ((info->shared + && (!info->symbolic + || info->unresolved_syms_in_shared_libs == RM_IGNORE)) + || !h->root.def_regular + || h->root.root.type == bfd_link_hash_defweak)) + maybe_dynamic = TRUE; - symval += info.tsec->output_section->vma + info.tsec->output_offset; - symval += irel->r_addend; + need = 0; + gotent_flags = 0; + r_type = ELF64_R_TYPE (rel->r_info); + addend = rel->r_addend; switch (r_type) { case R_ALPHA_LITERAL: - BFD_ASSERT(info.gotent != NULL); + need = NEED_GOT | NEED_GOT_ENTRY; - /* If there exist LITUSE relocations immediately following, this - opens up all sorts of interesting optimizations, because we - now know every location that this address load is used. */ - if (irel+1 < irelend - && ELF64_R_TYPE (irel[1].r_info) == R_ALPHA_LITUSE) - { - if (!elf64_alpha_relax_with_lituse (&info, symval, irel)) - goto error_return; - } - else - { - if (!elf64_alpha_relax_got_load (&info, symval, irel, r_type)) - goto error_return; - } + /* Remember how this literal is used from its LITUSEs. + This will be important when it comes to decide if we can + create a .plt entry for a function symbol. */ + while (++rel < relend && ELF64_R_TYPE (rel->r_info) == R_ALPHA_LITUSE) + if (rel->r_addend >= 1 && rel->r_addend <= 6) + gotent_flags |= 1 << rel->r_addend; + --rel; + + /* No LITUSEs -- presumably the address is used somehow. */ + if (gotent_flags == 0) + gotent_flags = ALPHA_ELF_LINK_HASH_LU_ADDR; break; + case R_ALPHA_GPDISP: + case R_ALPHA_GPREL16: + case R_ALPHA_GPREL32: case R_ALPHA_GPRELHIGH: case R_ALPHA_GPRELLOW: - if (!elf64_alpha_relax_gprelhilo (&info, symval, irel, - r_type == R_ALPHA_GPRELHIGH)) - goto error_return; + case R_ALPHA_BRSGP: + need = NEED_GOT; break; - case R_ALPHA_GOTDTPREL: - case R_ALPHA_GOTTPREL: - BFD_ASSERT(info.gotent != NULL); - if (!elf64_alpha_relax_got_load (&info, symval, irel, r_type)) - goto error_return; + case R_ALPHA_REFLONG: + case R_ALPHA_REFQUAD: + if (info->shared || maybe_dynamic) + need = NEED_DYNREL; break; - case R_ALPHA_TLSGD: case R_ALPHA_TLSLDM: - BFD_ASSERT(info.gotent != NULL); - if (!elf64_alpha_relax_tls_get_addr (&info, symval, irel, - r_type == R_ALPHA_TLSGD)) - goto error_return; + /* The symbol for a TLSLDM reloc is ignored. Collapse the + reloc to the 0 symbol so that they all match. */ + r_symndx = 0; + h = 0; + maybe_dynamic = FALSE; + /* FALLTHRU */ + + case R_ALPHA_TLSGD: + case R_ALPHA_GOTDTPREL: + need = NEED_GOT | NEED_GOT_ENTRY; break; - } - } - if (!elf64_alpha_size_plt_section (link_info)) - return FALSE; - if (!elf64_alpha_size_got_sections (link_info)) - return FALSE; - if (!elf64_alpha_size_rela_got_section (link_info)) - return FALSE; + case R_ALPHA_GOTTPREL: + need = NEED_GOT | NEED_GOT_ENTRY; + gotent_flags = ALPHA_ELF_LINK_HASH_TLS_IE; + if (info->shared) + info->flags |= DF_STATIC_TLS; + break; - if (isymbuf != NULL - && symtab_hdr->contents != (unsigned char *) isymbuf) - { - if (!link_info->keep_memory) - free (isymbuf); - else - { - /* Cache the symbols for elf_link_input_bfd. */ - symtab_hdr->contents = (unsigned char *) isymbuf; + case R_ALPHA_TPREL64: + if (info->shared || maybe_dynamic) + need = NEED_DYNREL; + if (info->shared) + info->flags |= DF_STATIC_TLS; + break; } - } - if (info.contents != NULL - && elf_section_data (sec)->this_hdr.contents != info.contents) - { - if (!info.changed_contents && !link_info->keep_memory) - free (info.contents); - else + if (need & NEED_GOT) { - /* Cache the section contents for elf_link_input_bfd. */ - elf_section_data (sec)->this_hdr.contents = info.contents; - } - } - - if (elf_section_data (sec)->relocs != internal_relocs) - { - if (!info.changed_relocs) - free (internal_relocs); - else - elf_section_data (sec)->relocs = internal_relocs; - } - - *again = info.changed_contents || info.changed_relocs; + if (!got_created) + { + if (!elf64_alpha_create_got_section (abfd, info)) + return FALSE; - return TRUE; + /* Make sure the object's gotobj is set to itself so + that we default to every object with its own .got. + We'll merge .gots later once we've collected each + object's info. */ + alpha_elf_tdata(abfd)->gotobj = abfd; - error_return: - if (isymbuf != NULL - && symtab_hdr->contents != (unsigned char *) isymbuf) - free (isymbuf); - if (info.contents != NULL - && elf_section_data (sec)->this_hdr.contents != info.contents) - free (info.contents); - if (internal_relocs != NULL - && elf_section_data (sec)->relocs != internal_relocs) - free (internal_relocs); - return FALSE; -} - -/* PLT/GOT Stuff */ -#define PLT_HEADER_SIZE 32 -#define PLT_HEADER_WORD1 (bfd_vma) 0xc3600000 /* br $27,.+4 */ -#define PLT_HEADER_WORD2 (bfd_vma) 0xa77b000c /* ldq $27,12($27) */ -#define PLT_HEADER_WORD3 (bfd_vma) 0x47ff041f /* nop */ -#define PLT_HEADER_WORD4 (bfd_vma) 0x6b7b0000 /* jmp $27,($27) */ - -#define PLT_ENTRY_SIZE 12 -#define PLT_ENTRY_WORD1 0xc3800000 /* br $28, plt0 */ -#define PLT_ENTRY_WORD2 0 -#define PLT_ENTRY_WORD3 0 + got_created = 1; + } + } -#define MAX_GOT_SIZE (64*1024) + if (need & NEED_GOT_ENTRY) + { + struct alpha_elf_got_entry *gotent; -#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so" - -/* Handle an Alpha specific section when reading an object file. This - is called when bfd_section_from_shdr finds a section with an unknown - type. - FIXME: We need to handle the SHF_ALPHA_GPREL flag, but I'm not sure - how to. */ + gotent = get_got_entry (abfd, h, r_type, r_symndx, addend); + if (!gotent) + return FALSE; -static bfd_boolean -elf64_alpha_section_from_shdr (bfd *abfd, - Elf_Internal_Shdr *hdr, - const char *name, - int shindex) -{ - asection *newsect; + if (gotent_flags) + { + gotent->flags |= gotent_flags; + if (h) + { + gotent_flags |= h->flags; + h->flags = gotent_flags; - /* There ought to be a place to keep ELF backend specific flags, but - at the moment there isn't one. We just keep track of the - sections by their name, instead. Fortunately, the ABI gives - suggested names for all the MIPS specific sections, so we will - probably get away with this. */ - switch (hdr->sh_type) - { - case SHT_ALPHA_DEBUG: - if (strcmp (name, ".mdebug") != 0) - return FALSE; - break; - default: - return FALSE; - } + /* Make a guess as to whether a .plt entry is needed. */ + /* ??? It appears that we won't make it into + adjust_dynamic_symbol for symbols that remain + totally undefined. Copying this check here means + we can create a plt entry for them too. */ + h->root.needs_plt + = (maybe_dynamic && elf64_alpha_want_plt (h)); + } + } + } - if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex)) - return FALSE; - newsect = hdr->bfd_section; + if (need & NEED_DYNREL) + { + if (rel_sec_name == NULL) + { + rel_sec_name = (bfd_elf_string_from_elf_section + (abfd, elf_elfheader(abfd)->e_shstrndx, + elf_section_data(sec)->rel_hdr.sh_name)); + if (rel_sec_name == NULL) + return FALSE; - if (hdr->sh_type == SHT_ALPHA_DEBUG) - { - if (! bfd_set_section_flags (abfd, newsect, - (bfd_get_section_flags (abfd, newsect) - | SEC_DEBUGGING))) - return FALSE; - } + BFD_ASSERT (strncmp (rel_sec_name, ".rela", 5) == 0 + && strcmp (bfd_get_section_name (abfd, sec), + rel_sec_name+5) == 0); + } - return TRUE; -} + /* We need to create the section here now whether we eventually + use it or not so that it gets mapped to an output section by + the linker. If not used, we'll kill it in + size_dynamic_sections. */ + if (sreloc == NULL) + { + sreloc = bfd_get_section_by_name (dynobj, rel_sec_name); + if (sreloc == NULL) + { + flagword flags; -/* Convert Alpha specific section flags to bfd internal section flags. */ + flags = (SEC_HAS_CONTENTS | SEC_IN_MEMORY + | SEC_LINKER_CREATED | SEC_READONLY); + if (sec->flags & SEC_ALLOC) + flags |= SEC_ALLOC | SEC_LOAD; + sreloc = bfd_make_section_with_flags (dynobj, + rel_sec_name, + flags); + if (sreloc == NULL + || !bfd_set_section_alignment (dynobj, sreloc, 3)) + return FALSE; + } + } -static bfd_boolean -elf64_alpha_section_flags (flags, hdr) - flagword *flags; - const Elf_Internal_Shdr *hdr; -{ - if (hdr->sh_flags & SHF_ALPHA_GPREL) - *flags |= SEC_SMALL_DATA; + if (h) + { + /* Since we havn't seen all of the input symbols yet, we + don't know whether we'll actually need a dynamic relocation + entry for this reloc. So make a record of it. Once we + find out if this thing needs dynamic relocation we'll + expand the relocation sections by the appropriate amount. */ - return TRUE; -} + struct alpha_elf_reloc_entry *rent; -/* Set the correct type for an Alpha ELF section. We do this by the - section name, which is a hack, but ought to work. */ + for (rent = h->reloc_entries; rent; rent = rent->next) + if (rent->rtype == r_type && rent->srel == sreloc) + break; -static bfd_boolean -elf64_alpha_fake_sections (abfd, hdr, sec) - bfd *abfd; - Elf_Internal_Shdr *hdr; - asection *sec; -{ - register const char *name; + if (!rent) + { + amt = sizeof (struct alpha_elf_reloc_entry); + rent = (struct alpha_elf_reloc_entry *) bfd_alloc (abfd, amt); + if (!rent) + return FALSE; - name = bfd_get_section_name (abfd, sec); + rent->srel = sreloc; + rent->rtype = r_type; + rent->count = 1; + rent->reltext = (sec->flags & SEC_READONLY) != 0; - if (strcmp (name, ".mdebug") == 0) - { - hdr->sh_type = SHT_ALPHA_DEBUG; - /* In a shared object on Irix 5.3, the .mdebug section has an - entsize of 0. FIXME: Does this matter? */ - if ((abfd->flags & DYNAMIC) != 0 ) - hdr->sh_entsize = 0; - else - hdr->sh_entsize = 1; + rent->next = h->reloc_entries; + h->reloc_entries = rent; + } + else + rent->count++; + } + else if (info->shared) + { + /* If this is a shared library, and the section is to be + loaded into memory, we need a RELATIVE reloc. */ + sreloc->size += sizeof (Elf64_External_Rela); + if (sec->flags & SEC_READONLY) + info->flags |= DF_TEXTREL; + } + } } - else if ((sec->flags & SEC_SMALL_DATA) - || strcmp (name, ".sdata") == 0 - || strcmp (name, ".sbss") == 0 - || strcmp (name, ".lit4") == 0 - || strcmp (name, ".lit8") == 0) - hdr->sh_flags |= SHF_ALPHA_GPREL; return TRUE; } -/* Hook called by the linker routine which adds symbols from an object - file. We use it to put .comm items in .sbss, and not .bss. */ +/* Adjust a symbol defined by a dynamic object and referenced by a + regular object. The current definition is in some section of the + dynamic object, but we're not including those sections. We have to + change the definition to something the rest of the link can + understand. */ static bfd_boolean -elf64_alpha_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) - bfd *abfd; - struct bfd_link_info *info; - Elf_Internal_Sym *sym; - const char **namep ATTRIBUTE_UNUSED; - flagword *flagsp ATTRIBUTE_UNUSED; - asection **secp; - bfd_vma *valp; +elf64_alpha_adjust_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h) { - if (sym->st_shndx == SHN_COMMON - && !info->relocatable - && sym->st_size <= elf_gp_size (abfd)) + bfd *dynobj; + asection *s; + struct alpha_elf_link_hash_entry *ah; + + dynobj = elf_hash_table(info)->dynobj; + ah = (struct alpha_elf_link_hash_entry *)h; + + /* Now that we've seen all of the input symbols, finalize our decision + about whether this symbol should get a .plt entry. Irritatingly, it + is common for folk to leave undefined symbols in shared libraries, + and they still expect lazy binding; accept undefined symbols in lieu + of STT_FUNC. */ + if (alpha_elf_dynamic_symbol_p (h, info) && elf64_alpha_want_plt (ah)) { - /* Common symbols less than or equal to -G nn bytes are - automatically put into .sbss. */ + h->needs_plt = TRUE; - asection *scomm = bfd_get_section_by_name (abfd, ".scommon"); + s = bfd_get_section_by_name(dynobj, ".plt"); + if (!s && !elf64_alpha_create_dynamic_sections (dynobj, info)) + return FALSE; - if (scomm == NULL) - { - scomm = bfd_make_section_with_flags (abfd, ".scommon", - (SEC_ALLOC - | SEC_IS_COMMON - | SEC_LINKER_CREATED)); - if (scomm == NULL) - return FALSE; - } + /* We need one plt entry per got subsection. Delay allocation of + the actual plt entries until size_plt_section, called from + size_dynamic_sections or during relaxation. */ - *secp = scomm; - *valp = sym->st_size; + return TRUE; + } + else + h->needs_plt = FALSE; + + /* If this is a weak symbol, and there is a real definition, the + processor independent code will have arranged for us to see the + real definition first, and we can just use the same value. */ + if (h->u.weakdef != NULL) + { + BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined + || h->u.weakdef->root.type == bfd_link_hash_defweak); + h->root.u.def.section = h->u.weakdef->root.u.def.section; + h->root.u.def.value = h->u.weakdef->root.u.def.value; + return TRUE; } + /* This is a reference to a symbol defined by a dynamic object which + is not a function. The Alpha, since it uses .got entries for all + symbols even in regular objects, does not need the hackery of a + .dynbss section and COPY dynamic relocations. */ + return TRUE; } -/* Create the .got section. */ +/* Symbol versioning can create new symbols, and make our old symbols + indirect to the new ones. Consolidate the got and reloc information + in these situations. */ static bfd_boolean -elf64_alpha_create_got_section(abfd, info) - bfd *abfd; - struct bfd_link_info *info ATTRIBUTE_UNUSED; +elf64_alpha_merge_ind_symbols (struct alpha_elf_link_hash_entry *hi, + PTR dummy ATTRIBUTE_UNUSED) { - asection *s; + struct alpha_elf_link_hash_entry *hs; - if ((s = bfd_get_section_by_name (abfd, ".got"))) - { - /* Check for a non-linker created .got? */ - if (alpha_elf_tdata (abfd)->got == NULL) - alpha_elf_tdata (abfd)->got = s; - return TRUE; - } + if (hi->root.root.type != bfd_link_hash_indirect) + return TRUE; + hs = hi; + do { + hs = (struct alpha_elf_link_hash_entry *)hs->root.root.u.i.link; + } while (hs->root.root.type == bfd_link_hash_indirect); - s = bfd_make_section_with_flags (abfd, ".got", (SEC_ALLOC | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_LINKER_CREATED)); - if (s == NULL - || !bfd_set_section_alignment (abfd, s, 3)) - return FALSE; + /* Merge the flags. Whee. */ - alpha_elf_tdata (abfd)->got = s; + hs->flags |= hi->flags; - return TRUE; -} + /* Merge the .got entries. Cannibalize the old symbol's list in + doing so, since we don't need it anymore. */ -/* Create all the dynamic sections. */ + if (hs->got_entries == NULL) + hs->got_entries = hi->got_entries; + else + { + struct alpha_elf_got_entry *gi, *gs, *gin, *gsh; -static bfd_boolean -elf64_alpha_create_dynamic_sections (abfd, info) - bfd *abfd; - struct bfd_link_info *info; -{ - asection *s; - struct elf_link_hash_entry *h; - struct bfd_link_hash_entry *bh; + gsh = hs->got_entries; + for (gi = hi->got_entries; gi ; gi = gin) + { + gin = gi->next; + for (gs = gsh; gs ; gs = gs->next) + if (gi->gotobj == gs->gotobj + && gi->reloc_type == gs->reloc_type + && gi->addend == gs->addend) + { + gi->use_count += gs->use_count; + goto got_found; + } + gi->next = hs->got_entries; + hs->got_entries = gi; + got_found:; + } + } + hi->got_entries = NULL; - /* We need to create .plt, .rela.plt, .got, and .rela.got sections. */ + /* And similar for the reloc entries. */ - s = bfd_make_section_with_flags (abfd, ".plt", - (SEC_ALLOC | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_LINKER_CREATED - | SEC_CODE)); - if (s == NULL - || ! bfd_set_section_alignment (abfd, s, 3)) - return FALSE; + if (hs->reloc_entries == NULL) + hs->reloc_entries = hi->reloc_entries; + else + { + struct alpha_elf_reloc_entry *ri, *rs, *rin, *rsh; + + rsh = hs->reloc_entries; + for (ri = hi->reloc_entries; ri ; ri = rin) + { + rin = ri->next; + for (rs = rsh; rs ; rs = rs->next) + if (ri->rtype == rs->rtype && ri->srel == rs->srel) + { + rs->count += ri->count; + goto found_reloc; + } + ri->next = hs->reloc_entries; + hs->reloc_entries = ri; + found_reloc:; + } + } + hi->reloc_entries = NULL; - /* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the - .plt section. */ - bh = NULL; - if (! (_bfd_generic_link_add_one_symbol - (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s, - (bfd_vma) 0, (const char *) NULL, FALSE, - get_elf_backend_data (abfd)->collect, &bh))) - return FALSE; - h = (struct elf_link_hash_entry *) bh; - h->def_regular = 1; - h->type = STT_OBJECT; + return TRUE; +} - if (info->shared - && ! bfd_elf_link_record_dynamic_symbol (info, h)) - return FALSE; +/* Is it possible to merge two object file's .got tables? */ - s = bfd_make_section_with_flags (abfd, ".rela.plt", - (SEC_ALLOC | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_LINKER_CREATED - | SEC_READONLY)); - if (s == NULL - || ! bfd_set_section_alignment (abfd, s, 3)) - return FALSE; +static bfd_boolean +elf64_alpha_can_merge_gots (bfd *a, bfd *b) +{ + int total = alpha_elf_tdata (a)->total_got_size; + bfd *bsub; - /* We may or may not have created a .got section for this object, but - we definitely havn't done the rest of the work. */ + /* Trivial quick fallout test. */ + if (total + alpha_elf_tdata (b)->total_got_size <= MAX_GOT_SIZE) + return TRUE; - if (!elf64_alpha_create_got_section (abfd, info)) + /* By their nature, local .got entries cannot be merged. */ + if ((total += alpha_elf_tdata (b)->local_got_size) > MAX_GOT_SIZE) return FALSE; - s = bfd_make_section_with_flags (abfd, ".rela.got", - (SEC_ALLOC | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_LINKER_CREATED - | SEC_READONLY)); - if (s == NULL - || !bfd_set_section_alignment (abfd, s, 3)) - return FALSE; + /* Failing the common trivial comparison, we must effectively + perform the merge. Not actually performing the merge means that + we don't have to store undo information in case we fail. */ + for (bsub = b; bsub ; bsub = alpha_elf_tdata (bsub)->in_got_link_next) + { + struct alpha_elf_link_hash_entry **hashes = alpha_elf_sym_hashes (bsub); + Elf_Internal_Shdr *symtab_hdr = &elf_tdata (bsub)->symtab_hdr; + int i, n; - /* Define the symbol _GLOBAL_OFFSET_TABLE_ at the start of the - dynobj's .got section. We don't do this in the linker script - because we don't want to define the symbol if we are not creating - a global offset table. */ - bh = NULL; - if (!(_bfd_generic_link_add_one_symbol - (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, - alpha_elf_tdata(abfd)->got, (bfd_vma) 0, (const char *) NULL, - FALSE, get_elf_backend_data (abfd)->collect, &bh))) - return FALSE; - h = (struct elf_link_hash_entry *) bh; - h->def_regular = 1; - h->type = STT_OBJECT; + n = NUM_SHDR_ENTRIES (symtab_hdr) - symtab_hdr->sh_info; + for (i = 0; i < n; ++i) + { + struct alpha_elf_got_entry *ae, *be; + struct alpha_elf_link_hash_entry *h; - if (info->shared - && ! bfd_elf_link_record_dynamic_symbol (info, h)) - return FALSE; + h = hashes[i]; + while (h->root.root.type == bfd_link_hash_indirect + || h->root.root.type == bfd_link_hash_warning) + h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link; - elf_hash_table (info)->hgot = h; + for (be = h->got_entries; be ; be = be->next) + { + if (be->use_count == 0) + continue; + if (be->gotobj != b) + continue; + + for (ae = h->got_entries; ae ; ae = ae->next) + if (ae->gotobj == a + && ae->reloc_type == be->reloc_type + && ae->addend == be->addend) + goto global_found; + + total += alpha_got_entry_size (be->reloc_type); + if (total > MAX_GOT_SIZE) + return FALSE; + global_found:; + } + } + } return TRUE; } - -/* Read ECOFF debugging information from a .mdebug section into a - ecoff_debug_info structure. */ -static bfd_boolean -elf64_alpha_read_ecoff_info (abfd, section, debug) - bfd *abfd; - asection *section; - struct ecoff_debug_info *debug; +/* Actually merge two .got tables. */ + +static void +elf64_alpha_merge_gots (bfd *a, bfd *b) { - HDRR *symhdr; - const struct ecoff_debug_swap *swap; - char *ext_hdr = NULL; + int total = alpha_elf_tdata (a)->total_got_size; + bfd *bsub; - swap = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap; - memset (debug, 0, sizeof (*debug)); + /* Remember local expansion. */ + { + int e = alpha_elf_tdata (b)->local_got_size; + total += e; + alpha_elf_tdata (a)->local_got_size += e; + } - ext_hdr = (char *) bfd_malloc (swap->external_hdr_size); - if (ext_hdr == NULL && swap->external_hdr_size != 0) - goto error_return; + for (bsub = b; bsub ; bsub = alpha_elf_tdata (bsub)->in_got_link_next) + { + struct alpha_elf_got_entry **local_got_entries; + struct alpha_elf_link_hash_entry **hashes; + Elf_Internal_Shdr *symtab_hdr; + int i, n; - if (! bfd_get_section_contents (abfd, section, ext_hdr, (file_ptr) 0, - swap->external_hdr_size)) - goto error_return; + /* Let the local .got entries know they are part of a new subsegment. */ + local_got_entries = alpha_elf_tdata (bsub)->local_got_entries; + if (local_got_entries) + { + n = elf_tdata (bsub)->symtab_hdr.sh_info; + for (i = 0; i < n; ++i) + { + struct alpha_elf_got_entry *ent; + for (ent = local_got_entries[i]; ent; ent = ent->next) + ent->gotobj = a; + } + } - symhdr = &debug->symbolic_header; - (*swap->swap_hdr_in) (abfd, ext_hdr, symhdr); + /* Merge the global .got entries. */ + hashes = alpha_elf_sym_hashes (bsub); + symtab_hdr = &elf_tdata (bsub)->symtab_hdr; - /* The symbolic header contains absolute file offsets and sizes to - read. */ -#define READ(ptr, offset, count, size, type) \ - if (symhdr->count == 0) \ - debug->ptr = NULL; \ - else \ - { \ - bfd_size_type amt = (bfd_size_type) size * symhdr->count; \ - debug->ptr = (type) bfd_malloc (amt); \ - if (debug->ptr == NULL) \ - goto error_return; \ - if (bfd_seek (abfd, (file_ptr) symhdr->offset, SEEK_SET) != 0 \ - || bfd_bread (debug->ptr, amt, abfd) != amt) \ - goto error_return; \ - } + n = NUM_SHDR_ENTRIES (symtab_hdr) - symtab_hdr->sh_info; + for (i = 0; i < n; ++i) + { + struct alpha_elf_got_entry *ae, *be, **pbe, **start; + struct alpha_elf_link_hash_entry *h; - READ (line, cbLineOffset, cbLine, sizeof (unsigned char), unsigned char *); - READ (external_dnr, cbDnOffset, idnMax, swap->external_dnr_size, PTR); - READ (external_pdr, cbPdOffset, ipdMax, swap->external_pdr_size, PTR); - READ (external_sym, cbSymOffset, isymMax, swap->external_sym_size, PTR); - READ (external_opt, cbOptOffset, ioptMax, swap->external_opt_size, PTR); - READ (external_aux, cbAuxOffset, iauxMax, sizeof (union aux_ext), - union aux_ext *); - READ (ss, cbSsOffset, issMax, sizeof (char), char *); - READ (ssext, cbSsExtOffset, issExtMax, sizeof (char), char *); - READ (external_fdr, cbFdOffset, ifdMax, swap->external_fdr_size, PTR); - READ (external_rfd, cbRfdOffset, crfd, swap->external_rfd_size, PTR); - READ (external_ext, cbExtOffset, iextMax, swap->external_ext_size, PTR); -#undef READ + h = hashes[i]; + while (h->root.root.type == bfd_link_hash_indirect + || h->root.root.type == bfd_link_hash_warning) + h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link; - debug->fdr = NULL; + pbe = start = &h->got_entries; + while ((be = *pbe) != NULL) + { + if (be->use_count == 0) + { + *pbe = be->next; + memset (be, 0xa5, sizeof (*be)); + goto kill; + } + if (be->gotobj != b) + goto next; - return TRUE; + for (ae = *start; ae ; ae = ae->next) + if (ae->gotobj == a + && ae->reloc_type == be->reloc_type + && ae->addend == be->addend) + { + ae->flags |= be->flags; + ae->use_count += be->use_count; + *pbe = be->next; + memset (be, 0xa5, sizeof (*be)); + goto kill; + } + be->gotobj = a; + total += alpha_got_entry_size (be->reloc_type); - error_return: - if (ext_hdr != NULL) - free (ext_hdr); - if (debug->line != NULL) - free (debug->line); - if (debug->external_dnr != NULL) - free (debug->external_dnr); - if (debug->external_pdr != NULL) - free (debug->external_pdr); - if (debug->external_sym != NULL) - free (debug->external_sym); - if (debug->external_opt != NULL) - free (debug->external_opt); - if (debug->external_aux != NULL) - free (debug->external_aux); - if (debug->ss != NULL) - free (debug->ss); - if (debug->ssext != NULL) - free (debug->ssext); - if (debug->external_fdr != NULL) - free (debug->external_fdr); - if (debug->external_rfd != NULL) - free (debug->external_rfd); - if (debug->external_ext != NULL) - free (debug->external_ext); - return FALSE; -} + next:; + pbe = &be->next; + kill:; + } + } -/* Alpha ELF local labels start with '$'. */ + alpha_elf_tdata (bsub)->gotobj = a; + } + alpha_elf_tdata (a)->total_got_size = total; -static bfd_boolean -elf64_alpha_is_local_label_name (abfd, name) - bfd *abfd ATTRIBUTE_UNUSED; - const char *name; -{ - return name[0] == '$'; -} + /* Merge the two in_got chains. */ + { + bfd *next; -/* Alpha ELF follows MIPS ELF in using a special find_nearest_line - routine in order to handle the ECOFF debugging information. We - still call this mips_elf_find_line because of the slot - find_line_info in elf_obj_tdata is declared that way. */ + bsub = a; + while ((next = alpha_elf_tdata (bsub)->in_got_link_next) != NULL) + bsub = next; + + alpha_elf_tdata (bsub)->in_got_link_next = b; + } +} -struct mips_elf_find_line -{ - struct ecoff_debug_info d; - struct ecoff_find_line i; -}; +/* Calculate the offsets for the got entries. */ static bfd_boolean -elf64_alpha_find_nearest_line (abfd, section, symbols, offset, filename_ptr, - functionname_ptr, line_ptr) - bfd *abfd; - asection *section; - asymbol **symbols; - bfd_vma offset; - const char **filename_ptr; - const char **functionname_ptr; - unsigned int *line_ptr; +elf64_alpha_calc_got_offsets_for_symbol (struct alpha_elf_link_hash_entry *h, + PTR arg ATTRIBUTE_UNUSED) { - asection *msec; - - if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, - filename_ptr, functionname_ptr, - line_ptr, 0, - &elf_tdata (abfd)->dwarf2_find_line_info)) - return TRUE; + struct alpha_elf_got_entry *gotent; - msec = bfd_get_section_by_name (abfd, ".mdebug"); - if (msec != NULL) - { - flagword origflags; - struct mips_elf_find_line *fi; - const struct ecoff_debug_swap * const swap = - get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap; + if (h->root.root.type == bfd_link_hash_warning) + h = (struct alpha_elf_link_hash_entry *) h->root.root.u.i.link; - /* If we are called during a link, alpha_elf_final_link may have - cleared the SEC_HAS_CONTENTS field. We force it back on here - if appropriate (which it normally will be). */ - origflags = msec->flags; - if (elf_section_data (msec)->this_hdr.sh_type != SHT_NOBITS) - msec->flags |= SEC_HAS_CONTENTS; + for (gotent = h->got_entries; gotent; gotent = gotent->next) + if (gotent->use_count > 0) + { + struct alpha_elf_obj_tdata *td; + bfd_size_type *plge; - fi = elf_tdata (abfd)->find_line_info; - if (fi == NULL) - { - bfd_size_type external_fdr_size; - char *fraw_src; - char *fraw_end; - struct fdr *fdr_ptr; - bfd_size_type amt = sizeof (struct mips_elf_find_line); + td = alpha_elf_tdata (gotent->gotobj); + plge = &td->got->size; + gotent->got_offset = *plge; + *plge += alpha_got_entry_size (gotent->reloc_type); + } - fi = (struct mips_elf_find_line *) bfd_zalloc (abfd, amt); - if (fi == NULL) - { - msec->flags = origflags; - return FALSE; - } + return TRUE; +} - if (!elf64_alpha_read_ecoff_info (abfd, msec, &fi->d)) - { - msec->flags = origflags; - return FALSE; - } +static void +elf64_alpha_calc_got_offsets (struct bfd_link_info *info) +{ + bfd *i, *got_list = alpha_elf_hash_table(info)->got_list; - /* Swap in the FDR information. */ - amt = fi->d.symbolic_header.ifdMax * sizeof (struct fdr); - fi->d.fdr = (struct fdr *) bfd_alloc (abfd, amt); - if (fi->d.fdr == NULL) - { - msec->flags = origflags; - return FALSE; - } - external_fdr_size = swap->external_fdr_size; - fdr_ptr = fi->d.fdr; - fraw_src = (char *) fi->d.external_fdr; - fraw_end = (fraw_src - + fi->d.symbolic_header.ifdMax * external_fdr_size); - for (; fraw_src < fraw_end; fraw_src += external_fdr_size, fdr_ptr++) - (*swap->swap_fdr_in) (abfd, (PTR) fraw_src, fdr_ptr); + /* First, zero out the .got sizes, as we may be recalculating the + .got after optimizing it. */ + for (i = got_list; i ; i = alpha_elf_tdata(i)->got_link_next) + alpha_elf_tdata(i)->got->size = 0; - elf_tdata (abfd)->find_line_info = fi; + /* Next, fill in the offsets for all the global entries. */ + alpha_elf_link_hash_traverse (alpha_elf_hash_table (info), + elf64_alpha_calc_got_offsets_for_symbol, + NULL); - /* Note that we don't bother to ever free this information. - find_nearest_line is either called all the time, as in - objdump -l, so the information should be saved, or it is - rarely called, as in ld error messages, so the memory - wasted is unimportant. Still, it would probably be a - good idea for free_cached_info to throw it away. */ - } + /* Finally, fill in the offsets for the local entries. */ + for (i = got_list; i ; i = alpha_elf_tdata(i)->got_link_next) + { + bfd_size_type got_offset = alpha_elf_tdata(i)->got->size; + bfd *j; - if (_bfd_ecoff_locate_line (abfd, section, offset, &fi->d, swap, - &fi->i, filename_ptr, functionname_ptr, - line_ptr)) + for (j = i; j ; j = alpha_elf_tdata(j)->in_got_link_next) { - msec->flags = origflags; - return TRUE; - } + struct alpha_elf_got_entry **local_got_entries, *gotent; + int k, n; - msec->flags = origflags; - } + local_got_entries = alpha_elf_tdata(j)->local_got_entries; + if (!local_got_entries) + continue; - /* Fall back on the generic ELF find_nearest_line routine. */ + for (k = 0, n = elf_tdata(j)->symtab_hdr.sh_info; k < n; ++k) + for (gotent = local_got_entries[k]; gotent; gotent = gotent->next) + if (gotent->use_count > 0) + { + gotent->got_offset = got_offset; + got_offset += alpha_got_entry_size (gotent->reloc_type); + } + } - return _bfd_elf_find_nearest_line (abfd, section, symbols, offset, - filename_ptr, functionname_ptr, - line_ptr); + alpha_elf_tdata(i)->got->size = got_offset; + } } - -/* Structure used to pass information to alpha_elf_output_extsym. */ -struct extsym_info -{ - bfd *abfd; - struct bfd_link_info *info; - struct ecoff_debug_info *debug; - const struct ecoff_debug_swap *swap; - bfd_boolean failed; -}; +/* Constructs the gots. */ static bfd_boolean -elf64_alpha_output_extsym (h, data) - struct alpha_elf_link_hash_entry *h; - PTR data; +elf64_alpha_size_got_sections (struct bfd_link_info *info) { - struct extsym_info *einfo = (struct extsym_info *) data; - bfd_boolean strip; - asection *sec, *output_section; - - if (h->root.root.type == bfd_link_hash_warning) - h = (struct alpha_elf_link_hash_entry *) h->root.root.u.i.link; - - if (h->root.indx == -2) - strip = FALSE; - else if ((h->root.def_dynamic - || h->root.ref_dynamic - || h->root.root.type == bfd_link_hash_new) - && !h->root.def_regular - && !h->root.ref_regular) - strip = TRUE; - else if (einfo->info->strip == strip_all - || (einfo->info->strip == strip_some - && bfd_hash_lookup (einfo->info->keep_hash, - h->root.root.root.string, - FALSE, FALSE) == NULL)) - strip = TRUE; - else - strip = FALSE; + bfd *i, *got_list, *cur_got_obj = NULL; + int something_changed = 0; - if (strip) - return TRUE; + got_list = alpha_elf_hash_table (info)->got_list; - if (h->esym.ifd == -2) + /* On the first time through, pretend we have an existing got list + consisting of all of the input files. */ + if (got_list == NULL) { - h->esym.jmptbl = 0; - h->esym.cobol_main = 0; - h->esym.weakext = 0; - h->esym.reserved = 0; - h->esym.ifd = ifdNil; - h->esym.asym.value = 0; - h->esym.asym.st = stGlobal; - - if (h->root.root.type != bfd_link_hash_defined - && h->root.root.type != bfd_link_hash_defweak) - h->esym.asym.sc = scAbs; - else + for (i = info->input_bfds; i ; i = i->link_next) { - const char *name; + bfd *this_got = alpha_elf_tdata (i)->gotobj; + if (this_got == NULL) + continue; - sec = h->root.root.u.def.section; - output_section = sec->output_section; + /* We are assuming no merging has yet occurred. */ + BFD_ASSERT (this_got == i); - /* When making a shared library and symbol h is the one from - the another shared library, OUTPUT_SECTION may be null. */ - if (output_section == NULL) - h->esym.asym.sc = scUndefined; - else + if (alpha_elf_tdata (this_got)->total_got_size > MAX_GOT_SIZE) { - name = bfd_section_name (output_section->owner, output_section); - - if (strcmp (name, ".text") == 0) - h->esym.asym.sc = scText; - else if (strcmp (name, ".data") == 0) - h->esym.asym.sc = scData; - else if (strcmp (name, ".sdata") == 0) - h->esym.asym.sc = scSData; - else if (strcmp (name, ".rodata") == 0 - || strcmp (name, ".rdata") == 0) - h->esym.asym.sc = scRData; - else if (strcmp (name, ".bss") == 0) - h->esym.asym.sc = scBss; - else if (strcmp (name, ".sbss") == 0) - h->esym.asym.sc = scSBss; - else if (strcmp (name, ".init") == 0) - h->esym.asym.sc = scInit; - else if (strcmp (name, ".fini") == 0) - h->esym.asym.sc = scFini; - else - h->esym.asym.sc = scAbs; + /* Yikes! A single object file has too many entries. */ + (*_bfd_error_handler) + (_("%B: .got subsegment exceeds 64K (size %d)"), + i, alpha_elf_tdata (this_got)->total_got_size); + return FALSE; } - } - h->esym.asym.reserved = 0; - h->esym.asym.index = indexNil; - } + if (got_list == NULL) + got_list = this_got; + else + alpha_elf_tdata(cur_got_obj)->got_link_next = this_got; + cur_got_obj = this_got; + } - if (h->root.root.type == bfd_link_hash_common) - h->esym.asym.value = h->root.root.u.c.size; - else if (h->root.root.type == bfd_link_hash_defined - || h->root.root.type == bfd_link_hash_defweak) - { - if (h->esym.asym.sc == scCommon) - h->esym.asym.sc = scBss; - else if (h->esym.asym.sc == scSCommon) - h->esym.asym.sc = scSBss; + /* Strange degenerate case of no got references. */ + if (got_list == NULL) + return TRUE; - sec = h->root.root.u.def.section; - output_section = sec->output_section; - if (output_section != NULL) - h->esym.asym.value = (h->root.root.u.def.value - + sec->output_offset - + output_section->vma); - else - h->esym.asym.value = 0; + alpha_elf_hash_table (info)->got_list = got_list; + + /* Force got offsets to be recalculated. */ + something_changed = 1; } - else if (h->root.needs_plt) + + cur_got_obj = got_list; + i = alpha_elf_tdata(cur_got_obj)->got_link_next; + while (i != NULL) { - /* Set type and value for a symbol with a function stub. */ - h->esym.asym.st = stProc; - sec = bfd_get_section_by_name (einfo->abfd, ".plt"); - if (sec == NULL) - h->esym.asym.value = 0; + if (elf64_alpha_can_merge_gots (cur_got_obj, i)) + { + elf64_alpha_merge_gots (cur_got_obj, i); + + alpha_elf_tdata(i)->got->size = 0; + i = alpha_elf_tdata(i)->got_link_next; + alpha_elf_tdata(cur_got_obj)->got_link_next = i; + + something_changed = 1; + } else { - output_section = sec->output_section; - if (output_section != NULL) - h->esym.asym.value = (h->root.plt.offset - + sec->output_offset - + output_section->vma); - else - h->esym.asym.value = 0; + cur_got_obj = i; + i = alpha_elf_tdata(i)->got_link_next; } } - if (! bfd_ecoff_debug_one_external (einfo->abfd, einfo->debug, einfo->swap, - h->root.root.root.string, - &h->esym)) - { - einfo->failed = TRUE; - return FALSE; - } + /* Once the gots have been merged, fill in the got offsets for + everything therein. */ + if (1 || something_changed) + elf64_alpha_calc_got_offsets (info); return TRUE; } - -/* Search for and possibly create a got entry. */ -static struct alpha_elf_got_entry * -get_got_entry (abfd, h, r_type, r_symndx, r_addend) - bfd *abfd; - struct alpha_elf_link_hash_entry *h; - unsigned long r_type, r_symndx; - bfd_vma r_addend; +static bfd_boolean +elf64_alpha_size_plt_section_1 (struct alpha_elf_link_hash_entry *h, PTR data) { + asection *splt = (asection *) data; struct alpha_elf_got_entry *gotent; - struct alpha_elf_got_entry **slot; - - if (h) - slot = &h->got_entries; - else - { - /* This is a local .got entry -- record for merge. */ - - struct alpha_elf_got_entry **local_got_entries; - - local_got_entries = alpha_elf_tdata(abfd)->local_got_entries; - if (!local_got_entries) - { - bfd_size_type size; - Elf_Internal_Shdr *symtab_hdr; + bfd_boolean saw_one = FALSE; - symtab_hdr = &elf_tdata(abfd)->symtab_hdr; - size = symtab_hdr->sh_info; - size *= sizeof (struct alpha_elf_got_entry *); + /* If we didn't need an entry before, we still don't. */ + if (!h->root.needs_plt) + return TRUE; - local_got_entries - = (struct alpha_elf_got_entry **) bfd_zalloc (abfd, size); - if (!local_got_entries) - return NULL; + /* For each LITERAL got entry still in use, allocate a plt entry. */ + for (gotent = h->got_entries; gotent ; gotent = gotent->next) + if (gotent->reloc_type == R_ALPHA_LITERAL + && gotent->use_count > 0) + { + if (splt->size == 0) + splt->size = PLT_HEADER_SIZE; + gotent->plt_offset = splt->size; + splt->size += PLT_ENTRY_SIZE; + saw_one = TRUE; + } - alpha_elf_tdata (abfd)->local_got_entries = local_got_entries; - } + /* If there weren't any, there's no longer a need for the PLT entry. */ + if (!saw_one) + h->root.needs_plt = FALSE; - slot = &local_got_entries[r_symndx]; - } + return TRUE; +} - for (gotent = *slot; gotent ; gotent = gotent->next) - if (gotent->gotobj == abfd - && gotent->reloc_type == r_type - && gotent->addend == r_addend) - break; +/* Called from relax_section to rebuild the PLT in light of + potential changes in the function's status. */ - if (!gotent) - { - int entry_size; - bfd_size_type amt; +static bfd_boolean +elf64_alpha_size_plt_section (struct bfd_link_info *info) +{ + asection *splt, *spltrel, *sgotplt; + unsigned long entries; + bfd *dynobj; - amt = sizeof (struct alpha_elf_got_entry); - gotent = (struct alpha_elf_got_entry *) bfd_alloc (abfd, amt); - if (!gotent) - return NULL; + dynobj = elf_hash_table(info)->dynobj; + splt = bfd_get_section_by_name (dynobj, ".plt"); + if (splt == NULL) + return TRUE; - gotent->gotobj = abfd; - gotent->addend = r_addend; - gotent->got_offset = -1; - gotent->use_count = 1; - gotent->reloc_type = r_type; - gotent->reloc_done = 0; - gotent->reloc_xlated = 0; + splt->size = 0; - gotent->next = *slot; - *slot = gotent; + alpha_elf_link_hash_traverse (alpha_elf_hash_table (info), + elf64_alpha_size_plt_section_1, splt); - entry_size = alpha_got_entry_size (r_type); - alpha_elf_tdata (abfd)->total_got_size += entry_size; - if (!h) - alpha_elf_tdata(abfd)->local_got_size += entry_size; + /* Every plt entry requires a JMP_SLOT relocation. */ + spltrel = bfd_get_section_by_name (dynobj, ".rela.plt"); + if (splt->size) + { + if (elf64_alpha_use_secureplt) + entries = (splt->size - NEW_PLT_HEADER_SIZE) / NEW_PLT_ENTRY_SIZE; + else + entries = (splt->size - OLD_PLT_HEADER_SIZE) / OLD_PLT_ENTRY_SIZE; } else - gotent->use_count += 1; + entries = 0; + spltrel->size = entries * sizeof (Elf64_External_Rela); - return gotent; -} + /* When using the secureplt, we need two words somewhere in the data + segment for the dynamic linker to tell us where to go. This is the + entire contents of the .got.plt section. */ + if (elf64_alpha_use_secureplt) + { + sgotplt = bfd_get_section_by_name (dynobj, ".got.plt"); + sgotplt->size = entries ? 16 : 0; + } -/* Handle dynamic relocations when doing an Alpha ELF link. */ + return TRUE; +} static bfd_boolean -elf64_alpha_check_relocs (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; +elf64_alpha_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) { - bfd *dynobj; - asection *sreloc; - const char *rel_sec_name; - Elf_Internal_Shdr *symtab_hdr; - struct alpha_elf_link_hash_entry **sym_hashes; - const Elf_Internal_Rela *rel, *relend; - bfd_boolean got_created; - bfd_size_type amt; + bfd *i; if (info->relocatable) return TRUE; - dynobj = elf_hash_table(info)->dynobj; - if (dynobj == NULL) - elf_hash_table(info)->dynobj = dynobj = abfd; + /* First, take care of the indirect symbols created by versioning. */ + alpha_elf_link_hash_traverse (alpha_elf_hash_table (info), + elf64_alpha_merge_ind_symbols, + NULL); - sreloc = NULL; - rel_sec_name = NULL; - symtab_hdr = &elf_tdata(abfd)->symtab_hdr; - sym_hashes = alpha_elf_sym_hashes(abfd); - got_created = FALSE; + if (!elf64_alpha_size_got_sections (info)) + return FALSE; - relend = relocs + sec->reloc_count; - for (rel = relocs; rel < relend; ++rel) + /* Allocate space for all of the .got subsections. */ + i = alpha_elf_hash_table (info)->got_list; + for ( ; i ; i = alpha_elf_tdata(i)->got_link_next) { - enum { - NEED_GOT = 1, - NEED_GOT_ENTRY = 2, - NEED_DYNREL = 4 - }; + asection *s = alpha_elf_tdata(i)->got; + if (s->size > 0) + { + s->contents = (bfd_byte *) bfd_zalloc (i, s->size); + if (s->contents == NULL) + return FALSE; + } + } - unsigned long r_symndx, r_type; - struct alpha_elf_link_hash_entry *h; - unsigned int gotent_flags; - bfd_boolean maybe_dynamic; - unsigned int need; - bfd_vma addend; + return TRUE; +} - r_symndx = ELF64_R_SYM (rel->r_info); - if (r_symndx < symtab_hdr->sh_info) - h = NULL; - else +/* The number of dynamic relocations required by a static relocation. */ + +static int +alpha_dynamic_entries_for_reloc (int r_type, int dynamic, int shared) +{ + switch (r_type) + { + /* May appear in GOT entries. */ + case R_ALPHA_TLSGD: + return (dynamic ? 2 : shared ? 1 : 0); + case R_ALPHA_TLSLDM: + return shared; + case R_ALPHA_LITERAL: + case R_ALPHA_GOTTPREL: + return dynamic || shared; + case R_ALPHA_GOTDTPREL: + return dynamic; + + /* May appear in data sections. */ + case R_ALPHA_REFLONG: + case R_ALPHA_REFQUAD: + case R_ALPHA_TPREL64: + return dynamic || shared; + + /* Everything else is illegal. We'll issue an error during + relocate_section. */ + default: + return 0; + } +} + +/* Work out the sizes of the dynamic relocation entries. */ + +static bfd_boolean +elf64_alpha_calc_dynrel_sizes (struct alpha_elf_link_hash_entry *h, + struct bfd_link_info *info) +{ + bfd_boolean dynamic; + struct alpha_elf_reloc_entry *relent; + unsigned long entries; + + if (h->root.root.type == bfd_link_hash_warning) + h = (struct alpha_elf_link_hash_entry *) h->root.root.u.i.link; + + /* If the symbol was defined as a common symbol in a regular object + file, and there was no definition in any dynamic object, then the + linker will have allocated space for the symbol in a common + section but the ELF_LINK_HASH_DEF_REGULAR flag will not have been + set. This is done for dynamic symbols in + elf_adjust_dynamic_symbol but this is not done for non-dynamic + symbols, somehow. */ + if (!h->root.def_regular + && h->root.ref_regular + && !h->root.def_dynamic + && (h->root.root.type == bfd_link_hash_defined + || h->root.root.type == bfd_link_hash_defweak) + && !(h->root.root.u.def.section->owner->flags & DYNAMIC)) + h->root.def_regular = 1; + + /* If the symbol is dynamic, we'll need all the relocations in their + natural form. If this is a shared object, and it has been forced + local, we'll need the same number of RELATIVE relocations. */ + dynamic = alpha_elf_dynamic_symbol_p (&h->root, info); + + /* If the symbol is a hidden undefined weak, then we never have any + relocations. Avoid the loop which may want to add RELATIVE relocs + based on info->shared. */ + if (h->root.root.type == bfd_link_hash_undefweak && !dynamic) + return TRUE; + + for (relent = h->reloc_entries; relent; relent = relent->next) + { + entries = alpha_dynamic_entries_for_reloc (relent->rtype, dynamic, + info->shared); + if (entries) { - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + relent->srel->size += + entries * sizeof (Elf64_External_Rela) * relent->count; + if (relent->reltext) + info->flags |= DT_TEXTREL; + } + } + + return TRUE; +} - while (h->root.root.type == bfd_link_hash_indirect - || h->root.root.type == bfd_link_hash_warning) - h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link; +/* Subroutine of elf64_alpha_size_rela_got_section for doing the + global symbols. */ - h->root.ref_regular = 1; - } +static bfd_boolean +elf64_alpha_size_rela_got_1 (struct alpha_elf_link_hash_entry *h, + struct bfd_link_info *info) +{ + bfd_boolean dynamic; + struct alpha_elf_got_entry *gotent; + unsigned long entries; - /* We can only get preliminary data on whether a symbol is - locally or externally defined, as not all of the input files - have yet been processed. Do something with what we know, as - this may help reduce memory usage and processing time later. */ - maybe_dynamic = FALSE; - if (h && ((info->shared - && (!info->symbolic || info->unresolved_syms_in_shared_libs == RM_IGNORE)) - || !h->root.def_regular - || h->root.root.type == bfd_link_hash_defweak)) - maybe_dynamic = TRUE; + if (h->root.root.type == bfd_link_hash_warning) + h = (struct alpha_elf_link_hash_entry *) h->root.root.u.i.link; - need = 0; - gotent_flags = 0; - r_type = ELF64_R_TYPE (rel->r_info); - addend = rel->r_addend; + /* If we're using a plt for this symbol, then all of its relocations + for its got entries go into .rela.plt. */ + if (h->root.needs_plt) + return TRUE; - switch (r_type) - { - case R_ALPHA_LITERAL: - need = NEED_GOT | NEED_GOT_ENTRY; + /* If the symbol is dynamic, we'll need all the relocations in their + natural form. If this is a shared object, and it has been forced + local, we'll need the same number of RELATIVE relocations. */ + dynamic = alpha_elf_dynamic_symbol_p (&h->root, info); - /* Remember how this literal is used from its LITUSEs. - This will be important when it comes to decide if we can - create a .plt entry for a function symbol. */ - while (++rel < relend && ELF64_R_TYPE (rel->r_info) == R_ALPHA_LITUSE) - if (rel->r_addend >= 1 && rel->r_addend <= 5) - gotent_flags |= 1 << rel->r_addend; - --rel; + /* If the symbol is a hidden undefined weak, then we never have any + relocations. Avoid the loop which may want to add RELATIVE relocs + based on info->shared. */ + if (h->root.root.type == bfd_link_hash_undefweak && !dynamic) + return TRUE; - /* No LITUSEs -- presumably the address is used somehow. */ - if (gotent_flags == 0) - gotent_flags = ALPHA_ELF_LINK_HASH_LU_ADDR; - break; + entries = 0; + for (gotent = h->got_entries; gotent ; gotent = gotent->next) + if (gotent->use_count > 0) + entries += alpha_dynamic_entries_for_reloc (gotent->reloc_type, + dynamic, info->shared); - case R_ALPHA_GPDISP: - case R_ALPHA_GPREL16: - case R_ALPHA_GPREL32: - case R_ALPHA_GPRELHIGH: - case R_ALPHA_GPRELLOW: - case R_ALPHA_BRSGP: - need = NEED_GOT; - break; + if (entries > 0) + { + bfd *dynobj = elf_hash_table(info)->dynobj; + asection *srel = bfd_get_section_by_name (dynobj, ".rela.got"); + BFD_ASSERT (srel != NULL); + srel->size += sizeof (Elf64_External_Rela) * entries; + } - case R_ALPHA_REFLONG: - case R_ALPHA_REFQUAD: - if ((info->shared && (sec->flags & SEC_ALLOC)) || maybe_dynamic) - need = NEED_DYNREL; - break; + return TRUE; +} - case R_ALPHA_TLSLDM: - /* The symbol for a TLSLDM reloc is ignored. Collapse the - reloc to the 0 symbol so that they all match. */ - r_symndx = 0; - h = 0; - maybe_dynamic = FALSE; - /* FALLTHRU */ +/* Set the sizes of the dynamic relocation sections. */ - case R_ALPHA_TLSGD: - case R_ALPHA_GOTDTPREL: - need = NEED_GOT | NEED_GOT_ENTRY; - break; +static bfd_boolean +elf64_alpha_size_rela_got_section (struct bfd_link_info *info) +{ + unsigned long entries; + bfd *i, *dynobj; + asection *srel; - case R_ALPHA_GOTTPREL: - need = NEED_GOT | NEED_GOT_ENTRY; - gotent_flags = ALPHA_ELF_LINK_HASH_TLS_IE; - if (info->shared) - info->flags |= DF_STATIC_TLS; - break; + /* Shared libraries often require RELATIVE relocs, and some relocs + require attention for the main application as well. */ - case R_ALPHA_TPREL64: - if (info->shared || maybe_dynamic) - need = NEED_DYNREL; - if (info->shared) - info->flags |= DF_STATIC_TLS; - break; - } + entries = 0; + for (i = alpha_elf_hash_table(info)->got_list; + i ; i = alpha_elf_tdata(i)->got_link_next) + { + bfd *j; - if (need & NEED_GOT) + for (j = i; j ; j = alpha_elf_tdata(j)->in_got_link_next) { - if (!got_created) - { - if (!elf64_alpha_create_got_section (abfd, info)) - return FALSE; + struct alpha_elf_got_entry **local_got_entries, *gotent; + int k, n; - /* Make sure the object's gotobj is set to itself so - that we default to every object with its own .got. - We'll merge .gots later once we've collected each - object's info. */ - alpha_elf_tdata(abfd)->gotobj = abfd; + local_got_entries = alpha_elf_tdata(j)->local_got_entries; + if (!local_got_entries) + continue; - got_created = 1; - } + for (k = 0, n = elf_tdata(j)->symtab_hdr.sh_info; k < n; ++k) + for (gotent = local_got_entries[k]; + gotent ; gotent = gotent->next) + if (gotent->use_count > 0) + entries += (alpha_dynamic_entries_for_reloc + (gotent->reloc_type, 0, info->shared)); } + } - if (need & NEED_GOT_ENTRY) - { - struct alpha_elf_got_entry *gotent; + dynobj = elf_hash_table(info)->dynobj; + srel = bfd_get_section_by_name (dynobj, ".rela.got"); + if (!srel) + { + BFD_ASSERT (entries == 0); + return TRUE; + } + srel->size = sizeof (Elf64_External_Rela) * entries; - gotent = get_got_entry (abfd, h, r_type, r_symndx, addend); - if (!gotent) - return FALSE; + /* Now do the non-local symbols. */ + alpha_elf_link_hash_traverse (alpha_elf_hash_table (info), + elf64_alpha_size_rela_got_1, info); - if (gotent_flags) - { - gotent->flags |= gotent_flags; - if (h) - { - gotent_flags |= h->flags; - h->flags = gotent_flags; + return TRUE; +} - /* Make a guess as to whether a .plt entry is needed. */ - if ((gotent_flags & ALPHA_ELF_LINK_HASH_LU_FUNC) - && !(gotent_flags & ~ALPHA_ELF_LINK_HASH_LU_FUNC)) - h->root.needs_plt = 1; - else - h->root.needs_plt = 0; - } - } - } +/* Set the sizes of the dynamic sections. */ - if (need & NEED_DYNREL) +static bfd_boolean +elf64_alpha_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) +{ + bfd *dynobj; + asection *s; + bfd_boolean relplt; + + dynobj = elf_hash_table(info)->dynobj; + BFD_ASSERT(dynobj != NULL); + + if (elf_hash_table (info)->dynamic_sections_created) + { + /* Set the contents of the .interp section to the interpreter. */ + if (info->executable) { - if (rel_sec_name == NULL) - { - rel_sec_name = (bfd_elf_string_from_elf_section - (abfd, elf_elfheader(abfd)->e_shstrndx, - elf_section_data(sec)->rel_hdr.sh_name)); - if (rel_sec_name == NULL) - return FALSE; + s = bfd_get_section_by_name (dynobj, ".interp"); + BFD_ASSERT (s != NULL); + s->size = sizeof ELF_DYNAMIC_INTERPRETER; + s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER; + } - BFD_ASSERT (strncmp (rel_sec_name, ".rela", 5) == 0 - && strcmp (bfd_get_section_name (abfd, sec), - rel_sec_name+5) == 0); - } + /* Now that we've seen all of the input files, we can decide which + symbols need dynamic relocation entries and which don't. We've + collected information in check_relocs that we can now apply to + size the dynamic relocation sections. */ + alpha_elf_link_hash_traverse (alpha_elf_hash_table (info), + elf64_alpha_calc_dynrel_sizes, info); - /* We need to create the section here now whether we eventually - use it or not so that it gets mapped to an output section by - the linker. If not used, we'll kill it in - size_dynamic_sections. */ - if (sreloc == NULL) - { - sreloc = bfd_get_section_by_name (dynobj, rel_sec_name); - if (sreloc == NULL) - { - flagword flags; + elf64_alpha_size_rela_got_section (info); + elf64_alpha_size_plt_section (info); + } + /* else we're not dynamic and by definition we don't need such things. */ - flags = (SEC_HAS_CONTENTS | SEC_IN_MEMORY - | SEC_LINKER_CREATED | SEC_READONLY); - if (sec->flags & SEC_ALLOC) - flags |= SEC_ALLOC | SEC_LOAD; - sreloc = bfd_make_section_with_flags (dynobj, - rel_sec_name, - flags); - if (sreloc == NULL - || !bfd_set_section_alignment (dynobj, sreloc, 3)) - return FALSE; - } - } + /* The check_relocs and adjust_dynamic_symbol entry points have + determined the sizes of the various dynamic sections. Allocate + memory for them. */ + relplt = FALSE; + for (s = dynobj->sections; s != NULL; s = s->next) + { + const char *name; + bfd_boolean strip; - if (h) - { - /* Since we havn't seen all of the input symbols yet, we - don't know whether we'll actually need a dynamic relocation - entry for this reloc. So make a record of it. Once we - find out if this thing needs dynamic relocation we'll - expand the relocation sections by the appropriate amount. */ + if (!(s->flags & SEC_LINKER_CREATED)) + continue; - struct alpha_elf_reloc_entry *rent; + /* It's OK to base decisions on the section name, because none + of the dynobj section names depend upon the input files. */ + name = bfd_get_section_name (dynobj, s); - for (rent = h->reloc_entries; rent; rent = rent->next) - if (rent->rtype == r_type && rent->srel == sreloc) - break; + /* If we don't need this section, strip it from the output file. + This is to handle .rela.bss and .rela.plt. We must create it + in create_dynamic_sections, because it must be created before + the linker maps input sections to output sections. The + linker does that before adjust_dynamic_symbol is called, and + it is that function which decides whether anything needs to + go into these sections. */ - if (!rent) - { - amt = sizeof (struct alpha_elf_reloc_entry); - rent = (struct alpha_elf_reloc_entry *) bfd_alloc (abfd, amt); - if (!rent) - return FALSE; + strip = FALSE; - rent->srel = sreloc; - rent->rtype = r_type; - rent->count = 1; - rent->reltext = ((sec->flags & (SEC_READONLY | SEC_ALLOC)) - == (SEC_READONLY | SEC_ALLOC)); + if (strncmp (name, ".rela", 5) == 0) + { + strip = (s->size == 0); - rent->next = h->reloc_entries; - h->reloc_entries = rent; - } - else - rent->count++; - } - else if (info->shared) + if (!strip) { - /* If this is a shared library, and the section is to be - loaded into memory, we need a RELATIVE reloc. */ - sreloc->size += sizeof (Elf64_External_Rela); - if ((sec->flags & (SEC_READONLY | SEC_ALLOC)) - == (SEC_READONLY | SEC_ALLOC)) - info->flags |= DF_TEXTREL; + if (strcmp(name, ".rela.plt") == 0) + relplt = TRUE; + + /* We use the reloc_count field as a counter if we need + to copy relocs into the output file. */ + s->reloc_count = 0; } } + else if (strcmp (name, ".plt") != 0) + { + /* It's not one of our dynamic sections, so don't allocate space. */ + continue; + } + + if (strip) + s->flags |= SEC_EXCLUDE; + else + { + /* Allocate memory for the section contents. */ + s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size); + if (s->contents == NULL && s->size != 0) + return FALSE; + } } - return TRUE; -} + if (elf_hash_table (info)->dynamic_sections_created) + { + /* Add some entries to the .dynamic section. We fill in the + values later, in elf64_alpha_finish_dynamic_sections, but we + must add the entries now so that we get the correct size for + the .dynamic section. The DT_DEBUG entry is filled in by the + dynamic linker and used by the debugger. */ +#define add_dynamic_entry(TAG, VAL) \ + _bfd_elf_add_dynamic_entry (info, TAG, VAL) -/* Adjust a symbol defined by a dynamic object and referenced by a - regular object. The current definition is in some section of the - dynamic object, but we're not including those sections. We have to - change the definition to something the rest of the link can - understand. */ + if (info->executable) + { + if (!add_dynamic_entry (DT_DEBUG, 0)) + return FALSE; + } -static bfd_boolean -elf64_alpha_adjust_dynamic_symbol (info, h) - struct bfd_link_info *info; - struct elf_link_hash_entry *h; -{ - bfd *dynobj; - asection *s; - struct alpha_elf_link_hash_entry *ah; + if (relplt) + { + if (!add_dynamic_entry (DT_PLTGOT, 0) + || !add_dynamic_entry (DT_PLTRELSZ, 0) + || !add_dynamic_entry (DT_PLTREL, DT_RELA) + || !add_dynamic_entry (DT_JMPREL, 0)) + return FALSE; - dynobj = elf_hash_table(info)->dynobj; - ah = (struct alpha_elf_link_hash_entry *)h; + if (elf64_alpha_use_secureplt + && !add_dynamic_entry (DT_ALPHA_PLTRO, 1)) + return FALSE; + } - /* Now that we've seen all of the input symbols, finalize our decision - about whether this symbol should get a .plt entry. */ + if (!add_dynamic_entry (DT_RELA, 0) + || !add_dynamic_entry (DT_RELASZ, 0) + || !add_dynamic_entry (DT_RELAENT, sizeof (Elf64_External_Rela))) + return FALSE; - if (alpha_elf_dynamic_symbol_p (h, info) - && ((h->type == STT_FUNC - && !(ah->flags & ALPHA_ELF_LINK_HASH_LU_ADDR)) - || (h->type == STT_NOTYPE - && (ah->flags & ALPHA_ELF_LINK_HASH_LU_FUNC) - && !(ah->flags & ~ALPHA_ELF_LINK_HASH_LU_FUNC))) - /* Don't prevent otherwise valid programs from linking by attempting - to create a new .got entry somewhere. A Correct Solution would be - to add a new .got section to a new object file and let it be merged - somewhere later. But for now don't bother. */ - && ah->got_entries) - { - h->needs_plt = 1; + if (info->flags & DF_TEXTREL) + { + if (!add_dynamic_entry (DT_TEXTREL, 0)) + return FALSE; + } + } +#undef add_dynamic_entry - s = bfd_get_section_by_name(dynobj, ".plt"); - if (!s && !elf64_alpha_create_dynamic_sections (dynobj, info)) - return FALSE; + return TRUE; +} + +/* These functions do relaxation for Alpha ELF. - /* The first bit of the .plt is reserved. */ - if (s->size == 0) - s->size = PLT_HEADER_SIZE; - - h->plt.offset = s->size; - s->size += PLT_ENTRY_SIZE; - - /* If this symbol is not defined in a regular file, and we are not - generating a shared library, then set the symbol to the location - in the .plt. This is required to make function pointers compare - equal between the normal executable and the shared library. */ - if (! info->shared - && h->root.type != bfd_link_hash_defweak) - { - ah->plt_old_section = h->root.u.def.section; - ah->plt_old_value = h->root.u.def.value; - ah->flags |= ALPHA_ELF_LINK_HASH_PLT_LOC; - h->root.u.def.section = s; - h->root.u.def.value = h->plt.offset; - } - - /* We also need a JMP_SLOT entry in the .rela.plt section. */ - s = bfd_get_section_by_name (dynobj, ".rela.plt"); - BFD_ASSERT (s != NULL); - s->size += sizeof (Elf64_External_Rela); + Currently I'm only handling what I can do with existing compiler + and assembler support, which means no instructions are removed, + though some may be nopped. At this time GCC does not emit enough + information to do all of the relaxing that is possible. It will + take some not small amount of work for that to happen. - return TRUE; - } - else - h->needs_plt = 0; + There are a couple of interesting papers that I once read on this + subject, that I cannot find references to at the moment, that + related to Alpha in particular. They are by David Wall, then of + DEC WRL. */ - /* If this is a weak symbol, and there is a real definition, the - processor independent code will have arranged for us to see the - real definition first, and we can just use the same value. */ - if (h->u.weakdef != NULL) +struct alpha_relax_info +{ + bfd *abfd; + asection *sec; + bfd_byte *contents; + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Rela *relocs, *relend; + struct bfd_link_info *link_info; + bfd_vma gp; + bfd *gotobj; + asection *tsec; + struct alpha_elf_link_hash_entry *h; + struct alpha_elf_got_entry **first_gotent; + struct alpha_elf_got_entry *gotent; + bfd_boolean changed_contents; + bfd_boolean changed_relocs; + unsigned char other; +}; + +static Elf_Internal_Rela * +elf64_alpha_find_reloc_at_ofs (Elf_Internal_Rela *rel, + Elf_Internal_Rela *relend, + bfd_vma offset, int type) +{ + while (rel < relend) { - BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined - || h->u.weakdef->root.type == bfd_link_hash_defweak); - h->root.u.def.section = h->u.weakdef->root.u.def.section; - h->root.u.def.value = h->u.weakdef->root.u.def.value; - return TRUE; + if (rel->r_offset == offset + && ELF64_R_TYPE (rel->r_info) == (unsigned int) type) + return rel; + ++rel; } - - /* This is a reference to a symbol defined by a dynamic object which - is not a function. The Alpha, since it uses .got entries for all - symbols even in regular objects, does not need the hackery of a - .dynbss section and COPY dynamic relocations. */ - - return TRUE; + return NULL; } -/* Symbol versioning can create new symbols, and make our old symbols - indirect to the new ones. Consolidate the got and reloc information - in these situations. */ - static bfd_boolean -elf64_alpha_merge_ind_symbols (hi, dummy) - struct alpha_elf_link_hash_entry *hi; - PTR dummy ATTRIBUTE_UNUSED; +elf64_alpha_relax_got_load (struct alpha_relax_info *info, bfd_vma symval, + Elf_Internal_Rela *irel, unsigned long r_type) { - struct alpha_elf_link_hash_entry *hs; + unsigned int insn; + bfd_signed_vma disp; - if (hi->root.root.type != bfd_link_hash_indirect) - return TRUE; - hs = hi; - do { - hs = (struct alpha_elf_link_hash_entry *)hs->root.root.u.i.link; - } while (hs->root.root.type == bfd_link_hash_indirect); + /* Get the instruction. */ + insn = bfd_get_32 (info->abfd, info->contents + irel->r_offset); - /* Merge the flags. Whee. */ + if (insn >> 26 != OP_LDQ) + { + reloc_howto_type *howto = elf64_alpha_howto_table + r_type; + ((*_bfd_error_handler) + ("%B: %A+0x%lx: warning: %s relocation against unexpected insn", + info->abfd, info->sec, + (unsigned long) irel->r_offset, howto->name)); + return TRUE; + } - hs->flags |= hi->flags; + /* Can't relax dynamic symbols. */ + if (alpha_elf_dynamic_symbol_p (&info->h->root, info->link_info)) + return TRUE; - /* Merge the .got entries. Cannibalize the old symbol's list in - doing so, since we don't need it anymore. */ + /* Can't use local-exec relocations in shared libraries. */ + if (r_type == R_ALPHA_GOTTPREL && info->link_info->shared) + return TRUE; - if (hs->got_entries == NULL) - hs->got_entries = hi->got_entries; + if (r_type == R_ALPHA_LITERAL) + { + /* Look for nice constant addresses. This includes the not-uncommon + special case of 0 for undefweak symbols. */ + if ((info->h && info->h->root.root.type == bfd_link_hash_undefweak) + || (!info->link_info->shared + && (symval >= (bfd_vma)-0x8000 || symval < 0x8000))) + { + disp = 0; + insn = (OP_LDA << 26) | (insn & (31 << 21)) | (31 << 16); + insn |= (symval & 0xffff); + r_type = R_ALPHA_NONE; + } + else + { + disp = symval - info->gp; + insn = (OP_LDA << 26) | (insn & 0x03ff0000); + r_type = R_ALPHA_GPREL16; + } + } else { - struct alpha_elf_got_entry *gi, *gs, *gin, *gsh; + bfd_vma dtp_base, tp_base; - gsh = hs->got_entries; - for (gi = hi->got_entries; gi ; gi = gin) + BFD_ASSERT (elf_hash_table (info->link_info)->tls_sec != NULL); + dtp_base = alpha_get_dtprel_base (info->link_info); + tp_base = alpha_get_tprel_base (info->link_info); + disp = symval - (r_type == R_ALPHA_GOTDTPREL ? dtp_base : tp_base); + + insn = (OP_LDA << 26) | (insn & (31 << 21)) | (31 << 16); + + switch (r_type) { - gin = gi->next; - for (gs = gsh; gs ; gs = gs->next) - if (gi->gotobj == gs->gotobj - && gi->reloc_type == gs->reloc_type - && gi->addend == gs->addend) - { - gi->use_count += gs->use_count; - goto got_found; - } - gi->next = hs->got_entries; - hs->got_entries = gi; - got_found:; + case R_ALPHA_GOTDTPREL: + r_type = R_ALPHA_DTPREL16; + break; + case R_ALPHA_GOTTPREL: + r_type = R_ALPHA_TPREL16; + break; + default: + BFD_ASSERT (0); + return FALSE; } } - hi->got_entries = NULL; - /* And similar for the reloc entries. */ + if (disp < -0x8000 || disp >= 0x8000) + return TRUE; + + bfd_put_32 (info->abfd, (bfd_vma) insn, info->contents + irel->r_offset); + info->changed_contents = TRUE; + + /* Reduce the use count on this got entry by one, possibly + eliminating it. */ + if (--info->gotent->use_count == 0) + { + int sz = alpha_got_entry_size (r_type); + alpha_elf_tdata (info->gotobj)->total_got_size -= sz; + if (!info->h) + alpha_elf_tdata (info->gotobj)->local_got_size -= sz; + } + + /* Smash the existing GOT relocation for its 16-bit immediate pair. */ + irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), r_type); + info->changed_relocs = TRUE; + + /* ??? Search forward through this basic block looking for insns + that use the target register. Stop after an insn modifying the + register is seen, or after a branch or call. + + Any such memory load insn may be substituted by a load directly + off the GP. This allows the memory load insn to be issued before + the calculated GP register would otherwise be ready. - if (hs->reloc_entries == NULL) - hs->reloc_entries = hi->reloc_entries; - else - { - struct alpha_elf_reloc_entry *ri, *rs, *rin, *rsh; + Any such jsr insn can be replaced by a bsr if it is in range. - rsh = hs->reloc_entries; - for (ri = hi->reloc_entries; ri ; ri = rin) - { - rin = ri->next; - for (rs = rsh; rs ; rs = rs->next) - if (ri->rtype == rs->rtype && ri->srel == rs->srel) - { - rs->count += ri->count; - goto found_reloc; - } - ri->next = hs->reloc_entries; - hs->reloc_entries = ri; - found_reloc:; - } - } - hi->reloc_entries = NULL; + This would mean that we'd have to _add_ relocations, the pain of + which gives one pause. */ return TRUE; } -/* Is it possible to merge two object file's .got tables? */ - -static bfd_boolean -elf64_alpha_can_merge_gots (a, b) - bfd *a, *b; +static bfd_vma +elf64_alpha_relax_opt_call (struct alpha_relax_info *info, bfd_vma symval) { - int total = alpha_elf_tdata (a)->total_got_size; - bfd *bsub; + /* If the function has the same gp, and we can identify that the + function does not use its function pointer, we can eliminate the + address load. */ - /* Trivial quick fallout test. */ - if (total + alpha_elf_tdata (b)->total_got_size <= MAX_GOT_SIZE) - return TRUE; + /* If the symbol is marked NOPV, we are being told the function never + needs its procedure value. */ + if ((info->other & STO_ALPHA_STD_GPLOAD) == STO_ALPHA_NOPV) + return symval; - /* By their nature, local .got entries cannot be merged. */ - if ((total += alpha_elf_tdata (b)->local_got_size) > MAX_GOT_SIZE) - return FALSE; + /* If the symbol is marked STD_GP, we are being told the function does + a normal ldgp in the first two words. */ + else if ((info->other & STO_ALPHA_STD_GPLOAD) == STO_ALPHA_STD_GPLOAD) + ; - /* Failing the common trivial comparison, we must effectively - perform the merge. Not actually performing the merge means that - we don't have to store undo information in case we fail. */ - for (bsub = b; bsub ; bsub = alpha_elf_tdata (bsub)->in_got_link_next) + /* Otherwise, we may be able to identify a GP load in the first two + words, which we can then skip. */ + else { - struct alpha_elf_link_hash_entry **hashes = alpha_elf_sym_hashes (bsub); - Elf_Internal_Shdr *symtab_hdr = &elf_tdata (bsub)->symtab_hdr; - int i, n; + Elf_Internal_Rela *tsec_relocs, *tsec_relend, *tsec_free, *gpdisp; + bfd_vma ofs; - n = NUM_SHDR_ENTRIES (symtab_hdr) - symtab_hdr->sh_info; - for (i = 0; i < n; ++i) + /* Load the relocations from the section that the target symbol is in. */ + if (info->sec == info->tsec) { - struct alpha_elf_got_entry *ae, *be; - struct alpha_elf_link_hash_entry *h; - - h = hashes[i]; - while (h->root.root.type == bfd_link_hash_indirect - || h->root.root.type == bfd_link_hash_warning) - h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link; + tsec_relocs = info->relocs; + tsec_relend = info->relend; + tsec_free = NULL; + } + else + { + tsec_relocs = (_bfd_elf_link_read_relocs + (info->abfd, info->tsec, (PTR) NULL, + (Elf_Internal_Rela *) NULL, + info->link_info->keep_memory)); + if (tsec_relocs == NULL) + return 0; + tsec_relend = tsec_relocs + info->tsec->reloc_count; + tsec_free = (info->link_info->keep_memory ? NULL : tsec_relocs); + } - for (be = h->got_entries; be ; be = be->next) - { - if (be->use_count == 0) - continue; - if (be->gotobj != b) - continue; + /* Recover the symbol's offset within the section. */ + ofs = (symval - info->tsec->output_section->vma + - info->tsec->output_offset); - for (ae = h->got_entries; ae ; ae = ae->next) - if (ae->gotobj == a - && ae->reloc_type == be->reloc_type - && ae->addend == be->addend) - goto global_found; + /* Look for a GPDISP reloc. */ + gpdisp = (elf64_alpha_find_reloc_at_ofs + (tsec_relocs, tsec_relend, ofs, R_ALPHA_GPDISP)); - total += alpha_got_entry_size (be->reloc_type); - if (total > MAX_GOT_SIZE) - return FALSE; - global_found:; - } + if (!gpdisp || gpdisp->r_addend != 4) + { + if (tsec_free) + free (tsec_free); + return 0; } + if (tsec_free) + free (tsec_free); } - return TRUE; -} + /* We've now determined that we can skip an initial gp load. Verify + that the call and the target use the same gp. */ + if (info->link_info->hash->creator != info->tsec->owner->xvec + || info->gotobj != alpha_elf_tdata (info->tsec->owner)->gotobj) + return 0; -/* Actually merge two .got tables. */ + return symval + 8; +} -static void -elf64_alpha_merge_gots (a, b) - bfd *a, *b; +static bfd_boolean +elf64_alpha_relax_with_lituse (struct alpha_relax_info *info, + bfd_vma symval, Elf_Internal_Rela *irel) { - int total = alpha_elf_tdata (a)->total_got_size; - bfd *bsub; - - /* Remember local expansion. */ - { - int e = alpha_elf_tdata (b)->local_got_size; - total += e; - alpha_elf_tdata (a)->local_got_size += e; - } + Elf_Internal_Rela *urel, *irelend = info->relend; + int flags, count, i; + bfd_signed_vma disp; + bfd_boolean fits16; + bfd_boolean fits32; + bfd_boolean lit_reused = FALSE; + bfd_boolean all_optimized = TRUE; + unsigned int lit_insn; - for (bsub = b; bsub ; bsub = alpha_elf_tdata (bsub)->in_got_link_next) + lit_insn = bfd_get_32 (info->abfd, info->contents + irel->r_offset); + if (lit_insn >> 26 != OP_LDQ) { - struct alpha_elf_got_entry **local_got_entries; - struct alpha_elf_link_hash_entry **hashes; - Elf_Internal_Shdr *symtab_hdr; - int i, n; - - /* Let the local .got entries know they are part of a new subsegment. */ - local_got_entries = alpha_elf_tdata (bsub)->local_got_entries; - if (local_got_entries) - { - n = elf_tdata (bsub)->symtab_hdr.sh_info; - for (i = 0; i < n; ++i) - { - struct alpha_elf_got_entry *ent; - for (ent = local_got_entries[i]; ent; ent = ent->next) - ent->gotobj = a; - } - } - - /* Merge the global .got entries. */ - hashes = alpha_elf_sym_hashes (bsub); - symtab_hdr = &elf_tdata (bsub)->symtab_hdr; + ((*_bfd_error_handler) + ("%B: %A+0x%lx: warning: LITERAL relocation against unexpected insn", + info->abfd, info->sec, + (unsigned long) irel->r_offset)); + return TRUE; + } - n = NUM_SHDR_ENTRIES (symtab_hdr) - symtab_hdr->sh_info; - for (i = 0; i < n; ++i) - { - struct alpha_elf_got_entry *ae, *be, **pbe, **start; - struct alpha_elf_link_hash_entry *h; + /* Can't relax dynamic symbols. */ + if (alpha_elf_dynamic_symbol_p (&info->h->root, info->link_info)) + return TRUE; - h = hashes[i]; - while (h->root.root.type == bfd_link_hash_indirect - || h->root.root.type == bfd_link_hash_warning) - h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link; + /* Summarize how this particular LITERAL is used. */ + for (urel = irel+1, flags = count = 0; urel < irelend; ++urel, ++count) + { + if (ELF64_R_TYPE (urel->r_info) != R_ALPHA_LITUSE) + break; + if (urel->r_addend <= 6) + flags |= 1 << urel->r_addend; + } - start = &h->got_entries; - for (pbe = start, be = *start; be ; pbe = &be->next, be = be->next) - { - if (be->use_count == 0) - { - *pbe = be->next; - continue; - } - if (be->gotobj != b) - continue; + /* A little preparation for the loop... */ + disp = symval - info->gp; - for (ae = *start; ae ; ae = ae->next) - if (ae->gotobj == a - && ae->reloc_type == be->reloc_type - && ae->addend == be->addend) - { - ae->flags |= be->flags; - ae->use_count += be->use_count; - *pbe = be->next; - goto global_found; - } - be->gotobj = a; - total += alpha_got_entry_size (be->reloc_type); + for (urel = irel+1, i = 0; i < count; ++i, ++urel) + { + unsigned int insn; + int insn_disp; + bfd_signed_vma xdisp; - global_found:; - } - } + insn = bfd_get_32 (info->abfd, info->contents + urel->r_offset); - alpha_elf_tdata (bsub)->gotobj = a; - } - alpha_elf_tdata (a)->total_got_size = total; + switch (urel->r_addend) + { + case LITUSE_ALPHA_ADDR: + default: + /* This type is really just a placeholder to note that all + uses cannot be optimized, but to still allow some. */ + all_optimized = FALSE; + break; - /* Merge the two in_got chains. */ - { - bfd *next; + case LITUSE_ALPHA_BASE: + /* We can always optimize 16-bit displacements. */ - bsub = a; - while ((next = alpha_elf_tdata (bsub)->in_got_link_next) != NULL) - bsub = next; + /* Extract the displacement from the instruction, sign-extending + it if necessary, then test whether it is within 16 or 32 bits + displacement from GP. */ + insn_disp = ((insn & 0xffff) ^ 0x8000) - 0x8000; - alpha_elf_tdata (bsub)->in_got_link_next = b; - } -} + xdisp = disp + insn_disp; + fits16 = (xdisp >= - (bfd_signed_vma) 0x8000 && xdisp < 0x8000); + fits32 = (xdisp >= - (bfd_signed_vma) 0x80000000 + && xdisp < 0x7fff8000); -/* Calculate the offsets for the got entries. */ + if (fits16) + { + /* Take the op code and dest from this insn, take the base + register from the literal insn. Leave the offset alone. */ + insn = (insn & 0xffe0ffff) | (lit_insn & 0x001f0000); + urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), + R_ALPHA_GPREL16); + urel->r_addend = irel->r_addend; + info->changed_relocs = TRUE; -static bfd_boolean -elf64_alpha_calc_got_offsets_for_symbol (h, arg) - struct alpha_elf_link_hash_entry *h; - PTR arg ATTRIBUTE_UNUSED; -{ - bfd_boolean result = TRUE; - struct alpha_elf_got_entry *gotent; + bfd_put_32 (info->abfd, (bfd_vma) insn, + info->contents + urel->r_offset); + info->changed_contents = TRUE; + } - if (h->root.root.type == bfd_link_hash_warning) - h = (struct alpha_elf_link_hash_entry *) h->root.root.u.i.link; + /* If all mem+byte, we can optimize 32-bit mem displacements. */ + else if (fits32 && !(flags & ~6)) + { + /* FIXME: sanity check that lit insn Ra is mem insn Rb. */ - for (gotent = h->got_entries; gotent; gotent = gotent->next) - if (gotent->use_count > 0) - { - struct alpha_elf_obj_tdata *td; - bfd_size_type *plge; + irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), + R_ALPHA_GPRELHIGH); + lit_insn = (OP_LDAH << 26) | (lit_insn & 0x03ff0000); + bfd_put_32 (info->abfd, (bfd_vma) lit_insn, + info->contents + irel->r_offset); + lit_reused = TRUE; + info->changed_contents = TRUE; - td = alpha_elf_tdata (gotent->gotobj); - if (td == NULL) - { - _bfd_error_handler (_("Symbol %s has no GOT subsection for offset 0x%x"), - h->root.root.root.string, gotent->got_offset); - result = FALSE; - continue; - } - plge = &td->got->size; - gotent->got_offset = *plge; - *plge += alpha_got_entry_size (gotent->reloc_type); - } + urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), + R_ALPHA_GPRELLOW); + urel->r_addend = irel->r_addend; + info->changed_relocs = TRUE; + } + else + all_optimized = FALSE; + break; - return result; -} + case LITUSE_ALPHA_BYTOFF: + /* We can always optimize byte instructions. */ -static void -elf64_alpha_calc_got_offsets (info) - struct bfd_link_info *info; -{ - bfd *i, *got_list = alpha_elf_hash_table(info)->got_list; + /* FIXME: sanity check the insn for byte op. Check that the + literal dest reg is indeed Rb in the byte insn. */ - /* First, zero out the .got sizes, as we may be recalculating the - .got after optimizing it. */ - for (i = got_list; i ; i = alpha_elf_tdata(i)->got_link_next) - alpha_elf_tdata(i)->got->size = 0; + insn &= ~ (unsigned) 0x001ff000; + insn |= ((symval & 7) << 13) | 0x1000; - /* Next, fill in the offsets for all the global entries. */ - alpha_elf_link_hash_traverse (alpha_elf_hash_table (info), - elf64_alpha_calc_got_offsets_for_symbol, - NULL); + urel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); + urel->r_addend = 0; + info->changed_relocs = TRUE; - /* Finally, fill in the offsets for the local entries. */ - for (i = got_list; i ; i = alpha_elf_tdata(i)->got_link_next) - { - bfd_size_type got_offset = alpha_elf_tdata(i)->got->size; - bfd *j; + bfd_put_32 (info->abfd, (bfd_vma) insn, + info->contents + urel->r_offset); + info->changed_contents = TRUE; + break; - for (j = i; j ; j = alpha_elf_tdata(j)->in_got_link_next) - { - struct alpha_elf_got_entry **local_got_entries, *gotent; - int k, n; + case LITUSE_ALPHA_JSR: + case LITUSE_ALPHA_TLSGD: + case LITUSE_ALPHA_TLSLDM: + case LITUSE_ALPHA_JSRDIRECT: + { + bfd_vma optdest, org; + bfd_signed_vma odisp; - local_got_entries = alpha_elf_tdata(j)->local_got_entries; - if (!local_got_entries) - continue; + /* For undefined weak symbols, we're mostly interested in getting + rid of the got entry whenever possible, so optimize this to a + use of the zero register. */ + if (info->h && info->h->root.root.type == bfd_link_hash_undefweak) + { + insn |= 31 << 16; + bfd_put_32 (info->abfd, (bfd_vma) insn, + info->contents + urel->r_offset); - for (k = 0, n = elf_tdata(j)->symtab_hdr.sh_info; k < n; ++k) - for (gotent = local_got_entries[k]; gotent; gotent = gotent->next) - if (gotent->use_count > 0) - { - gotent->got_offset = got_offset; - got_offset += alpha_got_entry_size (gotent->reloc_type); - } - } + info->changed_contents = TRUE; + break; + } - alpha_elf_tdata(i)->got->size = got_offset; - } -} + /* If not zero, place to jump without needing pv. */ + optdest = elf64_alpha_relax_opt_call (info, symval); + org = (info->sec->output_section->vma + + info->sec->output_offset + + urel->r_offset + 4); + odisp = (optdest ? optdest : symval) - org; -/* Constructs the gots. */ + if (odisp >= -0x400000 && odisp < 0x400000) + { + Elf_Internal_Rela *xrel; -static bfd_boolean -elf64_alpha_size_got_sections (info) - struct bfd_link_info *info; -{ - bfd *i, *got_list, *cur_got_obj = NULL; - int something_changed = 0; + /* Preserve branch prediction call stack when possible. */ + if ((insn & INSN_JSR_MASK) == INSN_JSR) + insn = (OP_BSR << 26) | (insn & 0x03e00000); + else + insn = (OP_BR << 26) | (insn & 0x03e00000); - got_list = alpha_elf_hash_table (info)->got_list; + urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), + R_ALPHA_BRADDR); + urel->r_addend = irel->r_addend; - /* On the first time through, pretend we have an existing got list - consisting of all of the input files. */ - if (got_list == NULL) - { - for (i = info->input_bfds; i ; i = i->link_next) - { - bfd *this_got = alpha_elf_tdata (i)->gotobj; - if (this_got == NULL) - continue; + if (optdest) + urel->r_addend += optdest - symval; + else + all_optimized = FALSE; - /* We are assuming no merging has yet occurred. */ - BFD_ASSERT (this_got == i); + bfd_put_32 (info->abfd, (bfd_vma) insn, + info->contents + urel->r_offset); - if (alpha_elf_tdata (this_got)->total_got_size > MAX_GOT_SIZE) - { - /* Yikes! A single object file has too many entries. */ - (*_bfd_error_handler) - (_("%B: .got subsegment exceeds 64K (size %d)"), - i, alpha_elf_tdata (this_got)->total_got_size); - return FALSE; - } + /* Kill any HINT reloc that might exist for this insn. */ + xrel = (elf64_alpha_find_reloc_at_ofs + (info->relocs, info->relend, urel->r_offset, + R_ALPHA_HINT)); + if (xrel) + xrel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); - if (got_list == NULL) - got_list = this_got; - else - alpha_elf_tdata(cur_got_obj)->got_link_next = this_got; - cur_got_obj = this_got; - } + info->changed_contents = TRUE; + info->changed_relocs = TRUE; + } + else + all_optimized = FALSE; - /* Strange degenerate case of no got references. */ - if (got_list == NULL) - return TRUE; + /* Even if the target is not in range for a direct branch, + if we share a GP, we can eliminate the gp reload. */ + if (optdest) + { + Elf_Internal_Rela *gpdisp + = (elf64_alpha_find_reloc_at_ofs + (info->relocs, irelend, urel->r_offset + 4, + R_ALPHA_GPDISP)); + if (gpdisp) + { + bfd_byte *p_ldah = info->contents + gpdisp->r_offset; + bfd_byte *p_lda = p_ldah + gpdisp->r_addend; + unsigned int ldah = bfd_get_32 (info->abfd, p_ldah); + unsigned int lda = bfd_get_32 (info->abfd, p_lda); - alpha_elf_hash_table (info)->got_list = got_list; + /* Verify that the instruction is "ldah $29,0($26)". + Consider a function that ends in a noreturn call, + and that the next function begins with an ldgp, + and that by accident there is no padding between. + In that case the insn would use $27 as the base. */ + if (ldah == 0x27ba0000 && lda == 0x23bd0000) + { + bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, p_ldah); + bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, p_lda); - /* Force got offsets to be recalculated. */ - something_changed = 1; + gpdisp->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); + info->changed_contents = TRUE; + info->changed_relocs = TRUE; + } + } + } + } + break; + } } - cur_got_obj = got_list; - i = alpha_elf_tdata(cur_got_obj)->got_link_next; - while (i != NULL) + /* If all cases were optimized, we can reduce the use count on this + got entry by one, possibly eliminating it. */ + if (all_optimized) { - if (elf64_alpha_can_merge_gots (cur_got_obj, i)) + if (--info->gotent->use_count == 0) { - elf64_alpha_merge_gots (cur_got_obj, i); - i = alpha_elf_tdata(i)->got_link_next; - alpha_elf_tdata(cur_got_obj)->got_link_next = i; - something_changed = 1; + int sz = alpha_got_entry_size (R_ALPHA_LITERAL); + alpha_elf_tdata (info->gotobj)->total_got_size -= sz; + if (!info->h) + alpha_elf_tdata (info->gotobj)->local_got_size -= sz; } - else + + /* If the literal instruction is no longer needed (it may have been + reused. We can eliminate it. */ + /* ??? For now, I don't want to deal with compacting the section, + so just nop it out. */ + if (!lit_reused) { - cur_got_obj = i; - i = alpha_elf_tdata(i)->got_link_next; - } - } + irel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); + info->changed_relocs = TRUE; - /* Once the gots have been merged, fill in the got offsets for - everything therein. */ - if (1 || something_changed) - elf64_alpha_calc_got_offsets (info); + bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, + info->contents + irel->r_offset); + info->changed_contents = TRUE; + } - return TRUE; + return TRUE; + } + else + return elf64_alpha_relax_got_load (info, symval, irel, R_ALPHA_LITERAL); } -/* Called from relax_section to rebuild the PLT in light of - potential changes in the function's status. */ - static bfd_boolean -elf64_alpha_size_plt_section (info) - struct bfd_link_info *info; +elf64_alpha_relax_tls_get_addr (struct alpha_relax_info *info, bfd_vma symval, + Elf_Internal_Rela *irel, bfd_boolean is_gd) { - asection *splt, *spltrel; - unsigned long entries; - bfd *dynobj; - - dynobj = elf_hash_table(info)->dynobj; - splt = bfd_get_section_by_name(dynobj, ".plt"); - if (splt == NULL) - return TRUE; + bfd_byte *pos[5]; + unsigned int insn; + Elf_Internal_Rela *gpdisp, *hint; + bfd_boolean dynamic, use_gottprel, pos1_unusable; + unsigned long new_symndx; - splt->size = 0; + dynamic = alpha_elf_dynamic_symbol_p (&info->h->root, info->link_info); - alpha_elf_link_hash_traverse (alpha_elf_hash_table (info), - elf64_alpha_size_plt_section_1, splt); + /* If a TLS symbol is accessed using IE at least once, there is no point + to use dynamic model for it. */ + if (is_gd && info->h && (info->h->flags & ALPHA_ELF_LINK_HASH_TLS_IE)) + ; - /* Every plt entry requires a JMP_SLOT relocation. */ - spltrel = bfd_get_section_by_name (dynobj, ".rela.plt"); - if (splt->size) - entries = (splt->size - PLT_HEADER_SIZE) / PLT_ENTRY_SIZE; - else - entries = 0; - spltrel->size = entries * sizeof (Elf64_External_Rela); + /* If the symbol is local, and we've already committed to DF_STATIC_TLS, + then we might as well relax to IE. */ + else if (info->link_info->shared && !dynamic + && (info->link_info->flags & DF_STATIC_TLS)) + ; - return TRUE; -} + /* Otherwise we must be building an executable to do anything. */ + else if (info->link_info->shared) + return TRUE; -static bfd_boolean -elf64_alpha_size_plt_section_1 (h, data) - struct alpha_elf_link_hash_entry *h; - PTR data; -{ - asection *splt = (asection *) data; - struct alpha_elf_got_entry *gotent; + /* The TLSGD/TLSLDM relocation must be followed by a LITERAL and + the matching LITUSE_TLS relocations. */ + if (irel + 2 >= info->relend) + return TRUE; + if (ELF64_R_TYPE (irel[1].r_info) != R_ALPHA_LITERAL + || ELF64_R_TYPE (irel[2].r_info) != R_ALPHA_LITUSE + || irel[2].r_addend != (is_gd ? LITUSE_ALPHA_TLSGD : LITUSE_ALPHA_TLSLDM)) + return TRUE; - /* If we didn't need an entry before, we still don't. */ - if (!h->root.needs_plt) + /* There must be a GPDISP relocation positioned immediately after the + LITUSE relocation. */ + gpdisp = elf64_alpha_find_reloc_at_ofs (info->relocs, info->relend, + irel[2].r_offset + 4, R_ALPHA_GPDISP); + if (!gpdisp) return TRUE; - /* There must still be a LITERAL got entry for the function. */ - for (gotent = h->got_entries; gotent ; gotent = gotent->next) - if (gotent->reloc_type == R_ALPHA_LITERAL - && gotent->use_count > 0) - break; + pos[0] = info->contents + irel[0].r_offset; + pos[1] = info->contents + irel[1].r_offset; + pos[2] = info->contents + irel[2].r_offset; + pos[3] = info->contents + gpdisp->r_offset; + pos[4] = pos[3] + gpdisp->r_addend; + pos1_unusable = FALSE; - /* If there is, reset the PLT offset. If not, there's no longer - a need for the PLT entry. */ - if (gotent) - { - if (splt->size == 0) - splt->size = PLT_HEADER_SIZE; - h->root.plt.offset = splt->size; - splt->size += PLT_ENTRY_SIZE; - } - else + /* Generally, the positions are not allowed to be out of order, lest the + modified insn sequence have different register lifetimes. We can make + an exception when pos 1 is adjacent to pos 0. */ + if (pos[1] + 4 == pos[0]) { - h->root.needs_plt = 0; - h->root.plt.offset = -1; - - /* Undo the definition frobbing begun in adjust_dynamic_symbol. */ - if (h->flags & ALPHA_ELF_LINK_HASH_PLT_LOC) - { - h->root.root.u.def.section = h->plt_old_section; - h->root.root.u.def.value = h->plt_old_value; - h->flags &= ~ALPHA_ELF_LINK_HASH_PLT_LOC; - } + bfd_byte *tmp = pos[0]; + pos[0] = pos[1]; + pos[1] = tmp; } + else if (pos[1] < pos[0]) + pos1_unusable = TRUE; + if (pos[1] >= pos[2] || pos[2] >= pos[3]) + return TRUE; - return TRUE; -} + /* Reduce the use count on the LITERAL relocation. Do this before we + smash the symndx when we adjust the relocations below. */ + { + struct alpha_elf_got_entry *lit_gotent; + struct alpha_elf_link_hash_entry *lit_h; + unsigned long indx; -static bfd_boolean -elf64_alpha_always_size_sections (output_bfd, info) - bfd *output_bfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info; -{ - bfd *i; + BFD_ASSERT (ELF64_R_SYM (irel[1].r_info) >= info->symtab_hdr->sh_info); + indx = ELF64_R_SYM (irel[1].r_info) - info->symtab_hdr->sh_info; + lit_h = alpha_elf_sym_hashes (info->abfd)[indx]; - if (info->relocatable) - return TRUE; + while (lit_h->root.root.type == bfd_link_hash_indirect + || lit_h->root.root.type == bfd_link_hash_warning) + lit_h = (struct alpha_elf_link_hash_entry *) lit_h->root.root.u.i.link; - /* First, take care of the indirect symbols created by versioning. */ - alpha_elf_link_hash_traverse (alpha_elf_hash_table (info), - elf64_alpha_merge_ind_symbols, - NULL); + for (lit_gotent = lit_h->got_entries; lit_gotent ; + lit_gotent = lit_gotent->next) + if (lit_gotent->gotobj == info->gotobj + && lit_gotent->reloc_type == R_ALPHA_LITERAL + && lit_gotent->addend == irel[1].r_addend) + break; + BFD_ASSERT (lit_gotent); - if (!elf64_alpha_size_got_sections (info)) - return FALSE; + if (--lit_gotent->use_count == 0) + { + int sz = alpha_got_entry_size (R_ALPHA_LITERAL); + alpha_elf_tdata (info->gotobj)->total_got_size -= sz; + } + } - /* Allocate space for all of the .got subsections. */ - i = alpha_elf_hash_table (info)->got_list; - for ( ; i ; i = alpha_elf_tdata(i)->got_link_next) - { - asection *s = alpha_elf_tdata(i)->got; - if (s->size > 0) - { - s->contents = (bfd_byte *) bfd_zalloc (i, s->size); - if (s->contents == NULL) - return FALSE; - } - } + /* Change - return TRUE; -} + lda $16,x($gp) !tlsgd!1 + ldq $27,__tls_get_addr($gp) !literal!1 + jsr $26,($27),__tls_get_addr !lituse_tlsgd!1 + ldah $29,0($26) !gpdisp!2 + lda $29,0($29) !gpdisp!2 + to + ldq $16,x($gp) !gottprel + unop + call_pal rduniq + addq $16,$0,$0 + unop + or the first pair to + lda $16,x($gp) !tprel + unop + or + ldah $16,x($gp) !tprelhi + lda $16,x($16) !tprello -/* The number of dynamic relocations required by a static relocation. */ + as appropriate. */ -static int -alpha_dynamic_entries_for_reloc (r_type, dynamic, shared) - int r_type, dynamic, shared; -{ - switch (r_type) + use_gottprel = FALSE; + new_symndx = is_gd ? ELF64_R_SYM (irel->r_info) : 0; + switch (!dynamic && !info->link_info->shared) { - /* May appear in GOT entries. */ - case R_ALPHA_TLSGD: - return (dynamic ? 2 : shared ? 1 : 0); - case R_ALPHA_TLSLDM: - return shared; - case R_ALPHA_LITERAL: - case R_ALPHA_GOTTPREL: - return dynamic || shared; - case R_ALPHA_GOTDTPREL: - return dynamic; - - /* May appear in data sections. */ - case R_ALPHA_REFLONG: - case R_ALPHA_REFQUAD: - case R_ALPHA_TPREL64: - return dynamic || shared; - - /* Everything else is illegal. We'll issue an error during - relocate_section. */ - default: - return 0; - } -} + case 1: + { + bfd_vma tp_base; + bfd_signed_vma disp; -/* Work out the sizes of the dynamic relocation entries. */ + BFD_ASSERT (elf_hash_table (info->link_info)->tls_sec != NULL); + tp_base = alpha_get_tprel_base (info->link_info); + disp = symval - tp_base; -static bfd_boolean -elf64_alpha_calc_dynrel_sizes (h, info) - struct alpha_elf_link_hash_entry *h; - struct bfd_link_info *info; -{ - bfd_boolean dynamic; - struct alpha_elf_reloc_entry *relent; - unsigned long entries; + if (disp >= -0x8000 && disp < 0x8000) + { + insn = (OP_LDA << 26) | (16 << 21) | (31 << 16); + bfd_put_32 (info->abfd, (bfd_vma) insn, pos[0]); + bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, pos[1]); - if (h->root.root.type == bfd_link_hash_warning) - h = (struct alpha_elf_link_hash_entry *) h->root.root.u.i.link; + irel[0].r_offset = pos[0] - info->contents; + irel[0].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_TPREL16); + irel[1].r_info = ELF64_R_INFO (0, R_ALPHA_NONE); + break; + } + else if (disp >= -(bfd_signed_vma) 0x80000000 + && disp < (bfd_signed_vma) 0x7fff8000 + && !pos1_unusable) + { + insn = (OP_LDAH << 26) | (16 << 21) | (31 << 16); + bfd_put_32 (info->abfd, (bfd_vma) insn, pos[0]); + insn = (OP_LDA << 26) | (16 << 21) | (16 << 16); + bfd_put_32 (info->abfd, (bfd_vma) insn, pos[1]); - /* If the symbol was defined as a common symbol in a regular object - file, and there was no definition in any dynamic object, then the - linker will have allocated space for the symbol in a common - section but the ELF_LINK_HASH_DEF_REGULAR flag will not have been - set. This is done for dynamic symbols in - elf_adjust_dynamic_symbol but this is not done for non-dynamic - symbols, somehow. */ - if (!h->root.def_regular - && h->root.ref_regular - && !h->root.def_dynamic - && (h->root.root.type == bfd_link_hash_defined - || h->root.root.type == bfd_link_hash_defweak) - && !(h->root.root.u.def.section->owner->flags & DYNAMIC)) - h->root.def_regular = 1; + irel[0].r_offset = pos[0] - info->contents; + irel[0].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_TPRELHI); + irel[1].r_offset = pos[1] - info->contents; + irel[1].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_TPRELLO); + break; + } + } + /* FALLTHRU */ - /* If the symbol is dynamic, we'll need all the relocations in their - natural form. If this is a shared object, and it has been forced - local, we'll need the same number of RELATIVE relocations. */ + default: + use_gottprel = TRUE; - dynamic = alpha_elf_dynamic_symbol_p (&h->root, info); + insn = (OP_LDQ << 26) | (16 << 21) | (29 << 16); + bfd_put_32 (info->abfd, (bfd_vma) insn, pos[0]); + bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, pos[1]); - for (relent = h->reloc_entries; relent; relent = relent->next) - { - entries = alpha_dynamic_entries_for_reloc (relent->rtype, dynamic, - info->shared); - if (entries) - { - relent->srel->size += - entries * sizeof (Elf64_External_Rela) * relent->count; - if (relent->reltext) - info->flags |= DT_TEXTREL; - } + irel[0].r_offset = pos[0] - info->contents; + irel[0].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_GOTTPREL); + irel[1].r_info = ELF64_R_INFO (0, R_ALPHA_NONE); + break; } - return TRUE; -} + bfd_put_32 (info->abfd, (bfd_vma) INSN_RDUNIQ, pos[2]); + + insn = INSN_ADDQ | (16 << 21) | (0 << 16) | (0 << 0); + bfd_put_32 (info->abfd, (bfd_vma) insn, pos[3]); -/* Set the sizes of the dynamic relocation sections. */ + bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, pos[4]); -static bfd_boolean -elf64_alpha_size_rela_got_section (info) - struct bfd_link_info *info; -{ - unsigned long entries; - bfd *i, *dynobj; - asection *srel; + irel[2].r_info = ELF64_R_INFO (0, R_ALPHA_NONE); + gpdisp->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); - /* Shared libraries often require RELATIVE relocs, and some relocs - require attention for the main application as well. */ + hint = elf64_alpha_find_reloc_at_ofs (info->relocs, info->relend, + irel[2].r_offset, R_ALPHA_HINT); + if (hint) + hint->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); - entries = 0; - for (i = alpha_elf_hash_table(info)->got_list; - i ; i = alpha_elf_tdata(i)->got_link_next) + info->changed_contents = TRUE; + info->changed_relocs = TRUE; + + /* Reduce the use count on the TLSGD/TLSLDM relocation. */ + if (--info->gotent->use_count == 0) { - bfd *j; + int sz = alpha_got_entry_size (info->gotent->reloc_type); + alpha_elf_tdata (info->gotobj)->total_got_size -= sz; + if (!info->h) + alpha_elf_tdata (info->gotobj)->local_got_size -= sz; + } - for (j = i; j ; j = alpha_elf_tdata(j)->in_got_link_next) + /* If we've switched to a GOTTPREL relocation, increment the reference + count on that got entry. */ + if (use_gottprel) + { + struct alpha_elf_got_entry *tprel_gotent; + + for (tprel_gotent = *info->first_gotent; tprel_gotent ; + tprel_gotent = tprel_gotent->next) + if (tprel_gotent->gotobj == info->gotobj + && tprel_gotent->reloc_type == R_ALPHA_GOTTPREL + && tprel_gotent->addend == irel->r_addend) + break; + if (tprel_gotent) + tprel_gotent->use_count++; + else { - struct alpha_elf_got_entry **local_got_entries, *gotent; - int k, n; + if (info->gotent->use_count == 0) + tprel_gotent = info->gotent; + else + { + tprel_gotent = (struct alpha_elf_got_entry *) + bfd_alloc (info->abfd, sizeof (struct alpha_elf_got_entry)); + if (!tprel_gotent) + return FALSE; - local_got_entries = alpha_elf_tdata(j)->local_got_entries; - if (!local_got_entries) - continue; + tprel_gotent->next = *info->first_gotent; + *info->first_gotent = tprel_gotent; - for (k = 0, n = elf_tdata(j)->symtab_hdr.sh_info; k < n; ++k) - for (gotent = local_got_entries[k]; - gotent ; gotent = gotent->next) - if (gotent->use_count > 0) - entries += (alpha_dynamic_entries_for_reloc - (gotent->reloc_type, 0, info->shared)); - } - } + tprel_gotent->gotobj = info->gotobj; + tprel_gotent->addend = irel->r_addend; + tprel_gotent->got_offset = -1; + tprel_gotent->reloc_done = 0; + tprel_gotent->reloc_xlated = 0; + } - dynobj = elf_hash_table(info)->dynobj; - srel = bfd_get_section_by_name (dynobj, ".rela.got"); - if (!srel) - { - BFD_ASSERT (entries == 0); - return TRUE; + tprel_gotent->use_count = 1; + tprel_gotent->reloc_type = R_ALPHA_GOTTPREL; + } } - srel->size = sizeof (Elf64_External_Rela) * entries; - - /* Now do the non-local symbols. */ - alpha_elf_link_hash_traverse (alpha_elf_hash_table (info), - elf64_alpha_size_rela_got_1, info); return TRUE; } -/* Subroutine of elf64_alpha_size_rela_got_section for doing the - global symbols. */ - static bfd_boolean -elf64_alpha_size_rela_got_1 (h, info) - struct alpha_elf_link_hash_entry *h; - struct bfd_link_info *info; +elf64_alpha_relax_section (bfd *abfd, asection *sec, + struct bfd_link_info *link_info, bfd_boolean *again) { - bfd_boolean dynamic; - struct alpha_elf_got_entry *gotent; - unsigned long entries; + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Rela *internal_relocs; + Elf_Internal_Rela *irel, *irelend; + Elf_Internal_Sym *isymbuf = NULL; + struct alpha_elf_got_entry **local_got_entries; + struct alpha_relax_info info; - if (h->root.root.type == bfd_link_hash_warning) - h = (struct alpha_elf_link_hash_entry *) h->root.root.u.i.link; + /* We are not currently changing any sizes, so only one pass. */ + *again = FALSE; - /* If the symbol is dynamic, we'll need all the relocations in their - natural form. If this is a shared object, and it has been forced - local, we'll need the same number of RELATIVE relocations. */ + if (link_info->relocatable + || ((sec->flags & (SEC_CODE | SEC_RELOC | SEC_ALLOC)) + != (SEC_CODE | SEC_RELOC | SEC_ALLOC)) + || sec->reloc_count == 0) + return TRUE; - dynamic = alpha_elf_dynamic_symbol_p (&h->root, info); + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + local_got_entries = alpha_elf_tdata(abfd)->local_got_entries; - entries = 0; - for (gotent = h->got_entries; gotent ; gotent = gotent->next) - if (gotent->use_count > 0) - entries += alpha_dynamic_entries_for_reloc (gotent->reloc_type, - dynamic, info->shared); + /* Load the relocations for this section. */ + internal_relocs = (_bfd_elf_link_read_relocs + (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, + link_info->keep_memory)); + if (internal_relocs == NULL) + return FALSE; - /* If we are using a .plt entry, subtract one, as the first - reference uses a .rela.plt entry instead. */ - if (h->root.plt.offset != MINUS_ONE) - entries--; + memset(&info, 0, sizeof (info)); + info.abfd = abfd; + info.sec = sec; + info.link_info = link_info; + info.symtab_hdr = symtab_hdr; + info.relocs = internal_relocs; + info.relend = irelend = internal_relocs + sec->reloc_count; - if (entries > 0) + /* Find the GP for this object. Do not store the result back via + _bfd_set_gp_value, since this could change again before final. */ + info.gotobj = alpha_elf_tdata (abfd)->gotobj; + if (info.gotobj) { - bfd *dynobj = elf_hash_table(info)->dynobj; - asection *srel = bfd_get_section_by_name (dynobj, ".rela.got"); - BFD_ASSERT (srel != NULL); - srel->size += sizeof (Elf64_External_Rela) * entries; + asection *sgot = alpha_elf_tdata (info.gotobj)->got; + info.gp = (sgot->output_section->vma + + sgot->output_offset + + 0x8000); } - return TRUE; -} + /* Get the section contents. */ + if (elf_section_data (sec)->this_hdr.contents != NULL) + info.contents = elf_section_data (sec)->this_hdr.contents; + else + { + if (!bfd_malloc_and_get_section (abfd, sec, &info.contents)) + goto error_return; + } -/* Set the sizes of the dynamic sections. */ + for (irel = internal_relocs; irel < irelend; irel++) + { + bfd_vma symval; + struct alpha_elf_got_entry *gotent; + unsigned long r_type = ELF64_R_TYPE (irel->r_info); + unsigned long r_symndx = ELF64_R_SYM (irel->r_info); -static bfd_boolean -elf64_alpha_size_dynamic_sections (output_bfd, info) - bfd *output_bfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info; -{ - bfd *dynobj; - asection *s; - bfd_boolean relplt; + /* Early exit for unhandled or unrelaxable relocations. */ + switch (r_type) + { + case R_ALPHA_LITERAL: + case R_ALPHA_GPRELHIGH: + case R_ALPHA_GPRELLOW: + case R_ALPHA_GOTDTPREL: + case R_ALPHA_GOTTPREL: + case R_ALPHA_TLSGD: + break; - dynobj = elf_hash_table(info)->dynobj; - BFD_ASSERT(dynobj != NULL); + case R_ALPHA_TLSLDM: + /* The symbol for a TLSLDM reloc is ignored. Collapse the + reloc to the 0 symbol so that they all match. */ + r_symndx = 0; + break; - if (elf_hash_table (info)->dynamic_sections_created) - { - /* Set the contents of the .interp section to the interpreter. */ - if (info->executable) - { - s = bfd_get_section_by_name (dynobj, ".interp"); - BFD_ASSERT (s != NULL); - s->size = sizeof ELF_DYNAMIC_INTERPRETER; - s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER; + default: + continue; } - /* Now that we've seen all of the input files, we can decide which - symbols need dynamic relocation entries and which don't. We've - collected information in check_relocs that we can now apply to - size the dynamic relocation sections. */ - alpha_elf_link_hash_traverse (alpha_elf_hash_table (info), - elf64_alpha_calc_dynrel_sizes, info); + /* Get the value of the symbol referred to by the reloc. */ + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ + Elf_Internal_Sym *isym; + + /* Read this BFD's local symbols. */ + if (isymbuf == NULL) + { + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) + goto error_return; + } + + isym = isymbuf + r_symndx; + + /* Given the symbol for a TLSLDM reloc is ignored, this also + means forcing the symbol value to the tp base. */ + if (r_type == R_ALPHA_TLSLDM) + { + info.tsec = bfd_abs_section_ptr; + symval = alpha_get_tprel_base (info.link_info); + } + else + { + symval = isym->st_value; + if (isym->st_shndx == SHN_UNDEF) + continue; + else if (isym->st_shndx == SHN_ABS) + info.tsec = bfd_abs_section_ptr; + else if (isym->st_shndx == SHN_COMMON) + info.tsec = bfd_com_section_ptr; + else + info.tsec = bfd_section_from_elf_index (abfd, isym->st_shndx); + } + + info.h = NULL; + info.other = isym->st_other; + if (local_got_entries) + info.first_gotent = &local_got_entries[r_symndx]; + else + { + info.first_gotent = &info.gotent; + info.gotent = NULL; + } + } + else + { + unsigned long indx; + struct alpha_elf_link_hash_entry *h; - elf64_alpha_size_rela_got_section (info); - } - /* else we're not dynamic and by definition we don't need such things. */ + indx = r_symndx - symtab_hdr->sh_info; + h = alpha_elf_sym_hashes (abfd)[indx]; + BFD_ASSERT (h != NULL); - /* The check_relocs and adjust_dynamic_symbol entry points have - determined the sizes of the various dynamic sections. Allocate - memory for them. */ - relplt = FALSE; - for (s = dynobj->sections; s != NULL; s = s->next) - { - const char *name; - bfd_boolean strip; + while (h->root.root.type == bfd_link_hash_indirect + || h->root.root.type == bfd_link_hash_warning) + h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link; - if (!(s->flags & SEC_LINKER_CREATED)) - continue; + /* If the symbol is undefined, we can't do anything with it. */ + if (h->root.root.type == bfd_link_hash_undefined) + continue; - /* It's OK to base decisions on the section name, because none - of the dynobj section names depend upon the input files. */ - name = bfd_get_section_name (dynobj, s); + /* If the symbol isn't defined in the current module, + again we can't do anything. */ + if (h->root.root.type == bfd_link_hash_undefweak) + { + info.tsec = bfd_abs_section_ptr; + symval = 0; + } + else if (!h->root.def_regular) + { + /* Except for TLSGD relocs, which can sometimes be + relaxed to GOTTPREL relocs. */ + if (r_type != R_ALPHA_TLSGD) + continue; + info.tsec = bfd_abs_section_ptr; + symval = 0; + } + else + { + info.tsec = h->root.root.u.def.section; + symval = h->root.root.u.def.value; + } - /* If we don't need this section, strip it from the output file. - This is to handle .rela.bss and .rela.plt. We must create it - in create_dynamic_sections, because it must be created before - the linker maps input sections to output sections. The - linker does that before adjust_dynamic_symbol is called, and - it is that function which decides whether anything needs to - go into these sections. */ + info.h = h; + info.other = h->root.other; + info.first_gotent = &h->got_entries; + } - strip = FALSE; + /* Search for the got entry to be used by this relocation. */ + for (gotent = *info.first_gotent; gotent ; gotent = gotent->next) + if (gotent->gotobj == info.gotobj + && gotent->reloc_type == r_type + && gotent->addend == irel->r_addend) + break; + info.gotent = gotent; - if (strncmp (name, ".rela", 5) == 0) + symval += info.tsec->output_section->vma + info.tsec->output_offset; + symval += irel->r_addend; + + switch (r_type) { - strip = (s->size == 0); + case R_ALPHA_LITERAL: + BFD_ASSERT(info.gotent != NULL); - if (!strip) + /* If there exist LITUSE relocations immediately following, this + opens up all sorts of interesting optimizations, because we + now know every location that this address load is used. */ + if (irel+1 < irelend + && ELF64_R_TYPE (irel[1].r_info) == R_ALPHA_LITUSE) { - if (strcmp(name, ".rela.plt") == 0) - relplt = TRUE; - - /* We use the reloc_count field as a counter if we need - to copy relocs into the output file. */ - s->reloc_count = 0; + if (!elf64_alpha_relax_with_lituse (&info, symval, irel)) + goto error_return; } - } - else if (strcmp (name, ".plt") != 0) - { - /* It's not one of our dynamic sections, so don't allocate space. */ - continue; - } + else + { + if (!elf64_alpha_relax_got_load (&info, symval, irel, r_type)) + goto error_return; + } + break; - if (strip) - s->flags |= SEC_EXCLUDE; - else - { - /* Allocate memory for the section contents. */ - s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size); - if (s->contents == NULL && s->size != 0) - return FALSE; + case R_ALPHA_GOTDTPREL: + case R_ALPHA_GOTTPREL: + BFD_ASSERT(info.gotent != NULL); + if (!elf64_alpha_relax_got_load (&info, symval, irel, r_type)) + goto error_return; + break; + + case R_ALPHA_TLSGD: + case R_ALPHA_TLSLDM: + BFD_ASSERT(info.gotent != NULL); + if (!elf64_alpha_relax_tls_get_addr (&info, symval, irel, + r_type == R_ALPHA_TLSGD)) + goto error_return; + break; } } - if (elf_hash_table (info)->dynamic_sections_created) - { - /* Add some entries to the .dynamic section. We fill in the - values later, in elf64_alpha_finish_dynamic_sections, but we - must add the entries now so that we get the correct size for - the .dynamic section. The DT_DEBUG entry is filled in by the - dynamic linker and used by the debugger. */ -#define add_dynamic_entry(TAG, VAL) \ - _bfd_elf_add_dynamic_entry (info, TAG, VAL) + if (!elf64_alpha_size_plt_section (link_info)) + return FALSE; + if (!elf64_alpha_size_got_sections (link_info)) + return FALSE; + if (!elf64_alpha_size_rela_got_section (link_info)) + return FALSE; - if (info->executable) + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + { + if (!link_info->keep_memory) + free (isymbuf); + else { - if (!add_dynamic_entry (DT_DEBUG, 0)) - return FALSE; + /* Cache the symbols for elf_link_input_bfd. */ + symtab_hdr->contents = (unsigned char *) isymbuf; } + } - if (relplt) + if (info.contents != NULL + && elf_section_data (sec)->this_hdr.contents != info.contents) + { + if (!info.changed_contents && !link_info->keep_memory) + free (info.contents); + else { - if (!add_dynamic_entry (DT_PLTGOT, 0) - || !add_dynamic_entry (DT_PLTRELSZ, 0) - || !add_dynamic_entry (DT_PLTREL, DT_RELA) - || !add_dynamic_entry (DT_JMPREL, 0)) - return FALSE; + /* Cache the section contents for elf_link_input_bfd. */ + elf_section_data (sec)->this_hdr.contents = info.contents; } + } - if (!add_dynamic_entry (DT_RELA, 0) - || !add_dynamic_entry (DT_RELASZ, 0) - || !add_dynamic_entry (DT_RELAENT, sizeof (Elf64_External_Rela))) - return FALSE; - - if (info->flags & DF_TEXTREL) - { - if (!add_dynamic_entry (DT_TEXTREL, 0)) - return FALSE; - } + if (elf_section_data (sec)->relocs != internal_relocs) + { + if (!info.changed_relocs) + free (internal_relocs); + else + elf_section_data (sec)->relocs = internal_relocs; } -#undef add_dynamic_entry + + *again = info.changed_contents || info.changed_relocs; return TRUE; -} + error_return: + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (info.contents != NULL + && elf_section_data (sec)->this_hdr.contents != info.contents) + free (info.contents); + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); + return FALSE; +} + /* Emit a dynamic relocation for (DYNINDX, RTYPE, ADDEND) at (SEC, OFFSET) into the next available slot in SREL. */ static void -elf64_alpha_emit_dynrel (abfd, info, sec, srel, offset, dynindx, rtype, addend) - bfd *abfd; - struct bfd_link_info *info; - asection *sec, *srel; - bfd_vma offset, addend; - long dynindx, rtype; +elf64_alpha_emit_dynrel (bfd *abfd, struct bfd_link_info *info, + asection *sec, asection *srel, bfd_vma offset, + long dynindx, long rtype, bfd_vma addend) { Elf_Internal_Rela outrel; bfd_byte *loc; @@ -4147,16 +3922,13 @@ elf64_alpha_emit_dynrel (abfd, info, sec symbol winds up in the output section. */ static bfd_boolean -elf64_alpha_relocate_section_r (output_bfd, info, input_bfd, input_section, - contents, relocs, local_syms, local_sections) - bfd *output_bfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - bfd *input_bfd; - asection *input_section; - bfd_byte *contents ATTRIBUTE_UNUSED; - Elf_Internal_Rela *relocs; - Elf_Internal_Sym *local_syms; - asection **local_sections; +elf64_alpha_relocate_section_r (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + bfd *input_bfd, asection *input_section, + bfd_byte *contents ATTRIBUTE_UNUSED, + Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, + asection **local_sections) { unsigned long symtab_hdr_sh_info; Elf_Internal_Rela *rel; @@ -4208,16 +3980,11 @@ elf64_alpha_relocate_section_r (output_b /* Relocate an Alpha ELF section. */ static bfd_boolean -elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, - contents, relocs, local_syms, local_sections) - bfd *output_bfd; - struct bfd_link_info *info; - bfd *input_bfd; - asection *input_section; - bfd_byte *contents; - Elf_Internal_Rela *relocs; - Elf_Internal_Sym *local_syms; - asection **local_sections; +elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info, + bfd *input_bfd, asection *input_section, + bfd_byte *contents, Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, + asection **local_sections) { Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Rela *rel; @@ -4227,7 +3994,6 @@ elf64_alpha_relocate_section (output_bfd bfd_vma gp, tp_base, dtp_base; struct alpha_elf_got_entry **local_got_entries; bfd_boolean ret_val; - const char *section_name; /* Handle relocatable links with a smaller loop. */ if (info->relocatable) @@ -4247,11 +4013,17 @@ elf64_alpha_relocate_section (output_bfd else srelgot = NULL; - section_name = (bfd_elf_string_from_elf_section - (input_bfd, elf_elfheader(input_bfd)->e_shstrndx, - elf_section_data(input_section)->rel_hdr.sh_name)); - BFD_ASSERT(section_name != NULL); - srel = bfd_get_section_by_name (dynobj, section_name); + if (input_section->flags & SEC_ALLOC) + { + const char *section_name; + section_name = (bfd_elf_string_from_elf_section + (input_bfd, elf_elfheader(input_bfd)->e_shstrndx, + elf_section_data(input_section)->rel_hdr.sh_name)); + BFD_ASSERT(section_name != NULL); + srel = bfd_get_section_by_name (dynobj, section_name); + } + else + srel = NULL; /* Find the gp value for this input bfd. */ gotobj = alpha_elf_tdata (input_bfd)->gotobj; @@ -4328,7 +4100,7 @@ elf64_alpha_relocate_section (output_bfd /* If this is a tp-relative relocation against sym 0, this is hackery from relax_section. Force the value to - be the tls base. */ + be the tls module base. */ if (r_symndx == 0 && (r_type == R_ALPHA_TLSLDM || r_type == R_ALPHA_GOTTPREL @@ -4336,7 +4108,7 @@ elf64_alpha_relocate_section (output_bfd || r_type == R_ALPHA_TPRELHI || r_type == R_ALPHA_TPRELLO || r_type == R_ALPHA_TPREL16)) - value = tp_base; + value = dtp_base; if (local_got_entries) gotent = local_got_entries[r_symndx]; @@ -4445,7 +4217,7 @@ elf64_alpha_relocate_section (output_bfd /* If the symbol has been forced local, output a RELATIVE reloc, otherwise it will be handled in finish_dynamic_symbol. */ - if (info->shared && !dynamic_symbol_p) + if (info->shared && !dynamic_symbol_p && !undef_weak_ref) elf64_alpha_emit_dynrel (output_bfd, info, sgot, srelgot, gotent->got_offset, 0, R_ALPHA_RELATIVE, value); @@ -4617,7 +4389,8 @@ elf64_alpha_relocate_section (output_bfd } else if (info->shared && r_symndx != 0 - && (input_section->flags & SEC_ALLOC)) + && (input_section->flags & SEC_ALLOC) + && !undef_weak_ref) { if (r_type == R_ALPHA_REFLONG) { @@ -4634,9 +4407,10 @@ elf64_alpha_relocate_section (output_bfd else goto default_reloc; - elf64_alpha_emit_dynrel (output_bfd, info, input_section, - srel, rel->r_offset, dynindx, - dyntype, dynaddend); + if (input_section->flags & SEC_ALLOC) + elf64_alpha_emit_dynrel (output_bfd, info, input_section, + srel, rel->r_offset, dynindx, + dyntype, dynaddend); } goto default_reloc; @@ -4650,6 +4424,14 @@ elf64_alpha_relocate_section (output_bfd input_bfd, h->root.root.root.string); ret_val = FALSE; } + else if ((info->shared || info->pie) && undef_weak_ref) + { + (*_bfd_error_handler) + (_("%B: pc-relative relocation against undefined weak symbol %s"), + input_bfd, h->root.root.root.string); + ret_val = FALSE; + } + /* ??? .eh_frame references to discarded sections will be smashed to relocations against SHN_UNDEF. The .eh_frame format allows @@ -4834,15 +4616,14 @@ elf64_alpha_relocate_section (output_bfd dynamic sections here. */ static bfd_boolean -elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym) - bfd *output_bfd; - struct bfd_link_info *info; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +elf64_alpha_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { + struct alpha_elf_link_hash_entry *ah = (struct alpha_elf_link_hash_entry *)h; bfd *dynobj = elf_hash_table(info)->dynobj; - if (h->plt.offset != MINUS_ONE) + if (h->needs_plt) { /* Fill in the .plt entry for this symbol. */ asection *splt, *sgot, *srel; @@ -4854,83 +4635,71 @@ elf64_alpha_finish_dynamic_symbol (outpu BFD_ASSERT (h->dynindx != -1); - /* The first .got entry will be updated by the .plt with the - address of the target function. */ - gotent = ((struct alpha_elf_link_hash_entry *) h)->got_entries; - BFD_ASSERT (gotent && gotent->addend == 0); - splt = bfd_get_section_by_name (dynobj, ".plt"); BFD_ASSERT (splt != NULL); srel = bfd_get_section_by_name (dynobj, ".rela.plt"); BFD_ASSERT (srel != NULL); - sgot = alpha_elf_tdata (gotent->gotobj)->got; - BFD_ASSERT (sgot != NULL); - - got_addr = (sgot->output_section->vma - + sgot->output_offset - + gotent->got_offset); - plt_addr = (splt->output_section->vma - + splt->output_offset - + h->plt.offset); - - plt_index = (h->plt.offset - PLT_HEADER_SIZE) / PLT_ENTRY_SIZE; - - /* Fill in the entry in the procedure linkage table. */ - { - bfd_vma insn1, insn2, insn3; - insn1 = PLT_ENTRY_WORD1 | ((-(h->plt.offset + 4) >> 2) & 0x1fffff); - insn2 = PLT_ENTRY_WORD2; - insn3 = PLT_ENTRY_WORD3; - - bfd_put_32 (output_bfd, insn1, splt->contents + h->plt.offset); - bfd_put_32 (output_bfd, insn2, splt->contents + h->plt.offset + 4); - bfd_put_32 (output_bfd, insn3, splt->contents + h->plt.offset + 8); - } - - /* Fill in the entry in the .rela.plt section. */ - outrel.r_offset = got_addr; - outrel.r_info = ELF64_R_INFO(h->dynindx, R_ALPHA_JMP_SLOT); - outrel.r_addend = 0; + for (gotent = ah->got_entries; gotent ; gotent = gotent->next) + if (gotent->reloc_type == R_ALPHA_LITERAL + && gotent->use_count > 0) + { + unsigned int insn; + int disp; - loc = srel->contents + plt_index * sizeof (Elf64_External_Rela); - bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + sgot = alpha_elf_tdata (gotent->gotobj)->got; + BFD_ASSERT (sgot != NULL); - if (!h->def_regular) - { - /* Mark the symbol as undefined, rather than as defined in the - .plt section. Leave the value alone. */ - sym->st_shndx = SHN_UNDEF; - } + BFD_ASSERT (gotent->got_offset != -1); + BFD_ASSERT (gotent->plt_offset != -1); - /* Fill in the entries in the .got. */ - bfd_put_64 (output_bfd, plt_addr, sgot->contents + gotent->got_offset); + got_addr = (sgot->output_section->vma + + sgot->output_offset + + gotent->got_offset); + plt_addr = (splt->output_section->vma + + splt->output_offset + + gotent->plt_offset); - /* Subsequent .got entries will continue to bounce through the .plt. */ - if (gotent->next) - { - srel = bfd_get_section_by_name (dynobj, ".rela.got"); - BFD_ASSERT (! info->shared || srel != NULL); + plt_index = (gotent->plt_offset-PLT_HEADER_SIZE) / PLT_ENTRY_SIZE; - gotent = gotent->next; - do - { - sgot = alpha_elf_tdata(gotent->gotobj)->got; - BFD_ASSERT(sgot != NULL); - BFD_ASSERT(gotent->addend == 0); + /* Fill in the entry in the procedure linkage table. */ + if (elf64_alpha_use_secureplt) + { + disp = (PLT_HEADER_SIZE - 4) - (gotent->plt_offset + 4); + insn = INSN_AD (INSN_BR, 31, disp); + bfd_put_32 (output_bfd, insn, + splt->contents + gotent->plt_offset); - bfd_put_64 (output_bfd, plt_addr, - sgot->contents + gotent->got_offset); + plt_index = ((gotent->plt_offset - NEW_PLT_HEADER_SIZE) + / NEW_PLT_ENTRY_SIZE); + } + else + { + disp = -(gotent->plt_offset + 4); + insn = INSN_AD (INSN_BR, 28, disp); + bfd_put_32 (output_bfd, insn, + splt->contents + gotent->plt_offset); + bfd_put_32 (output_bfd, INSN_UNOP, + splt->contents + gotent->plt_offset + 4); + bfd_put_32 (output_bfd, INSN_UNOP, + splt->contents + gotent->plt_offset + 8); - if (info->shared) - elf64_alpha_emit_dynrel (output_bfd, info, sgot, srel, - gotent->got_offset, 0, - R_ALPHA_RELATIVE, plt_addr); + plt_index = ((gotent->plt_offset - OLD_PLT_HEADER_SIZE) + / OLD_PLT_ENTRY_SIZE); + } - gotent = gotent->next; - } - while (gotent != NULL); - } + /* Fill in the entry in the .rela.plt section. */ + outrel.r_offset = got_addr; + outrel.r_info = ELF64_R_INFO(h->dynindx, R_ALPHA_JMP_SLOT); + outrel.r_addend = 0; + + loc = srel->contents + plt_index * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + + /* Fill in the entry in the .got. */ + bfd_put_64 (output_bfd, plt_addr, + sgot->contents + gotent->got_offset); + } } else if (alpha_elf_dynamic_symbol_p (h, info)) { @@ -4996,9 +4765,8 @@ elf64_alpha_finish_dynamic_symbol (outpu /* Finish up the dynamic sections. */ static bfd_boolean -elf64_alpha_finish_dynamic_sections (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; +elf64_alpha_finish_dynamic_sections (bfd *output_bfd, + struct bfd_link_info *info) { bfd *dynobj; asection *sdyn; @@ -5008,33 +4776,45 @@ elf64_alpha_finish_dynamic_sections (out if (elf_hash_table (info)->dynamic_sections_created) { - asection *splt; + asection *splt, *sgotplt, *srelaplt; Elf64_External_Dyn *dyncon, *dynconend; + bfd_vma plt_vma, gotplt_vma; splt = bfd_get_section_by_name (dynobj, ".plt"); + srelaplt = bfd_get_section_by_name (output_bfd, ".rela.plt"); BFD_ASSERT (splt != NULL && sdyn != NULL); + plt_vma = splt->output_section->vma + splt->output_offset; + + gotplt_vma = 0; + if (elf64_alpha_use_secureplt) + { + sgotplt = bfd_get_section_by_name (dynobj, ".got.plt"); + BFD_ASSERT (sgotplt != NULL); + if (sgotplt->size > 0) + gotplt_vma = sgotplt->output_section->vma + sgotplt->output_offset; + } + dyncon = (Elf64_External_Dyn *) sdyn->contents; dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->size); for (; dyncon < dynconend; dyncon++) { Elf_Internal_Dyn dyn; - const char *name; - asection *s; bfd_elf64_swap_dyn_in (dynobj, dyncon, &dyn); switch (dyn.d_tag) { case DT_PLTGOT: - name = ".plt"; - goto get_vma; + dyn.d_un.d_ptr + = elf64_alpha_use_secureplt ? gotplt_vma : plt_vma; + break; case DT_PLTRELSZ: - name = ".rela.plt"; - goto get_size; + dyn.d_un.d_val = srelaplt ? srelaplt->size : 0; + break; case DT_JMPREL: - name = ".rela.plt"; - goto get_vma; + dyn.d_un.d_ptr = srelaplt ? srelaplt->vma : 0; + break; case DT_RELASZ: /* My interpretation of the TIS v1.1 ELF document indicates @@ -5042,36 +4822,69 @@ elf64_alpha_finish_dynamic_sections (out the rest of the BFD does. It is, however, what the glibc ld.so wants. Do this fixup here until we found out who is right. */ - s = bfd_get_section_by_name (output_bfd, ".rela.plt"); - if (s) - dyn.d_un.d_val -= s->size; - break; - - get_vma: - s = bfd_get_section_by_name (output_bfd, name); - dyn.d_un.d_ptr = (s ? s->vma : 0); - break; - - get_size: - s = bfd_get_section_by_name (output_bfd, name); - dyn.d_un.d_val = s->size; + if (srelaplt) + dyn.d_un.d_val -= srelaplt->size; break; } bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); } - /* Initialize the PLT0 entry. */ + /* Initialize the plt header. */ if (splt->size > 0) { - bfd_put_32 (output_bfd, PLT_HEADER_WORD1, splt->contents); - bfd_put_32 (output_bfd, PLT_HEADER_WORD2, splt->contents + 4); - bfd_put_32 (output_bfd, PLT_HEADER_WORD3, splt->contents + 8); - bfd_put_32 (output_bfd, PLT_HEADER_WORD4, splt->contents + 12); - - /* The next two words will be filled in by ld.so */ - bfd_put_64 (output_bfd, (bfd_vma) 0, splt->contents + 16); - bfd_put_64 (output_bfd, (bfd_vma) 0, splt->contents + 24); + unsigned int insn; + int ofs; + + if (elf64_alpha_use_secureplt) + { + ofs = gotplt_vma - (plt_vma + PLT_HEADER_SIZE); + + insn = INSN_ABC (INSN_SUBQ, 27, 28, 25); + bfd_put_32 (output_bfd, insn, splt->contents); + + insn = INSN_ABO (INSN_LDAH, 28, 28, (ofs + 0x8000) >> 16); + bfd_put_32 (output_bfd, insn, splt->contents + 4); + + insn = INSN_ABC (INSN_S4SUBQ, 25, 25, 25); + bfd_put_32 (output_bfd, insn, splt->contents + 8); + + insn = INSN_ABO (INSN_LDA, 28, 28, ofs); + bfd_put_32 (output_bfd, insn, splt->contents + 12); + + insn = INSN_ABO (INSN_LDQ, 27, 28, 0); + bfd_put_32 (output_bfd, insn, splt->contents + 16); + + insn = INSN_ABC (INSN_ADDQ, 25, 25, 25); + bfd_put_32 (output_bfd, insn, splt->contents + 20); + + insn = INSN_ABO (INSN_LDQ, 28, 28, 8); + bfd_put_32 (output_bfd, insn, splt->contents + 24); + + insn = INSN_AB (INSN_JMP, 31, 27); + bfd_put_32 (output_bfd, insn, splt->contents + 28); + + insn = INSN_AD (INSN_BR, 28, -PLT_HEADER_SIZE); + bfd_put_32 (output_bfd, insn, splt->contents + 32); + } + else + { + insn = INSN_AD (INSN_BR, 27, 0); /* br $27, .+4 */ + bfd_put_32 (output_bfd, insn, splt->contents); + + insn = INSN_ABO (INSN_LDQ, 27, 27, 12); + bfd_put_32 (output_bfd, insn, splt->contents + 4); + + insn = INSN_UNOP; + bfd_put_32 (output_bfd, insn, splt->contents + 8); + + insn = INSN_AB (INSN_JMP, 27, 27); + bfd_put_32 (output_bfd, insn, splt->contents + 12); + + /* The next two words will be filled in by ld.so. */ + bfd_put_64 (output_bfd, 0, splt->contents + 16); + bfd_put_64 (output_bfd, 0, splt->contents + 24); + } elf_section_data (splt->output_section)->this_hdr.sh_entsize = 0; } @@ -5085,9 +4898,7 @@ elf64_alpha_finish_dynamic_sections (out them all out sequentially. */ static bfd_boolean -elf64_alpha_final_link (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +elf64_alpha_final_link (bfd *abfd, struct bfd_link_info *info) { asection *o; struct bfd_link_order *p; @@ -5354,8 +5165,7 @@ elf64_alpha_final_link (abfd, info) } static enum elf_reloc_type_class -elf64_alpha_reloc_type_class (rela) - const Elf_Internal_Rela *rela; +elf64_alpha_reloc_type_class (const Elf_Internal_Rela *rela) { switch ((int) ELF64_R_TYPE (rela->r_info)) { @@ -5570,13 +5380,9 @@ static const struct elf_size_info alpha_ "FreeBSD" label in the ELF header. So we put this label on all executables and (for simplicity) also all other object files. */ -static void elf64_alpha_fbsd_post_process_headers - PARAMS ((bfd *, struct bfd_link_info *)); - static void -elf64_alpha_fbsd_post_process_headers (abfd, link_info) - bfd * abfd; - struct bfd_link_info * link_info ATTRIBUTE_UNUSED; +elf64_alpha_fbsd_post_process_headers (bfd * abfd, + struct bfd_link_info * link_info ATTRIBUTE_UNUSED) { Elf_Internal_Ehdr * i_ehdrp; /* ELF file header, internal form. */ diff -uprN binutils-2.16.90.0.3/bfd/elf64-mips.c binutils-2.16.91.0.1/bfd/elf64-mips.c --- binutils-2.16.90.0.3/bfd/elf64-mips.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf64-mips.c 2005-06-22 13:53:34.378404374 -0700 @@ -3102,6 +3102,7 @@ const struct elf_size_info mips_elf64_si MIPS-specific function only applies to IRIX5, which had no 64-bit ABI. */ #define bfd_elf64_find_nearest_line _bfd_mips_elf_find_nearest_line +#define bfd_elf64_find_inliner_info _bfd_mips_elf_find_inliner_info #define bfd_elf64_new_section_hook _bfd_mips_elf_new_section_hook #define bfd_elf64_set_section_contents _bfd_mips_elf_set_section_contents #define bfd_elf64_bfd_get_relocated_section_contents \ diff -uprN binutils-2.16.90.0.3/bfd/elf64-mmix.c binutils-2.16.91.0.1/bfd/elf64-mmix.c --- binutils-2.16.90.0.3/bfd/elf64-mmix.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf64-mmix.c 2005-06-22 13:53:34.383403548 -0700 @@ -2014,7 +2014,12 @@ mmix_elf_check_relocs (abfd, info, sec, if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } switch (ELF64_R_TYPE (rel->r_info)) { diff -uprN binutils-2.16.90.0.3/bfd/elf64-ppc.c binutils-2.16.91.0.1/bfd/elf64-ppc.c --- binutils-2.16.90.0.3/bfd/elf64-ppc.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf64-ppc.c 2005-06-22 13:53:34.396401401 -0700 @@ -3520,10 +3520,14 @@ ppc64_elf_link_hash_table_create (bfd *a only care about glist, but when compiled on a 32-bit host the bfd_vma fields are larger. Setting the bfd_vma to zero makes debugger inspection of these fields look nicer. */ - htab->elf.init_refcount.refcount = 0; - htab->elf.init_refcount.glist = NULL; - htab->elf.init_offset.offset = 0; - htab->elf.init_offset.glist = NULL; + htab->elf.init_got_refcount.refcount = 0; + htab->elf.init_got_refcount.glist = NULL; + htab->elf.init_plt_refcount.refcount = 0; + htab->elf.init_plt_refcount.glist = NULL; + htab->elf.init_got_offset.offset = 0; + htab->elf.init_got_offset.glist = NULL; + htab->elf.init_plt_offset.offset = 0; + htab->elf.init_plt_offset.glist = NULL; return &htab->elf.root; } @@ -3577,26 +3581,26 @@ ppc_stub_name (const asection *input_sec { len = 8 + 1 + strlen (h->elf.root.root.string) + 1 + 8 + 1; stub_name = bfd_malloc (len); - if (stub_name != NULL) - { - sprintf (stub_name, "%08x.%s+%x", - input_section->id & 0xffffffff, - h->elf.root.root.string, - (int) rel->r_addend & 0xffffffff); - } + if (stub_name == NULL) + return stub_name; + + sprintf (stub_name, "%08x.%s+%x", + input_section->id & 0xffffffff, + h->elf.root.root.string, + (int) rel->r_addend & 0xffffffff); } else { len = 8 + 1 + 8 + 1 + 8 + 1 + 8 + 1; stub_name = bfd_malloc (len); - if (stub_name != NULL) - { - sprintf (stub_name, "%08x.%x:%x+%x", - input_section->id & 0xffffffff, - sym_sec->id & 0xffffffff, - (int) ELF64_R_SYM (rel->r_info) & 0xffffffff, - (int) rel->r_addend & 0xffffffff); - } + if (stub_name == NULL) + return stub_name; + + sprintf (stub_name, "%08x.%x:%x+%x", + input_section->id & 0xffffffff, + sym_sec->id & 0xffffffff, + (int) ELF64_R_SYM (rel->r_info) & 0xffffffff, + (int) rel->r_addend & 0xffffffff); } if (stub_name[len - 2] == '+' && stub_name[len - 1] == '0') stub_name[len - 2] = 0; @@ -4155,9 +4159,7 @@ add_symbol_adjust (struct elf_link_hash_ else fdh->elf.ref_regular = 1; } - else if (fdh != NULL - && (fdh->elf.root.type == bfd_link_hash_defined - || fdh->elf.root.type == bfd_link_hash_defweak)) + else if (fdh != NULL) { unsigned entry_vis = ELF_ST_VISIBILITY (eh->elf.other) - 1; unsigned descr_vis = ELF_ST_VISIBILITY (fdh->elf.other) - 1; @@ -4166,7 +4168,9 @@ add_symbol_adjust (struct elf_link_hash_ else if (entry_vis > descr_vis) eh->elf.other += descr_vis - entry_vis; - if (eh->elf.root.type == bfd_link_hash_undefined) + if ((fdh->elf.root.type == bfd_link_hash_defined + || fdh->elf.root.type == bfd_link_hash_defweak) + && eh->elf.root.type == bfd_link_hash_undefined) { eh->elf.root.type = bfd_link_hash_undefweak; eh->was_undefined = 1; @@ -4361,7 +4365,12 @@ ppc64_elf_check_relocs (bfd *abfd, struc if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } r_type = ELF64_R_TYPE (rel->r_info); switch (r_type) @@ -5060,7 +5069,7 @@ ppc64_elf_gc_mark_hook (asection *sec, if (!rsec->gc_mark) _bfd_elf_gc_mark (info, rsec, ppc64_elf_gc_mark_hook); - rsec = opd_sym_section[sym->st_value / 8]; + rsec = opd_sym_section[(sym->st_value + rel->r_addend) / 8]; } } @@ -6151,6 +6160,7 @@ dec_dynrel_count (bfd_vma r_info, bfd_boolean ppc64_elf_edit_opd (bfd *obfd, struct bfd_link_info *info, + bfd_boolean no_opd_opt, bfd_boolean non_overlapping) { bfd *ibfd; @@ -6171,7 +6181,7 @@ ppc64_elf_edit_opd (bfd *obfd, struct bf bfd_size_type cnt_16b = 0; sec = bfd_get_section_by_name (ibfd, ".opd"); - if (sec == NULL) + if (sec == NULL || sec->size == 0) continue; amt = sec->size * sizeof (long) / 8; @@ -6180,11 +6190,16 @@ ppc64_elf_edit_opd (bfd *obfd, struct bf { /* check_relocs hasn't been called. Must be a ld -r link or --just-symbols object. */ - opd_adjust = bfd_zalloc (obfd, amt); + opd_adjust = bfd_alloc (obfd, amt); + if (opd_adjust == NULL) + return FALSE; ppc64_elf_section_data (sec)->opd.adjust = opd_adjust; } memset (opd_adjust, 0, amt); + if (no_opd_opt) + continue; + if (sec->sec_info_type == ELF_INFO_TYPE_JUST_SYMS) continue; @@ -6354,18 +6369,16 @@ ppc64_elf_edit_opd (bfd *obfd, struct bf elf_section_data (sec)->relocs = relstart; - wptr = sec->contents; - rptr = sec->contents; new_contents = sec->contents; - if (add_aux_fields) { new_contents = bfd_malloc (sec->size + cnt_16b * 8); if (new_contents == NULL) return FALSE; need_pad = FALSE; - wptr = new_contents; } + wptr = new_contents; + rptr = sec->contents; write_rel = relstart; skip = FALSE; diff -uprN binutils-2.16.90.0.3/bfd/elf64-ppc.h binutils-2.16.91.0.1/bfd/elf64-ppc.h --- binutils-2.16.90.0.3/bfd/elf64-ppc.h 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf64-ppc.h 2005-06-22 13:53:34.399400905 -0700 @@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin Street - F void ppc64_elf_init_stub_bfd (bfd *, struct bfd_link_info *); bfd_boolean ppc64_elf_edit_opd - (bfd *, struct bfd_link_info *, bfd_boolean); + (bfd *, struct bfd_link_info *, bfd_boolean, bfd_boolean); asection *ppc64_elf_tls_setup (bfd *, struct bfd_link_info *); bfd_boolean ppc64_elf_tls_optimize diff -uprN binutils-2.16.90.0.3/bfd/elf64-s390.c binutils-2.16.91.0.1/bfd/elf64-s390.c --- binutils-2.16.90.0.3/bfd/elf64-s390.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf64-s390.c 2005-06-22 13:53:34.409399253 -0700 @@ -945,7 +945,12 @@ elf_s390_check_relocs (abfd, info, sec, if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } /* Create got section and local_got_refcounts array if they are needed. */ diff -uprN binutils-2.16.90.0.3/bfd/elf64-sh64.c binutils-2.16.91.0.1/bfd/elf64-sh64.c --- binutils-2.16.90.0.3/bfd/elf64-sh64.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf64-sh64.c 2005-06-22 13:53:34.418397766 -0700 @@ -2456,7 +2456,12 @@ sh_elf64_check_relocs (bfd *abfd, struct if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } /* Some relocs require a global offset table. */ if (dynobj == NULL) diff -uprN binutils-2.16.90.0.3/bfd/elf64-x86-64.c binutils-2.16.91.0.1/bfd/elf64-x86-64.c --- binutils-2.16.90.0.3/bfd/elf64-x86-64.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf64-x86-64.c 2005-06-22 13:53:34.429395949 -0700 @@ -103,6 +103,15 @@ static reloc_howto_type x86_64_elf_howto HOWTO(R_X86_64_TPOFF32, 0, 2, 32, FALSE, 0, complain_overflow_signed, bfd_elf_generic_reloc, "R_X86_64_TPOFF32", FALSE, 0xffffffff, 0xffffffff, FALSE), + HOWTO(R_X86_64_PC64, 0, 4, 64, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_X86_64_PC64", FALSE, MINUS_ONE, MINUS_ONE, + TRUE), + HOWTO(R_X86_64_GOTOFF64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_X86_64_GOTOFF64", + FALSE, MINUS_ONE, MINUS_ONE, FALSE), + HOWTO(R_X86_64_GOTPC32, 0, 2, 32, TRUE, 0, complain_overflow_signed, + bfd_elf_generic_reloc, "R_X86_64_GOTPC32", + FALSE, 0xffffffff, 0xffffffff, TRUE), /* GNU extension to record C++ vtable hierarchy. */ HOWTO (R_X86_64_GNU_VTINHERIT, 0, 4, 0, FALSE, 0, complain_overflow_dont, @@ -147,6 +156,9 @@ static const struct elf_reloc_map x86_64 { BFD_RELOC_X86_64_DTPOFF32, R_X86_64_DTPOFF32, }, { BFD_RELOC_X86_64_GOTTPOFF, R_X86_64_GOTTPOFF, }, { BFD_RELOC_X86_64_TPOFF32, R_X86_64_TPOFF32, }, + { BFD_RELOC_64_PCREL, R_X86_64_PC64, }, + { BFD_RELOC_X86_64_GOTOFF64, R_X86_64_GOTOFF64, }, + { BFD_RELOC_X86_64_GOTPC32, R_X86_64_GOTPC32, }, { BFD_RELOC_VTABLE_INHERIT, R_X86_64_GNU_VTINHERIT, }, { BFD_RELOC_VTABLE_ENTRY, R_X86_64_GNU_VTENTRY, }, }; @@ -179,13 +191,13 @@ elf64_x86_64_info_to_howto (bfd *abfd AT r_type = ELF64_R_TYPE (dst->r_info); if (r_type < (unsigned int) R_X86_64_GNU_VTINHERIT) { - BFD_ASSERT (r_type <= (unsigned int) R_X86_64_TPOFF32); + BFD_ASSERT (r_type <= (unsigned int) R_X86_64_GOTPC32); i = r_type; } else { BFD_ASSERT (r_type < (unsigned int) R_X86_64_max); - i = r_type - ((unsigned int) R_X86_64_GNU_VTINHERIT - R_X86_64_TPOFF32 - 1); + i = r_type - ((unsigned int) R_X86_64_GNU_VTINHERIT - R_X86_64_GOTPC32 - 1); } cache_ptr->howto = &x86_64_elf_howto_table[i]; BFD_ASSERT (r_type == cache_ptr->howto->type); @@ -652,7 +664,12 @@ elf64_x86_64_check_relocs (bfd *abfd, st if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } r_type = elf64_x86_64_tls_transition (info, r_type, h == NULL); switch (r_type) @@ -749,7 +766,8 @@ elf64_x86_64_check_relocs (bfd *abfd, st } /* Fall through */ - //case R_X86_64_GOTPCREL: + case R_X86_64_GOTOFF64: + case R_X86_64_GOTPC32: create_got: if (htab->sgot == NULL) { @@ -802,6 +820,7 @@ elf64_x86_64_check_relocs (bfd *abfd, st case R_X86_64_PC8: case R_X86_64_PC16: case R_X86_64_PC32: + case R_X86_64_PC64: case R_X86_64_64: if (h != NULL && !info->shared) { @@ -816,7 +835,7 @@ elf64_x86_64_check_relocs (bfd *abfd, st /* We may need a .plt entry if the function this reloc refers to is in a shared lib. */ h->plt.refcount += 1; - if (r_type != R_X86_64_PC32) + if (r_type != R_X86_64_PC32 && r_type != R_X86_64_PC64) h->pointer_equality_needed = 1; } @@ -845,7 +864,8 @@ elf64_x86_64_check_relocs (bfd *abfd, st && (sec->flags & SEC_ALLOC) != 0 && (((r_type != R_X86_64_PC8) && (r_type != R_X86_64_PC16) - && (r_type != R_X86_64_PC32)) + && (r_type != R_X86_64_PC32) + && (r_type != R_X86_64_PC64)) || (h != NULL && (! info->symbolic || h->root.type == bfd_link_hash_defweak @@ -948,7 +968,8 @@ elf64_x86_64_check_relocs (bfd *abfd, st p->count += 1; if (r_type == R_X86_64_PC8 || r_type == R_X86_64_PC16 - || r_type == R_X86_64_PC32) + || r_type == R_X86_64_PC32 + || r_type == R_X86_64_PC64) p->pc_count += 1; } break; @@ -1093,6 +1114,7 @@ elf64_x86_64_gc_sweep_hook (bfd *abfd, s case R_X86_64_PC8: case R_X86_64_PC16: case R_X86_64_PC32: + case R_X86_64_PC64: if (info->shared) break; /* Fall thru */ @@ -1624,7 +1646,8 @@ elf64_x86_64_size_dynamic_sections (bfd if (s == htab->splt || s == htab->sgot - || s == htab->sgotplt) + || s == htab->sgotplt + || s == htab->sdynbss) { /* Strip this section if we don't need it; see the comment below. */ @@ -1940,6 +1963,42 @@ elf64_x86_64_relocate_section (bfd *outp break; + case R_X86_64_GOTOFF64: + /* Relocation is relative to the start of the global offset + table. */ + + /* Check to make sure it isn't a protected function symbol + for shared library since it may not be local when used + as function address. */ + if (info->shared + && h + && h->def_regular + && h->type == STT_FUNC + && ELF_ST_VISIBILITY (h->other) == STV_PROTECTED) + { + (*_bfd_error_handler) + (_("%B: relocation R_X86_64_GOTOFF64 against protected function `%s' can not be used when making a shared object"), + input_bfd, h->root.root.string); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + /* Note that sgot is not involved in this + calculation. We always want the start of .got.plt. If we + defined _GLOBAL_OFFSET_TABLE_ in a different way, as is + permitted by the ABI, we might have to change this + calculation. */ + relocation -= htab->sgotplt->output_section->vma + + htab->sgotplt->output_offset; + break; + + case R_X86_64_GOTPC32: + /* Use global offset table as symbol value. */ + relocation = htab->sgotplt->output_section->vma + + htab->sgotplt->output_offset; + unresolved_reloc = FALSE; + break; + case R_X86_64_PLT32: /* Relocation is to the entry for this symbol in the procedure linkage table. */ @@ -1998,6 +2057,7 @@ elf64_x86_64_relocate_section (bfd *outp case R_X86_64_8: case R_X86_64_16: case R_X86_64_32: + case R_X86_64_PC64: case R_X86_64_64: /* FIXME: The ABI says the linker should make sure the value is the same when it's zeroextended to 64 bit. */ @@ -2015,7 +2075,8 @@ elf64_x86_64_relocate_section (bfd *outp || h->root.type != bfd_link_hash_undefweak) && ((r_type != R_X86_64_PC8 && r_type != R_X86_64_PC16 - && r_type != R_X86_64_PC32) + && r_type != R_X86_64_PC32 + && r_type != R_X86_64_PC64) || !SYMBOL_CALLS_LOCAL (info, h))) || (ELIMINATE_COPY_RELOCS && !info->shared @@ -2059,6 +2120,7 @@ elf64_x86_64_relocate_section (bfd *outp && (r_type == R_X86_64_PC8 || r_type == R_X86_64_PC16 || r_type == R_X86_64_PC32 + || r_type == R_X86_64_PC64 || !info->shared || !info->symbolic || !h->def_regular)) diff -uprN binutils-2.16.90.0.3/bfd/elf-bfd.h binutils-2.16.91.0.1/bfd/elf-bfd.h --- binutils-2.16.90.0.3/bfd/elf-bfd.h 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf-bfd.h 2005-06-22 13:53:34.207432623 -0700 @@ -349,13 +349,15 @@ struct elf_link_hash_table /* The value to use when initialising got.refcount/offset and plt.refcount/offset in an elf_link_hash_entry. Set to zero when - the values are refcounts. Set to init_offset in - size_dynamic_sections when the values may be offsets. */ - union gotplt_union init_refcount; + the values are refcounts. Set to init_got_offset/init_plt_offset + in size_dynamic_sections when the values may be offsets. */ + union gotplt_union init_got_refcount; + union gotplt_union init_plt_refcount; /* The value to use for got.refcount/offset and plt.refcount/offset when the values may be offsets. Normally (bfd_vma) -1. */ - union gotplt_union init_offset; + union gotplt_union init_got_offset; + union gotplt_union init_plt_offset; /* The number of symbols found in the link which must be put into the .dynsym section. */ @@ -1486,6 +1488,11 @@ extern bfd_boolean _bfd_elf_set_arch_mac extern bfd_boolean _bfd_elf_find_nearest_line (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, unsigned int *); +extern bfd_boolean _bfd_elf_find_line + (bfd *, asymbol **, asymbol *, const char **, unsigned int *); +#define _bfd_generic_find_line _bfd_elf_find_line +extern bfd_boolean _bfd_elf_find_inliner_info + (bfd *, const char **, const char **, unsigned int *); #define _bfd_elf_read_minisymbols _bfd_generic_read_minisymbols #define _bfd_elf_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol extern int _bfd_elf_sizeof_headers diff -uprN binutils-2.16.90.0.3/bfd/elf.c binutils-2.16.91.0.1/bfd/elf.c --- binutils-2.16.90.0.3/bfd/elf.c 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf.c 2005-06-22 13:53:34.219430641 -0700 @@ -452,8 +452,11 @@ group_signature (bfd *abfd, Elf_Internal Elf_External_Sym_Shndx eshndx; Elf_Internal_Sym isym; - /* First we need to ensure the symbol table is available. */ - if (! bfd_section_from_shdr (abfd, ghdr->sh_link)) + /* First we need to ensure the symbol table is available. Make sure + that it is a symbol table section. */ + hdr = elf_elfsections (abfd) [ghdr->sh_link]; + if (hdr->sh_type != SHT_SYMTAB + || ! bfd_section_from_shdr (abfd, ghdr->sh_link)) return NULL; /* Go read the symbol. */ @@ -750,25 +753,45 @@ _bfd_elf_make_section_from_shdr (bfd *ab if ((hdr->sh_flags & SHF_TLS) != 0) flags |= SEC_THREAD_LOCAL; - /* The debugging sections appear to be recognized only by name, not - any sort of flag. */ - { - static const char *debug_sec_names [] = + if ((flags & SEC_ALLOC) == 0) { - ".debug", - ".gnu.linkonce.wi.", - ".line", - ".stab" - }; - int i; - - for (i = ARRAY_SIZE (debug_sec_names); i--;) - if (strncmp (name, debug_sec_names[i], strlen (debug_sec_names[i])) == 0) - break; - - if (i >= 0) - flags |= SEC_DEBUGGING; - } + /* The debugging sections appear to be recognized only by name, + not any sort of flag. Their SEC_ALLOC bits are cleared. */ + static const struct + { + const char *name; + int len; + } debug_sections [] = + { + { "debug", 5 }, /* 'd' */ + { NULL, 0 }, /* 'e' */ + { NULL, 0 }, /* 'f' */ + { "gnu.linkonce.wi.", 17 }, /* 'g' */ + { NULL, 0 }, /* 'h' */ + { NULL, 0 }, /* 'i' */ + { NULL, 0 }, /* 'j' */ + { NULL, 0 }, /* 'k' */ + { "line", 4 }, /* 'l' */ + { NULL, 0 }, /* 'm' */ + { NULL, 0 }, /* 'n' */ + { NULL, 0 }, /* 'o' */ + { NULL, 0 }, /* 'p' */ + { NULL, 0 }, /* 'q' */ + { NULL, 0 }, /* 'r' */ + { "stab", 4 } /* 's' */ + }; + + if (name [0] == '.') + { + int i = name [1] - 'd'; + if (i >= 0 + && i < (int) ARRAY_SIZE (debug_sections) + && debug_sections [i].name != NULL + && strncmp (&name [1], debug_sections [i].name, + debug_sections [i].len) == 0) + flags |= SEC_DEBUGGING; + } + } /* As a GNU extension, if the name begins with .gnu.linkonce, we only link a single copy of the section. This is used to support @@ -1391,7 +1414,8 @@ _bfd_elf_link_hash_newfunc (struct bfd_h /* Set local fields. */ ret->indx = -1; ret->dynindx = -1; - ret->got = ret->plt = htab->init_refcount; + ret->got = htab->init_got_refcount; + ret->plt = htab->init_plt_refcount; memset (&ret->size, 0, (sizeof (struct elf_link_hash_entry) - offsetof (struct elf_link_hash_entry, size))); /* Assume that we have been called by a non-ELF symbol reader. @@ -1464,7 +1488,7 @@ _bfd_elf_link_hash_hide_symbol (struct b struct elf_link_hash_entry *h, bfd_boolean force_local) { - h->plt = elf_hash_table (info)->init_offset; + h->plt = elf_hash_table (info)->init_plt_offset; h->needs_plt = 0; if (force_local) { @@ -1489,14 +1513,14 @@ _bfd_elf_link_hash_table_init const char *)) { bfd_boolean ret; + int can_refcount = get_elf_backend_data (abfd)->can_refcount; table->dynamic_sections_created = FALSE; table->dynobj = NULL; - /* Make sure can_refcount is extended to the width and signedness of - init_refcount before we subtract one from it. */ - table->init_refcount.refcount = get_elf_backend_data (abfd)->can_refcount; - table->init_refcount.refcount -= 1; - table->init_offset.offset = -(bfd_vma) 1; + table->init_got_refcount.refcount = can_refcount - 1; + table->init_plt_refcount.refcount = can_refcount - 1; + table->init_got_offset.offset = -(bfd_vma) 1; + table->init_plt_offset.offset = -(bfd_vma) 1; /* The first dynamic symbol is a dummy. */ table->dynsymcount = 1; table->dynstr = NULL; @@ -1728,6 +1752,8 @@ bfd_section_from_shdr (bfd *abfd, unsign name = bfd_elf_string_from_elf_section (abfd, elf_elfheader (abfd)->e_shstrndx, hdr->sh_name); + if (name == NULL) + return FALSE; switch (hdr->sh_type) { @@ -1748,6 +1774,9 @@ bfd_section_from_shdr (bfd *abfd, unsign case SHT_DYNAMIC: /* Dynamic linking information. */ if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex)) return FALSE; + if (hdr->sh_link > elf_numsections (abfd) + || elf_elfsections (abfd)[hdr->sh_link] == NULL) + return FALSE; if (elf_elfsections (abfd)[hdr->sh_link]->sh_type != SHT_STRTAB) { Elf_Internal_Shdr *dynsymhdr; @@ -1782,7 +1811,8 @@ bfd_section_from_shdr (bfd *abfd, unsign if (elf_onesymtab (abfd) == shindex) return TRUE; - BFD_ASSERT (hdr->sh_entsize == bed->s->sizeof_sym); + if (hdr->sh_entsize != bed->s->sizeof_sym) + return FALSE; BFD_ASSERT (elf_onesymtab (abfd) == 0); elf_onesymtab (abfd) = shindex; elf_tdata (abfd)->symtab_hdr = *hdr; @@ -1833,7 +1863,8 @@ bfd_section_from_shdr (bfd *abfd, unsign if (elf_dynsymtab (abfd) == shindex) return TRUE; - BFD_ASSERT (hdr->sh_entsize == bed->s->sizeof_sym); + if (hdr->sh_entsize != bed->s->sizeof_sym) + return FALSE; BFD_ASSERT (elf_dynsymtab (abfd) == 0); elf_dynsymtab (abfd) = shindex; elf_tdata (abfd)->dynsymtab_hdr = *hdr; @@ -1895,6 +1926,9 @@ bfd_section_from_shdr (bfd *abfd, unsign Elf_Internal_Shdr *hdr2 = elf_elfsections (abfd)[i]; if (hdr2->sh_link == shindex) { + /* Prevent endless recursion on broken objects. */ + if (i == shindex) + return FALSE; if (! bfd_section_from_shdr (abfd, i)) return FALSE; if (elf_onesymtab (abfd) == i) @@ -1914,6 +1948,11 @@ bfd_section_from_shdr (bfd *abfd, unsign Elf_Internal_Shdr *hdr2; unsigned int num_sec = elf_numsections (abfd); + if (hdr->sh_entsize + != (bfd_size_type) (hdr->sh_type == SHT_REL + ? bed->s->sizeof_rel : bed->s->sizeof_rela)) + return FALSE; + /* Check for a bogus link to avoid crashing. */ if ((hdr->sh_link >= SHN_LORESERVE && hdr->sh_link <= SHN_HIRESERVE) || hdr->sh_link >= num_sec) @@ -1972,6 +2011,10 @@ bfd_section_from_shdr (bfd *abfd, unsign return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); + /* Prevent endless recursion on broken objects. */ + if (elf_elfsections (abfd)[hdr->sh_info]->sh_type == SHT_REL + || elf_elfsections (abfd)[hdr->sh_info]->sh_type == SHT_RELA) + return FALSE; if (! bfd_section_from_shdr (abfd, hdr->sh_info)) return FALSE; target_sect = bfd_section_from_elf_index (abfd, hdr->sh_info); @@ -2011,6 +2054,8 @@ bfd_section_from_shdr (bfd *abfd, unsign break; case SHT_GNU_versym: + if (hdr->sh_entsize != sizeof (Elf_External_Versym)) + return FALSE; elf_dynversym (abfd) = shindex; elf_tdata (abfd)->dynversym_hdr = *hdr; return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); @@ -2029,6 +2074,8 @@ bfd_section_from_shdr (bfd *abfd, unsign /* We need a BFD section for objcopy and relocatable linking, and it's handy to have the signature available as the section name. */ + if (hdr->sh_entsize != GRP_ENTRY_SIZE) + return FALSE; name = group_signature (abfd, hdr); if (name == NULL) return FALSE; @@ -4125,22 +4172,20 @@ assign_file_positions_for_segments (bfd { bfd_size_type align; bfd_vma adjust; + unsigned int align_power = 0; - if ((abfd->flags & D_PAGED) != 0) - align = bed->maxpagesize; - else + for (i = 0, secpp = m->sections; i < m->count; i++, secpp++) { - unsigned int align_power = 0; - for (i = 0, secpp = m->sections; i < m->count; i++, secpp++) - { - unsigned int secalign; + unsigned int secalign; - secalign = bfd_get_section_alignment (abfd, *secpp); - if (secalign > align_power) - align_power = secalign; - } - align = (bfd_size_type) 1 << align_power; + secalign = bfd_get_section_alignment (abfd, *secpp); + if (secalign > align_power) + align_power = secalign; } + align = (bfd_size_type) 1 << align_power; + + if ((abfd->flags & D_PAGED) != 0 && bed->maxpagesize > align) + align = bed->maxpagesize; adjust = vma_page_aligned_bias (m->sections[0]->vma, off, align); off += adjust; @@ -4326,7 +4371,7 @@ assign_file_positions_for_segments (bfd /* The section VMA must equal the file position modulo the page size. */ bfd_size_type page = align; - if ((abfd->flags & D_PAGED) != 0) + if ((abfd->flags & D_PAGED) != 0 && bed->maxpagesize > page) page = bed->maxpagesize; adjust = vma_page_aligned_bias (sec->vma, p->p_vaddr + p->p_memsz, @@ -4912,8 +4957,9 @@ _bfd_elf_write_object_contents (bfd *abf } /* Write out the section header names. */ - if (bfd_seek (abfd, elf_tdata (abfd)->shstrtab_hdr.sh_offset, SEEK_SET) != 0 - || ! _bfd_elf_strtab_emit (abfd, elf_shstrtab (abfd))) + if (elf_shstrtab (abfd) != NULL + && (bfd_seek (abfd, elf_tdata (abfd)->shstrtab_hdr.sh_offset, SEEK_SET) != 0 + || ! _bfd_elf_strtab_emit (abfd, elf_shstrtab (abfd)))) return FALSE; if (bed->elf_backend_final_write_processing) @@ -6646,6 +6692,36 @@ _bfd_elf_find_nearest_line (bfd *abfd, return TRUE; } +/* Find the line for a symbol. */ + +bfd_boolean +_bfd_elf_find_line (bfd *abfd, asymbol **symbols, asymbol *symbol, + const char **filename_ptr, unsigned int *line_ptr) +{ + return _bfd_dwarf2_find_line (abfd, symbols, symbol, + filename_ptr, line_ptr, 0, + &elf_tdata (abfd)->dwarf2_find_line_info); +} + +/* After a call to bfd_find_nearest_line, successive calls to + bfd_find_inliner_info can be used to get source information about + each level of function inlining that terminated at the address + passed to bfd_find_nearest_line. Currently this is only supported + for DWARF2 with appropriate DWARF3 extensions. */ + +bfd_boolean +_bfd_elf_find_inliner_info (bfd *abfd, + const char **filename_ptr, + const char **functionname_ptr, + unsigned int *line_ptr) +{ + bfd_boolean found; + found = _bfd_dwarf2_find_inliner_info (abfd, filename_ptr, + functionname_ptr, line_ptr, + & elf_tdata (abfd)->dwarf2_find_line_info); + return found; +} + int _bfd_elf_sizeof_headers (bfd *abfd, bfd_boolean reloc) { diff -uprN binutils-2.16.90.0.3/bfd/elfcode.h binutils-2.16.91.0.1/bfd/elfcode.h --- binutils-2.16.90.0.3/bfd/elfcode.h 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elfcode.h 2005-06-22 13:53:34.430395784 -0700 @@ -632,7 +632,8 @@ elf_object_p (bfd *abfd) if (i_ehdrp->e_shnum == SHN_UNDEF) { i_ehdrp->e_shnum = i_shdr.sh_size; - if (i_ehdrp->e_shnum != i_shdr.sh_size) + if (i_ehdrp->e_shnum != i_shdr.sh_size + || i_ehdrp->e_shnum == 0) goto got_wrong_format_error; } @@ -649,7 +650,8 @@ elf_object_p (bfd *abfd) if (i_ehdrp->e_shnum != 1) { /* Check that we don't have a totally silly number of sections. */ - if (i_ehdrp->e_shnum > (unsigned int) -1 / sizeof (x_shdr)) + if (i_ehdrp->e_shnum > (unsigned int) -1 / sizeof (x_shdr) + || i_ehdrp->e_shnum > (unsigned int) -1 / sizeof (i_shdr)) goto got_wrong_format_error; where += (i_ehdrp->e_shnum - 1) * sizeof (x_shdr); @@ -670,10 +672,6 @@ elf_object_p (bfd *abfd) } } - /* A further sanity check. */ - if (i_ehdrp->e_shstrndx >= i_ehdrp->e_shnum) - goto got_wrong_format_error; - /* Allocate space for a copy of the section header table in internal form. */ if (i_ehdrp->e_shnum != 0) @@ -715,6 +713,20 @@ elf_object_p (bfd *abfd) goto got_no_match; elf_swap_shdr_in (abfd, &x_shdr, i_shdrp + shindex); + /* Sanity check sh_link and sh_info. */ + if (i_shdrp[shindex].sh_link >= num_sec + || (i_shdrp[shindex].sh_link >= SHN_LORESERVE + && i_shdrp[shindex].sh_link <= SHN_HIRESERVE)) + goto got_wrong_format_error; + + if (((i_shdrp[shindex].sh_flags & SHF_INFO_LINK) + || i_shdrp[shindex].sh_type == SHT_RELA + || i_shdrp[shindex].sh_type == SHT_REL) + && (i_shdrp[shindex].sh_info >= num_sec + || (i_shdrp[shindex].sh_info >= SHN_LORESERVE + && i_shdrp[shindex].sh_info <= SHN_HIRESERVE))) + goto got_wrong_format_error; + /* If the section is loaded, but not page aligned, clear D_PAGED. */ if (i_shdrp[shindex].sh_size != 0 @@ -727,6 +739,17 @@ elf_object_p (bfd *abfd) } } + /* A further sanity check. */ + if (i_ehdrp->e_shnum != 0) + { + if (i_ehdrp->e_shstrndx >= elf_numsections (abfd) + || (i_ehdrp->e_shstrndx >= SHN_LORESERVE + && i_ehdrp->e_shstrndx <= SHN_HIRESERVE)) + goto got_wrong_format_error; + } + else if (i_ehdrp->e_shstrndx != 0) + goto got_wrong_format_error; + /* Read in the program headers. */ if (i_ehdrp->e_phnum == 0) elf_tdata (abfd)->phdr = NULL; @@ -852,6 +875,12 @@ elf_write_relocs (bfd *abfd, asection *s if (sec->reloc_count == 0) return; + /* If we have opened an existing file for update, reloc_count may be + set even though we are not linking. In that case we have nothing + to do. */ + if (sec->orelocation == NULL) + return; + rela_hdr = &elf_section_data (sec)->rel_hdr; rela_hdr->sh_size = rela_hdr->sh_entsize * sec->reloc_count; @@ -1633,7 +1662,10 @@ NAME(_bfd_elf,bfd_from_remote_memory) for (i = 0; i < i_ehdr.e_phnum; ++i) { elf_swap_phdr_in (templ, &x_phdrs[i], &i_phdrs[i]); - if (i_phdrs[i].p_type == PT_LOAD) + /* IA-64 vDSO may have two mappings for one segment, where one mapping + is executable only, and one is read only. We must not use the + executable one. */ + if (i_phdrs[i].p_type == PT_LOAD && (i_phdrs[i].p_flags & PF_R)) { bfd_vma segment_end; segment_end = (i_phdrs[i].p_offset + i_phdrs[i].p_filesz @@ -1680,7 +1712,10 @@ NAME(_bfd_elf,bfd_from_remote_memory) } for (i = 0; i < i_ehdr.e_phnum; ++i) - if (i_phdrs[i].p_type == PT_LOAD) + /* IA-64 vDSO may have two mappings for one segment, where one mapping + is executable only, and one is read only. We must not use the + executable one. */ + if (i_phdrs[i].p_type == PT_LOAD && (i_phdrs[i].p_flags & PF_R)) { bfd_vma start = i_phdrs[i].p_offset & -i_phdrs[i].p_align; bfd_vma end = (i_phdrs[i].p_offset + i_phdrs[i].p_filesz diff -uprN binutils-2.16.90.0.3/bfd/elflink.c binutils-2.16.91.0.1/bfd/elflink.c --- binutils-2.16.90.0.3/bfd/elflink.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elflink.c 2005-06-22 13:53:34.438394462 -0700 @@ -1188,8 +1188,8 @@ _bfd_elf_merge_symbol (bfd *abfd, /* Handle the special case of an old common symbol merging with a new symbol which looks like a common symbol in a shared object. We change *PSEC and *PVALUE to make the new symbol look like a - common symbol, and let _bfd_generic_link_add_one_symbol will do - the right thing. */ + common symbol, and let _bfd_generic_link_add_one_symbol do the + right thing. */ if (newdyncommon && h->root.type == bfd_link_hash_common) @@ -2362,8 +2362,8 @@ _bfd_elf_adjust_dynamic_symbol (struct e if (h->root.type == bfd_link_hash_warning) { - h->plt = elf_hash_table (eif->info)->init_offset; - h->got = elf_hash_table (eif->info)->init_offset; + h->got = elf_hash_table (eif->info)->init_got_offset; + h->plt = elf_hash_table (eif->info)->init_plt_offset; /* When warning symbols are created, they **replace** the "real" entry in the hash table, thus we never get to see the real @@ -2392,7 +2392,7 @@ _bfd_elf_adjust_dynamic_symbol (struct e || (!h->ref_regular && (h->u.weakdef == NULL || h->u.weakdef->dynindx == -1)))) { - h->plt = elf_hash_table (eif->info)->init_offset; + h->plt = elf_hash_table (eif->info)->init_plt_offset; return TRUE; } @@ -4986,7 +4986,10 @@ bfd_elf_size_dynamic_sections (bfd *outp /* Any syms created from now on start with -1 in got.refcount/offset and plt.refcount/offset. */ - elf_hash_table (info)->init_refcount = elf_hash_table (info)->init_offset; + elf_hash_table (info)->init_got_refcount + = elf_hash_table (info)->init_got_offset; + elf_hash_table (info)->init_plt_refcount + = elf_hash_table (info)->init_plt_offset; /* The backend may have to create some sections regardless of whether we're dynamic or not. */ @@ -5377,7 +5380,7 @@ bfd_elf_size_dynamic_sections (bfd *outp { bfd_size_type indx; - name = basename (output_bfd->filename); + name = lbasename (output_bfd->filename); def.vd_hash = bfd_elf_hash (name); indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, name, FALSE); @@ -5600,7 +5603,7 @@ bfd_elf_size_dynamic_sections (bfd *outp indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, elf_dt_name (t->vn_bfd) != NULL ? elf_dt_name (t->vn_bfd) - : basename (t->vn_bfd->filename), + : lbasename (t->vn_bfd->filename), FALSE); if (indx == (bfd_size_type) -1) return FALSE; @@ -7084,14 +7087,10 @@ elf_link_input_bfd (struct elf_final_lin { BFD_ASSERT (r_symndx != 0); if (action & COMPLAIN) - { - (*_bfd_error_handler) - (_("`%s' referenced in section `%A' of %B: " - "defined in discarded section `%A' of %B"), - o, input_bfd, sec, sec->owner, sym_name); - bfd_set_error (bfd_error_bad_value); - return FALSE; - } + (*finfo->info->callbacks->einfo) + (_("%X`%s' referenced in section `%A' of %B: " + "defined in discarded section `%A' of %B"), + sym_name, o, input_bfd, sec, sec->owner); /* Try to do the best we can to support buggy old versions of gcc. If we've warned, or this is @@ -9068,27 +9067,6 @@ elf_gc_mark_dynamic_ref_symbol (struct e return TRUE; } -/* Mark sections containing global symbols. This is called through - elf_link_hash_traverse. */ - -static bfd_boolean -elf_mark_used_section (struct elf_link_hash_entry *h, - void *data ATTRIBUTE_UNUSED) -{ - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - { - asection *s = h->root.u.def.section; - if (s != NULL && s->output_section != NULL) - s->output_section->flags |= SEC_KEEP; - } - - return TRUE; -} - /* Do mark and sweep of unused sections. */ bfd_boolean @@ -9101,15 +9079,7 @@ bfd_elf_gc_sections (bfd *abfd, struct b struct elf_link_hash_entry *h, Elf_Internal_Sym *); if (!info->gc_sections) - { - /* If we are called when info->gc_sections is 0, we will mark - all sections containing global symbols for non-relocatable - link. */ - if (!info->relocatable) - elf_link_hash_traverse (elf_hash_table (info), - elf_mark_used_section, NULL); - return TRUE; - } + return bfd_generic_gc_sections (abfd, info); if (!get_elf_backend_data (abfd)->can_gc_sections || info->relocatable diff -uprN binutils-2.16.90.0.3/bfd/elf-m10300.c binutils-2.16.91.0.1/bfd/elf-m10300.c --- binutils-2.16.90.0.3/bfd/elf-m10300.c 2005-05-10 15:46:41.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elf-m10300.c 2005-06-22 13:53:34.213431632 -0700 @@ -717,7 +717,12 @@ mn10300_elf_check_relocs (abfd, info, se if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } /* Some relocs require a global offset table. */ if (dynobj == NULL) diff -uprN binutils-2.16.90.0.3/bfd/elfn32-mips.c binutils-2.16.91.0.1/bfd/elfn32-mips.c --- binutils-2.16.90.0.3/bfd/elfn32-mips.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elfn32-mips.c 2005-06-22 13:53:34.441393967 -0700 @@ -2356,6 +2356,7 @@ static const struct ecoff_debug_swap mip #define elf_backend_mips_irix_compat elf_n32_mips_irix_compat #define elf_backend_mips_rtype_to_howto mips_elf_n32_rtype_to_howto #define bfd_elf32_find_nearest_line _bfd_mips_elf_find_nearest_line +#define bfd_elf32_find_inliner_info _bfd_mips_elf_find_inliner_info #define bfd_elf32_new_section_hook _bfd_mips_elf_new_section_hook #define bfd_elf32_set_section_contents _bfd_mips_elf_set_section_contents #define bfd_elf32_bfd_get_relocated_section_contents \ diff -uprN binutils-2.16.90.0.3/bfd/elfxx-ia64.c binutils-2.16.91.0.1/bfd/elfxx-ia64.c --- binutils-2.16.90.0.3/bfd/elfxx-ia64.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elfxx-ia64.c 2005-06-22 13:53:34.448392810 -0700 @@ -681,42 +681,174 @@ bfd_elfNN_ia64_after_parse (int itanium) oor_branch_size = itanium ? sizeof (oor_ip) : sizeof (oor_brl); } -static void -elfNN_ia64_relax_brl (bfd_byte *contents, bfd_vma off) +#define BTYPE_SHIFT 6 +#define Y_SHIFT 26 +#define X6_SHIFT 27 +#define X4_SHIFT 27 +#define X3_SHIFT 33 +#define X2_SHIFT 31 +#define X_SHIFT 33 +#define OPCODE_SHIFT 37 + +#define OPCODE_BITS (0xfLL << OPCODE_SHIFT) +#define X6_BITS (0x3fLL << X6_SHIFT) +#define X4_BITS (0xfLL << X4_SHIFT) +#define X3_BITS (0x7LL << X3_SHIFT) +#define X2_BITS (0x3LL << X2_SHIFT) +#define X_BITS (0x1LL << X_SHIFT) +#define Y_BITS (0x1LL << Y_SHIFT) +#define BTYPE_BITS (0x7LL << BTYPE_SHIFT) +#define PREDICATE_BITS (0x3fLL) + +#define IS_NOP_B(i) \ + (((i) & (OPCODE_BITS | X6_BITS)) == (2LL << OPCODE_SHIFT)) +#define IS_NOP_F(i) \ + (((i) & (OPCODE_BITS | X_BITS | X6_BITS | Y_BITS)) \ + == (0x1LL << X6_SHIFT)) +#define IS_NOP_I(i) \ + (((i) & (OPCODE_BITS | X3_BITS | X6_BITS | Y_BITS)) \ + == (0x1LL << X6_SHIFT)) +#define IS_NOP_M(i) \ + (((i) & (OPCODE_BITS | X3_BITS | X2_BITS | X4_BITS | Y_BITS)) \ + == (0x1LL << X4_SHIFT)) +#define IS_BR_COND(i) \ + (((i) & (OPCODE_BITS | BTYPE_BITS)) == (0x4LL << OPCODE_SHIFT)) +#define IS_BR_CALL(i) \ + (((i) & OPCODE_BITS) == (0x5LL << OPCODE_SHIFT)) + +static bfd_boolean +elfNN_ia64_relax_br (bfd_byte *contents, bfd_vma off) { - unsigned int template, t0, t1, t2, t3; + unsigned int template, mlx; + bfd_vma t0, t1, s0, s1, s2, br_code; + long br_slot; bfd_byte *hit_addr; hit_addr = (bfd_byte *) (contents + off); - hit_addr -= (long) hit_addr & 0x3; - t0 = bfd_getl32 (hit_addr + 0); - t1 = bfd_getl32 (hit_addr + 4); - t2 = bfd_getl32 (hit_addr + 8); - t3 = bfd_getl32 (hit_addr + 12); + br_slot = (long) hit_addr & 0x3; + hit_addr -= br_slot; + t0 = bfd_getl64 (hit_addr + 0); + t1 = bfd_getl64 (hit_addr + 8); + + /* Check if we can turn br into brl. A label is always at the start + of the bundle. Even if there are predicates on NOPs, we still + perform this optimization. */ + template = t0 & 0x1e; + s0 = (t0 >> 5) & 0x1ffffffffffLL; + s1 = ((t0 >> 46) | (t1 << 18)) & 0x1ffffffffffLL; + s2 = (t1 >> 23) & 0x1ffffffffffLL; + switch (br_slot) + { + case 0: + /* Check if slot 1 and slot 2 are NOPs. Possible template is + BBB. We only need to check nop.b. */ + if (!(IS_NOP_B (s1) && IS_NOP_B (s2))) + return FALSE; + br_code = s0; + break; + case 1: + /* Check if slot 2 is NOP. Possible templates are MBB and BBB. + For BBB, slot 0 also has to be nop.b. */ + if (!((template == 0x12 /* MBB */ + && IS_NOP_B (s2)) + || (template == 0x16 /* BBB */ + && IS_NOP_B (s0) + && IS_NOP_B (s2)))) + return FALSE; + br_code = s1; + break; + case 2: + /* Check if slot 1 is NOP. Possible templates are MIB, MBB, BBB, + MMB and MFB. For BBB, slot 0 also has to be nop.b. */ + if (!((template == 0x10 /* MIB */ + && IS_NOP_I (s1)) + || (template == 0x12 /* MBB */ + && IS_NOP_B (s1)) + || (template == 0x16 /* BBB */ + && IS_NOP_B (s0) + && IS_NOP_B (s1)) + || (template == 0x18 /* MMB */ + && IS_NOP_M (s1)) + || (template == 0x1c /* MFB */ + && IS_NOP_F (s1)))) + return FALSE; + br_code = s2; + break; + default: + /* It should never happen. */ + abort (); + } + + /* We can turn br.cond/br.call into brl.cond/brl.call. */ + if (!(IS_BR_COND (br_code) || IS_BR_CALL (br_code))) + return FALSE; - /* Turn a MLX bundle into a MBB bundle with the same stop-bit + /* Turn br into brl by setting bit 40. */ + br_code |= 0x1LL << 40; + + /* Turn the old bundle into a MLX bundle with the same stop-bit variety. */ - template = 0x12; - if ((t0 & 0x1f) == 5) - template += 1; + if (t0 & 0x1) + mlx = 0x5; + else + mlx = 0x4; - /* Keep the instruction in slot 0. */ - t0 &= 0xffffffe0; - t1 &= 0x3fff; + if (template == 0x16) + { + /* For BBB, we need to put nop.m in slot 0. We keep the original + predicate only if slot 0 isn't br. */ + if (br_slot == 0) + t0 = 0LL; + else + t0 &= PREDICATE_BITS << 5; + t0 |= 0x1LL << (X4_SHIFT + 5); + } + else + { + /* Keep the original instruction in slot 0. */ + t0 &= 0x1ffffffffffLL << 5; + } - t0 |= template; + t0 |= mlx; - /* For slot 2, turn brl into br by masking out bit 40. */ - t2 &= 0xff800000; - t3 &= 0x7fffffff; + /* Put brl in slot 1. */ + t1 = br_code << 23; + + bfd_putl64 (t0, hit_addr); + bfd_putl64 (t1, hit_addr + 8); + return TRUE; +} + +static void +elfNN_ia64_relax_brl (bfd_byte *contents, bfd_vma off) +{ + int template; + bfd_byte *hit_addr; + bfd_vma t0, t1, i0, i1, i2; + hit_addr = (bfd_byte *) (contents + off); + hit_addr -= (long) hit_addr & 0x3; + t0 = bfd_getl64 (hit_addr); + t1 = bfd_getl64 (hit_addr + 8); + + /* Keep the instruction in slot 0. */ + i0 = (t0 >> 5) & 0x1ffffffffffLL; /* Use nop.b for slot 1. */ - t2 |= 0x100000; + i1 = 0x4000000000LL; + /* For slot 2, turn brl into br by masking out bit 40. */ + i2 = (t1 >> 23) & 0x0ffffffffffLL; - bfd_putl32 (t0, hit_addr); - bfd_putl32 (t1, hit_addr + 4); - bfd_putl32 (t2, hit_addr + 8); - bfd_putl32 (t3, hit_addr + 12); + /* Turn a MLX bundle into a MBB bundle with the same stop-bit + variety. */ + if (t0 & 0x1) + template = 0x13; + else + template = 0x12; + t0 = (i1 << 46) | (i0 << 5) | template; + t1 = (i2 << 23) | (i1 >> 18); + + bfd_putl64 (t0, hit_addr); + bfd_putl64 (t1, hit_addr + 8); } /* These functions do relaxation for IA-64 ELF. */ @@ -985,6 +1117,16 @@ elfNN_ia64_relax_section (abfd, sec, lin } else if (r_type == R_IA64_PCREL60B) continue; + else if (elfNN_ia64_relax_br (contents, roff)) + { + irel->r_info + = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info), + R_IA64_PCREL60B); + + /* Make the relocation offset point to slot 1. */ + irel->r_offset = (irel->r_offset & ~((bfd_vma) 0x3)) + 1; + continue; + } /* We can't put a trampoline in a .init/.fini section. Issue an error. */ diff -uprN binutils-2.16.90.0.3/bfd/elfxx-mips.c binutils-2.16.91.0.1/bfd/elfxx-mips.c --- binutils-2.16.90.0.3/bfd/elfxx-mips.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elfxx-mips.c 2005-06-22 13:53:34.456391489 -0700 @@ -4987,6 +4987,13 @@ _bfd_mips_elf_section_processing (bfd *a bfd_mips_elf_swap_options_in (abfd, (Elf_External_Options *) l, &intopt); + if (intopt.size < sizeof (Elf_External_Options)) + { + (*_bfd_error_handler) + (_("%B: Warning: bad `%s' option size %u smaller than its header"), + abfd, MIPS_ELF_OPTIONS_SECTION_NAME (abfd), intopt.size); + break; + } if (ABI_64_P (abfd) && intopt.kind == ODK_REGINFO) { bfd_byte buf[8]; @@ -5201,6 +5208,13 @@ _bfd_mips_elf_section_from_shdr (bfd *ab bfd_mips_elf_swap_options_in (abfd, (Elf_External_Options *) l, &intopt); + if (intopt.size < sizeof (Elf_External_Options)) + { + (*_bfd_error_handler) + (_("%B: Warning: bad `%s' option size %u smaller than its header"), + abfd, MIPS_ELF_OPTIONS_SECTION_NAME (abfd), intopt.size); + break; + } if (ABI_64_P (abfd) && intopt.kind == ODK_REGINFO) { Elf64_Internal_RegInfo intreg; @@ -5239,8 +5253,10 @@ bfd_boolean _bfd_mips_elf_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec) { register const char *name; + unsigned int sh_type; name = bfd_get_section_name (abfd, sec); + sh_type = hdr->sh_type; if (strcmp (name, ".liblist") == 0) { @@ -5342,6 +5358,12 @@ _bfd_mips_elf_fake_sections (bfd *abfd, hdr->sh_entsize = 8; } + /* In the unlikely event a special section is empty it has to lose its + special meaning. This may happen e.g. when using `strip' with the + "--only-keep-debug" option. */ + if (sec->size > 0 && !(sec->flags & SEC_HAS_CONTENTS)) + hdr->sh_type = sh_type; + /* The generic elf_fake_sections will set up REL_HDR using the default kind of relocations. We used to set up a second header for the non-default kind of relocations here, but only NewABI would use @@ -5828,6 +5850,10 @@ _bfd_mips_elf_check_relocs (bfd *abfd, s h = ((struct mips_elf_link_hash_entry *) sym_hashes[r_symndx - extsymoff]); + while (h->root.root.type == bfd_link_hash_indirect + || h->root.root.type == bfd_link_hash_warning) + h = (struct mips_elf_link_hash_entry *) h->root.root.u.i.link; + /* H is the symbol this stub is for. */ h->fn_stub = sec; @@ -7674,18 +7700,6 @@ _bfd_mips_elf_finish_dynamic_sections (b dyn.d_un.d_ptr = s->vma; break; - case DT_RELSZ: - /* Reduce DT_RELSZ to account for any relocations we - decided not to make. This is for the n64 irix rld, - which doesn't seem to apply any relocations if there - are trailing null entries. */ - s = mips_elf_rel_dyn_section (dynobj, FALSE); - dyn.d_un.d_val = (s->reloc_count - * (ABI_64_P (output_bfd) - ? sizeof (Elf64_Mips_External_Rel) - : sizeof (Elf32_External_Rel))); - break; - default: swap_out_p = FALSE; break; @@ -7747,6 +7761,55 @@ _bfd_mips_elf_finish_dynamic_sections (b } } + /* The generation of dynamic relocations for the non-primary gots + adds more dynamic relocations. We cannot count them until + here. */ + + if (elf_hash_table (info)->dynamic_sections_created) + { + bfd_byte *b; + bfd_boolean swap_out_p; + + BFD_ASSERT (sdyn != NULL); + + for (b = sdyn->contents; + b < sdyn->contents + sdyn->size; + b += MIPS_ELF_DYN_SIZE (dynobj)) + { + Elf_Internal_Dyn dyn; + asection *s; + + /* Read in the current dynamic entry. */ + (*get_elf_backend_data (dynobj)->s->swap_dyn_in) (dynobj, b, &dyn); + + /* Assume that we're going to modify it and write it out. */ + swap_out_p = TRUE; + + switch (dyn.d_tag) + { + case DT_RELSZ: + /* Reduce DT_RELSZ to account for any relocations we + decided not to make. This is for the n64 irix rld, + which doesn't seem to apply any relocations if there + are trailing null entries. */ + s = mips_elf_rel_dyn_section (dynobj, FALSE); + dyn.d_un.d_val = (s->reloc_count + * (ABI_64_P (output_bfd) + ? sizeof (Elf64_Mips_External_Rel) + : sizeof (Elf32_External_Rel))); + break; + + default: + swap_out_p = FALSE; + break; + } + + if (swap_out_p) + (*get_elf_backend_data (dynobj)->s->swap_dyn_out) + (dynobj, &dyn, b); + } + } + { asection *s; Elf32_compact_rel cpt; @@ -8625,6 +8688,20 @@ _bfd_mips_elf_find_nearest_line (bfd *ab filename_ptr, functionname_ptr, line_ptr); } + +bfd_boolean +_bfd_mips_elf_find_inliner_info (bfd *abfd, + const char **filename_ptr, + const char **functionname_ptr, + unsigned int *line_ptr) +{ + bfd_boolean found; + found = _bfd_dwarf2_find_inliner_info (abfd, filename_ptr, + functionname_ptr, line_ptr, + & elf_tdata (abfd)->dwarf2_find_line_info); + return found; +} + /* When are writing out the .options or .MIPS.options section, remember the bytes we are writing out, so that we can install the diff -uprN binutils-2.16.90.0.3/bfd/elfxx-mips.h binutils-2.16.91.0.1/bfd/elfxx-mips.h --- binutils-2.16.90.0.3/bfd/elfxx-mips.h 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elfxx-mips.h 2005-06-22 13:53:34.457391324 -0700 @@ -81,6 +81,8 @@ extern bfd_boolean _bfd_mips_elf_ignore_ extern bfd_boolean _bfd_mips_elf_find_nearest_line (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, unsigned int *); +extern bfd_boolean _bfd_mips_elf_find_inliner_info + (bfd *, const char **, const char **, unsigned int *); extern bfd_boolean _bfd_mips_elf_set_section_contents (bfd *, asection *, const void *, file_ptr, bfd_size_type); extern bfd_byte *_bfd_elf_mips_get_relocated_section_contents diff -uprN binutils-2.16.90.0.3/bfd/elfxx-sparc.c binutils-2.16.91.0.1/bfd/elfxx-sparc.c --- binutils-2.16.90.0.3/bfd/elfxx-sparc.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elfxx-sparc.c 2005-06-22 13:53:34.462390498 -0700 @@ -1019,7 +1019,12 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } /* Compatibility with old R_SPARC_REV32 reloc conflicting with R_SPARC_TLS_GD_HI22. */ diff -uprN binutils-2.16.90.0.3/bfd/elfxx-target.h binutils-2.16.91.0.1/bfd/elfxx-target.h --- binutils-2.16.90.0.3/bfd/elfxx-target.h 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/elfxx-target.h 2005-06-22 13:53:34.463390332 -0700 @@ -44,6 +44,9 @@ #ifndef bfd_elfNN_find_nearest_line #define bfd_elfNN_find_nearest_line _bfd_elf_find_nearest_line #endif +#ifndef bfd_elfNN_find_inliner_info +#define bfd_elfNN_find_inliner_info _bfd_elf_find_inliner_info +#endif #define bfd_elfNN_read_minisymbols _bfd_elf_read_minisymbols #define bfd_elfNN_minisymbol_to_symbol _bfd_elf_minisymbol_to_symbol #define bfd_elfNN_get_dynamic_symtab_upper_bound \ diff -uprN binutils-2.16.90.0.3/bfd/format.c binutils-2.16.91.0.1/bfd/format.c --- binutils-2.16.90.0.3/bfd/format.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/format.c 2005-06-22 13:53:34.463390332 -0700 @@ -173,6 +173,14 @@ bfd_check_format_matches (bfd *abfd, bfd if (matching) free (matching_vector); + /* If the file was opened for update, then `output_has_begun' + some time ago when the file was created. Do not recompute + sections sizes or alignments in _bfd_set_section_contents. + We can not set this flag until after checking the format, + because it will interfere with creation of BFD sections. */ + if (abfd->direction == both_direction) + abfd->output_has_begun = TRUE; + return TRUE; /* File position has moved, BTW. */ } @@ -319,6 +327,14 @@ bfd_check_format_matches (bfd *abfd, bfd if (matching) free (matching_vector); + /* If the file was opened for update, then `output_has_begun' + some time ago when the file was created. Do not recompute + sections sizes or alignments in _bfd_set_section_contents. + We can not set this flag until after checking the format, + because it will interfere with creation of BFD sections. */ + if (abfd->direction == both_direction) + abfd->output_has_begun = TRUE; + return TRUE; /* File position has moved, BTW. */ } diff -uprN binutils-2.16.90.0.3/bfd/i386msdos.c binutils-2.16.91.0.1/bfd/i386msdos.c --- binutils-2.16.90.0.3/bfd/i386msdos.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/i386msdos.c 2005-06-22 13:53:34.470389176 -0700 @@ -169,6 +169,7 @@ msdos_set_section_contents (abfd, sectio #define msdos_print_symbol _bfd_nosymbols_print_symbol #define msdos_get_symbol_info _bfd_nosymbols_get_symbol_info #define msdos_find_nearest_line _bfd_nosymbols_find_nearest_line +#define msdos_find_inliner_info _bfd_nosymbols_find_inliner_info #define msdos_get_lineno _bfd_nosymbols_get_lineno #define msdos_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) #define msdos_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name diff -uprN binutils-2.16.90.0.3/bfd/ieee.c binutils-2.16.91.0.1/bfd/ieee.c --- binutils-2.16.90.0.3/bfd/ieee.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/ieee.c 2005-06-22 13:53:34.472388846 -0700 @@ -3664,6 +3664,15 @@ ieee_find_nearest_line (bfd *abfd ATTRIB return FALSE; } +static bfd_boolean +ieee_find_inliner_info (bfd *abfd ATTRIBUTE_UNUSED, + const char **filename_ptr ATTRIBUTE_UNUSED, + const char **functionname_ptr ATTRIBUTE_UNUSED, + unsigned int *line_ptr ATTRIBUTE_UNUSED) +{ + return FALSE; +} + static int ieee_generic_stat_arch_elt (bfd *abfd, struct stat *buf) { diff -uprN binutils-2.16.90.0.3/bfd/ihex.c binutils-2.16.91.0.1/bfd/ihex.c --- binutils-2.16.90.0.3/bfd/ihex.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/ihex.c 2005-06-22 13:53:34.473388680 -0700 @@ -920,6 +920,7 @@ ihex_sizeof_headers (bfd *abfd ATTRIBUTE #define ihex_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name #define ihex_get_lineno _bfd_nosymbols_get_lineno #define ihex_find_nearest_line _bfd_nosymbols_find_nearest_line +#define ihex_find_inliner_info _bfd_nosymbols_find_inliner_info #define ihex_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define ihex_read_minisymbols _bfd_nosymbols_read_minisymbols #define ihex_minisymbol_to_symbol _bfd_nosymbols_minisymbol_to_symbol diff -uprN binutils-2.16.90.0.3/bfd/libaout.h binutils-2.16.91.0.1/bfd/libaout.h --- binutils-2.16.90.0.3/bfd/libaout.h 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/libaout.h 2005-06-22 13:53:34.477388020 -0700 @@ -590,6 +590,12 @@ extern bfd_boolean NAME (aout, final_lin extern bfd_boolean NAME (aout, bfd_free_cached_info) (bfd *); +#define aout_32_find_inliner_info _bfd_nosymbols_find_inliner_info +#if 0 /* Are these needed? */ +#define aout_16_find_inliner_info _bfd_nosymbols_find_inliner_info +#define aout_64_find_inliner_info _bfd_nosymbols_find_inliner_info +#endif + /* A.out uses the generic versions of these routines... */ #define aout_16_get_section_contents _bfd_generic_get_section_contents diff -uprN binutils-2.16.90.0.3/bfd/libbfd.c binutils-2.16.91.0.1/bfd/libbfd.c --- binutils-2.16.90.0.3/bfd/libbfd.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/libbfd.c 2005-06-22 13:53:34.479387689 -0700 @@ -918,3 +918,13 @@ read_signed_leb128 (bfd *abfd ATTRIBUTE_ *bytes_read_ptr = num_read; return result; } + +bfd_boolean +_bfd_generic_find_line (bfd *abfd ATTRIBUTE_UNUSED, + asymbol **symbols ATTRIBUTE_UNUSED, + asymbol *symbol ATTRIBUTE_UNUSED, + const char **filename_ptr ATTRIBUTE_UNUSED, + unsigned int *linenumber_ptr ATTRIBUTE_UNUSED) +{ + return FALSE; +} diff -uprN binutils-2.16.90.0.3/bfd/libbfd.h binutils-2.16.91.0.1/bfd/libbfd.h --- binutils-2.16.90.0.3/bfd/libbfd.h 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/libbfd.h 2005-06-22 13:53:34.481387359 -0700 @@ -317,6 +317,9 @@ extern bfd_boolean _bfd_archive_coff_con ((bfd_boolean (*) (bfd *, asection *, asymbol **, bfd_vma, const char **, \ const char **, unsigned int *)) \ bfd_false) +#define _bfd_nosymbols_find_inliner_info \ + ((bfd_boolean (*) (bfd *, const char **, const char **, unsigned int *)) \ + bfd_false) #define _bfd_nosymbols_bfd_make_debug_symbol \ ((asymbol *(*) (bfd *, void *, unsigned long)) bfd_nullvoidptr) #define _bfd_nosymbols_read_minisymbols \ @@ -420,7 +423,7 @@ extern bfd_boolean _bfd_stab_section_fin (bfd *, asymbol **, asection *, bfd_vma, bfd_boolean *, const char **, const char **, unsigned int *, void **); -/* Find the neaderst line using DWARF 1 debugging information. */ +/* Find the nearest line using DWARF 1 debugging information. */ extern bfd_boolean _bfd_dwarf1_find_nearest_line (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, unsigned int *); @@ -430,6 +433,18 @@ extern bfd_boolean _bfd_dwarf2_find_near (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, unsigned int *, unsigned int, void **); +/* Find the line using DWARF 2 debugging information. */ +extern bfd_boolean _bfd_dwarf2_find_line + (bfd *, asymbol **, asymbol *, const char **, + unsigned int *, unsigned int, void **); + +bfd_boolean _bfd_generic_find_line + (bfd *, asymbol **, asymbol *, const char **, unsigned int *); + +/* Find inliner info after calling bfd_find_nearest_line. */ +extern bfd_boolean _bfd_dwarf2_find_inliner_info + (bfd *, const char **, const char **, unsigned int *, void **); + /* Create a new section entry. */ extern struct bfd_hash_entry *bfd_section_hash_newfunc (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); @@ -907,6 +922,9 @@ static const char *const bfd_reloc_code_ "BFD_RELOC_HI16", "BFD_RELOC_HI16_S", "BFD_RELOC_LO16", + "BFD_RELOC_HI16_PCREL", + "BFD_RELOC_HI16_S_PCREL", + "BFD_RELOC_LO16_PCREL", "BFD_RELOC_MIPS16_HI16", "BFD_RELOC_MIPS16_HI16_S", "BFD_RELOC_MIPS16_LO16", @@ -1031,6 +1049,8 @@ static const char *const bfd_reloc_code_ "BFD_RELOC_X86_64_DTPOFF32", "BFD_RELOC_X86_64_GOTTPOFF", "BFD_RELOC_X86_64_TPOFF32", + "BFD_RELOC_X86_64_GOTOFF64", + "BFD_RELOC_X86_64_GOTPC32", "BFD_RELOC_NS32K_IMM_8", "BFD_RELOC_NS32K_IMM_16", "BFD_RELOC_NS32K_IMM_32", @@ -1149,9 +1169,37 @@ static const char *const bfd_reloc_code_ "BFD_RELOC_ARM_PCREL_BRANCH", "BFD_RELOC_ARM_PCREL_BLX", "BFD_RELOC_THUMB_PCREL_BLX", + "BFD_RELOC_THUMB_PCREL_BRANCH7", + "BFD_RELOC_THUMB_PCREL_BRANCH9", + "BFD_RELOC_THUMB_PCREL_BRANCH12", + "BFD_RELOC_THUMB_PCREL_BRANCH20", + "BFD_RELOC_THUMB_PCREL_BRANCH23", + "BFD_RELOC_THUMB_PCREL_BRANCH25", + "BFD_RELOC_ARM_OFFSET_IMM", + "BFD_RELOC_ARM_THUMB_OFFSET", + "BFD_RELOC_ARM_TARGET1", + "BFD_RELOC_ARM_ROSEGREL32", + "BFD_RELOC_ARM_SBREL32", + "BFD_RELOC_ARM_TARGET2", + "BFD_RELOC_ARM_PREL31", + "BFD_RELOC_ARM_JUMP_SLOT", + "BFD_RELOC_ARM_GLOB_DAT", + "BFD_RELOC_ARM_GOT32", + "BFD_RELOC_ARM_PLT32", + "BFD_RELOC_ARM_RELATIVE", + "BFD_RELOC_ARM_GOTOFF", + "BFD_RELOC_ARM_GOTPC", + "BFD_RELOC_ARM_TLS_GD32", + "BFD_RELOC_ARM_TLS_LDO32", + "BFD_RELOC_ARM_TLS_LDM32", + "BFD_RELOC_ARM_TLS_DTPOFF32", + "BFD_RELOC_ARM_TLS_DTPMOD32", + "BFD_RELOC_ARM_TLS_TPOFF32", + "BFD_RELOC_ARM_TLS_IE32", + "BFD_RELOC_ARM_TLS_LE32", "BFD_RELOC_ARM_IMMEDIATE", "BFD_RELOC_ARM_ADRL_IMMEDIATE", - "BFD_RELOC_ARM_OFFSET_IMM", + "BFD_RELOC_ARM_T32_IMMEDIATE", "BFD_RELOC_ARM_SHIFT_IMM", "BFD_RELOC_ARM_SMI", "BFD_RELOC_ARM_SWI", @@ -1163,33 +1211,12 @@ static const char *const bfd_reloc_code_ "BFD_RELOC_ARM_LITERAL", "BFD_RELOC_ARM_IN_POOL", "BFD_RELOC_ARM_OFFSET_IMM8", + "BFD_RELOC_ARM_T32_OFFSET_U8", + "BFD_RELOC_ARM_T32_OFFSET_IMM", "BFD_RELOC_ARM_HWLITERAL", "BFD_RELOC_ARM_THUMB_ADD", "BFD_RELOC_ARM_THUMB_IMM", "BFD_RELOC_ARM_THUMB_SHIFT", - "BFD_RELOC_ARM_THUMB_OFFSET", - "BFD_RELOC_ARM_GOT12", - "BFD_RELOC_ARM_GOT32", - "BFD_RELOC_ARM_JUMP_SLOT", - "BFD_RELOC_ARM_COPY", - "BFD_RELOC_ARM_GLOB_DAT", - "BFD_RELOC_ARM_PLT32", - "BFD_RELOC_ARM_RELATIVE", - "BFD_RELOC_ARM_GOTOFF", - "BFD_RELOC_ARM_GOTPC", - "BFD_RELOC_ARM_TLS_GD32", - "BFD_RELOC_ARM_TLS_LDO32", - "BFD_RELOC_ARM_TLS_LDM32", - "BFD_RELOC_ARM_TLS_DTPOFF32", - "BFD_RELOC_ARM_TLS_DTPMOD32", - "BFD_RELOC_ARM_TLS_TPOFF32", - "BFD_RELOC_ARM_TLS_IE32", - "BFD_RELOC_ARM_TLS_LE32", - "BFD_RELOC_ARM_TARGET1", - "BFD_RELOC_ARM_ROSEGREL32", - "BFD_RELOC_ARM_SBREL32", - "BFD_RELOC_ARM_TARGET2", - "BFD_RELOC_ARM_PREL31", "BFD_RELOC_SH_PCDISP8BY2", "BFD_RELOC_SH_PCDISP12BY2", "BFD_RELOC_SH_IMM3", @@ -1280,9 +1307,6 @@ static const char *const bfd_reloc_code_ "BFD_RELOC_SH_TLS_DTPMOD32", "BFD_RELOC_SH_TLS_DTPOFF32", "BFD_RELOC_SH_TLS_TPOFF32", - "BFD_RELOC_THUMB_PCREL_BRANCH9", - "BFD_RELOC_THUMB_PCREL_BRANCH12", - "BFD_RELOC_THUMB_PCREL_BRANCH23", "BFD_RELOC_ARC_B22_PCREL", "BFD_RELOC_ARC_B26", "BFD_RELOC_D10V_10_PCREL_R", diff -uprN binutils-2.16.90.0.3/bfd/libbfd-in.h binutils-2.16.91.0.1/bfd/libbfd-in.h --- binutils-2.16.90.0.3/bfd/libbfd-in.h 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/libbfd-in.h 2005-06-22 13:53:34.478387854 -0700 @@ -312,6 +312,9 @@ extern bfd_boolean _bfd_archive_coff_con ((bfd_boolean (*) (bfd *, asection *, asymbol **, bfd_vma, const char **, \ const char **, unsigned int *)) \ bfd_false) +#define _bfd_nosymbols_find_inliner_info \ + ((bfd_boolean (*) (bfd *, const char **, const char **, unsigned int *)) \ + bfd_false) #define _bfd_nosymbols_bfd_make_debug_symbol \ ((asymbol *(*) (bfd *, void *, unsigned long)) bfd_nullvoidptr) #define _bfd_nosymbols_read_minisymbols \ @@ -415,7 +418,7 @@ extern bfd_boolean _bfd_stab_section_fin (bfd *, asymbol **, asection *, bfd_vma, bfd_boolean *, const char **, const char **, unsigned int *, void **); -/* Find the neaderst line using DWARF 1 debugging information. */ +/* Find the nearest line using DWARF 1 debugging information. */ extern bfd_boolean _bfd_dwarf1_find_nearest_line (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, unsigned int *); @@ -425,6 +428,18 @@ extern bfd_boolean _bfd_dwarf2_find_near (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, unsigned int *, unsigned int, void **); +/* Find the line using DWARF 2 debugging information. */ +extern bfd_boolean _bfd_dwarf2_find_line + (bfd *, asymbol **, asymbol *, const char **, + unsigned int *, unsigned int, void **); + +bfd_boolean _bfd_generic_find_line + (bfd *, asymbol **, asymbol *, const char **, unsigned int *); + +/* Find inliner info after calling bfd_find_nearest_line. */ +extern bfd_boolean _bfd_dwarf2_find_inliner_info + (bfd *, const char **, const char **, unsigned int *, void **); + /* Create a new section entry. */ extern struct bfd_hash_entry *bfd_section_hash_newfunc (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); diff -uprN binutils-2.16.90.0.3/bfd/libcoff.h binutils-2.16.91.0.1/bfd/libcoff.h --- binutils-2.16.90.0.3/bfd/libcoff.h 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/libcoff.h 2005-06-22 13:53:34.482387194 -0700 @@ -349,6 +349,8 @@ extern asymbol *coff_bfd_make_debug_symb extern bfd_boolean coff_find_nearest_line (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, unsigned int *); +extern bfd_boolean coff_find_inliner_info + (bfd *, const char **, const char **, unsigned int *); extern int coff_sizeof_headers (bfd *, bfd_boolean); extern bfd_boolean bfd_coff_reloc16_relax_section diff -uprN binutils-2.16.90.0.3/bfd/libcoff-in.h binutils-2.16.91.0.1/bfd/libcoff-in.h --- binutils-2.16.90.0.3/bfd/libcoff-in.h 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/libcoff-in.h 2005-06-22 13:53:34.481387359 -0700 @@ -345,6 +345,8 @@ extern asymbol *coff_bfd_make_debug_symb extern bfd_boolean coff_find_nearest_line (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, unsigned int *); +extern bfd_boolean coff_find_inliner_info + (bfd *, const char **, const char **, unsigned int *); extern int coff_sizeof_headers (bfd *, bfd_boolean); extern bfd_boolean bfd_coff_reloc16_relax_section diff -uprN binutils-2.16.90.0.3/bfd/libecoff.h binutils-2.16.91.0.1/bfd/libecoff.h --- binutils-2.16.90.0.3/bfd/libecoff.h 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/libecoff.h 2005-06-22 13:53:34.483387028 -0700 @@ -289,6 +289,7 @@ extern bfd_boolean _bfd_ecoff_find_neare #define _bfd_ecoff_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define _bfd_ecoff_read_minisymbols _bfd_generic_read_minisymbols #define _bfd_ecoff_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol +#define _bfd_ecoff_find_inliner_info _bfd_nosymbols_find_inliner_info #define _bfd_ecoff_get_reloc_upper_bound coff_get_reloc_upper_bound extern long _bfd_ecoff_canonicalize_reloc diff -uprN binutils-2.16.90.0.3/bfd/mach-o.c binutils-2.16.91.0.1/bfd/mach-o.c --- binutils-2.16.90.0.3/bfd/mach-o.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/mach-o.c 2005-06-22 13:53:34.490385872 -0700 @@ -48,6 +48,7 @@ #define bfd_mach_o_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name #define bfd_mach_o_get_lineno _bfd_nosymbols_get_lineno #define bfd_mach_o_find_nearest_line _bfd_nosymbols_find_nearest_line +#define bfd_mach_o_find_inliner_info _bfd_nosymbols_find_inliner_info #define bfd_mach_o_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define bfd_mach_o_read_minisymbols _bfd_generic_read_minisymbols #define bfd_mach_o_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol diff -uprN binutils-2.16.90.0.3/bfd/Makefile.am binutils-2.16.91.0.1/bfd/Makefile.am --- binutils-2.16.90.0.3/bfd/Makefile.am 2005-05-10 15:46:40.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/Makefile.am 2005-06-22 13:53:34.121446830 -0700 @@ -88,6 +88,7 @@ ALL_MACHINES = \ cpu-mcore.lo \ cpu-mips.lo \ cpu-mmix.lo \ + cpu-ms1.lo \ cpu-msp430.lo \ cpu-or32.lo \ cpu-ns32k.lo \ @@ -146,6 +147,7 @@ ALL_MACHINES_CFILES = \ cpu-mcore.c \ cpu-mips.c \ cpu-mmix.c \ + cpu-ms1.c \ cpu-msp430.c \ cpu-or32.c \ cpu-ns32k.c \ @@ -251,6 +253,7 @@ BFD32_BACKENDS = \ elf32-mcore.lo \ elfxx-mips.lo \ elf32-mips.lo \ + elf32-ms1.lo \ elf32-msp430.lo \ elf32-openrisc.lo \ elf32-or32.lo \ @@ -421,6 +424,7 @@ BFD32_BACKENDS_CFILES = \ elf32-mcore.c \ elfxx-mips.c \ elf32-mips.c \ + elf32-ms1.c \ elf32-msp430.c \ elf32-openrisc.c \ elf32-or32.c \ @@ -647,7 +651,7 @@ po/BLD-POTFILES.in: @MAINT@ Makefile $(B | LC_COLLATE= sort > tmp.bld \ && mv tmp.bld $(srcdir)/po/BLD-POTFILES.in -diststuff: info +all diststuff: info # Various kinds of .o files to put in libbfd.a: # BFD_BACKENDS Routines the configured targets need. @@ -1264,8 +1268,8 @@ elf32-i370.lo: elf32-i370.c $(INCDIR)/fi $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-i386.lo: elf32-i386.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h elf-vxworks.h + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf-vxworks.h \ + $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-i860.lo: elf32-i860.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/i860.h \ @@ -1333,6 +1337,10 @@ elf32-mips.lo: elf32-mips.c $(INCDIR)/fi $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \ ecoffswap.h elf32-target.h +elf32-ms1.lo: elf32-ms1.c elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/elf/ms1.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-msp430.lo: elf32-msp430.c $(INCDIR)/filenames.h \ $(INCDIR)/libiberty.h $(INCDIR)/hashtab.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ @@ -1383,14 +1391,15 @@ elf32-sh-symbian.lo: elf32-sh-symbian.c $(INCDIR)/libiberty.h $(srcdir)/../opcodes/sh-opc.h \ elf32-target.h elfxx-sparc.lo: elfxx-sparc.c $(INCDIR)/filenames.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h elfxx-sparc.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/sparc.h \ - $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h + $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \ + elfxx-sparc.h elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h elfxx-sparc.h \ - elf32-target.h + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \ + elfxx-sparc.h elf32-target.h elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h \ @@ -1424,10 +1433,10 @@ elf-eh-frame.lo: elf-eh-frame.c $(INCDIR $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ $(INCDIR)/elf/dwarf2.h -elf-vxworks.lo: elf-vxworks.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ +elf-vxworks.lo: elf-vxworks.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/reloc-macros.h elf-vxworks.h + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + elf-vxworks.h epoc-pe-arm.lo: epoc-pe-arm.c pe-arm.c $(INCDIR)/filenames.h \ coff-arm.c $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h \ $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ @@ -1726,10 +1735,10 @@ elf64-sh64.lo: elf64-sh64.c $(INCDIR)/fi $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \ $(INCDIR)/elf/reloc-macros.h elf64-target.h elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \ - $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h elfxx-sparc.h \ + $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/opcode/sparc.h $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ - elf64-target.h + $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/sparc.h elfxx-sparc.h elf64-target.h elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h diff -uprN binutils-2.16.90.0.3/bfd/Makefile.in binutils-2.16.91.0.1/bfd/Makefile.in --- binutils-2.16.90.0.3/bfd/Makefile.in 2005-05-10 15:46:40.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/Makefile.in 2005-06-22 13:53:34.123446500 -0700 @@ -325,6 +325,7 @@ ALL_MACHINES = \ cpu-mcore.lo \ cpu-mips.lo \ cpu-mmix.lo \ + cpu-ms1.lo \ cpu-msp430.lo \ cpu-or32.lo \ cpu-ns32k.lo \ @@ -383,6 +384,7 @@ ALL_MACHINES_CFILES = \ cpu-mcore.c \ cpu-mips.c \ cpu-mmix.c \ + cpu-ms1.c \ cpu-msp430.c \ cpu-or32.c \ cpu-ns32k.c \ @@ -489,6 +491,7 @@ BFD32_BACKENDS = \ elf32-mcore.lo \ elfxx-mips.lo \ elf32-mips.lo \ + elf32-ms1.lo \ elf32-msp430.lo \ elf32-openrisc.lo \ elf32-or32.lo \ @@ -659,6 +662,7 @@ BFD32_BACKENDS_CFILES = \ elf32-mcore.c \ elfxx-mips.c \ elf32-mips.c \ + elf32-ms1.c \ elf32-msp430.c \ elf32-openrisc.c \ elf32-or32.c \ @@ -1253,7 +1257,7 @@ po/BLD-POTFILES.in: @MAINT@ Makefile $(B | LC_COLLATE= sort > tmp.bld \ && mv tmp.bld $(srcdir)/po/BLD-POTFILES.in -diststuff: info +all diststuff: info stamp-ofiles: Makefile rm -f tofiles @@ -1833,8 +1837,8 @@ elf32-i370.lo: elf32-i370.c $(INCDIR)/fi $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-i386.lo: elf32-i386.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h elf-vxworks.h + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf-vxworks.h \ + $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-i860.lo: elf32-i860.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/i860.h \ @@ -1902,6 +1906,10 @@ elf32-mips.lo: elf32-mips.c $(INCDIR)/fi $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \ ecoffswap.h elf32-target.h +elf32-ms1.lo: elf32-ms1.c elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/elf/ms1.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-msp430.lo: elf32-msp430.c $(INCDIR)/filenames.h \ $(INCDIR)/libiberty.h $(INCDIR)/hashtab.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ @@ -1952,14 +1960,15 @@ elf32-sh-symbian.lo: elf32-sh-symbian.c $(INCDIR)/libiberty.h $(srcdir)/../opcodes/sh-opc.h \ elf32-target.h elfxx-sparc.lo: elfxx-sparc.c $(INCDIR)/filenames.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h elfxx-sparc.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/sparc.h \ - $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h + $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \ + elfxx-sparc.h elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h elfxx-sparc.h \ - elf32-target.h + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \ + elfxx-sparc.h elf32-target.h elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h \ @@ -1993,10 +2002,10 @@ elf-eh-frame.lo: elf-eh-frame.c $(INCDIR $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ $(INCDIR)/elf/dwarf2.h -elf-vxworks.lo: elf-vxworks.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ +elf-vxworks.lo: elf-vxworks.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/reloc-macros.h elf-vxworks.h + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + elf-vxworks.h epoc-pe-arm.lo: epoc-pe-arm.c pe-arm.c $(INCDIR)/filenames.h \ coff-arm.c $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h \ $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ @@ -2295,10 +2304,10 @@ elf64-sh64.lo: elf64-sh64.c $(INCDIR)/fi $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \ $(INCDIR)/elf/reloc-macros.h elf64-target.h elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \ - $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h elfxx-sparc.h \ + $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/opcode/sparc.h $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ - elf64-target.h + $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/sparc.h elfxx-sparc.h elf64-target.h elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h diff -uprN binutils-2.16.90.0.3/bfd/mmo.c binutils-2.16.91.0.1/bfd/mmo.c --- binutils-2.16.90.0.3/bfd/mmo.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/mmo.c 2005-06-22 13:53:34.493385376 -0700 @@ -3202,6 +3202,7 @@ mmo_canonicalize_reloc (bfd *abfd ATTRIB /* FIXME: We can do better on this one, if we have a dwarf2 .debug_line section or if MMO line numbers are implemented. */ #define mmo_find_nearest_line _bfd_nosymbols_find_nearest_line +#define mmo_find_inliner_info _bfd_nosymbols_find_inliner_info #define mmo_make_empty_symbol _bfd_generic_make_empty_symbol #define mmo_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define mmo_read_minisymbols _bfd_generic_read_minisymbols diff -uprN binutils-2.16.90.0.3/bfd/nlm-target.h binutils-2.16.91.0.1/bfd/nlm-target.h --- binutils-2.16.90.0.3/bfd/nlm-target.h 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/nlm-target.h 2005-06-22 13:53:34.499384385 -0700 @@ -29,6 +29,7 @@ #define nlm_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) #define nlm_get_lineno _bfd_nosymbols_get_lineno #define nlm_find_nearest_line _bfd_nosymbols_find_nearest_line +#define nlm_find_inliner_info _bfd_nosymbols_find_inliner_info #define nlm_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define nlm_read_minisymbols _bfd_generic_read_minisymbols #define nlm_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol diff -uprN binutils-2.16.90.0.3/bfd/oasys.c binutils-2.16.91.0.1/bfd/oasys.c --- binutils-2.16.90.0.3/bfd/oasys.c 2005-05-10 15:46:42.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/oasys.c 2005-06-22 13:53:34.503383724 -0700 @@ -1132,6 +1132,15 @@ oasys_find_nearest_line (bfd *abfd ATTRI return FALSE; } +static bfd_boolean +oasys_find_inliner_info (bfd *abfd ATTRIBUTE_UNUSED, + const char **filename_ptr ATTRIBUTE_UNUSED, + const char **functionname_ptr ATTRIBUTE_UNUSED, + unsigned int *line_ptr ATTRIBUTE_UNUSED) +{ + return FALSE; +} + static int oasys_generic_stat_arch_elt (bfd *abfd, struct stat *buf) { diff -uprN binutils-2.16.90.0.3/bfd/opncls.c binutils-2.16.91.0.1/bfd/opncls.c --- binutils-2.16.90.0.3/bfd/opncls.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/opncls.c 2005-06-22 13:53:34.504383559 -0700 @@ -128,25 +128,31 @@ SECTION /* FUNCTION - bfd_openr + bfd_fopen SYNOPSIS - bfd *bfd_openr (const char *filename, const char *target); + bfd *bfd_fopen (const char *filename, const char *target, + const char *mode, int fd); DESCRIPTION - Open the file @var{filename} (using <>) with the target - @var{target}. Return a pointer to the created BFD. + Open the file @var{filename} with the target @var{target}. + Return a pointer to the created BFD. If @var{fd} is not -1, + then <> is used to open the file; otherwise, <> + is used. @var{mode} is passed directly to <> or + <>. Calls <>, so @var{target} is interpreted as by that function. + The new BFD is marked as cacheable iff @var{fd} is -1. + If <> is returned then an error has occured. Possible errors are <>, <> or <> error. */ bfd * -bfd_openr (const char *filename, const char *target) +bfd_fopen (const char *filename, const char *target, const char *mode, int fd) { bfd *nbfd; const bfd_target *target_vec; @@ -161,21 +167,74 @@ bfd_openr (const char *filename, const c _bfd_delete_bfd (nbfd); return NULL; } + +#ifdef HAVE_FDOPEN + if (fd != -1) + nbfd->iostream = fdopen (fd, mode); + else +#endif + nbfd->iostream = fopen (filename, mode); + if (nbfd->iostream == NULL) + { + bfd_set_error (bfd_error_system_call); + _bfd_delete_bfd (nbfd); + return NULL; + } + /* OK, put everything where it belongs. */ nbfd->filename = filename; - nbfd->direction = read_direction; - if (bfd_open_file (nbfd) == NULL) + /* Figure out whether the user is opening the file for reading, + writing, or both, by looking at the MODE argument. */ + if ((mode[0] == 'r' || mode[0] == 'w' || mode[0] == 'a') + && mode[1] == '+') + nbfd->direction = both_direction; + else if (mode[0] == 'r') + nbfd->direction = read_direction; + else + nbfd->direction = write_direction; + + if (! bfd_cache_init (nbfd)) { - /* File didn't exist, or some such. */ - bfd_set_error (bfd_error_system_call); _bfd_delete_bfd (nbfd); return NULL; } + nbfd->opened_once = TRUE; + /* If we opened the file by name, mark it cacheable; we can close it + and reopen it later. However, if a file descriptor was provided, + then it may have been opened with special flags that make it + unsafe to close and reopen the file. */ + if (fd == -1) + bfd_set_cacheable (nbfd, TRUE); return nbfd; } +/* +FUNCTION + bfd_openr + +SYNOPSIS + bfd *bfd_openr (const char *filename, const char *target); + +DESCRIPTION + Open the file @var{filename} (using <>) with the target + @var{target}. Return a pointer to the created BFD. + + Calls <>, so @var{target} is interpreted as by + that function. + + If <> is returned then an error has occured. Possible errors + are <>, <> or + <> error. +*/ + +bfd * +bfd_openr (const char *filename, const char *target) +{ + return bfd_fopen (filename, target, FOPEN_RB, -1); +} + /* Don't try to `optimize' this function: o - We lock using stack space so that interrupting the locking @@ -212,72 +271,32 @@ DESCRIPTION bfd * bfd_fdopenr (const char *filename, const char *target, int fd) { - bfd *nbfd; - const bfd_target *target_vec; + const char *mode; +#if defined(HAVE_FCNTL) && defined(F_GETFL) int fdflags; +#endif - bfd_set_error (bfd_error_system_call); #if ! defined(HAVE_FCNTL) || ! defined(F_GETFL) - fdflags = O_RDWR; /* Assume full access. */ + mode = FOPEN_RUB; /* Assume full access. */ #else fdflags = fcntl (fd, F_GETFL, NULL); -#endif if (fdflags == -1) - return NULL; - - nbfd = _bfd_new_bfd (); - if (nbfd == NULL) - return NULL; - - target_vec = bfd_find_target (target, nbfd); - if (target_vec == NULL) { - _bfd_delete_bfd (nbfd); + bfd_set_error (bfd_error_system_call); return NULL; } -#ifndef HAVE_FDOPEN - nbfd->iostream = fopen (filename, FOPEN_RB); -#else /* (O_ACCMODE) parens are to avoid Ultrix header file bug. */ switch (fdflags & (O_ACCMODE)) { - case O_RDONLY: nbfd->iostream = fdopen (fd, FOPEN_RB); break; - case O_WRONLY: nbfd->iostream = fdopen (fd, FOPEN_RUB); break; - case O_RDWR: nbfd->iostream = fdopen (fd, FOPEN_RUB); break; + case O_RDONLY: mode = FOPEN_RB; break; + case O_WRONLY: mode = FOPEN_RUB; break; + case O_RDWR: mode = FOPEN_RUB; break; default: abort (); } #endif - if (nbfd->iostream == NULL) - { - _bfd_delete_bfd (nbfd); - return NULL; - } - - /* OK, put everything where it belongs. */ - nbfd->filename = filename; - - /* As a special case we allow a FD open for read/write to - be written through, although doing so requires that we end - the previous clause with a preposition. */ - /* (O_ACCMODE) parens are to avoid Ultrix header file bug. */ - switch (fdflags & (O_ACCMODE)) - { - case O_RDONLY: nbfd->direction = read_direction; break; - case O_WRONLY: nbfd->direction = write_direction; break; - case O_RDWR: nbfd->direction = both_direction; break; - default: abort (); - } - - if (! bfd_cache_init (nbfd)) - { - _bfd_delete_bfd (nbfd); - return NULL; - } - nbfd->opened_once = TRUE; - - return nbfd; + return bfd_fopen (filename, target, mode, fd); } /* diff -uprN binutils-2.16.90.0.3/bfd/pef.c binutils-2.16.91.0.1/bfd/pef.c --- binutils-2.16.90.0.3/bfd/pef.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/pef.c 2005-06-22 13:53:34.516381577 -0700 @@ -37,6 +37,7 @@ #define bfd_pef_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) #define bfd_pef_get_lineno _bfd_nosymbols_get_lineno #define bfd_pef_find_nearest_line _bfd_nosymbols_find_nearest_line +#define bfd_pef_find_inliner_info _bfd_nosymbols_find_inliner_info #define bfd_pef_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define bfd_pef_read_minisymbols _bfd_generic_read_minisymbols #define bfd_pef_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol diff -uprN binutils-2.16.90.0.3/bfd/peXXigen.c binutils-2.16.91.0.1/bfd/peXXigen.c --- binutils-2.16.90.0.3/bfd/peXXigen.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/peXXigen.c 2005-06-22 13:53:34.515381742 -0700 @@ -1103,7 +1103,7 @@ pe_print_idata (bfd * abfd, void * vfile bfd_vma toc_address; bfd_vma start_address; bfd_byte *data; - int offset; + bfd_vma offset; if (!bfd_malloc_and_get_section (abfd, rel_section, &data)) { @@ -1114,6 +1114,13 @@ pe_print_idata (bfd * abfd, void * vfile offset = abfd->start_address - rel_section->vma; + if (offset >= rel_section->size || offset + 8 > rel_section->size) + { + if (data != NULL) + free (data); + return FALSE; + } + start_address = bfd_get_32 (abfd, data + offset); loadable_toc_address = bfd_get_32 (abfd, data + offset + 4); toc_address = loadable_toc_address - 32768; @@ -1182,6 +1189,9 @@ pe_print_idata (bfd * abfd, void * vfile if (hint_addr == 0 && first_thunk == 0) break; + if (dll_name - adj >= section->size) + break; + dll = (char *) data + dll_name - adj; fprintf (file, _("\n\tDLL Name: %s\n"), dll); diff -uprN binutils-2.16.90.0.3/bfd/ppcboot.c binutils-2.16.91.0.1/bfd/ppcboot.c --- binutils-2.16.90.0.3/bfd/ppcboot.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/ppcboot.c 2005-06-22 13:53:34.521380751 -0700 @@ -350,6 +350,7 @@ ppcboot_get_symbol_info (ignore_abfd, sy #define ppcboot_bfd_is_local_label_name bfd_generic_is_local_label_name #define ppcboot_get_lineno _bfd_nosymbols_get_lineno #define ppcboot_find_nearest_line _bfd_nosymbols_find_nearest_line +#define ppcboot_find_inliner_info _bfd_nosymbols_find_inliner_info #define ppcboot_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define ppcboot_read_minisymbols _bfd_generic_read_minisymbols #define ppcboot_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol diff -uprN binutils-2.16.90.0.3/bfd/reloc.c binutils-2.16.91.0.1/bfd/reloc.c --- binutils-2.16.90.0.3/bfd/reloc.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/reloc.c 2005-06-22 13:53:34.524380255 -0700 @@ -2063,6 +2063,19 @@ ENUMDOC Low 16 bits. ENUM + BFD_RELOC_HI16_PCREL +ENUMDOC + High 16 bits of 32-bit pc-relative value +ENUM + BFD_RELOC_HI16_S_PCREL +ENUMDOC + High 16 bits of 32-bit pc-relative value, adjusted +ENUM + BFD_RELOC_LO16_PCREL +ENUMDOC + Low 16 bits of pc-relative value + +ENUM BFD_RELOC_MIPS16_HI16 ENUMDOC MIPS16 high 16 bits of 32-bit value. @@ -2349,6 +2362,10 @@ ENUMX BFD_RELOC_X86_64_GOTTPOFF ENUMX BFD_RELOC_X86_64_TPOFF32 +ENUMX + BFD_RELOC_X86_64_GOTOFF64 +ENUMX + BFD_RELOC_X86_64_GOTPC32 ENUMDOC x86-64/elf relocations @@ -2622,104 +2639,139 @@ ENUMDOC Thumb 22 bit pc-relative branch. The lowest bit must be zero and is not stored in the instruction. The 2nd lowest bit comes from a 1 bit field in the instruction. + ENUM - BFD_RELOC_ARM_IMMEDIATE + BFD_RELOC_THUMB_PCREL_BRANCH7 ENUMX - BFD_RELOC_ARM_ADRL_IMMEDIATE + BFD_RELOC_THUMB_PCREL_BRANCH9 ENUMX - BFD_RELOC_ARM_OFFSET_IMM + BFD_RELOC_THUMB_PCREL_BRANCH12 ENUMX - BFD_RELOC_ARM_SHIFT_IMM + BFD_RELOC_THUMB_PCREL_BRANCH20 ENUMX - BFD_RELOC_ARM_SMI + BFD_RELOC_THUMB_PCREL_BRANCH23 ENUMX - BFD_RELOC_ARM_SWI + BFD_RELOC_THUMB_PCREL_BRANCH25 +ENUMDOC + Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. + The lowest bit must be zero and is not stored in the instruction. + Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an + "nn" one smaller in all cases. Note further that BRANCH23 + corresponds to R_ARM_THM_CALL. + +ENUM + BFD_RELOC_ARM_OFFSET_IMM +ENUMDOC + 12-bit immediate offset, used in ARM-format ldr and str instructions. + +ENUM + BFD_RELOC_ARM_THUMB_OFFSET +ENUMDOC + 5-bit immediate offset, used in Thumb-format ldr and str instructions. + +ENUM + BFD_RELOC_ARM_TARGET1 +ENUMDOC + Pc-relative or absolute relocation depending on target. Used for + entries in .init_array sections. +ENUM + BFD_RELOC_ARM_ROSEGREL32 +ENUMDOC + Read-only segment base relative address. +ENUM + BFD_RELOC_ARM_SBREL32 +ENUMDOC + Data segment base relative address. +ENUM + BFD_RELOC_ARM_TARGET2 +ENUMDOC + This reloc is used for references to RTTI data from exception handling + tables. The actual definition depends on the target. It may be a + pc-relative or some form of GOT-indirect relocation. +ENUM + BFD_RELOC_ARM_PREL31 +ENUMDOC + 31-bit PC relative address. + +ENUM + BFD_RELOC_ARM_JUMP_SLOT ENUMX - BFD_RELOC_ARM_MULTI + BFD_RELOC_ARM_GLOB_DAT ENUMX - BFD_RELOC_ARM_CP_OFF_IMM + BFD_RELOC_ARM_GOT32 ENUMX - BFD_RELOC_ARM_CP_OFF_IMM_S2 + BFD_RELOC_ARM_PLT32 ENUMX - BFD_RELOC_ARM_ADR_IMM + BFD_RELOC_ARM_RELATIVE ENUMX - BFD_RELOC_ARM_LDR_IMM + BFD_RELOC_ARM_GOTOFF ENUMX - BFD_RELOC_ARM_LITERAL + BFD_RELOC_ARM_GOTPC +ENUMDOC + Relocations for setting up GOTs and PLTs for shared libraries. + +ENUM + BFD_RELOC_ARM_TLS_GD32 ENUMX - BFD_RELOC_ARM_IN_POOL + BFD_RELOC_ARM_TLS_LDO32 ENUMX - BFD_RELOC_ARM_OFFSET_IMM8 + BFD_RELOC_ARM_TLS_LDM32 ENUMX - BFD_RELOC_ARM_HWLITERAL + BFD_RELOC_ARM_TLS_DTPOFF32 ENUMX - BFD_RELOC_ARM_THUMB_ADD + BFD_RELOC_ARM_TLS_DTPMOD32 ENUMX - BFD_RELOC_ARM_THUMB_IMM + BFD_RELOC_ARM_TLS_TPOFF32 ENUMX - BFD_RELOC_ARM_THUMB_SHIFT + BFD_RELOC_ARM_TLS_IE32 ENUMX - BFD_RELOC_ARM_THUMB_OFFSET + BFD_RELOC_ARM_TLS_LE32 +ENUMDOC + ARM thread-local storage relocations. + +ENUM + BFD_RELOC_ARM_IMMEDIATE ENUMX - BFD_RELOC_ARM_GOT12 + BFD_RELOC_ARM_ADRL_IMMEDIATE ENUMX - BFD_RELOC_ARM_GOT32 + BFD_RELOC_ARM_T32_IMMEDIATE ENUMX - BFD_RELOC_ARM_JUMP_SLOT + BFD_RELOC_ARM_SHIFT_IMM ENUMX - BFD_RELOC_ARM_COPY + BFD_RELOC_ARM_SMI ENUMX - BFD_RELOC_ARM_GLOB_DAT + BFD_RELOC_ARM_SWI ENUMX - BFD_RELOC_ARM_PLT32 + BFD_RELOC_ARM_MULTI ENUMX - BFD_RELOC_ARM_RELATIVE + BFD_RELOC_ARM_CP_OFF_IMM ENUMX - BFD_RELOC_ARM_GOTOFF + BFD_RELOC_ARM_CP_OFF_IMM_S2 ENUMX - BFD_RELOC_ARM_GOTPC + BFD_RELOC_ARM_ADR_IMM ENUMX - BFD_RELOC_ARM_TLS_GD32 + BFD_RELOC_ARM_LDR_IMM ENUMX - BFD_RELOC_ARM_TLS_LDO32 + BFD_RELOC_ARM_LITERAL ENUMX - BFD_RELOC_ARM_TLS_LDM32 + BFD_RELOC_ARM_IN_POOL ENUMX - BFD_RELOC_ARM_TLS_DTPOFF32 + BFD_RELOC_ARM_OFFSET_IMM8 ENUMX - BFD_RELOC_ARM_TLS_DTPMOD32 + BFD_RELOC_ARM_T32_OFFSET_U8 ENUMX - BFD_RELOC_ARM_TLS_TPOFF32 + BFD_RELOC_ARM_T32_OFFSET_IMM ENUMX - BFD_RELOC_ARM_TLS_IE32 + BFD_RELOC_ARM_HWLITERAL ENUMX - BFD_RELOC_ARM_TLS_LE32 + BFD_RELOC_ARM_THUMB_ADD +ENUMX + BFD_RELOC_ARM_THUMB_IMM +ENUMX + BFD_RELOC_ARM_THUMB_SHIFT ENUMDOC These relocs are only used within the ARM assembler. They are not (at present) written to any object files. -ENUM - BFD_RELOC_ARM_TARGET1 -ENUMDOC - Pc-relative or absolute relocation depending on target. Used for - entries in .init_array sections. -ENUM - BFD_RELOC_ARM_ROSEGREL32 -ENUMDOC - Read-only segment base relative address. -ENUM - BFD_RELOC_ARM_SBREL32 -ENUMDOC - Data segment base relative address. -ENUM - BFD_RELOC_ARM_TARGET2 -ENUMDOC - This reloc is used for References to RTTI dta from exception handling - tables. The actual definition depends on the target. It may be a - pc-relative or some form of GOT-indirect relocation. -ENUM - BFD_RELOC_ARM_PREL31 -ENUMDOC - 31-bit PC relative address. ENUM BFD_RELOC_SH_PCDISP8BY2 @@ -2905,16 +2957,6 @@ ENUMDOC Renesas / SuperH SH relocs. Not all of these appear in object files. ENUM - BFD_RELOC_THUMB_PCREL_BRANCH9 -ENUMX - BFD_RELOC_THUMB_PCREL_BRANCH12 -ENUMX - BFD_RELOC_THUMB_PCREL_BRANCH23 -ENUMDOC - Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must - be zero and is not stored in the instruction. - -ENUM BFD_RELOC_ARC_B22_PCREL ENUMDOC ARC Cores relocs. @@ -4478,6 +4520,27 @@ bfd_generic_relax_section (bfd *abfd ATT return TRUE; } +/* Mark sections containing global symbols. This is called through + bfd_link_hash_traverse. */ + +static bfd_boolean +bfd_mark_used_section (struct bfd_link_hash_entry *h, + void *data ATTRIBUTE_UNUSED) +{ + if (h->type == bfd_link_hash_warning) + h = h->u.i.link; + + if (h->type == bfd_link_hash_defined + || h->type == bfd_link_hash_defweak) + { + asection *s = h->u.def.section; + if (s != NULL && s->output_section != NULL) + s->output_section->flags |= SEC_KEEP; + } + + return TRUE; +} + /* INTERNAL_FUNCTION bfd_generic_gc_sections @@ -4488,13 +4551,18 @@ SYNOPSIS DESCRIPTION Provides default handling for relaxing for back ends which - don't do section gc -- i.e., does nothing. + don't do section gc -- i.e., does nothing besides the special + case for marking sections having global symbols. */ bfd_boolean bfd_generic_gc_sections (bfd *abfd ATTRIBUTE_UNUSED, - struct bfd_link_info *link_info ATTRIBUTE_UNUSED) + struct bfd_link_info *info) { + /* If called when info->gc_sections is 0, then mark all sections + containing global symbols with SEC_KEEP. */ + if (!info->gc_sections && !info->relocatable) + bfd_link_hash_traverse (info->hash, bfd_mark_used_section, NULL); return TRUE; } diff -uprN binutils-2.16.90.0.3/bfd/section.c binutils-2.16.91.0.1/bfd/section.c --- binutils-2.16.90.0.3/bfd/section.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/section.c 2005-06-22 13:53:34.525380090 -0700 @@ -1346,22 +1346,10 @@ bfd_set_section_contents (bfd *abfd, return FALSE; } - switch (abfd->direction) + if (!bfd_write_p (abfd)) { - case read_direction: - case no_direction: bfd_set_error (bfd_error_invalid_operation); return FALSE; - - case write_direction: - break; - - case both_direction: - /* File is opened for update. `output_has_begun' some time ago when - the file was created. Do not recompute sections sizes or alignments - in _bfd_set_section_content. */ - abfd->output_has_begun = TRUE; - break; } /* Record a copy of the data in memory if desired. */ diff -uprN binutils-2.16.90.0.3/bfd/simple.c binutils-2.16.91.0.1/bfd/simple.c --- binutils-2.16.90.0.3/bfd/simple.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/simple.c 2005-06-22 13:53:34.526379925 -0700 @@ -92,6 +92,11 @@ simple_dummy_multiple_definition (struct return TRUE; } +static void +simple_dummy_einfo (const char *fmt ATTRIBUTE_UNUSED, ...) +{ +} + struct saved_output_info { bfd_vma offset; @@ -187,6 +192,7 @@ bfd_simple_get_relocated_section_content callbacks.reloc_dangerous = simple_dummy_reloc_dangerous; callbacks.unattached_reloc = simple_dummy_unattached_reloc; callbacks.multiple_definition = simple_dummy_multiple_definition; + callbacks.einfo = simple_dummy_einfo; memset (&link_order, 0, sizeof (link_order)); link_order.next = NULL; diff -uprN binutils-2.16.90.0.3/bfd/som.c binutils-2.16.91.0.1/bfd/som.c --- binutils-2.16.90.0.3/bfd/som.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/som.c 2005-06-22 13:53:34.536378273 -0700 @@ -1054,7 +1054,7 @@ som_reloc_queue_find (unsigned char *p, static unsigned char * try_prev_fixup (bfd *abfd ATTRIBUTE_UNUSED, - int *subspace_reloc_sizep, + unsigned int *subspace_reloc_sizep, unsigned char *p, unsigned int size, struct reloc_queue *queue) @@ -2958,8 +2958,8 @@ som_write_space_strings (bfd *abfd, /* Chunk of memory that we can use as buffer space, then throw away. */ size_t tmp_space_size = SOM_TMP_BUFSIZE; - unsigned char *tmp_space = alloca (tmp_space_size); - unsigned char *p = tmp_space; + char *tmp_space = alloca (tmp_space_size); + char *p = tmp_space; unsigned int strings_size = 0; asection *section; bfd_size_type amt; @@ -3063,11 +3063,11 @@ som_write_symbol_strings (bfd *abfd, /* Chunk of memory that we can use as buffer space, then throw away. */ size_t tmp_space_size = SOM_TMP_BUFSIZE; - unsigned char *tmp_space = alloca (tmp_space_size); - unsigned char *p = tmp_space; + char *tmp_space = alloca (tmp_space_size); + char *p = tmp_space; unsigned int strings_size = 0; - unsigned char *comp[4]; + char *comp[4]; bfd_size_type amt; /* This gets a bit gruesome because of the compilation unit. The @@ -3227,7 +3227,7 @@ static bfd_boolean som_begin_writing (bfd *abfd) { unsigned long current_offset = 0; - int strings_size = 0; + unsigned int strings_size = 0; unsigned long num_spaces, num_subspaces, i; asection *section; unsigned int total_subspaces = 0; @@ -3576,12 +3576,12 @@ som_finish_writing (bfd *abfd) { int num_spaces = som_count_spaces (abfd); asymbol **syms = bfd_get_outsymbols (abfd); - int i, num_syms, strings_size; + int i, num_syms; int subspace_index = 0; file_ptr location; asection *section; unsigned long current_offset; - unsigned int total_reloc_size; + unsigned int strings_size, total_reloc_size; bfd_size_type amt; /* We must set up the version identifier here as objcopy/strip copy @@ -4842,7 +4842,7 @@ som_slurp_reloc_table (bfd *abfd, asymbol **symbols, bfd_boolean just_count) { - char *external_relocs; + unsigned char *external_relocs; unsigned int fixup_stream_size; arelent *internal_relocs; unsigned int num_relocs; @@ -6246,6 +6246,7 @@ som_bfd_link_split_section (bfd *abfd AT #define som_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data #define som_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data #define som_bfd_set_private_flags _bfd_generic_bfd_set_private_flags +#define som_find_inliner_info _bfd_nosymbols_find_inliner_info const bfd_target som_vec = { diff -uprN binutils-2.16.90.0.3/bfd/som.h binutils-2.16.91.0.1/bfd/som.h --- binutils-2.16.90.0.3/bfd/som.h 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/som.h 2005-06-22 13:53:34.537378108 -0700 @@ -214,7 +214,7 @@ struct som_section_data_struct { struct som_copyable_section_data_struct *copy_data; unsigned int reloc_size; - char *reloc_stream; + unsigned char *reloc_stream; struct space_dictionary_record *space_dict; struct som_subspace_dictionary_record *subspace_dict; }; diff -uprN binutils-2.16.90.0.3/bfd/srec.c binutils-2.16.91.0.1/bfd/srec.c --- binutils-2.16.90.0.3/bfd/srec.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/srec.c 2005-06-22 13:53:34.538377942 -0700 @@ -1188,6 +1188,7 @@ srec_print_symbol (bfd *abfd, #define srec_bfd_is_local_label_name bfd_generic_is_local_label_name #define srec_get_lineno _bfd_nosymbols_get_lineno #define srec_find_nearest_line _bfd_nosymbols_find_nearest_line +#define srec_find_inliner_info _bfd_nosymbols_find_inliner_info #define srec_make_empty_symbol _bfd_generic_make_empty_symbol #define srec_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define srec_read_minisymbols _bfd_generic_read_minisymbols diff -uprN binutils-2.16.90.0.3/bfd/targets.c binutils-2.16.91.0.1/bfd/targets.c --- binutils-2.16.90.0.3/bfd/targets.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/targets.c 2005-06-22 13:53:34.539377777 -0700 @@ -349,6 +349,8 @@ BFD_JUMP_TABLE macros. . NAME##_bfd_is_target_special_symbol, \ . NAME##_get_lineno, \ . NAME##_find_nearest_line, \ +. _bfd_generic_find_line, \ +. NAME##_find_inliner_info, \ . NAME##_bfd_make_debug_symbol, \ . NAME##_read_minisymbols, \ . NAME##_minisymbol_to_symbol @@ -370,6 +372,11 @@ BFD_JUMP_TABLE macros. . bfd_boolean (*_bfd_find_nearest_line) . (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, . const char **, const char **, unsigned int *); +. bfd_boolean (*_bfd_find_line) +. (bfd *, struct bfd_symbol **, struct bfd_symbol *, +. const char **, unsigned int *); +. bfd_boolean (*_bfd_find_inliner_info) +. (bfd *, const char **, const char **, unsigned int *); . {* Back-door to allow format-aware applications to create debug symbols . while using BFD for everything else. Currently used by the assembler . when creating COFF files. *} @@ -783,6 +790,7 @@ extern const bfd_target sco5_core_vec; extern const bfd_target trad_core_vec; extern const bfd_target bfd_elf32_am33lin_vec; +extern const bfd_target bfd_elf32_ms1_vec; static const bfd_target * const _bfd_target_vector[] = { #ifdef SELECT_VECS @@ -1113,6 +1121,7 @@ static const bfd_target * const _bfd_tar &we32kcoff_vec, &z8kcoff_vec, &bfd_elf32_am33lin_vec, + &bfd_elf32_ms1_vec, #endif /* not SELECT_VECS */ /* Always support S-records, for convenience. */ diff -uprN binutils-2.16.90.0.3/bfd/tekhex.c binutils-2.16.91.0.1/bfd/tekhex.c --- binutils-2.16.90.0.3/bfd/tekhex.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/tekhex.c 2005-06-22 13:53:34.540377612 -0700 @@ -895,6 +895,7 @@ tekhex_print_symbol (bfd *abfd, #define tekhex_bfd_is_local_label_name bfd_generic_is_local_label_name #define tekhex_get_lineno _bfd_nosymbols_get_lineno #define tekhex_find_nearest_line _bfd_nosymbols_find_nearest_line +#define tekhex_find_inliner_info _bfd_nosymbols_find_inliner_info #define tekhex_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define tekhex_read_minisymbols _bfd_generic_read_minisymbols #define tekhex_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol diff -uprN binutils-2.16.90.0.3/bfd/versados.c binutils-2.16.91.0.1/bfd/versados.c --- binutils-2.16.90.0.3/bfd/versados.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/versados.c 2005-06-22 13:53:34.541377447 -0700 @@ -792,6 +792,7 @@ versados_canonicalize_reloc (bfd *abfd, #define versados_bfd_is_local_label_name bfd_generic_is_local_label_name #define versados_get_lineno _bfd_nosymbols_get_lineno #define versados_find_nearest_line _bfd_nosymbols_find_nearest_line +#define versados_find_inliner_info _bfd_nosymbols_find_inliner_info #define versados_make_empty_symbol _bfd_generic_make_empty_symbol #define versados_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define versados_read_minisymbols _bfd_generic_read_minisymbols diff -uprN binutils-2.16.90.0.3/bfd/version.h binutils-2.16.91.0.1/bfd/version.h --- binutils-2.16.90.0.3/bfd/version.h 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/version.h 2005-06-22 13:53:34.541377447 -0700 @@ -1,3 +1,3 @@ -#define BFD_VERSION_DATE 20050510 +#define BFD_VERSION_DATE 20050622 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_string@ diff -uprN binutils-2.16.90.0.3/bfd/vms.c binutils-2.16.91.0.1/bfd/vms.c --- binutils-2.16.90.0.3/bfd/vms.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/vms.c 2005-06-22 13:53:34.546376621 -0700 @@ -972,6 +972,19 @@ vms_find_nearest_line (bfd * abfd ATTRIB return FALSE; } +static bfd_boolean +vms_find_inliner_info (bfd * abfd ATTRIBUTE_UNUSED, + const char **file ATTRIBUTE_UNUSED, + const char **func ATTRIBUTE_UNUSED, + unsigned int *line ATTRIBUTE_UNUSED) +{ +#if VMS_DEBUG + vms_debug (1, "vms_find_inliner_info (%p, , , )\n", + abfd); +#endif + return FALSE; +} + /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ diff -uprN binutils-2.16.90.0.3/bfd/xsym.c binutils-2.16.91.0.1/bfd/xsym.c --- binutils-2.16.90.0.3/bfd/xsym.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/bfd/xsym.c 2005-06-22 13:53:34.548376290 -0700 @@ -30,6 +30,7 @@ #define bfd_sym_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) #define bfd_sym_get_lineno _bfd_nosymbols_get_lineno #define bfd_sym_find_nearest_line _bfd_nosymbols_find_nearest_line +#define bfd_sym_find_inliner_info _bfd_nosymbols_find_inliner_info #define bfd_sym_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define bfd_sym_read_minisymbols _bfd_generic_read_minisymbols #define bfd_sym_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol diff -uprN binutils-2.16.90.0.3/binutils/acinclude.m4 binutils-2.16.91.0.1/binutils/acinclude.m4 --- binutils-2.16.90.0.3/binutils/acinclude.m4 2004-03-03 12:24:34.000000000 -0800 +++ binutils-2.16.91.0.1/binutils/acinclude.m4 2005-06-22 13:53:34.571372491 -0700 @@ -1,33 +1,2 @@ sinclude(../bfd/acinclude.m4) sinclude(../libiberty/aclibdl.m4) - -dnl sinclude(../libtool.m4) already included in bfd/acinclude.m4 -dnl The lines below arrange for aclocal not to bring libtool.m4 -dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake -dnl to add a definition of LIBTOOL to Makefile.in. -ifelse(yes,no,[ -AC_DEFUN([AM_PROG_LIBTOOL],) -AC_SUBST(LIBTOOL) -]) - -dnl sinclude(../gettext.m4) already included in bfd/acinclude.m4 -ifelse(yes,no,[ -AC_DEFUN([CY_WITH_NLS],) -AC_SUBST(INTLLIBS) -]) - -## Replacement for AC_PROG_LEX and AC_DECL_YYTEXT -## by Alexandre Oliva - -## We need to override the installed aclocal/lex.m4 because of a bug in -## this definition in the recommended automake snapshot of 000227: -## There were double-quotes around ``$missing_dir/missing flex'' which was -## bad since aclocal wraps it in double-quotes. - -dnl AM_PROG_LEX -dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT -AC_DEFUN([AM_PROG_LEX], -[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1) -AC_CHECK_PROGS(LEX, flex lex, [$missing_dir/missing flex]) -AC_PROG_LEX -AC_DECL_YYTEXT]) diff -uprN binutils-2.16.90.0.3/binutils/aclocal.m4 binutils-2.16.91.0.1/binutils/aclocal.m4 --- binutils-2.16.90.0.3/binutils/aclocal.m4 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/aclocal.m4 2005-06-22 13:53:34.573372160 -0700 @@ -1,155 +1,771 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p6 +# generated automatically by aclocal 1.9.5 -*- Autoconf -*- -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. -sinclude(../bfd/acinclude.m4) -sinclude(../libiberty/aclibdl.m4) +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -dnl sinclude(../libtool.m4) already included in bfd/acinclude.m4 -dnl The lines below arrange for aclocal not to bring libtool.m4 -dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake -dnl to add a definition of LIBTOOL to Makefile.in. -ifelse(yes,no,[ -AC_DEFUN([AM_PROG_LIBTOOL],) -AC_SUBST(LIBTOOL) +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.9.5])]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` ]) -dnl sinclude(../gettext.m4) already included in bfd/acinclude.m4 -ifelse(yes,no,[ -AC_DEFUN([CY_WITH_NLS],) -AC_SUBST(INTLLIBS) +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 7 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) -dnl AM_PROG_LEX -dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT -AC_DEFUN([AM_PROG_LEX], -[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1) -AC_CHECK_PROGS(LEX, flex lex, [$missing_dir/missing flex]) -AC_PROG_LEX -AC_DECL_YYTEXT]) - -# isc-posix.m4 serial 2 (gettext-0.11.2) -dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -# This file is not needed with autoconf-2.53 and newer. Remove it in 2005. - -# This test replaces the one in autoconf. -# Currently this macro should have the same name as the autoconf macro -# because gettext's gettext.m4 (distributed in the automake package) -# still uses it. Otherwise, the use in gettext.m4 makes autoheader -# give these diagnostics: -# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX -# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX - -undefine([AC_ISC_POSIX]) - -AC_DEFUN([AC_ISC_POSIX], - [ - dnl This test replaces the obsolescent AC_ISC_POSIX kludge. - AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) - ] -) -# Do all the work for Automake. This macro actually does too much -- -# some checks are only needed if your package does certain things. -# But this isn't really a big deal. +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 -# serial 1 +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) -dnl Usage: -dnl AM_INIT_AUTOMAKE(package,version, [no-define]) +# Do all the work for Automake. -*- Autoconf -*- +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL]) -PACKAGE=[$1] -AC_SUBST(PACKAGE) -VERSION=[$2] -AC_SUBST(VERSION) -dnl test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi -ifelse([$3],, -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) -AC_REQUIRE([AM_SANITY_CHECK]) -AC_REQUIRE([AC_ARG_PROGRAM]) -dnl FIXME This is truly gross. -missing_dir=`cd $ac_aux_dir && pwd` -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir) -AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir) -AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) -AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -AC_REQUIRE([AC_PROG_MAKE_SET])]) - -# Copyright 2002 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 -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"]) +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION so it can be traced. -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.4-p6])]) +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_PROG_LEX +# ----------- +# Autoconf leaves LEX=: if lex or flex can't be found. Change that to a +# "missing" invocation, for better error output. +AC_DEFUN([AM_PROG_LEX], +[AC_PREREQ(2.50)dnl +AC_REQUIRE([AM_MISSING_HAS_RUN])dnl +AC_REQUIRE([AC_PROG_LEX])dnl +if test "$LEX" = :; then + LEX=${am_missing_run}flex +fi]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. # -# Check to make sure that the build environment is sane. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. +# +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 -echo timestamp > conftestfile +echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "[$]*" = "X"; then + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` + set X `ls -t $srcdir/configure conftest.file` fi - if test "[$]*" != "X $srcdir/configure conftestfile" \ - && test "[$]*" != "X conftestfile $srcdir/configure"; then + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a @@ -159,7 +775,7 @@ if ( alias in your environment]) fi - test "[$]2" = conftestfile + test "$[2]" = conftest.file ) then # Ok. @@ -168,78 +784,130 @@ else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -rm -f conftest* AC_MSG_RESULT(yes)]) -dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) -dnl The program must properly implement --version. -AC_DEFUN([AM_MISSING_PROG], -[AC_MSG_CHECKING(for working $2) -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if ($2 --version) < /dev/null > /dev/null 2>&1; then - $1=$2 - AC_MSG_RESULT(found) -else - $1="$3/missing $2" - AC_MSG_RESULT(missing) +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) fi -AC_SUBST($1)]) +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Like AC_CONFIG_HEADER, but automatically create stamp file. +# Check how to create a tarball. -*- Autoconf -*- -AC_DEFUN([AM_CONFIG_HEADER], -[AC_PREREQ([2.12]) -AC_CONFIG_HEADER([$1]) -dnl When config.status generates a header, we must update the stamp-h file. -dnl This file resides in the same directory as the config header -dnl that is generated. We must strip everything past the first ":", -dnl and everything past the last "/". -AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl -ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, -<>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, -<>; do - case " <<$>>CONFIG_HEADERS " in - *" <<$>>am_file "*<<)>> - echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false ;; esac - am_indx=`expr "<<$>>am_indx" + 1` -done<<>>dnl>>) -changequote([,]))]) - -# Add --enable-maintainer-mode option to configure. -# From Jim Meyering - -# serial 1 - -AC_DEFUN([AM_MAINTAINER_MODE], -[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode is disabled by default - AC_ARG_ENABLE(maintainer-mode, -[ --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer], - USE_MAINTAINER_MODE=$enableval, - USE_MAINTAINER_MODE=no) - AC_MSG_RESULT($USE_MAINTAINER_MODE) - AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) - MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST(MAINT)dnl -] -) -# Define a conditional. - -AC_DEFUN([AM_CONDITIONAL], -[AC_SUBST($1_TRUE) -AC_SUBST($1_FALSE) -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi]) + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR +m4_include([acinclude.m4]) diff -uprN binutils-2.16.90.0.3/binutils/addr2line.c binutils-2.16.91.0.1/binutils/addr2line.c --- binutils-2.16.90.0.3/binutils/addr2line.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/addr2line.c 2005-06-22 13:53:34.574371995 -0700 @@ -39,6 +39,7 @@ #include "bucomm.h" #include "budemang.h" +static bfd_boolean unwind_inlines; /* -i, unwind inlined functions. */ static bfd_boolean with_functions; /* -f, show function names. */ static bfd_boolean do_demangle; /* -C, demangle names. */ static bfd_boolean base_names; /* -s, strip directory names. */ @@ -58,6 +59,7 @@ static struct option long_options[] = {"demangler", required_argument, NULL, OPTION_DEMANGLER}, {"exe", required_argument, NULL, 'e'}, {"functions", no_argument, NULL, 'f'}, + {"inlines", no_argument, NULL, 'i'}, {"target", required_argument, NULL, 'b'}, {"help", no_argument, NULL, 'H'}, {"version", no_argument, NULL, 'V'}, @@ -81,6 +83,7 @@ usage (FILE *stream, int status) fprintf (stream, _(" The options are:\n\ -b --target= Set the binary file format\n\ -e --exe= Set the input file name (default is a.out)\n\ + -i --inlines Unwind inlined functions\n\ -s --basenames Strip directory names\n\ -f --functions Show function names\n\ -C --demangle[=%s]\n\ @@ -190,36 +193,43 @@ translate_addresses (bfd *abfd) } else { - if (with_functions) - { - const char *name; - char *alloc = NULL; - - name = functionname; - if (name == NULL || *name == '\0') - name = "??"; - else if (do_demangle) - { - alloc = demangle (abfd, name); - name = alloc; - } - - printf ("%s\n", name); - - if (alloc != NULL) - free (alloc); - } - - if (base_names && filename != NULL) - { - char *h; - - h = strrchr (filename, '/'); - if (h != NULL) - filename = h + 1; - } + do { + if (with_functions) + { + const char *name; + char *alloc = NULL; + + name = functionname; + if (name == NULL || *name == '\0') + name = "??"; + else if (do_demangle) + { + alloc = demangle (abfd, name); + name = alloc; + } + + printf ("%s\n", name); + + if (alloc != NULL) + free (alloc); + } + + if (base_names && filename != NULL) + { + char *h; + + h = strrchr (filename, '/'); + if (h != NULL) + filename = h + 1; + } + + printf ("%s:%u\n", filename ? filename : "??", line); + if (!unwind_inlines) + found = FALSE; + else + found = bfd_find_inliner_info (abfd, &filename, &functionname, &line); + } while (found); - printf ("%s:%u\n", filename ? filename : "??", line); } /* fflush() is essential for using this command as a server @@ -299,7 +309,7 @@ main (int argc, char **argv) file_name = NULL; target = NULL; - while ((c = getopt_long (argc, argv, "b:Ce:sfHhVv", long_options, (int *) 0)) + while ((c = getopt_long (argc, argv, "b:Ce:sfHhiVv", long_options, (int *) 0)) != EOF) { switch (c) @@ -331,6 +341,9 @@ main (int argc, char **argv) case 'H': usage (stdout, 0); break; + case 'i': + unwind_inlines = TRUE; + break; case OPTION_DEMANGLER: demangler = optarg; break; diff -uprN binutils-2.16.90.0.3/binutils/ar.c binutils-2.16.91.0.1/binutils/ar.c --- binutils-2.16.90.0.3/binutils/ar.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/ar.c 2005-06-22 13:53:34.574371995 -0700 @@ -49,8 +49,6 @@ #define O_BINARY 0 #endif -#define BUFSIZE 8192 - /* Kludge declaration from BFD! This is ugly! FIXME! XXX */ struct ar_hdr * diff -uprN binutils-2.16.90.0.3/binutils/bucomm.c binutils-2.16.91.0.1/binutils/bucomm.c --- binutils-2.16.90.0.3/binutils/bucomm.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/bucomm.c 2005-06-22 13:53:34.575371830 -0700 @@ -31,6 +31,7 @@ #include #include /* ctime, maybe time_t */ +#include #ifndef HAVE_TIME_T_IN_TIME_H #ifndef HAVE_TIME_T_IN_TYPES_H @@ -475,3 +476,38 @@ get_file_size (const char * file_name) return 0; } + +/* Return the filename in a static buffer. */ + +const char * +bfd_get_archive_filename (bfd *abfd) +{ + static size_t curr = 0; + static char *buf; + size_t needed; + + assert (abfd != NULL); + + if (!abfd->my_archive) + return bfd_get_filename (abfd); + + needed = (strlen (bfd_get_filename (abfd->my_archive)) + + strlen (bfd_get_filename (abfd)) + 3); + if (needed > curr) + { + if (curr) + free (buf); + curr = needed + (needed >> 1); + buf = bfd_malloc (curr); + /* If we can't malloc, fail safe by returning just the file name. + This function is only used when building error messages. */ + if (!buf) + { + curr = 0; + return bfd_get_filename (abfd); + } + } + sprintf (buf, "%s(%s)", bfd_get_filename (abfd->my_archive), + bfd_get_filename (abfd)); + return buf; +} diff -uprN binutils-2.16.90.0.3/binutils/bucomm.h binutils-2.16.91.0.1/binutils/bucomm.h --- binutils-2.16.90.0.3/binutils/bucomm.h 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/bucomm.h 2005-06-22 13:53:34.575371830 -0700 @@ -147,7 +147,14 @@ void *alloca (); # define N_(String) (String) #endif +/* Used by ar.c and objcopy.c. */ +#define BUFSIZE 8192 + /* bucomm.c */ + +/* Return the filename in a static buffer. */ +const char *bfd_get_archive_filename (bfd *); + void bfd_nonfatal (const char *); void bfd_fatal (const char *) ATTRIBUTE_NORETURN; diff -uprN binutils-2.16.90.0.3/binutils/ChangeLog binutils-2.16.91.0.1/binutils/ChangeLog --- binutils-2.16.90.0.3/binutils/ChangeLog 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/ChangeLog 2005-06-22 13:53:34.550375960 -0700 @@ -1,3 +1,226 @@ +2005-06-17 Jakub Jelinek + + * readelf.c (CHECK_ENTSIZE_VALUES, CHECK_ENTSIZE): Define. + (process_section_headers): Use it. + (process_relocs): Don't crash if symsec is not SHT_SYMTAB + or SHT_DYNSYM. + (process_version_sections): Use sizeof (Elf_External_Versym) + instead of sh_entsize. + +2005-06-16 Nick Clifton + + * rename.c (simple_copy): Only define if it is going to be used. + (smart_rename): Mark the preserve_dates parameter as possibly + being unused. + + * resres.c (write_res_data): Prevent a potential compile time + warning by casting the return value from fwrite. + +2005-06-14 H.J. Lu + + PR 995 + * ar.c (BUFSIZE): Moved to ... + * bucomm.h (BUFSIZE): Here. + + * bucomm.c: Include . + (bfd_get_archive_filename): New. + * bucomm.h (bfd_get_archive_filename): New. + + * objcopy.c (copy_unknown_object): New. + (copy_object): Use bfd_get_archive_filename when reporting input + error. Don't call fatal on unknown arch. + (copy_archive): Call copy_unknown_object on unknown format or + arch. + +2005-06-14 Jakub Jelinek + + * readelf.c (cmalloc, xcmalloc, xcrealloc): New functions. + (get_data): Add nmemb argument. Return NULL if nmemb * size + overflows. If var == NULL, allocate one extra byte and + clear it. + (slurp_rela_relocs, slurp_rel_relocs, get_32bit_program_headers, + get_64bit_program_headers, get_program_headers, + get_32bit_section_headers, get_64bit_section_headers, + get_32bit_elf_symbols, get_64bit_elf_symbols, process_section_headers, + process_section_groups, process_relocs, slurp_ia64_unwind_table, + ia64_process_unwind, slurp_hppa_unwind_table, hppa_process_unwind, + get_32bit_dynamic_section, get_64bit_dynamic_section, + process_dynamic_section, process_version_sections, get_dynamic_data, + process_symbol_table, dump_section, load_debug_str, load_debug_loc, + load_debug_range, read_and_display_attr_value, process_debug_info, + get_debug_info, frame_need_space, display_debug_frames, + display_debug_section, process_mips_specific, process_gnu_liblist, + process_corefile_note_segment): Adjust get_data callers. Use + cmalloc, xcmalloc and xcrealloc instead of {m,xm,xre}alloc where + passed size is a product of 2 numbers. + + * readelf.c (print_mode): Fix comment typo. + (slurp_rela_relocs, slurp_rel_relocs): Fix memory leaks. + (dump_relocations): Fix a thinko in check for invalid st_name. + (process_program_headers): Don't crash if string_table is NULL. + (process_section_headers): Don't crash if e_shstrndx is invalid. + Ensure string_table_length is 0 if string_table == NULL. + Don't return just because string_table is NULL. + (process_section_groups): Don't crash if symtab's sh_link or + symbol's st_name is invalid. Fix a memory leak. Fix check for + invalid section number entry. + (process_relocs): Don't crash if relocation or symbol section's + sh_link is invalid. + (slurp_ia64_unwind_table, slurp_hppa_unwind_table): Don't crash if + relocation section's sh_info is invalid. + (ia64_process_unwind, hppa_process_unwind): Don't crash if symbol + table's sh_link is invalid. + (process_version_sections): Don't crash on version or symbol + section's sh_link is invalid. Don't crash if symbol's st_shndx + is invalid. + (process_symbol_table): Don't crash if string table is corrupt + or symbol's st_name, st_shndx, vna_name or vda_name is invalid. + (debug_apply_rela_addends): Don't crash if relocation section's + sh_info or sh_link is invalid. + (display_debug_loc): Warn for unterminated .debug_loc section + or start offsets not within .debug_loc section boundaries. + (process_gnu_liblist): Don't crash if liblist section's sh_link + or entry's l_name is invalid. + +2005-06-09 Jakub Jelinek + + * objdump.c (disassemble_bytes): Don't crash if q->howto == NULL. + If q->howto->name == NULL, print q->howto->type as number instead. + (dump_reloc_set): Likewise. + +2005-06-07 Eric Christopher + + * readelf.c (guess_is_rela): Support ms1. + (dump_relocations): Ditto. + (get_machine_name): Ditto. + +2005-06-07 Aldy Hernandez + Michael Snyder + Stan Cox + + * Makefile.am (readelf.o): Depend on ms1.h. + + * Makefile.in: Regenerate. + + * readelf.c: Include ms1.h. + +2005-06-06 H.J. Lu + + PR 990 + * nm.c (print_symbol): Call bfd_find_line before + bfd_find_nearest_line. + +2005-06-06 Alan Modra + + * NEWS: Mention new powerpc ld support. + +2005-06-03 Steve Ellcey + + * configure.in: Check for getc_unlocked prototype. + * configure: Regenerate. + * config.in: Regenerate. + * strings.c (get_char): Only call getc_unlocked if we have seen a + prototype. + +2005-06-03 Nick Clifton + + * configure.in (ALL_LINGUAS): Add zh_TW + * configure: Regenerate. + * po/zh_TW.po: New Chinese (traditional) translation. + +2005-05-31 Richard Henderson + + * readelf.c (dump_relocations): Special case R_ALPHA_LITUSE. + +2005-05-29 Richard Henderson + + * readelf.c (get_alpha_dynamic_type): New. + (get_dynamic_type): Call it. + +2005-05-24 H.J. Lu + + * readelf.c (process_section_groups): Report group section + index. Check if the section member index is valid. + +2005-05-23 Fred Fish + + * addr2line.c (unwind_inlines): New flag for 'i' option. + (usage): Document '-i' option. + (long_options): Recognize '--inlines'. + (translate_addresses): Loop, calling bfd_find_inliner_info as + necessary and printing multiple output lines. + (main): Handle 'i' option. + * doc/binutils.texi (addr2line): Document '-i' option. + * NEWS: Mention new addr2line '-i' option. + +2005-05-23 Nick Clifton + + * readelf.c (fetch_indirect_string): Display a warning message + when a corrupt DW_FORM_strp value is encountered. + + (process_debug_info): Mention that the compilation unit offset is + being displayed in hexadecimal. + + (display_debug_lines): Fix typo in name of .debug_line section. + +2005-05-19 Zack Weinberg + + * Makefile.am: Have 'all' depend on 'info'. + * Makefile.in: Regenerate. + +2005-05-19 Ben Elliston + + * readelf.c (read_and_display_attr_value): Handle a DW_AT_encoding + value of DW_ATE_GNU_decimal_float. + +2005-05-17 Daniel Jacobowitz + + * doc/Makefile.am (config.texi): Don't use $<. + * doc/Makefile.in: Regenerated. + +2005-05-15 Yitzchak Scott-Thoennes + + * deflex.l: Ignore CRs + +2005-05-15 Daniel Jacobowitz + + * acinclude.m4: Remove obsolete code. + * configure.in: Update AC_PREREQ. + * doc/Makefile.am (binutils_TEXINFOS): Define. + (config.texi): Depend on distributed files instead of built + files. + (binutils.dvi, binutils.info): Remove unnecessary rules. + (DISTCLEANFILES): Remove. + (install-data-local): Renamed from install. + (info-local): Renamed from info. + * Makefile.in, aclocal.m4, config.in, configure, + doc/Makefile.in: Regenerated. + +2005-05-14 Alan Modra + + * readelf.c (get_ppc_dynamic_type): Display DT_PPC_GOT, not + DT_PPC_GLINK. + +2005-05-13 Fred Fish + + * readelf.c: Fix a couple of obvious comment typos, + 'debug_str' -> 'debug_ranges' and proecess' -> 'process'. + +2005-05-13 H.J. Lu + + * readelf.c (dump_ia64_unwind): Get stamp with proper size. + +2005-05-12 Nick Clifton + + * readelf.c (display_debug_lines): If pointer_size has not been + found then assume that it is 4 in order to prevent a seg fault + when process_extend_line_op attempts to read the line data. + +2005-05-11 Alan Modra + + * readelf.c (get_ppc_dynamic_type): New function for DT_PPC_GLINK. + (get_dynamic_type): Call the above. + 2005-05-07 Nick Clifton * Update the address and phone number of the FSF organization in @@ -77,7 +300,7 @@ PR872 * objcopy.c (copy_archive): Initialise 'obfd' field of new name_list structure. - + * objcopy.c (copy_usage): Fix description of -K switch. * doc/binutils.texi (strip, objcopy): Fix description of -K @@ -184,7 +407,7 @@ * doc/binutils.texi: Document new VAX disassembler-specific option -M entry:0xfooba8. * NEWS: Mention the new option. - + 2005-03-29 Anil Paranjpe * MAINTAINERS: Add myself as H8300 maintainer. @@ -210,7 +433,7 @@ 2005-03-24 Dmitry Diky - * MAINTAINERS: Add myself as MSP430 maintainer. + * MAINTAINERS: Add myself as MSP430 maintainer. 2005-03-23 Nick Clifton @@ -246,7 +469,7 @@ * configure: Regenerate. 2005-03-15 Daniel Marques - Nick Clifton + Nick Clifton * objcopy.c (globalize_specific_list): New linked list of symbols to convert from local binding into global binding. diff -uprN binutils-2.16.90.0.3/binutils/ChangeLog.linux binutils-2.16.91.0.1/binutils/ChangeLog.linux --- binutils-2.16.90.0.3/binutils/ChangeLog.linux 2005-04-09 12:03:01.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/ChangeLog.linux 2005-06-22 13:53:34.555375134 -0700 @@ -1,3 +1,10 @@ +2005-05-14 H.J. Lu + + * acinclude.m4: Updated. + * aclocal.m4: Regenerated. + * config.in: Likewise. + * configure: Likewise. + 2003-11-24 H.J. Lu * cxxfilt.c (main): Updated. diff -uprN binutils-2.16.90.0.3/binutils/config.in binutils-2.16.91.0.1/binutils/config.in --- binutils-2.16.90.0.3/binutils/config.in 2005-04-29 10:50:26.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/config.in 2005-06-22 13:53:34.576371665 -0700 @@ -1,215 +1,225 @@ -/* config.in. Generated automatically from configure.in by autoheader. */ +/* config.in. Generated from configure.in by autoheader. */ +/* Define if you have weak symbol. */ +#undef HAVE_WEAK_SYMBOL + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +#undef CRAY_STACKSEG_END -/* Define if using alloca.c. */ +/* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA -/* Define to empty if the keyword does not work. */ -#undef const +/* Define to 1 if NLS is requested */ +#undef ENABLE_NLS -/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. - This function is required for alloca.c support on those systems. */ -#undef CRAY_STACKSEG_END +/* Suffix used for executables, if any. */ +#undef EXECUTABLE_SUFFIX -/* Define if you have alloca, as a function or macro. */ +/* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA -/* Define if you have and it should be used (not on Ultrix). */ +/* Define to 1 if you have and it should be used (not on Ultrix). + */ #undef HAVE_ALLOCA_H -/* Define if you have a working `mmap' system call. */ -#undef HAVE_MMAP +/* Define to 1 if you have the header file. */ +#undef HAVE_ARGZ_H -/* Define if you have that is POSIX.1 compatible. */ -#undef HAVE_SYS_WAIT_H +/* Define to 1 if you have the `dcgettext' function. */ +#undef HAVE_DCGETTEXT -/* Define as __inline if that's what the C compiler calls it. */ -#undef inline +/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you + don't. */ +#undef HAVE_DECL_GETC_UNLOCKED -/* Define to `long' if doesn't define. */ -#undef off_t +/* Is the prototype for getopt in in the expected format? */ +#undef HAVE_DECL_GETOPT -/* Define to `unsigned' if doesn't define. */ -#undef size_t +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown - */ -#undef STACK_DIRECTION +/* Define if dlopen exists. */ +#undef HAVE_DLOPEN -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS +/* Does the platform use an executable suffix? */ +#undef HAVE_EXECUTABLE_SUFFIX -/* Define if lex declares yytext as a char * by default, not a char[]. */ -#undef YYTEXT_POINTER +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H -/* Define if you have the __argz_count function. */ -#undef HAVE___ARGZ_COUNT +/* Is fopen64 available? */ +#undef HAVE_FOPEN64 -/* Define if you have the __argz_next function. */ -#undef HAVE___ARGZ_NEXT +/* Define to 1 if you have the `getcwd' function. */ +#undef HAVE_GETCWD -/* Define if you have the __argz_stringify function. */ -#undef HAVE___ARGZ_STRINGIFY +/* Define to 1 if you have the `getc_unlocked' function. */ +#undef HAVE_GETC_UNLOCKED -/* Define if you have the dcgettext function. */ -#undef HAVE_DCGETTEXT +/* Define to 1 if you have the `getpagesize' function. */ +#undef HAVE_GETPAGESIZE -/* Define if you have the getc_unlocked function. */ -#undef HAVE_GETC_UNLOCKED +/* Define as 1 if you have gettext and don't want to use GNU gettext. */ +#undef HAVE_GETTEXT -/* Define if you have the getcwd function. */ -#undef HAVE_GETCWD +/* Does define struct utimbuf? */ +#undef HAVE_GOOD_UTIME_H -/* Define if you have the getpagesize function. */ -#undef HAVE_GETPAGESIZE +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H -/* Define if you have the munmap function. */ +/* Define if your locale.h file contains LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LOCALE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MALLOC_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define to 1 if you have the `munmap' function. */ #undef HAVE_MUNMAP -/* Define if you have the putenv function. */ +/* Define to 1 if you have the header file. */ +#undef HAVE_NL_TYPES_H + +/* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV -/* Define if you have the sbrk function. */ +/* Define to 1 if you have the `sbrk' function. */ #undef HAVE_SBRK -/* Define if you have the setenv function. */ +/* Define to 1 if you have the `setenv' function. */ #undef HAVE_SETENV -/* Define if you have the setlocale function. */ +/* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE -/* Define if you have the setmode function. */ +/* Define to 1 if you have the `setmode' function. */ #undef HAVE_SETMODE -/* Define if you have the stpcpy function. */ +/* Is stat64 available? */ +#undef HAVE_STAT64 + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define if you have the stpcpy function */ #undef HAVE_STPCPY -/* Define if you have the strcasecmp function. */ +/* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP -/* Define if you have the strchr function. */ +/* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR -/* Define if you have the strcoll function. */ +/* Define to 1 if you have the `strcoll' function. */ #undef HAVE_STRCOLL -/* Define if you have the utimes function. */ -#undef HAVE_UTIMES - -/* Define if you have the header file. */ -#undef HAVE_ARGZ_H - -/* Define if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define if you have the header file. */ -#undef HAVE_FCNTL_H - -/* Define if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define if you have the header file. */ -#undef HAVE_LOCALE_H - -/* Define if you have the header file. */ -#undef HAVE_MALLOC_H - -/* Define if you have the header file. */ -#undef HAVE_NL_TYPES_H - -/* Define if you have the header file. */ -#undef HAVE_STDLIB_H +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_STRING_H -/* Define if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H -/* Define if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define if you have the header file. */ -#undef HAVE_VALUES_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H -/* Name of package */ -#undef PACKAGE +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H -/* Version number of package */ -#undef VERSION - -/* Define if you have the stpcpy function */ -#undef HAVE_STPCPY +/* Define to 1 if you have that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H -/* Define if your locale.h file contains LC_MESSAGES. */ -#undef HAVE_LC_MESSAGES +/* Is the type time_t defined in ? */ +#undef HAVE_TIME_T_IN_TIME_H -/* Define as 1 if you have gettext and don't want to use GNU gettext. */ -#undef HAVE_GETTEXT +/* Is the type time_t defined in ? */ +#undef HAVE_TIME_T_IN_TYPES_H -/* Define to 1 if NLS is requested */ -#undef ENABLE_NLS +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H -/* Does the platform use an executable suffix? */ -#undef HAVE_EXECUTABLE_SUFFIX +/* Define to 1 if you have the `utimes' function. */ +#undef HAVE_UTIMES -/* Suffix used for executables, if any. */ -#undef EXECUTABLE_SUFFIX +/* Define to 1 if you have the header file. */ +#undef HAVE_VALUES_H /* Define if weak symbol works. */ #undef HAVE_WEAK_SYMBOL -/* Define if dlopen exists. */ -#undef HAVE_DLOPEN - -/* Is fopen64 available? */ -#undef HAVE_FOPEN64 - -/* Is stat64 available? */ -#undef HAVE_STAT64 - -/* Enable LFS */ -#undef _LARGEFILE64_SOURCE - -/* Is the type time_t defined in ? */ -#undef HAVE_TIME_T_IN_TIME_H +/* Define to 1 if you have the `__argz_count' function. */ +#undef HAVE___ARGZ_COUNT -/* Is the type time_t defined in ? */ -#undef HAVE_TIME_T_IN_TYPES_H +/* Define to 1 if you have the `__argz_next' function. */ +#undef HAVE___ARGZ_NEXT -/* Is the prototype for getopt in in the expected format? */ -#undef HAVE_DECL_GETOPT +/* Define to 1 if you have the `__argz_stringify' function. */ +#undef HAVE___ARGZ_STRINGIFY -/* Does define struct utimbuf? */ -#undef HAVE_GOOD_UTIME_H +/* Define if environ is not declared in system header files. */ +#undef NEED_DECLARATION_ENVIRON /* Define if fprintf is not declared in system header files. */ #undef NEED_DECLARATION_FPRINTF -/* Define if strstr is not declared in system header files. */ -#undef NEED_DECLARATION_STRSTR +/* Define if getenv is not declared in system header files. */ +#undef NEED_DECLARATION_GETENV /* Define if sbrk is not declared in system header files. */ #undef NEED_DECLARATION_SBRK -/* Define if getenv is not declared in system header files. */ -#undef NEED_DECLARATION_GETENV +/* Define if strstr is not declared in system header files. */ +#undef NEED_DECLARATION_STRSTR -/* Define if environ is not declared in system header files. */ -#undef NEED_DECLARATION_ENVIRON +/* Name of package */ +#undef PACKAGE -/* Use b modifier when opening binary files? */ -#undef USE_BINARY_FOPEN +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS /* Configured target name. */ #undef TARGET @@ -217,3 +227,30 @@ /* Define to 1 if user symbol names have a leading underscore, 0 if not. */ #undef TARGET_PREPENDS_UNDERSCORE +/* Use b modifier when opening binary files? */ +#undef USE_BINARY_FOPEN + +/* Version number of package */ +#undef VERSION + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#undef YYTEXT_POINTER + +/* Enable LFS */ +#undef _LARGEFILE64_SOURCE + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to `long' if does not define. */ +#undef off_t + +/* Define to `unsigned' if does not define. */ +#undef size_t diff -uprN binutils-2.16.90.0.3/binutils/configure binutils-2.16.91.0.1/binutils/configure --- binutils-2.16.90.0.3/binutils/configure 2005-04-29 10:50:26.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/configure 2005-06-22 13:53:34.600367700 -0700 @@ -1,53 +1,325 @@ #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# Generated by GNU Autoconf 2.59. # +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + -# Defaults: -ac_help= +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help - --enable-shared[=PKGS] build shared libraries [default=yes]" -ac_help="$ac_help - --enable-static[=PKGS] build static libraries [default=yes]" -ac_help="$ac_help - --enable-fast-install[=PKGS] optimize for fast installation [default=yes]" -ac_help="$ac_help - --with-gnu-ld assume the C compiler uses GNU ld [default=no]" -ac_help="$ac_help - --disable-libtool-lock avoid locking (might break parallel builds)" -ac_help="$ac_help - --with-pic try to use only PIC/non-PIC objects [default=use both]" -ac_help="$ac_help - --enable-targets alternative target configurations" -ac_help="$ac_help - --enable-commonbfdlib build shared BFD/opcodes/libiberty library" -ac_help="$ac_help - --enable-werror treat compile warnings as errors" -ac_help="$ac_help - --enable-build-warnings Enable build-time compiler warnings" -ac_help="$ac_help - --disable-nls do not use Native Language Support" -ac_help="$ac_help - --with-included-gettext use the GNU gettext library included here" -ac_help="$ac_help - --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer" +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="ar.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S RANLIB ac_ct_RANLIB LIBTOOL WARN_CFLAGS NO_WERROR YACC LEX LEXLIB LEX_OUTPUT_ROOT CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT HDEFINES AR CC_FOR_BUILD EXEEXT_FOR_BUILD DEMANGLER_NAME NLMCONV_DEFS BUILD_NLMCONV BUILD_SRCONV BUILD_DLLTOOL DLLTOOL_DEFS BUILD_WINDRES BUILD_DLLWRAP BUILD_MISC OBJDUMP_DEFS EMULATION EMULATION_VECTOR LIBOBJS LTLIBOBJS' +ac_subst_files='' # Initialize some variables set by options. +ac_init_help= +ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. -build=NONE -cache_file=./config.cache +cache_file=/dev/null exec_prefix=NONE -host=NONE no_create= -nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE @@ -56,10 +328,15 @@ program_transform_name=s,x,x, silent= site= srcdir= -target=NONE verbose= x_includes=NONE x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' @@ -73,17 +350,9 @@ oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - ac_prev= for ac_option do - # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" @@ -91,59 +360,59 @@ do continue fi - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. - case "$ac_option" in + case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; + bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) - ac_prev=build ;; + ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; + build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) - datadir="$ac_optarg" ;; + datadir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "enable_${ac_feature}='$ac_optarg'" ;; + eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -152,95 +421,47 @@ do -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; + exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; -host | --host | --hos | --ho) - ac_prev=host ;; + ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; + host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; + includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; + infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; + libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; + libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ @@ -249,19 +470,19 @@ EOF -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; + localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; + mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) + | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ @@ -275,26 +496,26 @@ EOF -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; + oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; + prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; + program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; + program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ @@ -311,7 +532,7 @@ EOF | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; + program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) @@ -321,7 +542,7 @@ EOF ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; + sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ @@ -332,58 +553,57 @@ EOF | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; + sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; + site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; + srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; + sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; + ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; + target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "with_${ac_package}='$ac_optarg'" ;; + eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. @@ -394,99 +614,110 @@ EOF ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; + x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; + x_libraries=$ac_optarg ;; - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } fi -exec 5>./config.log -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; esac done -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=ar.c # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. @@ -496,509 +727,2351 @@ else fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } fi fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi +Usage: $0 [OPTION]... [VAR=VALUE]... -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi +Defaults for the options are specified in brackets. -echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:552: 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 - rm -rf conftest* - ac_cv_cygwin=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_cygwin=no -fi -rm -f conftest* -rm -f conftest* -fi + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] -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:585: 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 - rm -rf conftest* - ac_cv_mingw32=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_mingw32=no -fi -rm -f conftest* -rm -f conftest* +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF fi -echo "$ac_t""$ac_cv_mingw32" 1>&6 -MINGW32= -test "$ac_cv_mingw32" = yes && MINGW32=yes - +if test -n "$ac_init_help"; then -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + cat <<\_ACEOF +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-shared=PKGS build shared libraries default=yes + --enable-static=PKGS build static libraries default=yes + --enable-fast-install=PKGS optimize for fast installation default=yes + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-targets alternative target configurations + --enable-commonbfdlib build shared BFD/opcodes/libiberty library + --enable-werror treat compile warnings as errors + --enable-build-warnings Enable build-time compiler warnings + --disable-nls do not use Native Language Support + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer -# Do some error checking and defaulting for the host and target type. -# The inputs are: -# configure --host=HOST --target=TARGET --build=BUILD NONOPT -# -# The rules are: -# 1. You are not allowed to specify --host, --target, and nonopt at the -# same time. -# 2. Host defaults to nonopt. -# 3. If nonopt is not specified, then host defaults to the current host, -# as determined by config.guess. -# 4. Target and build default to nonopt. -# 5. If nonopt is not specified, then target and build default to host. +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld default=no + --with-pic try to use only PIC/non-PIC objects default=use both + --with-included-gettext use the GNU gettext library included here + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -case $host---$target---$nonopt in -NONE---*---* | *---NONE---* | *---*---NONE) ;; -*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; esac + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:662: checking host system type" >&5 +It was created by $as_me, which was +generated by GNU Autoconf 2.59. Invocation command line was -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac + $ $0 $@ -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - -echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:683: checking target system type" >&5 - -target_alias=$target -case "$target_alias" in -NONE) - case $nonopt in - NONE) target_alias=$host_alias ;; - *) target_alias=$nonopt ;; - esac ;; -esac - -target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` -target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$target" 1>&6 - -echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:701: checking build system type" >&5 - -build_alias=$build -case "$build_alias" in -NONE) - case $nonopt in - NONE) build_alias=$host_alias ;; - *) build_alias=$nonopt ;; - esac ;; -esac - -build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` -build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$build" 1>&6 +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` -test "$host_alias" != "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- +_ASUNAME +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done - echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6 -echo "configure:725: checking for strerror in -lcposix" >&5 -ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lcposix $LIBS" -cat > conftest.$ac_ext <&5 -int main() { -strerror() -; return 0; } -EOF -if { (eval echo configure:744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" +cat >&5 <<_ACEOF -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -lcposix" -else - echo "$ac_t""no" 1>&6 -fi - +## ----------- ## +## Core tests. ## +## ----------- ## +_ACEOF -BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in` -am__api_version="1.4" -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:781: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6 +if test "${ac_cv_target+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_target_alias=$target_alias +test "x$ac_cv_target_alias" = "x" && + ac_cv_target_alias=$ac_cv_host_alias +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6 +target=$ac_cv_target +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +echo "$as_me:$LINENO: checking for library containing strerror" >&5 +echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6 +if test "${ac_cv_search_strerror+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_strerror=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strerror (); +int +main () +{ +strerror (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_strerror="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_strerror" = no; then + for ac_lib in cposix; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strerror (); +int +main () +{ +strerror (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_strerror="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext done - IFS="$ac_save_IFS" +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 +echo "${ECHO_T}$ac_cv_search_strerror" >&6 +if test "$ac_cv_search_strerror" != no; then + test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS" + +fi + + +BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in` +am__api_version="1.9" +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + fi if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" + INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. - INSTALL="$ac_install_sh" + INSTALL=$ac_install_sh fi fi -echo "$ac_t""$INSTALL" 1>&6 +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:834: checking whether build environment is sane" >&5 +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 -echo timestamp > conftestfile +echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi + +for ac_prog in gawk mawk nawk awk +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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +DEPDIR="${am__leading_dot}deps" + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD fi - if test "$*" != "X $srcdir/configure conftestfile" \ - && test "$*" != "X conftestfile $srcdir/configure"; then +fi + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE=binutils + VERSION=${BFD_VERSION} + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - { echo "configure: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" 1>&2; exit 1; } - fi +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - test "$2" = conftestfile - ) -then - # Ok. - : + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else - { echo "configure: error: newly created file is older than distributed files! -Check your system clock" 1>&2; exit 1; } +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi -rm -f conftest* -echo "$ac_t""yes" 1>&6 -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed fi -test "$program_prefix" != NONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" - -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:891: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else - eval ac_cv_prog_make_${ac_make}_set=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi -rm -f conftestmake fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + +depcc="$CC" am_compiler_list= +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub -PACKAGE=binutils + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf -VERSION=${BFD_VERSION} + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done -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; } + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none fi -cat >> confdefs.h <> confdefs.h <&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type -missing_dir=`cd $ac_aux_dir && pwd` -echo $ac_n "checking for working aclocal-${am__api_version}""... $ac_c" 1>&6 -echo "configure:937: checking for working aclocal-${am__api_version}" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (aclocal-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then - ACLOCAL=aclocal-${am__api_version} - echo "$ac_t""found" 1>&6 -else - ACLOCAL="$missing_dir/missing aclocal-${am__api_version}" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:950: checking for working autoconf" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoconf --version) < /dev/null > /dev/null 2>&1; then - AUTOCONF=autoconf - echo "$ac_t""found" 1>&6 -else - AUTOCONF="$missing_dir/missing autoconf" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working automake-${am__api_version}""... $ac_c" 1>&6 -echo "configure:963: checking for working automake-${am__api_version}" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (automake-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then - AUTOMAKE=automake-${am__api_version} - echo "$ac_t""found" 1>&6 -else - AUTOMAKE="$missing_dir/missing automake-${am__api_version}" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:976: checking for working autoheader" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoheader --version) < /dev/null > /dev/null 2>&1; then - AUTOHEADER=autoheader - echo "$ac_t""found" 1>&6 -else - AUTOHEADER="$missing_dir/missing autoheader" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:989: checking for working makeinfo" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (makeinfo --version) < /dev/null > /dev/null 2>&1; then - MAKEINFO=makeinfo - echo "$ac_t""found" 1>&6 +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' else - MAKEINFO="$missing_dir/missing makeinfo" - echo "$ac_t""missing" 1>&6 + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= fi + # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" @@ -1020,8 +3093,7 @@ no) enable_shared=no ;; esac else enable_shared=yes -fi - +fi; # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" @@ -1043,8 +3115,7 @@ no) enable_static=no ;; esac else enable_static=yes -fi - +fi; # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" @@ -1066,229 +3137,7 @@ no) enable_fast_install=no ;; esac else enable_fast_install=yes -fi - -# 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:1075: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -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:1105: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1156: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1188: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 1199 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:1204: \"$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 - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1230: 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:1235: 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 - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi - -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1263: 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 - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi +fi; # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then @@ -1296,13 +3145,12 @@ if test "${with_gnu_ld+set}" = set; then test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no -fi - +fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1306: checking for ld used by GCC" >&5 + echo "$as_me:$LINENO: checking for ld used by GCC" >&5 +echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1331,14 +3179,14 @@ echo "configure:1306: checking for ld us ;; esac elif test "$with_gnu_ld" = yes; then - echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1336: checking for GNU ld" >&5 + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else - echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1339: checking for non-GNU ld" >&5 + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi -if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" @@ -1364,15 +3212,19 @@ fi LD="$lt_cv_path_LD" if test -n "$LD"; then - echo "$ac_t""$LD" 1>&6 + echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } -echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1374: checking if the linker ($LD) is GNU ld" >&5 -if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then @@ -1381,27 +3233,27 @@ else lt_cv_prog_gnu_ld=no fi fi - -echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6 +echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld -echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1391: checking for $LD option to reload object files" >&5 -if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi - -echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6 +echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" -echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1403: checking for BSD-compatible nm" >&5 -if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 +if test "${lt_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. @@ -1434,33 +3286,24 @@ fi fi NM="$lt_cv_path_NM" -echo "$ac_t""$NM" 1>&6 - -echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1441: checking whether ln -s works" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - rm -f conftestdata -if ln -s X conftestdata 2>/dev/null -then - rm -f conftestdata - ac_cv_prog_LN_S="ln -s" -else - ac_cv_prog_LN_S=ln -fi -fi -LN_S="$ac_cv_prog_LN_S" -if test "$ac_cv_prog_LN_S" = "ln -s"; then - echo "$ac_t""yes" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi +echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6 -echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1462: checking how to recognise dependant libraries" >&5 -if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + +echo "$as_me:$LINENO: checking how to recognise dependant libraries" >&5 +echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" >&6 +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= @@ -1616,82 +3459,22 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) ncr) lt_cv_deplibs_check_method=pass_all ;; - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - esac - ;; -esac - -fi - -echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6 -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method - -echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1635: checking for object suffix" >&5 -if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - rm -f conftest* -echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1641: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - for ac_file in conftest.*; do - case $ac_file in - *.c) ;; - *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; - esac - done -else - { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_objext" 1>&6 -OBJEXT=$ac_cv_objext -ac_objext=$ac_cv_objext - - - -echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1661: checking for executable suffix" >&5 -if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$CYGWIN" = yes || test "$MINGW32" = yes; then - ac_cv_exeext=.exe -else - rm -f conftest* - echo 'int main () { return 0; }' > conftest.$ac_ext - ac_cv_exeext= - if { (eval echo configure:1671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then - for file in conftest.*; do - case $file in - *.c | *.o | *.obj) ;; - *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; - esac - done - else - { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } - fi - rm -f conftest* - test x"${ac_cv_exeext}" = x && ac_cv_exeext=no -fi + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + esac + ;; +esac + fi +echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method + -EXEEXT="" -test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} -echo "$ac_t""${ac_cv_exeext}" 1>&6 -ac_exeext=$EXEEXT -if test $host != $build; then - ac_tool_prefix=${host_alias}- -else - ac_tool_prefix= -fi # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! @@ -1699,10 +3482,10 @@ fi case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then - echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:1704: checking for ${ac_tool_prefix}file" >&5 -if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in /*) @@ -1754,17 +3537,19 @@ fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - echo "$ac_t""$MAGIC_CMD" 1>&6 + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then - echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:1766: checking for file" >&5 -if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in /*) @@ -1816,9 +3601,11 @@ fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - echo "$ac_t""$MAGIC_CMD" 1>&6 + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi else @@ -1830,138 +3617,164 @@ fi ;; esac -# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1837: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -RANLIB="$ac_cv_prog_RANLIB" +RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - +fi if test -z "$ac_cv_prog_RANLIB"; then -if test -n "$ac_tool_prefix"; then + ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1869: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi + RANLIB=$ac_ct_RANLIB else - RANLIB=":" -fi + RANLIB="$ac_cv_prog_RANLIB" fi -# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1904: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -STRIP="$ac_cv_prog_STRIP" +STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - echo "$ac_t""$STRIP" 1>&6 + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - +fi if test -z "$ac_cv_prog_STRIP"; then -if test -n "$ac_tool_prefix"; then + ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1936: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_STRIP="strip" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi -STRIP="$ac_cv_prog_STRIP" -if test -n "$STRIP"; then - echo "$ac_t""$STRIP" 1>&6 +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi + STRIP=$ac_ct_STRIP else - STRIP=":" -fi + STRIP="$ac_cv_prog_STRIP" fi @@ -1977,20 +3790,19 @@ test "$lt_cv_prog_gnu_ld" = yes && libto # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" - : -fi +fi; test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" + # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default -fi - +fi; test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic" test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" @@ -1999,8 +3811,12 @@ test x"$pic_mode" = xno && libtool_flags case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 2003 "configure"' > conftest.$ac_ext - if { (eval echo configure:2004: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 3814 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) @@ -2033,7 +3849,11 @@ case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext - if { (eval echo configure:2037: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then case "`/usr/bin/file conftest.o`" in *ELF-32*) HPUX_IA64_MODE="32" @@ -2050,47 +3870,74 @@ ia64-*-hpux*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" - echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2055: checking whether the C compiler needs -belf" >&5 -if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + + ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { +int +main () +{ -; return 0; } -EOF -if { (eval echo configure:2075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then lt_cv_cc_needs_belf=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - lt_cv_cc_needs_belf=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +lt_cv_cc_needs_belf=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu fi - -echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 +echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" @@ -2102,54 +3949,61 @@ esac # Save cache, so that ltconfig can load it -cat > confcache <<\EOF +cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. # -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. # -EOF +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache - # Actually configure libtool. ac_aux_dir is where install-sh is found. AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ @@ -2159,15 +4013,26 @@ objext="$OBJEXT" exeext="$EXEEXT" reload deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ $libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \ -|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; } +|| { { echo "$as_me:$LINENO: error: libtool configure failed" >&5 +echo "$as_me: error: libtool configure failed" >&2;} + { (exit 1); exit 1; }; } # Reload cache, that may have been modified by ltconfig if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi else - echo "creating cache $cache_file" - > $cache_file + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file fi @@ -2181,32 +4046,34 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtoo # clobbered by the next message. exec 5>>./config.log - - - - + + + + # Check whether --enable-targets or --disable-targets was given. if test "${enable_targets+set}" = set; then enableval="$enable_targets" case "${enableval}" in - yes | "") { echo "configure: error: enable-targets option must specify target names or 'all'" 1>&2; exit 1; } + yes | "") { { echo "$as_me:$LINENO: error: enable-targets option must specify target names or 'all'" >&5 +echo "$as_me: error: enable-targets option must specify target names or 'all'" >&2;} + { (exit 1); exit 1; }; } ;; no) enable_targets= ;; *) enable_targets=$enableval ;; esac -fi -# Check whether --enable-commonbfdlib or --disable-commonbfdlib was given. +fi; # Check whether --enable-commonbfdlib or --disable-commonbfdlib was given. if test "${enable_commonbfdlib+set}" = set; then enableval="$enable_commonbfdlib" case "${enableval}" in yes) commonbfdlib=true ;; no) commonbfdlib=false ;; - *) { echo "configure: error: bad value ${enableval} for BFD commonbfdlib option" 1>&2; exit 1; } ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for BFD commonbfdlib option" >&5 +echo "$as_me: error: bad value ${enableval} for BFD commonbfdlib option" >&2;} + { (exit 1); exit 1; }; } ;; esac -fi - +fi; WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" # Check whether --enable-werror or --disable-werror was given. @@ -2215,10 +4082,11 @@ if test "${enable_werror+set}" = set; th case "${enableval}" in yes | y) ERROR_ON_WARNING="yes" ;; no | n) ERROR_ON_WARNING="no" ;; - *) { echo "configure: error: bad value ${enableval} for --enable-werror" 1>&2; exit 1; } ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-werror" >&5 +echo "$as_me: error: bad value ${enableval} for --enable-werror" >&2;} + { (exit 1); exit 1; }; } ;; esac -fi - +fi; # Enable -Werror by default when using gcc if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then @@ -2230,7 +4098,7 @@ if test "${ERROR_ON_WARNING}" = yes ; th WARN_CFLAGS="$WARN_CFLAGS -Werror" NO_WERROR="-Wno-error" fi - + # Check whether --enable-build-warnings or --disable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then enableval="$enable_build_warnings" @@ -2243,8 +4111,7 @@ if test "${enable_build_warnings+set}" = WARN_CFLAGS="${t} ${WARN_CFLAGS}";; *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; esac -fi - +fi; if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then echo "Setting warning flags = $WARN_CFLAGS" 6>&1 @@ -2253,225 +4120,472 @@ fi - - + ac_config_headers="$ac_config_headers config.h:config.in" if test -z "$target" ; then - { echo "configure: error: Unrecognized target system type; please check config.sub." 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: Unrecognized target system type; please check config.sub." >&5 +echo "$as_me: error: Unrecognized target system type; please check config.sub." >&2;} + { (exit 1); exit 1; }; } fi if test -z "$host" ; then - { echo "configure: error: Unrecognized host system type; please check config.sub." 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: Unrecognized host system type; please check config.sub." >&5 +echo "$as_me: error: Unrecognized host system type; please check config.sub." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -# Extract the first word of "gcc", so it can be a program name with args. +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # 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:2271: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi 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:2301: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift - if test $# -gt 0; then + if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2352: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - ;; - esac + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2384: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + test -n "$ac_ct_CC" && break +done -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross + CC=$ac_ct_CC +fi -cat > conftest.$ac_ext << EOF +fi -#line 2395 "configure" -#include "confdefs.h" -main(){return(0);} -EOF -if { (eval echo configure:2400: \"$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 - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2426: 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:2431: 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 - cat > conftest.c <&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me #endif -EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2440: \"$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 -fi -fi -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi +int +main () +{ -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:2459: 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 - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else - ac_cv_prog_cc_g=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" + CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" @@ -2485,371 +4599,991 @@ else CFLAGS= fi fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} - -for ac_prog in 'bison -y' byacc +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" 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:2496: 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 - if test -n "$YACC"; then - ac_cv_prog_YACC="$YACC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_YACC="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -YACC="$ac_cv_prog_YACC" -if test -n "$YACC"; then - echo "$ac_t""$YACC" 1>&6 + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break else - echo "$ac_t""no" 1>&6 -fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -test -n "$YACC" && break +fi +rm -f conftest.err conftest.$ac_objext done -test -n "$YACC" || YACC="yacc" +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2527: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2548: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2565: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2582: \"$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 + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then : else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done rm -f conftest* - ac_cv_prog_CPP="$CPP" +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h fi - CPP="$ac_cv_prog_CPP" + else - ac_cv_prog_CPP="$CPP" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -echo "$ac_t""$CPP" 1>&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -missing_dir=`cd $ac_aux_dir && pwd` -for ac_prog in flex lex + +for ac_prog in 'bison -y' byacc do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # 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:2612: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_YACC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$LEX"; then - ac_cv_prog_LEX="$LEX" # Let the user override the test. + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LEX="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_YACC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LEX="$ac_cv_prog_LEX" -if test -n "$LEX"; then - echo "$ac_t""$LEX" 1>&6 +YACC=$ac_cv_prog_YACC +if test -n "$YACC"; then + echo "$as_me:$LINENO: result: $YACC" >&5 +echo "${ECHO_T}$YACC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$LEX" && break + test -n "$YACC" && break done -test -n "$LEX" || LEX="$missing_dir/missing flex" +test -n "$YACC" || YACC="yacc" -# 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:2645: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +for ac_prog in flex lex +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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LEX="flex" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LEX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LEX="$ac_cv_prog_LEX" +LEX=$ac_cv_prog_LEX if test -n "$LEX"; then - echo "$ac_t""$LEX" 1>&6 + echo "$as_me:$LINENO: result: $LEX" >&5 +echo "${ECHO_T}$LEX" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi + test -n "$LEX" && break +done +test -n "$LEX" || LEX=":" + if test -z "$LEXLIB" then - case "$LEX" in - flex*) ac_lib=fl ;; - *) ac_lib=l ;; - esac - echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:2679: 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 -else - ac_save_LIBS="$LIBS" -LIBS="-l$ac_lib $LIBS" -cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 +if test "${ac_cv_lib_fl_yywrap+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lfl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char yywrap(); + builtin and then its argument prototype would still apply. */ +char yywrap (); +int +main () +{ +yywrap (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_fl_yywrap=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_fl_yywrap=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 +echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 +if test $ac_cv_lib_fl_yywrap = yes; then + LEXLIB="-lfl" +else + echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 +echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 +if test "${ac_cv_lib_l_yywrap+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ll $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { -yywrap() -; return 0; } -EOF -if { (eval echo configure:2698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char yywrap (); +int +main () +{ +yywrap (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_l_yywrap=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_l_yywrap=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 +echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 +if test $ac_cv_lib_l_yywrap = yes; then + LEXLIB="-ll" fi -rm -f conftest* -LIBS="$ac_save_LIBS" fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LEXLIB="-l$ac_lib" -else - echo "$ac_t""no" 1>&6 -fi fi -echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:2721: 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 +if test "x$LEX" != "x:"; then + echo "$as_me:$LINENO: checking lex output file root" >&5 +echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 +if test "${ac_cv_prog_lex_root+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else # The minimal lex program is just a single line: %%. But some broken lexes # (Solaris, I think it was) want two %% lines, so accommodate them. -echo '%% -%%' | $LEX +cat >conftest.l <<_ACEOF +%% +%% +_ACEOF +{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 + (eval $LEX conftest.l) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else - { echo "configure: error: cannot find output from $LEX; giving up" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 +echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} + { (exit 1); exit 1; }; } fi fi - -echo "$ac_t""$ac_cv_prog_lex_root" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 +rm -f conftest.l LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root -echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 -echo "configure:2742: 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 +echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 +echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 +if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c -ac_save_LIBS="$LIBS" +ac_save_LIBS=$LIBS LIBS="$LIBS $LEXLIB" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF `cat $LEX_OUTPUT_ROOT.c` -int main() { - -; return 0; } -EOF -if { (eval echo configure:2761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_lex_yytext_pointer=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_save_LIBS +rm -f "${LEX_OUTPUT_ROOT}.c" + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 +if test $ac_cv_prog_lex_yytext_pointer = yes; then + +cat >>confdefs.h <<\_ACEOF +#define YYTEXT_POINTER 1 +_ACEOF + +fi + +fi +if test "$LEX" = :; then + LEX=${am_missing_run}flex +fi + +ALL_LINGUAS="fr tr ja es sv da zh_CN ru ro rw zh_TW" +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes fi -rm -f conftest* -LIBS="$ac_save_LIBS" -rm -f "${LEX_OUTPUT_ROOT}.c" +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue fi +rm -f conftest.err conftest.$ac_ext -echo "$ac_t""$ac_cv_prog_lex_yytext_pointer" 1>&6 -if test $ac_cv_prog_lex_yytext_pointer = yes; then - cat >> confdefs.h <<\EOF -#define YYTEXT_POINTER 1 -EOF - + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext -ALL_LINGUAS="fr tr ja es sv da zh_CN ru ro rw" -# Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2787: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" -fi + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_t""no" 1>&6 + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2815: 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 +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include #include #include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2828: \"$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* + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_header_stdc=yes else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_stdc=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -EOF + +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then + $EGREP "memchr" >/dev/null 2>&1; then : else - rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* @@ -2858,16 +5592,19 @@ 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 <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -EOF + +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then + $EGREP "free" >/dev/null 2>&1; then : else - rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* @@ -2876,269 +5613,530 @@ fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif -EOF -if { (eval echo configure:2895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then : else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no fi -rm -fr conftest* +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi fi - -echo "$ac_t""$ac_cv_header_stdc" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 -EOF +_ACEOF fi -echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2919: 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 <j = 5; -} -{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; -} +echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -; return 0; } -EOF -if { (eval echo configure:2973: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_const=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_c_const=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_const=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi - -echo "$ac_t""$ac_cv_c_const" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then - cat >> confdefs.h <<\EOF -#define const -EOF + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF fi -echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2994: checking for inline" >&5 -if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6 +if test "${ac_cv_c_inline+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 - rm -rf conftest* + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done fi +echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6 -echo "$ac_t""$ac_cv_c_inline" 1>&6 -case "$ac_cv_c_inline" in + +case $ac_cv_c_inline in inline | yes) ;; - no) cat >> confdefs.h <<\EOF -#define inline -EOF - ;; - *) cat >> confdefs.h <>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; esac -echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:3034: 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 -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6 +if test "${ac_cv_type_off_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((off_t *) 0) + return 0; +if (sizeof (off_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_type_off_t=yes else - rm -rf conftest* - ac_cv_type_off_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_off_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$ac_cv_type_off_t" 1>&6 -if test $ac_cv_type_off_t = no; then - cat >> confdefs.h <<\EOF +echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6 +if test $ac_cv_type_off_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF #define off_t long -EOF +_ACEOF fi -echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3067: 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 -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_type_size_t=yes else - rm -rf conftest* - ac_cv_type_size_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_size_t=no fi -echo "$ac_t""$ac_cv_type_size_t" 1>&6 -if test $ac_cv_type_size_t = no; then - cat >> confdefs.h <<\EOF +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF #define size_t unsigned -EOF +_ACEOF 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:3102: 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 <&5 +echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 +if test "${ac_cv_working_alloca_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -int main() { -char *p = alloca(2 * sizeof(int)); -; return 0; } -EOF -if { (eval echo configure:3114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_header_alloca_h=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_alloca_h=no -fi -rm -f conftest* -fi +int +main () +{ +char *p = (char *) alloca (2 * sizeof (int)); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_working_alloca_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_working_alloca_h=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 +echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 +if test $ac_cv_working_alloca_h = yes; then -echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 -if test $ac_cv_header_alloca_h = yes; then - cat >> confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 -EOF +_ACEOF fi -echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3135: 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 +echo $ECHO_N "checking for alloca... $ECHO_C" >&6 +if test "${ac_cv_func_alloca_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else @@ -3160,137 +6158,217 @@ char *alloca (); # endif #endif -int main() { -char *p = (char *) alloca(1); -; return 0; } -EOF -if { (eval echo configure:3168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* +int +main () +{ +char *p = (char *) alloca (1); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_func_alloca_works=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_func_alloca_works=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_alloca_works=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi +echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 +echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 -echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 if test $ac_cv_func_alloca_works = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_ALLOCA 1 -EOF -fi +cat >>confdefs.h <<\_ACEOF +#define HAVE_ALLOCA 1 +_ACEOF -if test $ac_cv_func_alloca_works = no; then +else # The SVR3 libPW and SVR4 libucb both contain incompatible functions - # that cause trouble. Some versions do not even contain alloca or - # contain a buggy version. If you still want to use their alloca, - # use ar to extract alloca.o from them instead of compiling alloca.c. - ALLOCA=alloca.${ac_objext} - cat >> confdefs.h <<\EOF +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + +ALLOCA=alloca.$ac_objext + +cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 -EOF +_ACEOF -echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3200: 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 <&5 +echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 +if test "${ac_cv_os_cray+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #if defined(CRAY) && ! defined(CRAY2) webecray #else wenotbecray #endif -EOF +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "webecray" >/dev/null 2>&1; then - rm -rf conftest* + $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else - rm -rf conftest* ac_cv_os_cray=no fi rm -f conftest* fi - -echo "$ac_t""$ac_cv_os_cray" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 +echo "${ECHO_T}$ac_cv_os_cray" >&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:3230: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif -int main() { +#undef $ac_func +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:3258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func -EOF +_ACEOF - break -else - echo "$ac_t""no" 1>&6 + break fi -done + done fi -echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3285: 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 +echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 +echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 +if test "${ac_cv_c_stack_direction+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int find_stack_direction () { static char *addr = 0; @@ -3303,138 +6381,316 @@ find_stack_direction () else return (&dummy > addr) ? 1 : -1; } + +int main () { - exit (find_stack_direction() < 0); + exit (find_stack_direction () < 0); } -EOF -if { (eval echo configure:3312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_c_stack_direction=-1 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_stack_direction=-1 fi -rm -fr conftest* +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi +echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 -echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 -cat >> confdefs.h <>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction -EOF +_ACEOF + fi -for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h + + +for ac_header in stdlib.h unistd.h do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3337: 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:3347: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* + ac_cpp_err=yes fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi + done + for ac_func in getpagesize do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3376: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif -int main() { +#undef $ac_func +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:3404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 fi done -echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3429: 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 +echo "$as_me:$LINENO: checking for working mmap" >&5 +echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 +if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_mmap_fixed_mapped=no else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +/* malloc might have been renamed as rpl_malloc. */ +#undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: @@ -3448,47 +6704,34 @@ else back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the - VM page cache was not coherent with the filesystem buffer cache + VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get - propogated back to all the places they're supposed to be. + propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ -#include + #include #include -#if HAVE_SYS_TYPES_H -# include -#endif - -#if HAVE_STDLIB_H -# include -#endif - -#if HAVE_SYS_STAT_H -# include -#endif - -#if HAVE_UNISTD_H -# include +#if !STDC_HEADERS && !HAVE_STDLIB_H +char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ -#ifndef HAVE_GETPAGESIZE - +#if !HAVE_GETPAGESIZE /* Assume that all systems that can run configure have sys/param.h. */ -# ifndef HAVE_SYS_PARAM_H +# if !HAVE_SYS_PARAM_H # define HAVE_SYS_PARAM_H 1 # endif # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ -# ifdef HAVE_SYS_PARAM_H +# if HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE @@ -3515,323 +6758,573 @@ else #endif /* no HAVE_GETPAGESIZE */ -#ifdef __cplusplus -extern "C" { void *malloc(unsigned); } -#else -char *malloc(); -#endif - int -main() +main () { - char *data, *data2, *data3; - int i, pagesize; - int fd; - - pagesize = getpagesize(); - - /* - * First, make a file with some known garbage in it. - */ - data = malloc(pagesize); - if (!data) - exit(1); - for (i = 0; i < pagesize; ++i) - *(data + i) = rand(); - umask(0); - fd = creat("conftestmmap", 0600); - if (fd < 0) - exit(1); - if (write(fd, data, pagesize) != pagesize) - exit(1); - close(fd); - - /* - * Next, try to mmap the file at a fixed address which - * already has something else allocated at it. If we can, - * also make sure that we see the same garbage. - */ - fd = open("conftestmmap", O_RDWR); - if (fd < 0) - exit(1); - data2 = malloc(2 * pagesize); - if (!data2) - exit(1); - data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); - if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_FIXED, fd, 0L)) - exit(1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data2 + i)) - exit(1); - - /* - * Finally, make sure that changes to the mapped area - * do not percolate back to the file as seen by read(). - * (This is a bug on some variants of i386 svr4.0.) - */ - for (i = 0; i < pagesize; ++i) - *(data2 + i) = *(data2 + i) + 1; - data3 = malloc(pagesize); - if (!data3) - exit(1); - if (read(fd, data3, pagesize) != pagesize) - exit(1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data3 + i)) - exit(1); - close(fd); - unlink("conftestmmap"); - exit(0); + char *data, *data2, *data3; + int i, pagesize; + int fd; + + pagesize = getpagesize (); + + /* First, make a file with some known garbage in it. */ + data = (char *) malloc (pagesize); + if (!data) + exit (1); + for (i = 0; i < pagesize; ++i) + *(data + i) = rand (); + umask (0); + fd = creat ("conftest.mmap", 0600); + if (fd < 0) + exit (1); + if (write (fd, data, pagesize) != pagesize) + exit (1); + close (fd); + + /* Next, try to mmap the file at a fixed address which already has + something else allocated at it. If we can, also make sure that + we see the same garbage. */ + fd = open ("conftest.mmap", O_RDWR); + if (fd < 0) + exit (1); + data2 = (char *) malloc (2 * pagesize); + if (!data2) + exit (1); + data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); + if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + exit (1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + exit (1); + + /* Finally, make sure that changes to the mapped area do not + percolate back to the file as seen by read(). (This is a bug on + some variants of i386 svr4.0.) */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = (char *) malloc (pagesize); + if (!data3) + exit (1); + if (read (fd, data3, pagesize) != pagesize) + exit (1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + exit (1); + close (fd); + exit (0); } - -EOF -if { (eval echo configure:3590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_func_mmap_fixed_mapped=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_func_mmap_fixed_mapped=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_mmap_fixed_mapped=no fi -rm -fr conftest* +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi - -echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 +echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 if test $ac_cv_func_mmap_fixed_mapped = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_MMAP 1 -EOF +_ACEOF fi +rm -f conftest.mmap + + + + - - for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \ + + + + + + +for ac_header in argz.h limits.h locale.h nl_types.h malloc.h string.h \ unistd.h values.h sys/param.h do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3618: 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:3628: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* + ac_cpp_err=yes fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_t""no" 1>&6 + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi + done - for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \ + + + + + + + + + + +for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \ __argz_count __argz_stringify __argz_next do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3658: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif -int main() { +#undef $ac_func +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:3686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 fi done if test "${ac_cv_func_stpcpy+set}" != "set"; then - for ac_func in stpcpy + +for ac_func in stpcpy do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3715: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif -int main() { +#undef $ac_func +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:3743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 fi done fi if test "${ac_cv_func_stpcpy}" = "yes"; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_STPCPY 1 -EOF +_ACEOF fi if test $ac_cv_header_locale_h = yes; then - echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3777: 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 <&5 +echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6 +if test "${am_cv_val_LC_MESSAGES+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -int main() { +int +main () +{ return LC_MESSAGES -; return 0; } -EOF -if { (eval echo configure:3789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then am_cv_val_LC_MESSAGES=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - am_cv_val_LC_MESSAGES=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +am_cv_val_LC_MESSAGES=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi - -echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6 +echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 +echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6 if test $am_cv_val_LC_MESSAGES = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_LC_MESSAGES 1 -EOF +_ACEOF fi fi - echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3810: checking whether NLS is requested" >&5 + echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" USE_NLS=$enableval else USE_NLS=yes -fi +fi; + echo "$as_me:$LINENO: result: $USE_NLS" >&5 +echo "${ECHO_T}$USE_NLS" >&6 - echo "$ac_t""$USE_NLS" 1>&6 - USE_INCLUDED_LIBINTL=no if test "$USE_NLS" = "yes"; then - echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3826: checking whether included gettext is requested" >&5 - # Check whether --with-included-gettext or --without-included-gettext was given. + echo "$as_me:$LINENO: checking whether included gettext is requested" >&5 +echo $ECHO_N "checking whether included gettext is requested... $ECHO_C" >&6 + +# Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" nls_cv_force_use_gnu_gettext=$withval else nls_cv_force_use_gnu_gettext=no -fi - - echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6 +fi; + echo "$as_me:$LINENO: result: $nls_cv_force_use_gnu_gettext" >&5 +echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then @@ -3839,141 +7332,336 @@ fi nls_cv_header_libgt= CATOBJEXT= - ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3845: 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 <&5 +echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6 +if test "${ac_cv_header_libintl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 +echo "${ECHO_T}$ac_cv_header_libintl_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking libintl.h usability" >&5 +echo $ECHO_N "checking libintl.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default #include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3855: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking libintl.h presence" >&5 +echo $ECHO_N "checking libintl.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* + ac_cpp_err=yes 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:3872: 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 <&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: libintl.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: libintl.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: libintl.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: libintl.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: libintl.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: libintl.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for libintl.h" >&5 +echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6 +if test "${ac_cv_header_libintl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_libintl_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 +echo "${ECHO_T}$ac_cv_header_libintl_h" >&6 + +fi +if test $ac_cv_header_libintl_h = yes; then + echo "$as_me:$LINENO: checking for gettext in libc" >&5 +echo $ECHO_N "checking for gettext in libc... $ECHO_C" >&6 +if test "${gt_cv_func_gettext_libc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -int main() { +int +main () +{ return (int) gettext ("") -; return 0; } -EOF -if { (eval echo configure:3884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then gt_cv_func_gettext_libc=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - gt_cv_func_gettext_libc=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gt_cv_func_gettext_libc=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi - -echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 +echo "$as_me:$LINENO: result: $gt_cv_func_gettext_libc" >&5 +echo "${ECHO_T}$gt_cv_func_gettext_libc" >&6 if test "$gt_cv_func_gettext_libc" != "yes"; then - echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3900: 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 + echo "$as_me:$LINENO: checking for bindtextdomain in -lintl" >&5 +echo $ECHO_N "checking for bindtextdomain in -lintl... $ECHO_C" >&6 +if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char bindtextdomain(); - -int main() { -bindtextdomain() -; return 0; } -EOF -if { (eval echo configure:3919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3935: 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>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_intl_bindtextdomain=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_intl_bindtextdomain=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_intl_bindtextdomain" >&5 +echo "${ECHO_T}$ac_cv_lib_intl_bindtextdomain" >&6 +if test $ac_cv_lib_intl_bindtextdomain = yes; then + echo "$as_me:$LINENO: checking for gettext in libintl" >&5 +echo $ECHO_N "checking for gettext in libintl... $ECHO_C" >&6 +if test "${gt_cv_func_gettext_libintl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { +int +main () +{ return (int) gettext ("") -; return 0; } -EOF -if { (eval echo configure:3947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then gt_cv_func_gettext_libintl=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - gt_cv_func_gettext_libintl=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gt_cv_func_gettext_libintl=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi - -echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6 -else - echo "$ac_t""no" 1>&6 +echo "$as_me:$LINENO: result: $gt_cv_func_gettext_libintl" >&5 +echo "${ECHO_T}$gt_cv_func_gettext_libintl" >&6 fi fi if test "$gt_cv_func_gettext_libc" = "yes" \ || test "$gt_cv_func_gettext_libintl" = "yes"; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_GETTEXT 1 -EOF +_ACEOF # 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:3975: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in /*) @@ -3997,108 +7685,161 @@ esac fi MSGFMT="$ac_cv_path_MSGFMT" if test -n "$MSGFMT"; then - echo "$ac_t""$MSGFMT" 1>&6 + echo "$as_me:$LINENO: result: $MSGFMT" >&5 +echo "${ECHO_T}$MSGFMT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi if test "$MSGFMT" != "no"; then - for ac_func in dcgettext + +for ac_func in dcgettext do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4009: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ -int main() { +#ifdef __STDC__ +# include +#else +# include +#endif +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:4037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 fi done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4064: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_GMSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$GMSGFMT" in - /*) + case $GMSGFMT in + [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_GMSGFMT="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi -GMSGFMT="$ac_cv_path_GMSGFMT" +GMSGFMT=$ac_cv_path_GMSGFMT + if test -n "$GMSGFMT"; then - echo "$ac_t""$GMSGFMT" 1>&6 + echo "$as_me:$LINENO: result: $GMSGFMT" >&5 +echo "${ECHO_T}$GMSGFMT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4100: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_XGETTEXT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in /*) @@ -4122,42 +7863,71 @@ esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test -n "$XGETTEXT"; then - echo "$ac_t""$XGETTEXT" 1>&6 + echo "$as_me:$LINENO: result: $XGETTEXT" >&5 +echo "${ECHO_T}$XGETTEXT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { +int +main () +{ extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr -; return 0; } -EOF -if { (eval echo configure:4140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then CATOBJEXT=.gmo DATADIRNAME=share else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CATOBJEXT=.mo + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +CATOBJEXT=.mo DATADIRNAME=lib fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext INSTOBJEXT=.mo fi fi - -else - echo "$ac_t""no" 1>&6 + fi - + + if test x"$CATOBJEXT" = x && test -d $srcdir/../intl; then # Neither gettext nor catgets in included in the C library. # Fall back on GNU gettext library (assuming it is present). @@ -4169,10 +7939,10 @@ fi INTLOBJS="\$(GETTOBJS)" # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4174: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in /*) @@ -4196,53 +7966,59 @@ esac fi MSGFMT="$ac_cv_path_MSGFMT" if test -n "$MSGFMT"; then - echo "$ac_t""$MSGFMT" 1>&6 + echo "$as_me:$LINENO: result: $MSGFMT" >&5 +echo "${ECHO_T}$MSGFMT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4208: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_GMSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$GMSGFMT" in - /*) + case $GMSGFMT in + [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_GMSGFMT="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi -GMSGFMT="$ac_cv_path_GMSGFMT" +GMSGFMT=$ac_cv_path_GMSGFMT + if test -n "$GMSGFMT"; then - echo "$ac_t""$GMSGFMT" 1>&6 + echo "$as_me:$LINENO: result: $GMSGFMT" >&5 +echo "${ECHO_T}$GMSGFMT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4244: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_XGETTEXT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in /*) @@ -4266,12 +8042,14 @@ esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test -n "$XGETTEXT"; then - echo "$ac_t""$XGETTEXT" 1>&6 + echo "$as_me:$LINENO: result: $XGETTEXT" >&5 +echo "${ECHO_T}$XGETTEXT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + USE_INCLUDED_LIBINTL=yes CATOBJEXT=.gmo INSTOBJEXT=.mo @@ -4287,7 +8065,8 @@ fi if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else - echo "$ac_t""found xgettext programs is not GNU xgettext; ignore it" 1>&6 + echo "$as_me:$LINENO: result: found xgettext programs is not GNU xgettext; ignore it" >&5 +echo "${ECHO_T}found xgettext programs is not GNU xgettext; ignore it" >&6 XGETTEXT=":" fi fi @@ -4312,31 +8091,32 @@ fi POFILES="$POFILES $lang.po" done - - - - - - - - - - - + + + + + + + + + + + if test "x$CATOBJEXT" != "x"; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define ENABLE_NLS 1 -EOF +_ACEOF fi - + if test "x$CATOBJEXT" != "x"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else - echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:4340: checking for catalogs to be installed" >&5 + echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 +echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -4344,7 +8124,8 @@ echo "configure:4340: checking for catal esac done LINGUAS=$NEW_LINGUAS - echo "$ac_t""$LINGUAS" 1>&6 + echo "$as_me:$LINENO: result: $LINGUAS" >&5 +echo "${ECHO_T}$LINGUAS" >&6 fi if test -n "$LINGUAS"; then @@ -4358,45 +8139,155 @@ echo "configure:4340: checking for catal INCLUDE_LOCALE_H="\ /* The system does not provide the header . Take care yourself. */" fi - + if test -f $srcdir/po2tbl.sed.in; then if test "$CATOBJEXT" = ".cat"; then - ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:4368: 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 <&5 +echo $ECHO_N "checking for linux/version.h... $ECHO_C" >&6 +if test "${ac_cv_header_linux_version_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_linux_version_h" >&5 +echo "${ECHO_T}$ac_cv_header_linux_version_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking linux/version.h usability" >&5 +echo $ECHO_N "checking linux/version.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default #include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4378: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking linux/version.h presence" >&5 +echo $ECHO_N "checking linux/version.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + ac_cpp_err=yes fi -rm -f conftest* +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: linux/version.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: linux/version.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/version.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: linux/version.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: linux/version.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: linux/version.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/version.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: linux/version.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/version.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: linux/version.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/version.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: linux/version.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/version.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: linux/version.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/version.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: linux/version.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for linux/version.h" >&5 +echo $ECHO_N "checking for linux/version.h... $ECHO_C" >&6 +if test "${ac_cv_header_linux_version_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_linux_version_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_linux_version_h" >&5 +echo "${ECHO_T}$ac_cv_header_linux_version_h" >&6 + fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 +if test $ac_cv_header_linux_version_h = yes; then msgformat=linux else - echo "$ac_t""no" 1>&6 -msgformat=xopen + msgformat=xopen fi + sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed fi sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ @@ -4410,14 +8301,14 @@ fi GT_NO= GT_YES="#YES#" fi - - + + MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs" - + l= - + if test -f $srcdir/po/POTFILES.in; then test -d po || mkdir po @@ -4434,20 +8325,20 @@ fi sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES fi - -echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:4441: checking whether to enable maintainer-specific portions of Makefiles" >&5 + +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no -fi +fi; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 - echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 - if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= @@ -4456,51 +8347,22 @@ else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi - MAINT=$MAINTAINER_MODE_TRUE - - + MAINT=$MAINTAINER_MODE_TRUE -echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:4466: checking for executable suffix" >&5 -if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$CYGWIN" = yes || test "$MINGW32" = yes; then - ac_cv_exeext=.exe -else - rm -f conftest* - echo 'int main () { return 0; }' > conftest.$ac_ext - ac_cv_exeext= - if { (eval echo configure:4476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then - for file in conftest.*; do - case $file in - *.c | *.o | *.obj) ;; - *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; - esac - done - else - { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } - fi - rm -f conftest* - test x"${ac_cv_exeext}" = x && ac_cv_exeext=no -fi -fi -EXEEXT="" -test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} -echo "$ac_t""${ac_cv_exeext}" 1>&6 -ac_exeext=$EXEEXT if test -n "$EXEEXT"; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_EXECUTABLE_SUFFIX 1 -EOF +_ACEOF fi -cat >> confdefs.h <>confdefs.h <<_ACEOF #define EXECUTABLE_SUFFIX "${EXEEXT}" -EOF +_ACEOF # host-specific stuff: @@ -4512,34 +8374,84 @@ HDEFINES= AR=${AR-ar} -# Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4519: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -RANLIB="$ac_cv_prog_RANLIB" +RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" fi # Find a good install program. We prefer a C program (faster), @@ -4549,60 +8461,75 @@ fi # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:4558: checking for a BSD compatible install" >&5 +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 fi fi done - ;; - esac - done - IFS="$ac_save_IFS" + done + ;; +esac +done + fi if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" + INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. - INSTALL="$ac_install_sh" + INSTALL=$ac_install_sh fi fi -echo "$ac_t""$INSTALL" 1>&6 +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' @@ -4620,10 +8547,10 @@ fi if test "x$cross_compiling" = "xno"; then EXEEXT_FOR_BUILD='$(EXEEXT)' else - echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6 -echo "configure:4625: checking for build system executable suffix" >&5 -if eval "test \"`echo '$''{'bfd_cv_build_exeext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:$LINENO: checking for build system executable suffix" >&5 +echo $ECHO_N "checking for build system executable suffix... $ECHO_C" >&6 +if test "${bfd_cv_build_exeext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f conftest* echo 'int main () { return 0; }' > conftest.c @@ -4638,8 +8565,8 @@ else rm -f conftest* test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no fi - -echo "$ac_t""$bfd_cv_build_exeext" 1>&6 +echo "$as_me:$LINENO: result: $bfd_cv_build_exeext" >&5 +echo "${ECHO_T}$bfd_cv_build_exeext" >&6 EXEEXT_FOR_BUILD="" test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext} fi @@ -4652,132 +8579,308 @@ case "${host}" in esac -for ac_hdr in string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h dlfcn.h + + + + + + + +for ac_header in string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h dlfcn.h do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4660: 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:4670: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* + ac_cpp_err=yes fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_t""no" 1>&6 + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi + done -echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:4697: checking for sys/wait.h that is POSIX.1 compatible" >&5 -if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 +if test "${ac_cv_header_sys_wait_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include #ifndef WEXITSTATUS -#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED -#define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif -int main() { -int s; -wait (&s); -s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; -; return 0; } -EOF -if { (eval echo configure:4718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + +int +main () +{ + int s; + wait (&s); + s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_header_sys_wait_h=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_sys_wait_h=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_sys_wait_h=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi - -echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 if test $ac_cv_header_sys_wait_h = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_WAIT_H 1 -EOF +_ACEOF 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:4741: 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 <&5 +echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 +if test "${ac_cv_working_alloca_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -int main() { -char *p = alloca(2 * sizeof(int)); -; return 0; } -EOF -if { (eval echo configure:4753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_header_alloca_h=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_alloca_h=no -fi -rm -f conftest* -fi +int +main () +{ +char *p = (char *) alloca (2 * sizeof (int)); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_working_alloca_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_working_alloca_h=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 +echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 +if test $ac_cv_working_alloca_h = yes; then -echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 -if test $ac_cv_header_alloca_h = yes; then - cat >> confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 -EOF +_ACEOF fi -echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:4774: 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 +echo $ECHO_N "checking for alloca... $ECHO_C" >&6 +if test "${ac_cv_func_alloca_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else @@ -4799,137 +8902,217 @@ char *alloca (); # endif #endif -int main() { -char *p = (char *) alloca(1); -; return 0; } -EOF -if { (eval echo configure:4807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* +int +main () +{ +char *p = (char *) alloca (1); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_func_alloca_works=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_func_alloca_works=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_alloca_works=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi +echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 +echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 -echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 if test $ac_cv_func_alloca_works = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_ALLOCA 1 -EOF -fi +cat >>confdefs.h <<\_ACEOF +#define HAVE_ALLOCA 1 +_ACEOF -if test $ac_cv_func_alloca_works = no; then +else # The SVR3 libPW and SVR4 libucb both contain incompatible functions - # that cause trouble. Some versions do not even contain alloca or - # contain a buggy version. If you still want to use their alloca, - # use ar to extract alloca.o from them instead of compiling alloca.c. - ALLOCA=alloca.${ac_objext} - cat >> confdefs.h <<\EOF +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + +ALLOCA=alloca.$ac_objext + +cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 -EOF +_ACEOF -echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:4839: 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 <&5 +echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 +if test "${ac_cv_os_cray+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #if defined(CRAY) && ! defined(CRAY2) webecray #else wenotbecray #endif -EOF +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "webecray" >/dev/null 2>&1; then - rm -rf conftest* + $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else - rm -rf conftest* ac_cv_os_cray=no fi rm -f conftest* fi - -echo "$ac_t""$ac_cv_os_cray" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 +echo "${ECHO_T}$ac_cv_os_cray" >&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:4869: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif -int main() { +#undef $ac_func +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:4897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func -EOF +_ACEOF - break -else - echo "$ac_t""no" 1>&6 + break fi -done + done fi -echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:4924: 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 +echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 +echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 +if test "${ac_cv_c_stack_direction+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int find_stack_direction () { static char *addr = 0; @@ -4942,520 +9125,981 @@ find_stack_direction () else return (&dummy > addr) ? 1 : -1; } + +int main () { - exit (find_stack_direction() < 0); + exit (find_stack_direction () < 0); } -EOF -if { (eval echo configure:4951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_c_stack_direction=-1 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_stack_direction=-1 fi -rm -fr conftest* +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi +echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 -echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 -cat >> confdefs.h <>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction -EOF +_ACEOF + fi + + + + + for ac_func in sbrk utimes setmode getc_unlocked strcoll do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4975: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif -int main() { +#undef $ac_func +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:5003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 fi done # Check whether fopen64 is available and whether _LARGEFILE64_SOURCE # needs to be defined for it -echo $ac_n "checking for fopen64""... $ac_c" 1>&6 -echo "configure:5031: checking for fopen64" >&5 -if eval "test \"`echo '$''{'bu_cv_have_fopen64'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for fopen64... $ECHO_C" >&6 +if test "${bu_cv_have_fopen64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -int main() { +int +main () +{ FILE *f = fopen64 ("/tmp/foo","r"); -; return 0; } -EOF -if { (eval echo configure:5043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then bu_cv_have_fopen64=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - saved_CPPFLAGS=$CPPFLAGS + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +saved_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -int main() { +int +main () +{ FILE *f = fopen64 ("/tmp/foo","r"); -; return 0; } -EOF -if { (eval echo configure:5060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - bu_cv_have_fopen64=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +bu_cv_have_fopen64=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CPPFLAGS=$saved_CPPFLAGS fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$ac_t""$bu_cv_have_fopen64" 1>&6 +echo "$as_me:$LINENO: result: $bu_cv_have_fopen64" >&5 +echo "${ECHO_T}$bu_cv_have_fopen64" >&6 if test "$bu_cv_have_fopen64" != no; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_FOPEN64 1 -EOF +_ACEOF fi -echo $ac_n "checking for stat64""... $ac_c" 1>&6 -echo "configure:5083: checking for stat64" >&5 -if eval "test \"`echo '$''{'bu_cv_have_stat64'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for stat64... $ECHO_C" >&6 +if test "${bu_cv_have_stat64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -int main() { +int +main () +{ struct stat64 st; stat64 ("/tmp/foo", &st); -; return 0; } -EOF -if { (eval echo configure:5095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then bu_cv_have_stat64=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - saved_CPPFLAGS=$CPPFLAGS + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +saved_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -int main() { +int +main () +{ struct stat64 st; stat64 ("/tmp/foo", &st); -; return 0; } -EOF -if { (eval echo configure:5112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then bu_cv_have_stat64="need -D_LARGEFILE64_SOURCE" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - bu_cv_have_stat64=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +bu_cv_have_stat64=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CPPFLAGS=$saved_CPPFLAGS fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$ac_t""$bu_cv_have_stat64" 1>&6 +echo "$as_me:$LINENO: result: $bu_cv_have_stat64" >&5 +echo "${ECHO_T}$bu_cv_have_stat64" >&6 if test "$bu_cv_have_stat64" != no; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_STAT64 1 -EOF +_ACEOF fi if test "$bu_cv_have_fopen64" = "need -D_LARGEFILE64_SOURCE" \ || test "$bu_cv_have_stat64" = "need -D_LARGEFILE64_SOURCE"; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define _LARGEFILE64_SOURCE 1 -EOF +_ACEOF CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" fi # Some systems have frexp only in -lm, not in -lc. +echo "$as_me:$LINENO: checking for library containing frexp" >&5 +echo $ECHO_N "checking for library containing frexp... $ECHO_C" >&6 +if test "${ac_cv_search_frexp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_frexp=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -echo $ac_n "checking for library containing frexp""... $ac_c" 1>&6 -echo "configure:5146: checking for library containing frexp" >&5 -if eval "test \"`echo '$''{'ac_cv_search_frexp'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_func_search_save_LIBS="$LIBS" -ac_cv_search_frexp="no" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + builtin and then its argument prototype would still apply. */ +char frexp (); +int +main () +{ +frexp (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_search_frexp="none required" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest* -test "$ac_cv_search_frexp" = "no" && for i in m; do -LIBS="-l$i $ac_func_search_save_LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char frexp(); - -int main() { -frexp() -; return 0; } -EOF -if { (eval echo configure:5186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_search_frexp="-l$i" + builtin and then its argument prototype would still apply. */ +char frexp (); +int +main () +{ +frexp (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_frexp="-l$ac_lib" break else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest* -done -LIBS="$ac_func_search_save_LIBS" +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done fi - -echo "$ac_t""$ac_cv_search_frexp" 1>&6 -if test "$ac_cv_search_frexp" != "no"; then +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_frexp" >&5 +echo "${ECHO_T}$ac_cv_search_frexp" >&6 +if test "$ac_cv_search_frexp" != no; then test "$ac_cv_search_frexp" = "none required" || LIBS="$ac_cv_search_frexp $LIBS" - -else : - + fi -echo $ac_n "checking whether weak symbol works""... $ac_c" 1>&6 -echo "configure:5208: checking whether weak symbol works" >&5 -if eval "test \"`echo '$''{'libiberty_cv_have_weak_symbol'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking whether weak symbol works... $ECHO_C" >&6 +if test "${libiberty_cv_have_weak_symbol+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #pragma weak liberty_weak_symbol_test extern void liberty_weak_symbol_test (); -int main() { +int +main () +{ if (return &liberty_weak_symbol_test != NULL) return 1 -; return 0; } -EOF -if { (eval echo configure:5222: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then libiberty_cv_have_weak_symbol=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - libiberty_cv_have_weak_symbol=yes + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +libiberty_cv_have_weak_symbol=yes fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$libiberty_cv_have_weak_symbol" 1>&6 +echo "$as_me:$LINENO: result: $libiberty_cv_have_weak_symbol" >&5 +echo "${ECHO_T}$libiberty_cv_have_weak_symbol" >&6 if test $libiberty_cv_have_weak_symbol = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_WEAK_SYMBOL 1 -EOF +_ACEOF fi if test $libiberty_cv_have_weak_symbol = yes; then # demangler may use dlopen. - -echo $ac_n "checking for library containing dlopen""... $ac_c" 1>&6 -echo "configure:5246: checking for library containing dlopen" >&5 -if eval "test \"`echo '$''{'ac_cv_search_dlopen'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_func_search_save_LIBS="$LIBS" -ac_cv_search_dlopen="no" -cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for library containing dlopen... $ECHO_C" >&6 +if test "${ac_cv_search_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_dlopen=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen(); - -int main() { -dlopen() -; return 0; } -EOF -if { (eval echo configure:5264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_search_dlopen="none required" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest* -test "$ac_cv_search_dlopen" = "no" && for i in dl; do -LIBS="-l$i $ac_func_search_save_LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen(); - -int main() { -dlopen() -; return 0; } -EOF -if { (eval echo configure:5286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_search_dlopen="-l$i" + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_dlopen="-l$ac_lib" break else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest* -done -LIBS="$ac_func_search_save_LIBS" +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done fi - -echo "$ac_t""$ac_cv_search_dlopen" 1>&6 -if test "$ac_cv_search_dlopen" != "no"; then +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_dlopen" >&5 +echo "${ECHO_T}$ac_cv_search_dlopen" >&6 +if test "$ac_cv_search_dlopen" != no; then test "$ac_cv_search_dlopen" = "none required" || LIBS="$ac_cv_search_dlopen $LIBS" libiberty_cv_have_dlopen=yes -else : +else libiberty_cv_have_dlopen=no fi + if test $libiberty_cv_have_dlopen = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_DLOPEN 1 -EOF +_ACEOF fi fi -echo $ac_n "checking for time_t in time.h""... $ac_c" 1>&6 -echo "configure:5315: checking for time_t in time.h" >&5 -if eval "test \"`echo '$''{'bu_cv_decl_time_t_time_h'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for time_t in time.h... $ECHO_C" >&6 +if test "${bu_cv_decl_time_t_time_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -int main() { +int +main () +{ time_t i; -; return 0; } -EOF -if { (eval echo configure:5327: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then bu_cv_decl_time_t_time_h=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - bu_cv_decl_time_t_time_h=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +bu_cv_decl_time_t_time_h=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$bu_cv_decl_time_t_time_h" 1>&6 +echo "$as_me:$LINENO: result: $bu_cv_decl_time_t_time_h" >&5 +echo "${ECHO_T}$bu_cv_decl_time_t_time_h" >&6 if test $bu_cv_decl_time_t_time_h = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_TIME_T_IN_TIME_H 1 -EOF +_ACEOF fi -echo $ac_n "checking for time_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:5348: checking for time_t in sys/types.h" >&5 -if eval "test \"`echo '$''{'bu_cv_decl_time_t_types_h'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for time_t in sys/types.h... $ECHO_C" >&6 +if test "${bu_cv_decl_time_t_types_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -int main() { +int +main () +{ time_t i; -; return 0; } -EOF -if { (eval echo configure:5360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then bu_cv_decl_time_t_types_h=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - bu_cv_decl_time_t_types_h=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +bu_cv_decl_time_t_types_h=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$bu_cv_decl_time_t_types_h" 1>&6 +echo "$as_me:$LINENO: result: $bu_cv_decl_time_t_types_h" >&5 +echo "${ECHO_T}$bu_cv_decl_time_t_types_h" >&6 if test $bu_cv_decl_time_t_types_h = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_TIME_T_IN_TYPES_H 1 -EOF +_ACEOF fi -echo $ac_n "checking for a known getopt prototype in unistd.h""... $ac_c" 1>&6 -echo "configure:5381: checking for a known getopt prototype in unistd.h" >&5 -if eval "test \"`echo '$''{'bu_cv_decl_getopt_unistd_h'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for a known getopt prototype in unistd.h... $ECHO_C" >&6 +if test "${bu_cv_decl_getopt_unistd_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -int main() { +int +main () +{ extern int getopt (int, char *const*, const char *); -; return 0; } -EOF -if { (eval echo configure:5393: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then bu_cv_decl_getopt_unistd_h=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - bu_cv_decl_getopt_unistd_h=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +bu_cv_decl_getopt_unistd_h=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$bu_cv_decl_getopt_unistd_h" 1>&6 +echo "$as_me:$LINENO: result: $bu_cv_decl_getopt_unistd_h" >&5 +echo "${ECHO_T}$bu_cv_decl_getopt_unistd_h" >&6 if test $bu_cv_decl_getopt_unistd_h = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_DECL_GETOPT 1 -EOF +_ACEOF fi # Under Next 3.2 apparently does not define struct utimbuf # by default. -echo $ac_n "checking for utime.h""... $ac_c" 1>&6 -echo "configure:5416: checking for utime.h" >&5 -if eval "test \"`echo '$''{'bu_cv_header_utime_h'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for utime.h... $ECHO_C" >&6 +if test "${bu_cv_header_utime_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #ifdef HAVE_TIME_H #include #endif #include -int main() { +int +main () +{ struct utimbuf s; -; return 0; } -EOF -if { (eval echo configure:5432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then bu_cv_header_utime_h=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - bu_cv_header_utime_h=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +bu_cv_header_utime_h=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$bu_cv_header_utime_h" 1>&6 +echo "$as_me:$LINENO: result: $bu_cv_header_utime_h" >&5 +echo "${ECHO_T}$bu_cv_header_utime_h" >&6 if test $bu_cv_header_utime_h = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_GOOD_UTIME_H 1 -EOF +_ACEOF fi -echo $ac_n "checking whether fprintf must be declared""... $ac_c" 1>&6 -echo "configure:5453: checking whether fprintf must be declared" >&5 -if eval "test \"`echo '$''{'bfd_cv_decl_needed_fprintf'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking whether fprintf must be declared... $ECHO_C" >&6 +if test "${bfd_cv_decl_needed_fprintf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #ifdef HAVE_STRING_H @@ -5471,38 +10115,67 @@ else #ifdef HAVE_UNISTD_H #include #endif -int main() { +int +main () +{ char *(*pfn) = (char *(*)) fprintf -; return 0; } -EOF -if { (eval echo configure:5479: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then bfd_cv_decl_needed_fprintf=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - bfd_cv_decl_needed_fprintf=yes + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +bfd_cv_decl_needed_fprintf=yes fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$bfd_cv_decl_needed_fprintf" 1>&6 +echo "$as_me:$LINENO: result: $bfd_cv_decl_needed_fprintf" >&5 +echo "${ECHO_T}$bfd_cv_decl_needed_fprintf" >&6 if test $bfd_cv_decl_needed_fprintf = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define NEED_DECLARATION_FPRINTF 1 -EOF +_ACEOF fi -echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:5500: checking whether strstr must be declared" >&5 -if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking whether strstr must be declared... $ECHO_C" >&6 +if test "${bfd_cv_decl_needed_strstr+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #ifdef HAVE_STRING_H @@ -5518,38 +10191,67 @@ else #ifdef HAVE_UNISTD_H #include #endif -int main() { +int +main () +{ char *(*pfn) = (char *(*)) strstr -; return 0; } -EOF -if { (eval echo configure:5526: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then bfd_cv_decl_needed_strstr=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - bfd_cv_decl_needed_strstr=yes + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +bfd_cv_decl_needed_strstr=yes fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$bfd_cv_decl_needed_strstr" 1>&6 +echo "$as_me:$LINENO: result: $bfd_cv_decl_needed_strstr" >&5 +echo "${ECHO_T}$bfd_cv_decl_needed_strstr" >&6 if test $bfd_cv_decl_needed_strstr = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define NEED_DECLARATION_STRSTR 1 -EOF +_ACEOF fi -echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6 -echo "configure:5547: checking whether sbrk must be declared" >&5 -if eval "test \"`echo '$''{'bfd_cv_decl_needed_sbrk'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking whether sbrk must be declared... $ECHO_C" >&6 +if test "${bfd_cv_decl_needed_sbrk+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #ifdef HAVE_STRING_H @@ -5565,38 +10267,67 @@ else #ifdef HAVE_UNISTD_H #include #endif -int main() { +int +main () +{ char *(*pfn) = (char *(*)) sbrk -; return 0; } -EOF -if { (eval echo configure:5573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then bfd_cv_decl_needed_sbrk=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - bfd_cv_decl_needed_sbrk=yes + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +bfd_cv_decl_needed_sbrk=yes fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$bfd_cv_decl_needed_sbrk" 1>&6 +echo "$as_me:$LINENO: result: $bfd_cv_decl_needed_sbrk" >&5 +echo "${ECHO_T}$bfd_cv_decl_needed_sbrk" >&6 if test $bfd_cv_decl_needed_sbrk = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define NEED_DECLARATION_SBRK 1 -EOF +_ACEOF fi -echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:5594: checking whether getenv must be declared" >&5 -if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking whether getenv must be declared... $ECHO_C" >&6 +if test "${bfd_cv_decl_needed_getenv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #ifdef HAVE_STRING_H @@ -5612,38 +10343,67 @@ else #ifdef HAVE_UNISTD_H #include #endif -int main() { +int +main () +{ char *(*pfn) = (char *(*)) getenv -; return 0; } -EOF -if { (eval echo configure:5620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then bfd_cv_decl_needed_getenv=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - bfd_cv_decl_needed_getenv=yes + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +bfd_cv_decl_needed_getenv=yes fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$bfd_cv_decl_needed_getenv" 1>&6 +echo "$as_me:$LINENO: result: $bfd_cv_decl_needed_getenv" >&5 +echo "${ECHO_T}$bfd_cv_decl_needed_getenv" >&6 if test $bfd_cv_decl_needed_getenv = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define NEED_DECLARATION_GETENV 1 -EOF +_ACEOF fi -echo $ac_n "checking whether environ must be declared""... $ac_c" 1>&6 -echo "configure:5641: checking whether environ must be declared" >&5 -if eval "test \"`echo '$''{'bfd_cv_decl_needed_environ'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking whether environ must be declared... $ECHO_C" >&6 +if test "${bfd_cv_decl_needed_environ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #ifdef HAVE_STRING_H @@ -5659,37 +10419,136 @@ else #ifdef HAVE_UNISTD_H #include #endif -int main() { +int +main () +{ char *(*pfn) = (char *(*)) environ -; return 0; } -EOF -if { (eval echo configure:5667: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then bfd_cv_decl_needed_environ=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - bfd_cv_decl_needed_environ=yes + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +bfd_cv_decl_needed_environ=yes fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$bfd_cv_decl_needed_environ" 1>&6 +echo "$as_me:$LINENO: result: $bfd_cv_decl_needed_environ" >&5 +echo "${ECHO_T}$bfd_cv_decl_needed_environ" >&6 if test $bfd_cv_decl_needed_environ = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define NEED_DECLARATION_ENVIRON 1 -EOF +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5 +echo $ECHO_N "checking whether getc_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef getc_unlocked + char *p = (char *) getc_unlocked; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_getc_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_getc_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getc_unlocked" >&6 +if test $ac_cv_have_decl_getc_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETC_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETC_UNLOCKED 0 +_ACEOF + fi + case "${host}" in *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define USE_BINARY_FOPEN 1 -EOF +_ACEOF ;; esac @@ -5729,7 +10588,7 @@ do NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC" else case $targ in - i[3-7]86*-*-netware*) + i[3-7]86*-*-netware*) BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386" ;; @@ -5825,9 +10684,10 @@ fi -cat >> confdefs.h <>confdefs.h <<_ACEOF #define TARGET "${target}" -EOF +_ACEOF targ=$target @@ -5837,12 +10697,13 @@ if test "x$targ_underscore" = "xyes"; th else UNDERSCORE=0 fi -cat >> confdefs.h <>confdefs.h <<_ACEOF #define TARGET_PREPENDS_UNDERSCORE $UNDERSCORE -EOF +_ACEOF -# Emulation +# Emulation for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'` do # Canonicalize the secondary target names. @@ -5856,447 +10717,1482 @@ do . ${srcdir}/configure.tgt EMULATION=$targ_emul - EMULATION_VECTOR=$targ_emul_vector + EMULATION_VECTOR=$targ_emul_vector done -trap '' 1 2 15 -cat > confcache <<\EOF + ac_config_files="$ac_config_files Makefile doc/Makefile po/Makefile.in:po/Make-in" + ac_config_commands="$ac_config_commands default" +cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. # -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. # -EOF +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' fi -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - DEFS=-DHAVE_CONFIG_H -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS <&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. # Run this file to recreate the current configuration. -# This directory was configured as follows, -# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# $0 $ac_configure_args -# # Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. +# configure, is in config.log if it exists. -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by $as_me, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 do - case "\$ac_option" in + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + esac + shift done -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" +ac_configure_extra_args= -trap 'rm -fr `echo "Makefile doc/Makefile po/Makefile.in:po/Make-in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS </dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF -# Protect against being on the right side of a sed subst in config.status. -sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; - s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@host@%$host%g -s%@host_alias@%$host_alias%g -s%@host_cpu@%$host_cpu%g -s%@host_vendor@%$host_vendor%g -s%@host_os@%$host_os%g -s%@target@%$target%g -s%@target_alias@%$target_alias%g -s%@target_cpu@%$target_cpu%g -s%@target_vendor@%$target_vendor%g -s%@target_os@%$target_os%g -s%@build@%$build%g -s%@build_alias@%$build_alias%g -s%@build_cpu@%$build_cpu%g -s%@build_vendor@%$build_vendor%g -s%@build_os@%$build_os%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@PACKAGE@%$PACKAGE%g -s%@VERSION@%$VERSION%g -s%@ACLOCAL@%$ACLOCAL%g -s%@AUTOCONF@%$AUTOCONF%g -s%@AUTOMAKE@%$AUTOMAKE%g -s%@AUTOHEADER@%$AUTOHEADER%g -s%@MAKEINFO@%$MAKEINFO%g -s%@SET_MAKE@%$SET_MAKE%g -s%@CC@%$CC%g -s%@LN_S@%$LN_S%g -s%@OBJEXT@%$OBJEXT%g -s%@EXEEXT@%$EXEEXT%g -s%@RANLIB@%$RANLIB%g -s%@STRIP@%$STRIP%g -s%@LIBTOOL@%$LIBTOOL%g -s%@WARN_CFLAGS@%$WARN_CFLAGS%g -s%@NO_WERROR@%$NO_WERROR%g -s%@YACC@%$YACC%g -s%@LEX@%$LEX%g -s%@LEXLIB@%$LEXLIB%g -s%@CPP@%$CPP%g -s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g -s%@ALLOCA@%$ALLOCA%g -s%@USE_NLS@%$USE_NLS%g -s%@MSGFMT@%$MSGFMT%g -s%@GMSGFMT@%$GMSGFMT%g -s%@XGETTEXT@%$XGETTEXT%g -s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g -s%@CATALOGS@%$CATALOGS%g -s%@CATOBJEXT@%$CATOBJEXT%g -s%@DATADIRNAME@%$DATADIRNAME%g -s%@GMOFILES@%$GMOFILES%g -s%@INSTOBJEXT@%$INSTOBJEXT%g -s%@INTLDEPS@%$INTLDEPS%g -s%@INTLLIBS@%$INTLLIBS%g -s%@INTLOBJS@%$INTLOBJS%g -s%@POFILES@%$POFILES%g -s%@POSUB@%$POSUB%g -s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g -s%@GT_NO@%$GT_NO%g -s%@GT_YES@%$GT_YES%g -s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g -s%@l@%$l%g -s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g -s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g -s%@MAINT@%$MAINT%g -s%@HDEFINES@%$HDEFINES%g -s%@AR@%$AR%g -s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g -s%@EXEEXT_FOR_BUILD@%$EXEEXT_FOR_BUILD%g -s%@DEMANGLER_NAME@%$DEMANGLER_NAME%g -s%@NLMCONV_DEFS@%$NLMCONV_DEFS%g -s%@BUILD_NLMCONV@%$BUILD_NLMCONV%g -s%@BUILD_SRCONV@%$BUILD_SRCONV%g -s%@BUILD_DLLTOOL@%$BUILD_DLLTOOL%g -s%@DLLTOOL_DEFS@%$DLLTOOL_DEFS%g -s%@BUILD_WINDRES@%$BUILD_WINDRES%g -s%@BUILD_DLLWRAP@%$BUILD_DLLWRAP%g -s%@BUILD_MISC@%$BUILD_MISC%g -s%@OBJDUMP_DEFS@%$OBJDUMP_DEFS%g -s%@EMULATION@%$EMULATION%g -s%@EMULATION_VECTOR@%$EMULATION_VECTOR%g + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in:po/Make-in" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@target@,$target,;t t +s,@target_cpu@,$target_cpu,;t t +s,@target_vendor@,$target_vendor,;t t +s,@target_os@,$target_os,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CYGPATH_W@,$CYGPATH_W,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@mkdir_p@,$mkdir_p,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@am__leading_dot@,$am__leading_dot,;t t +s,@AMTAR@,$AMTAR,;t t +s,@am__tar@,$am__tar,;t t +s,@am__untar@,$am__untar,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@LN_S@,$LN_S,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@LIBTOOL@,$LIBTOOL,;t t +s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t +s,@NO_WERROR@,$NO_WERROR,;t t +s,@YACC@,$YACC,;t t +s,@LEX@,$LEX,;t t +s,@LEXLIB@,$LEXLIB,;t t +s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t +s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t +s,@ALLOCA@,$ALLOCA,;t t +s,@USE_NLS@,$USE_NLS,;t t +s,@MSGFMT@,$MSGFMT,;t t +s,@GMSGFMT@,$GMSGFMT,;t t +s,@XGETTEXT@,$XGETTEXT,;t t +s,@USE_INCLUDED_LIBINTL@,$USE_INCLUDED_LIBINTL,;t t +s,@CATALOGS@,$CATALOGS,;t t +s,@CATOBJEXT@,$CATOBJEXT,;t t +s,@DATADIRNAME@,$DATADIRNAME,;t t +s,@GMOFILES@,$GMOFILES,;t t +s,@INSTOBJEXT@,$INSTOBJEXT,;t t +s,@INTLDEPS@,$INTLDEPS,;t t +s,@INTLLIBS@,$INTLLIBS,;t t +s,@INTLOBJS@,$INTLOBJS,;t t +s,@POFILES@,$POFILES,;t t +s,@POSUB@,$POSUB,;t t +s,@INCLUDE_LOCALE_H@,$INCLUDE_LOCALE_H,;t t +s,@GT_NO@,$GT_NO,;t t +s,@GT_YES@,$GT_YES,;t t +s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t +s,@l@,$l,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t +s,@HDEFINES@,$HDEFINES,;t t +s,@AR@,$AR,;t t +s,@CC_FOR_BUILD@,$CC_FOR_BUILD,;t t +s,@EXEEXT_FOR_BUILD@,$EXEEXT_FOR_BUILD,;t t +s,@DEMANGLER_NAME@,$DEMANGLER_NAME,;t t +s,@NLMCONV_DEFS@,$NLMCONV_DEFS,;t t +s,@BUILD_NLMCONV@,$BUILD_NLMCONV,;t t +s,@BUILD_SRCONV@,$BUILD_SRCONV,;t t +s,@BUILD_DLLTOOL@,$BUILD_DLLTOOL,;t t +s,@DLLTOOL_DEFS@,$DLLTOOL_DEFS,;t t +s,@BUILD_WINDRES@,$BUILD_WINDRES,;t t +s,@BUILD_DLLWRAP@,$BUILD_DLLWRAP,;t t +s,@BUILD_MISC@,$BUILD_MISC,;t t +s,@OBJDUMP_DEFS@,$OBJDUMP_DEFS,;t t +s,@EMULATION@,$EMULATION,;t t +s,@EMULATION_VECTOR@,$EMULATION_VECTOR,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF -EOF -cat >> $CONFIG_STATUS <<\EOF +_ACEOF -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; esac - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' +ac_uD=',;t' -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; esac - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. - +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail -while : +while grep . conftest.undefs >/dev/null do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals -done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h - else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file fi - rm -f $ac_file - mv conftest.h $ac_file + else + cat $tmp/config.h + rm -f $tmp/config.h fi -fi; done +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'`/stamp-h$_am_stamp_count +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF -EOF -cat >> $CONFIG_STATUS </dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac -EOF -cat >> $CONFIG_STATUS <<\EOF -test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + default ) case "x$CONFIG_FILES" in *) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;; esac + ;; + esac +done +_ACEOF -exit 0 -EOF +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi diff -uprN binutils-2.16.90.0.3/binutils/configure.in binutils-2.16.91.0.1/binutils/configure.in --- binutils-2.16.90.0.3/binutils/configure.in 2005-04-29 10:50:26.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/configure.in 2005-06-22 13:53:34.603367205 -0700 @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. dnl -AC_PREREQ(2.13) +AC_PREREQ(2.57) AC_INIT(ar.c) AC_CANONICAL_SYSTEM @@ -86,7 +86,7 @@ AC_PROG_CC AC_PROG_YACC AM_PROG_LEX -ALL_LINGUAS="fr tr ja es sv da zh_CN ru ro rw" +ALL_LINGUAS="fr tr ja es sv da zh_CN ru ro rw zh_TW" CY_GNU_GETTEXT AM_MAINTAINER_MODE @@ -228,6 +228,7 @@ BFD_NEED_DECLARATION(strstr) BFD_NEED_DECLARATION(sbrk) BFD_NEED_DECLARATION(getenv) BFD_NEED_DECLARATION(environ) +AC_CHECK_DECLS(getc_unlocked) BFD_BINARY_FOPEN diff -uprN binutils-2.16.90.0.3/binutils/deflex.l binutils-2.16.91.0.1/binutils/deflex.l --- binutils-2.16.90.0.3/binutils/deflex.l 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/deflex.l 2005-06-22 13:53:34.605366874 -0700 @@ -83,6 +83,7 @@ int linenumber; ";".* { } " " { } "\t" { } +"\r" { } "\n" { linenumber ++ ;} "=" { return '=';} "." { return '.';} diff -uprN binutils-2.16.90.0.3/binutils/doc/binutils.texi binutils-2.16.91.0.1/binutils/doc/binutils.texi --- binutils-2.16.90.0.3/binutils/doc/binutils.texi 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/doc/binutils.texi 2005-06-22 13:53:34.654358779 -0700 @@ -2524,6 +2524,7 @@ addr2line [@option{-b} @var{bfdname}|@op [@option{-C}|@option{--demangle}[=@var{style}]] [@option{-e} @var{filename}|@option{--exe=}@var{filename}] [@option{-f}|@option{--functions}] [@option{-s}|@option{--basename}] + [@option{-i}|@option{--inlines}] [@option{-H}|@option{--help}] [@option{-V}|@option{--version}] [addr addr @dots{}] @c man end @@ -2596,6 +2597,15 @@ Display function names as well as file a @item -s @itemx --basenames Display only the base of each file name. + +@item -i +@itemx --inlines +If the address belongs to a function that was inlined, the source +information for all enclosing scopes back to the first non-inlined +function will also be printed. For example, if @code{main} inlines +@code{callee1} which inlines @code{callee2}, and address is from +@code{callee2}, the source information for @code{callee1} and @code{main} +will also be printed. @end table @c man end diff -uprN binutils-2.16.90.0.3/binutils/doc/Makefile.am binutils-2.16.91.0.1/binutils/doc/Makefile.am --- binutils-2.16.90.0.3/binutils/doc/Makefile.am 2004-12-20 11:16:49.000000000 -0800 +++ binutils-2.16.91.0.1/binutils/doc/Makefile.am 2005-06-22 13:53:34.648359771 -0700 @@ -31,18 +31,15 @@ man_MANS = \ $(DEMANGLER_NAME).1 info_TEXINFOS = binutils.texi +binutils_TEXINFOS = config.texi +binutils_TEXI = $(srcdir)/binutils.texi -config.texi: Makefile +config.texi: $(srcdir)/../../bfd/configure $(binutils_TEXI) rm -f config.texi - echo '@set VERSION $(VERSION)' > config.texi + eval `grep '^ *VERSION=' $(srcdir)/../../bfd/configure`; \ + echo "@set VERSION $$VERSION" > $@ echo "@set UPDATED `date "+%B %Y"`" >> config.texi -binutils_TEXI = $(srcdir)/binutils.texi - -binutils.dvi: $(binutils_TEXI) config.texi - -binutils.info: $(binutils_TEXI) config.texi - # Man page generation from texinfo addr2line.1: $(binutils_TEXI) touch $@ @@ -143,7 +140,6 @@ cxxfilt.man: $(binutils_TEXI) rm -f $(DEMANGLER_NAME).pod MAINTAINERCLEANFILES = config.texi -DISTCLEANFILES = config.texi MOSTLYCLEANFILES = $(DEMANGLER_NAME).1 $(DEMANGLER_NAME).1: cxxfilt.man Makefile @@ -158,9 +154,9 @@ $(DEMANGLER_NAME).1: cxxfilt.man Makefil # We want install to imply install-info as per GNU standards, despite the # cygnus option. -install: install-info +install-data-local: install-info # Maintenance # We need it for the taz target in ../../Makefile.in. -info: $(MANS) +info-local: $(MANS) diff -uprN binutils-2.16.90.0.3/binutils/doc/Makefile.in binutils-2.16.91.0.1/binutils/doc/Makefile.in --- binutils-2.16.90.0.3/binutils/doc/Makefile.in 2005-04-29 10:50:27.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/doc/Makefile.in 2005-06-22 13:53:34.651359275 -0700 @@ -1,6 +1,8 @@ -# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am +# Makefile.in generated by automake 1.9.5 from Makefile.am. +# @configure_input@ -# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -10,61 +12,78 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. - -SHELL = @SHELL@ - +@SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ - top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_alias = @build_alias@ build_triplet = @build@ -host_alias = @host_alias@ host_triplet = @host@ -target_alias = @target_alias@ target_triplet = @target@ +subdir = doc +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(binutils_TEXINFOS) +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/../bfd/acinclude.m4 \ + $(top_srcdir)/../config/acx.m4 $(top_srcdir)/../bfd/bfd.m4 \ + $(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/../libtool.m4 \ + $(top_srcdir)/../gettext.m4 $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +depcomp = +am__depfiles_maybe = +SOURCES = +INFO_DEPS = $(srcdir)/binutils.info +TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex +am__TEXINFO_TEX_DIR = $(top_srcdir)/../texinfo +DVIS = binutils.dvi +PDFS = binutils.pdf +PSS = binutils.ps +HTMLS = binutils.html +TEXINFOS = binutils.texi +TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then \ + echo $(top_srcdir)/../texinfo/util/texi2dvi; \ + else \ + echo texi2dvi; \ + fi` +TEXI2PDF = $(TEXI2DVI) --pdf --batch +MAKEINFOHTML = $(MAKEINFO) --html +AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) +DVIPS = dvips +man1dir = $(mandir)/man1 +am__installdirs = "$(DESTDIR)$(man1dir)" +NROFF = nroff +MANS = $(man_MANS) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ AR = @AR@ -AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ BUILD_DLLTOOL = @BUILD_DLLTOOL@ BUILD_DLLWRAP = @BUILD_DLLWRAP@ BUILD_MISC = @BUILD_MISC@ @@ -74,66 +93,120 @@ BUILD_WINDRES = @BUILD_WINDRES@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ +CFLAGS = @CFLAGS@ CPP = @CPP@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ DEMANGLER_NAME = @DEMANGLER_NAME@ -DLLTOOL = @DLLTOOL@ +DEPDIR = @DEPDIR@ DLLTOOL_DEFS = @DLLTOOL_DEFS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ EMULATION = @EMULATION@ EMULATION_VECTOR = @EMULATION_VECTOR@ EXEEXT = @EXEEXT@ EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@ -GCJ = @GCJ@ -GCJFLAGS = @GCJFLAGS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ -GNATBIND = @GNATBIND@ GT_NO = @GT_NO@ GT_YES = @GT_YES@ HDEFINES = @HDEFINES@ INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLDEPS = @INTLDEPS@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ +LDFLAGS = @LDFLAGS@ LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LN = @LN@ LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ NLMCONV_DEFS = @NLMCONV_DEFS@ NO_WERROR = @NO_WERROR@ -OBJDUMP = @OBJDUMP@ OBJDUMP_DEFS = @OBJDUMP_DEFS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ STRIP = @STRIP@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ +XGETTEXT = @XGETTEXT@ YACC = @YACC@ -bfdincludedir = @bfdincludedir@ -bfdlibdir = @bfdlibdir@ -build_noncanonical = @build_noncanonical@ -build_subdir = @build_subdir@ -do_compare = @do_compare@ -host_noncanonical = @host_noncanonical@ -host_subdir = @host_subdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ l = @l@ -ncn_cv_ = @ncn_cv_@ -target_noncanonical = @target_noncanonical@ -target_subdir = @target_subdir@ - +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ AUTOMAKE_OPTIONS = cygnus # What version of the manual you want; "all" includes everything @@ -141,9 +214,7 @@ CONFIG = all # Options to extract the man page from as.texinfo MANCONF = -Dman - TEXI2POD = perl $(top_srcdir)/../etc/texi2pod.pl - POD2MAN = pod2man --center="GNU Development Tools" \ --release="binutils-$(VERSION)" --section=1 @@ -165,161 +236,162 @@ man_MANS = \ windres.1 \ $(DEMANGLER_NAME).1 - info_TEXINFOS = binutils.texi - +binutils_TEXINFOS = config.texi binutils_TEXI = $(srcdir)/binutils.texi - MAINTAINERCLEANFILES = config.texi -DISTCLEANFILES = config.texi MOSTLYCLEANFILES = $(DEMANGLER_NAME).1 -mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs -CONFIG_HEADER = ../config.h -CONFIG_CLEAN_FILES = -TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then echo $(top_srcdir)/../texinfo/util/texi2dvi; else echo texi2dvi; fi` -TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex -INFO_DEPS = binutils.info -DVIS = binutils.dvi -TEXINFOS = binutils.texi -man1dir = $(mandir)/man1 -MANS = $(man_MANS) - -NROFF = nroff -DIST_COMMON = Makefile.am Makefile.in - +all: all-am -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -all: all-redirect .SUFFIXES: -.SUFFIXES: .dvi .info .ps .texi .texinfo .txi -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --cygnus doc/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - +.SUFFIXES: .dvi .html .info .pdf .ps .texi +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign doc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -binutils.info: binutils.texi -binutils.dvi: binutils.texi +mostlyclean-libtool: + -rm -f *.lo +clean-libtool: + -rm -rf .libs _libs -DVIPS = dvips +distclean-libtool: + -rm -f libtool .texi.info: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< + restore=: && backupdir="$(am__leading_dot)am$$$$" && \ + am__cwd=`pwd` && cd $(srcdir) && \ + rm -rf $$backupdir && mkdir $$backupdir && \ + for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ + if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ + done; \ + cd "$$am__cwd"; \ + if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $@ $<; \ + then \ + rc=0; \ + cd $(srcdir); \ + else \ + rc=$$?; \ + cd $(srcdir) && \ + $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ + fi; \ + rm -rf $$backupdir; exit $$rc .texi.dvi: - TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \ - MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< - -.texi: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< - -.texinfo.info: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< - -.texinfo: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< - -.texinfo.dvi: - TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \ - MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< - -.txi.info: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< - -.txi.dvi: - TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \ - MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< - -.txi: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2DVI) $< + +.texi.pdf: + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2PDF) $< + +.texi.html: + rm -rf $(@:.html=.htp) + if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $(@:.html=.htp) $<; \ + then \ + rm -rf $@; \ + if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ + mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ + else \ + if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ + rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ + exit 1; \ + fi +$(srcdir)/binutils.info: binutils.texi $(binutils_TEXINFOS) +binutils.dvi: binutils.texi $(binutils_TEXINFOS) +binutils.pdf: binutils.texi $(binutils_TEXINFOS) +binutils.html: binutils.texi $(binutils_TEXINFOS) .dvi.ps: - $(DVIPS) $< -o $@ + $(DVIPS) -o $@ $< -install-info-am: $(INFO_DEPS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(infodir) - @list='$(INFO_DEPS)'; \ - for file in $$list; do \ - if test -f $$file; then d=.; else d=$(srcdir); fi; \ - for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ - if test -f $$d/$$ifile; then \ - echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \ - $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \ - else : ; fi; \ - done; \ - done - @$(POST_INSTALL) - @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ +uninstall-info-am: + @$(PRE_UNINSTALL) + @if (install-info --version && \ + install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ - echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\ - install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ + install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ done; \ - else : ; fi - -uninstall-info: - $(PRE_UNINSTALL) - @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ - ii=yes; \ - else ii=; fi; \ - list='$(INFO_DEPS)'; \ - for file in $$list; do \ - test -z "$$ii" \ - || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ - done + else :; fi @$(NORMAL_UNINSTALL) - list='$(INFO_DEPS)'; \ + @list='$(INFO_DEPS)'; \ for file in $$list; do \ - (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ + (if cd "$(DESTDIR)$(infodir)"; then \ + echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ + rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ + else :; fi); \ done dist-info: $(INFO_DEPS) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for base in $$list; do \ + case $$base in \ + $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \ - for file in `cd $$d && eval echo $$base*`; do \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file; \ + for file in $$d/$$base*; do \ + relfile=`expr "$$file" : "$$d/\(.*\)"`; \ + test -f $(distdir)/$$relfile || \ + cp -p $$file $(distdir)/$$relfile; \ done; \ done mostlyclean-aminfo: - -rm -f binutils.aux binutils.cp binutils.cps binutils.dvi binutils.fn \ - binutils.fns binutils.ky binutils.kys binutils.ps \ - binutils.log binutils.pg binutils.toc binutils.tp \ - binutils.tps binutils.vr binutils.vrs binutils.op binutils.tr \ - binutils.cv binutils.cn - -clean-aminfo: - -distclean-aminfo: + -rm -rf binutils.aux binutils.cp binutils.cps binutils.fn binutils.fns \ + binutils.ky binutils.log binutils.pg binutils.pgs \ + binutils.tmp binutils.toc binutils.tp binutils.tps \ + binutils.vr binutils.vrs binutils.dvi binutils.pdf \ + binutils.ps binutils.html maintainer-clean-aminfo: - for i in $(INFO_DEPS); do \ - rm -f $$i; \ - if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \ - rm -f $$i-[0-9]*; \ - fi; \ + @list='$(INFO_DEPS)'; for i in $$list; do \ + i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ + echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ + rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done -clean-info: mostlyclean-aminfo -install-man1: - $(mkinstalldirs) $(DESTDIR)$(man1dir) - @list='$(man1_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ +clean-info: mostlyclean-aminfo +install-man1: $(man1_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ @@ -328,131 +400,176 @@ install-man1: if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done - uninstall-man1: - @list='$(man1_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ - rm -f $(DESTDIR)$(man1dir)/$$inst; \ + echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done -install-man: $(MANS) - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-man1 -uninstall-man: - @$(NORMAL_UNINSTALL) - $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 tags: TAGS TAGS: +ctags: CTAGS +CTAGS: -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = doc - -distdir: $(DISTFILES) - @for file in $(DISTFILES); do \ - if test -f $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done - $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info -info-am: $(INFO_DEPS) -info: info-am -dvi-am: $(DVIS) -dvi: dvi-am check-am: check: check-am -installcheck-am: -installcheck: installcheck-am -install-info-am: -install-info: install-info-am -install-exec-am: +all-am: Makefile $(MANS) +installdirs: + for dir in "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am install-exec: install-exec-am - -install-data-am: install-man install-data: install-data-am +uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: uninstall-man -uninstall: uninstall-am -all-am: Makefile $(MANS) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - $(mkinstalldirs) $(DESTDIR)$(mandir)/man1 - +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -mostlyclean-am: mostlyclean-aminfo mostlyclean-generic +clean: clean-am -mostlyclean: mostlyclean-am +clean-am: clean-generic clean-libtool mostlyclean-am -clean-am: clean-aminfo clean-generic mostlyclean-am +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool -clean: clean-am +dvi: dvi-am -distclean-am: distclean-aminfo distclean-generic clean-am - -rm -f libtool +dvi-am: $(DVIS) -distclean: distclean-am +html: html-am -maintainer-clean-am: maintainer-clean-aminfo maintainer-clean-generic \ - distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." +html-am: $(HTMLS) + +info: info-am + +info-am: $(INFO_DEPS) info-local + +install-data-am: install-data-local install-man + +install-exec-am: + +install-info: install-info-am + +install-info-am: $(INFO_DEPS) + @$(NORMAL_INSTALL) + test -z "$(infodir)" || $(mkdir_p) "$(DESTDIR)$(infodir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ + for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ + $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ + if test -f $$ifile; then \ + relfile=`echo "$$ifile" | sed 's|^.*/||'`; \ + echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \ + $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \ + else : ; fi; \ + done; \ + done + @$(POST_INSTALL) + @if (install-info --version && \ + install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ + install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ + done; \ + else : ; fi +install-man: install-man1 + +installcheck-am: maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-aminfo \ + maintainer-clean-generic + +mostlyclean: mostlyclean-am -.PHONY: install-info-am uninstall-info mostlyclean-aminfo \ -distclean-aminfo clean-aminfo maintainer-clean-aminfo install-man1 \ -uninstall-man1 install-man uninstall-man tags distdir info-am info \ -dvi-am dvi check check-am installcheck-am installcheck install-info-am \ -install-info install-exec-am install-exec install-data-am install-data \ -install-am install uninstall-am uninstall all-redirect all-am all \ -installdirs mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean +mostlyclean-am: mostlyclean-aminfo mostlyclean-generic \ + mostlyclean-libtool +pdf: pdf-am -config.texi: Makefile - rm -f config.texi - echo '@set VERSION $(VERSION)' > config.texi - echo "@set UPDATED `date "+%B %Y"`" >> config.texi +pdf-am: $(PDFS) + +ps: ps-am + +ps-am: $(PSS) + +uninstall-am: uninstall-man + +uninstall-man: uninstall-man1 + +.PHONY: all all-am check check-am clean clean-generic clean-info \ + clean-libtool dist-info distclean distclean-generic \ + distclean-libtool dvi dvi-am html html-am info info-am \ + info-local install install-am install-data install-data-am \ + install-data-local install-exec install-exec-am install-info \ + install-info-am install-man install-man1 install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-aminfo maintainer-clean-generic mostlyclean \ + mostlyclean-aminfo mostlyclean-generic mostlyclean-libtool pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-info-am \ + uninstall-man uninstall-man1 -binutils.dvi: $(binutils_TEXI) config.texi -binutils.info: $(binutils_TEXI) config.texi +config.texi: $(srcdir)/../../bfd/configure $(binutils_TEXI) + rm -f config.texi + eval `grep '^ *VERSION=' $(srcdir)/../../bfd/configure`; \ + echo "@set VERSION $$VERSION" > $@ + echo "@set UPDATED `date "+%B %Y"`" >> config.texi # Man page generation from texinfo addr2line.1: $(binutils_TEXI) @@ -565,13 +682,12 @@ $(DEMANGLER_NAME).1: cxxfilt.man Makefil # We want install to imply install-info as per GNU standards, despite the # cygnus option. -install: install-info +install-data-local: install-info # Maintenance # We need it for the taz target in ../../Makefile.in. -info: $(MANS) - +info-local: $(MANS) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff -uprN binutils-2.16.90.0.3/binutils/Makefile.am binutils-2.16.91.0.1/binutils/Makefile.am --- binutils-2.16.90.0.3/binutils/Makefile.am 2005-04-29 10:50:26.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/Makefile.am 2005-06-22 13:53:34.560374308 -0700 @@ -297,6 +297,7 @@ EXTRA_DIST = arparse.c arparse.h arlex.c syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c diststuff: $(EXTRA_DIST) info +all: info DISTCLEANFILES = sysinfo sysroff.c sysroff.h \ site.exp site.bak @@ -494,6 +495,7 @@ readelf.o: readelf.c ../bfd/bfd.h $(INCD $(INCDIR)/elf/m32r.h $(INCDIR)/elf/m68k.h $(INCDIR)/elf/m68hc11.h \ $(INCDIR)/elf/mcore.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/mmix.h \ $(INCDIR)/elf/mn10200.h $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/msp430.h \ + $(INCDIR)/elf/ms1.h \ $(INCDIR)/elf/or32.h $(INCDIR)/elf/pj.h $(INCDIR)/elf/ppc.h \ $(INCDIR)/elf/ppc64.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/sh.h \ $(INCDIR)/elf/sparc.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/vax.h \ diff -uprN binutils-2.16.90.0.3/binutils/Makefile.in binutils-2.16.91.0.1/binutils/Makefile.in --- binutils-2.16.90.0.3/binutils/Makefile.in 2005-04-29 10:50:26.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/Makefile.in 2005-06-22 13:53:34.563373812 -0700 @@ -1,6 +1,8 @@ -# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am +# Makefile.in generated by automake 1.9.5 from Makefile.am. +# @configure_input@ -# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -10,61 +12,231 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +@SET_MAKE@ -SHELL = @SHELL@ +SOURCES = $(addr2line_SOURCES) $(ar_SOURCES) $(coffdump_SOURCES) $(cxxfilt_SOURCES) $(dlltool_SOURCES) $(dllwrap_SOURCES) $(nlmconv_SOURCES) $(nm_new_SOURCES) $(objcopy_SOURCES) $(objdump_SOURCES) $(ranlib_SOURCES) $(readelf_SOURCES) $(size_SOURCES) $(srconv_SOURCES) $(strings_SOURCES) $(strip_new_SOURCES) $(sysdump_SOURCES) $(windres_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ - top_builddir = . - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_alias = @build_alias@ build_triplet = @build@ -host_alias = @host_alias@ host_triplet = @host@ -target_alias = @target_alias@ target_triplet = @target@ +bin_PROGRAMS = $(am__EXEEXT_5) $(am__EXEEXT_6) $(am__EXEEXT_7) \ + $(am__EXEEXT_8) $(am__EXEEXT_9) $(am__EXEEXT_10) \ + @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ \ + $(am__EXEEXT_11) $(am__EXEEXT_12) @BUILD_DLLWRAP@ @BUILD_MISC@ +noinst_PROGRAMS = $(am__EXEEXT_13) $(am__EXEEXT_14) $(am__EXEEXT_15) +EXTRA_PROGRAMS = $(am__EXEEXT_1) srconv$(EXEEXT) sysdump$(EXEEXT) \ + coffdump$(EXEEXT) $(am__EXEEXT_2) $(am__EXEEXT_3) \ + $(am__EXEEXT_4) +DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub NEWS \ + README ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/config.in $(srcdir)/../mkinstalldirs \ + $(top_srcdir)/po/Make-in arparse.h arparse.c arlex.c \ + defparse.h defparse.c deflex.c nlmheader.h nlmheader.c \ + arparse.h arparse.c arlex.c rcparse.h rcparse.c rclex.c \ + $(srcdir)/../ylwrap $(srcdir)/../ltmain.sh \ + $(srcdir)/../config.guess $(srcdir)/../config.sub +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/../bfd/acinclude.m4 \ + $(top_srcdir)/../config/acx.m4 $(top_srcdir)/../bfd/bfd.m4 \ + $(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/../libtool.m4 \ + $(top_srcdir)/../gettext.m4 $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno configure.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = po/Makefile.in +am__EXEEXT_1 = nlmconv$(EXEEXT) +am__EXEEXT_2 = dlltool$(EXEEXT) +am__EXEEXT_3 = windres$(EXEEXT) +am__EXEEXT_4 = dllwrap$(EXEEXT) +am__EXEEXT_5 = size$(EXEEXT) +am__EXEEXT_6 = objdump$(EXEEXT) +am__EXEEXT_7 = ar$(EXEEXT) +am__EXEEXT_8 = strings$(EXEEXT) +am__EXEEXT_9 = ranlib$(EXEEXT) +am__EXEEXT_10 = objcopy$(EXEEXT) +am__EXEEXT_11 = addr2line$(EXEEXT) +am__EXEEXT_12 = readelf$(EXEEXT) +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +am__EXEEXT_13 = nm-new$(EXEEXT) +am__EXEEXT_14 = strip-new$(EXEEXT) +am__EXEEXT_15 = cxxfilt$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) +am__objects_1 = bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT) +am_addr2line_OBJECTS = addr2line.$(OBJEXT) budemang.$(OBJEXT) \ + $(am__objects_1) +addr2line_OBJECTS = $(am_addr2line_OBJECTS) +addr2line_LDADD = $(LDADD) +am__DEPENDENCIES_1 = ../bfd/libbfd.la +am__DEPENDENCIES_2 = ../libiberty/libiberty.a +am__DEPENDENCIES_3 = +addr2line_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) +am_ar_OBJECTS = arparse.$(OBJEXT) arlex.$(OBJEXT) ar.$(OBJEXT) \ + not-ranlib.$(OBJEXT) arsup.$(OBJEXT) rename.$(OBJEXT) \ + binemul.$(OBJEXT) emul_$(EMULATION).$(OBJEXT) $(am__objects_1) +ar_OBJECTS = $(am_ar_OBJECTS) +ar_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) +am_coffdump_OBJECTS = coffdump.$(OBJEXT) coffgrok.$(OBJEXT) \ + $(am__objects_1) +coffdump_OBJECTS = $(am_coffdump_OBJECTS) +coffdump_LDADD = $(LDADD) +coffdump_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) +am_cxxfilt_OBJECTS = cxxfilt.$(OBJEXT) $(am__objects_1) +cxxfilt_OBJECTS = $(am_cxxfilt_OBJECTS) +cxxfilt_LDADD = $(LDADD) +cxxfilt_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) +am_dlltool_OBJECTS = dlltool.$(OBJEXT) defparse.$(OBJEXT) \ + deflex.$(OBJEXT) $(am__objects_1) +dlltool_OBJECTS = $(am_dlltool_OBJECTS) +dlltool_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) +am_dllwrap_OBJECTS = dllwrap.$(OBJEXT) version.$(OBJEXT) +dllwrap_OBJECTS = $(am_dllwrap_OBJECTS) +dllwrap_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) +am_nlmconv_OBJECTS = nlmconv.$(OBJEXT) nlmheader.$(OBJEXT) \ + $(am__objects_1) +nlmconv_OBJECTS = $(am_nlmconv_OBJECTS) +nlmconv_LDADD = $(LDADD) +nlmconv_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) +am_nm_new_OBJECTS = nm.$(OBJEXT) budemang.$(OBJEXT) $(am__objects_1) +nm_new_OBJECTS = $(am_nm_new_OBJECTS) +nm_new_LDADD = $(LDADD) +nm_new_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) +am__objects_2 = rddbg.$(OBJEXT) debug.$(OBJEXT) stabs.$(OBJEXT) \ + ieee.$(OBJEXT) rdcoff.$(OBJEXT) +am__objects_3 = $(am__objects_2) wrstabs.$(OBJEXT) +am_objcopy_OBJECTS = objcopy.$(OBJEXT) not-strip.$(OBJEXT) \ + rename.$(OBJEXT) $(am__objects_3) $(am__objects_1) +objcopy_OBJECTS = $(am_objcopy_OBJECTS) +objcopy_LDADD = $(LDADD) +objcopy_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) +am_objdump_OBJECTS = objdump.$(OBJEXT) budemang.$(OBJEXT) \ + prdbg.$(OBJEXT) $(am__objects_2) $(am__objects_1) +objdump_OBJECTS = $(am_objdump_OBJECTS) +am__DEPENDENCIES_4 = ../opcodes/libopcodes.la +objdump_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) +am_ranlib_OBJECTS = ar.$(OBJEXT) is-ranlib.$(OBJEXT) arparse.$(OBJEXT) \ + arlex.$(OBJEXT) arsup.$(OBJEXT) rename.$(OBJEXT) \ + binemul.$(OBJEXT) emul_$(EMULATION).$(OBJEXT) $(am__objects_1) +ranlib_OBJECTS = $(am_ranlib_OBJECTS) +ranlib_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) +am_readelf_OBJECTS = readelf.$(OBJEXT) version.$(OBJEXT) \ + unwind-ia64.$(OBJEXT) +readelf_OBJECTS = $(am_readelf_OBJECTS) +readelf_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_2) +am_size_OBJECTS = size.$(OBJEXT) $(am__objects_1) +size_OBJECTS = $(am_size_OBJECTS) +size_LDADD = $(LDADD) +size_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) +am_srconv_OBJECTS = srconv.$(OBJEXT) coffgrok.$(OBJEXT) \ + $(am__objects_1) +srconv_OBJECTS = $(am_srconv_OBJECTS) +srconv_LDADD = $(LDADD) +srconv_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) +am_strings_OBJECTS = strings.$(OBJEXT) $(am__objects_1) +strings_OBJECTS = $(am_strings_OBJECTS) +strings_LDADD = $(LDADD) +strings_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) +am_strip_new_OBJECTS = objcopy.$(OBJEXT) is-strip.$(OBJEXT) \ + rename.$(OBJEXT) $(am__objects_3) $(am__objects_1) +strip_new_OBJECTS = $(am_strip_new_OBJECTS) +strip_new_LDADD = $(LDADD) +strip_new_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) +am_sysdump_OBJECTS = sysdump.$(OBJEXT) $(am__objects_1) +sysdump_OBJECTS = $(am_sysdump_OBJECTS) +sysdump_LDADD = $(LDADD) +sysdump_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) +am_windres_OBJECTS = windres.$(OBJEXT) resrc.$(OBJEXT) \ + rescoff.$(OBJEXT) resbin.$(OBJEXT) rcparse.$(OBJEXT) \ + rclex.$(OBJEXT) winduni.$(OBJEXT) resres.$(OBJEXT) \ + $(am__objects_1) +windres_OBJECTS = $(am_windres_OBJECTS) +windres_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I. +depcomp = +am__depfiles_maybe = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) +LTLEXCOMPILE = $(LIBTOOL) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS) +YLWRAP = $(top_srcdir)/../ylwrap +YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) +LTYACCCOMPILE = $(LIBTOOL) --mode=compile $(YACC) $(YFLAGS) \ + $(AM_YFLAGS) +SOURCES = $(addr2line_SOURCES) $(ar_SOURCES) $(coffdump_SOURCES) \ + $(cxxfilt_SOURCES) $(dlltool_SOURCES) $(dllwrap_SOURCES) \ + $(nlmconv_SOURCES) $(nm_new_SOURCES) $(objcopy_SOURCES) \ + $(objdump_SOURCES) $(ranlib_SOURCES) $(readelf_SOURCES) \ + $(size_SOURCES) $(srconv_SOURCES) $(strings_SOURCES) \ + $(strip_new_SOURCES) $(sysdump_SOURCES) $(windres_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DEJATOOL = $(PACKAGE) +RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir +DIST_SUBDIRS = $(SUBDIRS) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ AR = @AR@ -AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ BUILD_DLLTOOL = @BUILD_DLLTOOL@ BUILD_DLLWRAP = @BUILD_DLLWRAP@ BUILD_MISC = @BUILD_MISC@ @@ -74,76 +246,124 @@ BUILD_WINDRES = @BUILD_WINDRES@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CC_FOR_BUILD = @CC_FOR_BUILD@ +CFLAGS = @CFLAGS@ CPP = @CPP@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ DEMANGLER_NAME = @DEMANGLER_NAME@ -DLLTOOL = @DLLTOOL@ +DEPDIR = @DEPDIR@ DLLTOOL_DEFS = @DLLTOOL_DEFS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ EMULATION = @EMULATION@ EMULATION_VECTOR = @EMULATION_VECTOR@ EXEEXT = @EXEEXT@ -GCJ = @GCJ@ -GCJFLAGS = @GCJFLAGS@ +EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ -GNATBIND = @GNATBIND@ GT_NO = @GT_NO@ GT_YES = @GT_YES@ HDEFINES = @HDEFINES@ INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLDEPS = @INTLDEPS@ +INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ +LDFLAGS = @LDFLAGS@ +LEX = `if [ -f ../flex/flex ]; then echo ../flex/flex; else echo @LEX@; fi` +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LN = @LN@ LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ NLMCONV_DEFS = @NLMCONV_DEFS@ -OBJDUMP = @OBJDUMP@ +NO_WERROR = @NO_WERROR@ OBJDUMP_DEFS = @OBJDUMP_DEFS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ STRIP = @STRIP@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ -bfdincludedir = @bfdincludedir@ -bfdlibdir = @bfdlibdir@ -build_noncanonical = @build_noncanonical@ -build_subdir = @build_subdir@ -do_compare = @do_compare@ -host_noncanonical = @host_noncanonical@ -host_subdir = @host_subdir@ +WARN_CFLAGS = @WARN_CFLAGS@ +XGETTEXT = @XGETTEXT@ +YACC = `if [ -f ../bison/bison ]; then echo ../bison/bison -y -L$(srcdir)/../bison/; else echo @YACC@; fi` +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ l = @l@ -ncn_cv_ = @ncn_cv_@ -target_noncanonical = @target_noncanonical@ -target_subdir = @target_subdir@ - -INTLLIBS = @INTLLIBS@ - +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ AUTOMAKE_OPTIONS = cygnus dejagnu - SUBDIRS = doc po - tooldir = $(exec_prefix)/$(target_alias) - -CC_FOR_BUILD = @CC_FOR_BUILD@ -EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@ - -YACC = `if [ -f ../bison/bison ]; then echo ../bison/bison -y -L$(srcdir)/../bison/; else echo @YACC@; fi` YFLAGS = -d -LEX = `if [ -f ../flex/flex ]; then echo ../flex/flex; else echo @LEX@; fi` - -WARN_CFLAGS = @WARN_CFLAGS@ -NO_WERROR = @NO_WERROR@ AM_CFLAGS = $(WARN_CFLAGS) # these two are almost the same program @@ -153,9 +373,7 @@ RANLIB_PROG = ranlib # objcopy and strip should be the same program OBJCOPY_PROG = objcopy STRIP_PROG = strip-new - STRINGS_PROG = strings - READELF_PROG = readelf # These should all be the same program too. @@ -166,33 +384,20 @@ OBJDUMP_PROG = objdump # This is the demangler, as a standalone program. # Note: This one is used as the installed name too, unlike the above. DEMANGLER_PROG = cxxfilt - ADDR2LINE_PROG = addr2line - NLMCONV_PROG = nlmconv DLLTOOL_PROG = dlltool WINDRES_PROG = windres DLLWRAP_PROG = dllwrap - SRCONV_PROG = srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT) - PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_MISC@ -bin_PROGRAMS = $(SIZE_PROG) $(OBJDUMP_PROG) $(AR_PROG) $(STRINGS_PROG) $(RANLIB_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_MISC@ - -noinst_PROGRAMS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG) - -EXTRA_PROGRAMS = $(NLMCONV_PROG) srconv sysdump coffdump $(DLLTOOL_PROG) $(WINDRES_PROG) $(DLLWRAP_PROG) - # Stuff that goes in tooldir/ if appropriate. TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump - BASEDIR = $(srcdir)/.. BFDDIR = $(BASEDIR)/bfd INCDIR = $(BASEDIR)/include - MKDEP = gcc -MM - INCLUDES = -D_GNU_SOURCE \ -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) \ @HDEFINES@ \ @@ -200,15 +405,12 @@ INCLUDES = -D_GNU_SOURCE \ -DLOCALEDIR="\"$(datadir)/locale\"" \ -Dbin_dummy_emulation=$(EMULATION_VECTOR) - HFILES = \ arsup.h binemul.h bucomm.h budbg.h budemang.h \ coffgrok.h debug.h dlltool.h nlmconv.h \ windres.h winduni.h - GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h - CFILES = \ addr2line.c ar.c arsup.c binemul.c bucomm.c budemang.c \ coffdump.c coffgrok.c cxxfilt.c debug.c dlltool.c dllwrap.c \ @@ -221,26 +423,19 @@ CFILES = \ size.c srconv.c stabs.c strings.c sysdump.c version.c \ windres.c winduni.c wrstabs.c - GENERATED_CFILES = \ arparse.c arlex.c sysroff.c sysinfo.c syslex.c \ defparse.c deflex.c nlmheader.c rcparse.c rclex.c - DEBUG_SRCS = rddbg.c debug.c stabs.c ieee.c rdcoff.c WRITE_DEBUG_SRCS = $(DEBUG_SRCS) wrstabs.c # Code shared by all the binutils. BULIBS = bucomm.c version.c filemode.c - BFDLIB = ../bfd/libbfd.la - OPCODES = ../opcodes/libopcodes.la - LIBIBERTY = ../libiberty/libiberty.a - POTFILES = $(CFILES) $(DEBUG_SRCS) $(HFILES) - EXPECT = `if [ -f $$r/../expect/expect ] ; then \ echo $$r/../expect/expect ; \ else echo expect ; fi` @@ -249,7 +444,6 @@ RUNTEST = `if [ -f ${srcdir}/../dejagnu/ echo ${srcdir}/../dejagnu/runtest ; \ else echo runtest ; fi` - CC_FOR_TARGET = ` \ if [ -f $$r/../gcc/xgcc ] ; then \ if [ -f $$r/../newlib/Makefile ] ; then \ @@ -265,404 +459,216 @@ CC_FOR_TARGET = ` \ fi; \ fi` - LDADD = $(BFDLIB) $(LIBIBERTY) $(INTLLIBS) - size_SOURCES = size.c $(BULIBS) - objcopy_SOURCES = objcopy.c not-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) - strings_SOURCES = strings.c $(BULIBS) - readelf_SOURCES = readelf.c version.c unwind-ia64.c readelf_LDADD = $(INTLLIBS) $(LIBIBERTY) - strip_new_SOURCES = objcopy.c is-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) - nm_new_SOURCES = nm.c budemang.c $(BULIBS) - objdump_SOURCES = objdump.c budemang.c prdbg.c $(DEBUG_SRCS) $(BULIBS) objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(INTLLIBS) - cxxfilt_SOURCES = cxxfilt.c $(BULIBS) - ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c rename.c binemul.c \ emul_$(EMULATION).c $(BULIBS) ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) - ranlib_SOURCES = ar.c is-ranlib.c arparse.y arlex.l arsup.c rename.c \ binemul.c emul_$(EMULATION).c $(BULIBS) ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) - addr2line_SOURCES = addr2line.c budemang.c $(BULIBS) - srconv_SOURCES = srconv.c coffgrok.c $(BULIBS) - dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS) dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) - coffdump_SOURCES = coffdump.c coffgrok.c $(BULIBS) - sysdump_SOURCES = sysdump.c $(BULIBS) - nlmconv_SOURCES = nlmconv.c nlmheader.y $(BULIBS) - windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.l \ winduni.c resres.c $(BULIBS) windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) - dllwrap_SOURCES = dllwrap.c version.c dllwrap_LDADD = $(LIBIBERTY) $(INTLLIBS) - EXTRA_DIST = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \ syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c - DISTCLEANFILES = sysinfo sysroff.c sysroff.h \ site.exp site.bak ### - MOSTLYCLEANFILES = sysinfo binutils.log binutils.sum abcdefgh* - CLEANFILES = dep.sed DEP DEPA DEP1 DEP2 -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = -bin_PROGRAMS = size$(EXEEXT) objdump$(EXEEXT) ar$(EXEEXT) \ -strings$(EXEEXT) ranlib$(EXEEXT) objcopy$(EXEEXT) @BUILD_NLMCONV@ \ -@BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ addr2line$(EXEEXT) \ -readelf$(EXEEXT) @BUILD_DLLWRAP@ @BUILD_MISC@ -noinst_PROGRAMS = nm-new$(EXEEXT) strip-new$(EXEEXT) cxxfilt$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -nlmconv_OBJECTS = nlmconv.$(OBJEXT) nlmheader.$(OBJEXT) \ -bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT) -nlmconv_LDADD = $(LDADD) -nlmconv_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a -nlmconv_LDFLAGS = -srconv_OBJECTS = srconv.$(OBJEXT) coffgrok.$(OBJEXT) bucomm.$(OBJEXT) \ -version.$(OBJEXT) filemode.$(OBJEXT) -srconv_LDADD = $(LDADD) -srconv_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a -srconv_LDFLAGS = -sysdump_OBJECTS = sysdump.$(OBJEXT) bucomm.$(OBJEXT) version.$(OBJEXT) \ -filemode.$(OBJEXT) -sysdump_LDADD = $(LDADD) -sysdump_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a -sysdump_LDFLAGS = -coffdump_OBJECTS = coffdump.$(OBJEXT) coffgrok.$(OBJEXT) \ -bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT) -coffdump_LDADD = $(LDADD) -coffdump_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a -coffdump_LDFLAGS = -dlltool_OBJECTS = dlltool.$(OBJEXT) defparse.$(OBJEXT) deflex.$(OBJEXT) \ -bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT) -dlltool_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a -dlltool_LDFLAGS = -windres_OBJECTS = windres.$(OBJEXT) resrc.$(OBJEXT) rescoff.$(OBJEXT) \ -resbin.$(OBJEXT) rcparse.$(OBJEXT) rclex.$(OBJEXT) winduni.$(OBJEXT) \ -resres.$(OBJEXT) bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT) -windres_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a -windres_LDFLAGS = -dllwrap_OBJECTS = dllwrap.$(OBJEXT) version.$(OBJEXT) -dllwrap_DEPENDENCIES = ../libiberty/libiberty.a -dllwrap_LDFLAGS = -size_OBJECTS = size.$(OBJEXT) bucomm.$(OBJEXT) version.$(OBJEXT) \ -filemode.$(OBJEXT) -size_LDADD = $(LDADD) -size_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a -size_LDFLAGS = -objdump_OBJECTS = objdump.$(OBJEXT) budemang.$(OBJEXT) prdbg.$(OBJEXT) \ -rddbg.$(OBJEXT) debug.$(OBJEXT) stabs.$(OBJEXT) ieee.$(OBJEXT) \ -rdcoff.$(OBJEXT) bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT) -objdump_DEPENDENCIES = ../opcodes/libopcodes.la ../bfd/libbfd.la \ -../libiberty/libiberty.a -objdump_LDFLAGS = -ar_OBJECTS = arparse.$(OBJEXT) arlex.$(OBJEXT) ar.$(OBJEXT) \ -not-ranlib.$(OBJEXT) arsup.$(OBJEXT) rename.$(OBJEXT) binemul.$(OBJEXT) \ -emul_$(EMULATION).$(OBJEXT) bucomm.$(OBJEXT) version.$(OBJEXT) \ -filemode.$(OBJEXT) -ar_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a -ar_LDFLAGS = -strings_OBJECTS = strings.$(OBJEXT) bucomm.$(OBJEXT) version.$(OBJEXT) \ -filemode.$(OBJEXT) -strings_LDADD = $(LDADD) -strings_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a -strings_LDFLAGS = -ranlib_OBJECTS = ar.$(OBJEXT) is-ranlib.$(OBJEXT) arparse.$(OBJEXT) \ -arlex.$(OBJEXT) arsup.$(OBJEXT) rename.$(OBJEXT) binemul.$(OBJEXT) \ -emul_$(EMULATION).$(OBJEXT) bucomm.$(OBJEXT) version.$(OBJEXT) \ -filemode.$(OBJEXT) -ranlib_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a -ranlib_LDFLAGS = -objcopy_OBJECTS = objcopy.$(OBJEXT) not-strip.$(OBJEXT) \ -rename.$(OBJEXT) rddbg.$(OBJEXT) debug.$(OBJEXT) stabs.$(OBJEXT) \ -ieee.$(OBJEXT) rdcoff.$(OBJEXT) wrstabs.$(OBJEXT) bucomm.$(OBJEXT) \ -version.$(OBJEXT) filemode.$(OBJEXT) -objcopy_LDADD = $(LDADD) -objcopy_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a -objcopy_LDFLAGS = -addr2line_OBJECTS = addr2line.$(OBJEXT) budemang.$(OBJEXT) \ -bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT) -addr2line_LDADD = $(LDADD) -addr2line_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a -addr2line_LDFLAGS = -readelf_OBJECTS = readelf.$(OBJEXT) version.$(OBJEXT) \ -unwind-ia64.$(OBJEXT) -readelf_DEPENDENCIES = ../libiberty/libiberty.a -readelf_LDFLAGS = -nm_new_OBJECTS = nm.$(OBJEXT) budemang.$(OBJEXT) bucomm.$(OBJEXT) \ -version.$(OBJEXT) filemode.$(OBJEXT) -nm_new_LDADD = $(LDADD) -nm_new_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a -nm_new_LDFLAGS = -strip_new_OBJECTS = objcopy.$(OBJEXT) is-strip.$(OBJEXT) \ -rename.$(OBJEXT) rddbg.$(OBJEXT) debug.$(OBJEXT) stabs.$(OBJEXT) \ -ieee.$(OBJEXT) rdcoff.$(OBJEXT) wrstabs.$(OBJEXT) bucomm.$(OBJEXT) \ -version.$(OBJEXT) filemode.$(OBJEXT) -strip_new_LDADD = $(LDADD) -strip_new_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a -strip_new_LDFLAGS = -cxxfilt_OBJECTS = cxxfilt.$(OBJEXT) bucomm.$(OBJEXT) version.$(OBJEXT) \ -filemode.$(OBJEXT) -cxxfilt_LDADD = $(LDADD) -cxxfilt_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a -cxxfilt_LDFLAGS = -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LEXLIB = @LEXLIB@ -YLWRAP = $(top_srcdir)/../ylwrap -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = README ./stamp-h.in ChangeLog Makefile.am Makefile.in \ -NEWS acinclude.m4 aclocal.m4 arlex.c arparse.c config.in configure \ -configure.in deflex.c defparse.c nlmheader.c rclex.c rcparse.c - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -SOURCES = $(nlmconv_SOURCES) $(srconv_SOURCES) $(sysdump_SOURCES) $(coffdump_SOURCES) $(dlltool_SOURCES) $(windres_SOURCES) $(dllwrap_SOURCES) $(size_SOURCES) $(objdump_SOURCES) $(ar_SOURCES) $(strings_SOURCES) $(ranlib_SOURCES) $(objcopy_SOURCES) $(addr2line_SOURCES) $(readelf_SOURCES) $(nm_new_SOURCES) $(strip_new_SOURCES) $(cxxfilt_SOURCES) -OBJECTS = $(nlmconv_OBJECTS) $(srconv_OBJECTS) $(sysdump_OBJECTS) $(coffdump_OBJECTS) $(dlltool_OBJECTS) $(windres_OBJECTS) $(dllwrap_OBJECTS) $(size_OBJECTS) $(objdump_OBJECTS) $(ar_OBJECTS) $(strings_OBJECTS) $(ranlib_OBJECTS) $(objcopy_OBJECTS) $(addr2line_OBJECTS) $(readelf_OBJECTS) $(nm_new_OBJECTS) $(strip_new_OBJECTS) $(cxxfilt_OBJECTS) +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive -all: all-redirect .SUFFIXES: -.SUFFIXES: .S .c .l .lo .o .obj .s .y -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 - cd $(srcdir) && $(ACLOCAL) +.SUFFIXES: .c .l .lo .o .obj .y +am--refresh: + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ + cd $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile -config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -config.h: stamp-h +config.h: stamp-h1 @if test ! -f $@; then \ - rm -f stamp-h; \ - $(MAKE) stamp-h; \ + rm -f stamp-h1; \ + $(MAKE) stamp-h1; \ else :; fi -stamp-h: $(srcdir)/config.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES= CONFIG_HEADERS=config.h:config.in \ - $(SHELL) ./config.status - @echo timestamp > stamp-h 2> /dev/null -$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in - @if test ! -f $@; then \ - rm -f $(srcdir)/stamp-h.in; \ - $(MAKE) $(srcdir)/stamp-h.in; \ - else :; fi -$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOHEADER) - @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null -mostlyclean-hdr: - -clean-hdr: +stamp-h1: $(srcdir)/config.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ distclean-hdr: - -rm -f config.h - -maintainer-clean-hdr: - -mostlyclean-binPROGRAMS: - -clean-binPROGRAMS: - -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) - -distclean-binPROGRAMS: - -maintainer-clean-binPROGRAMS: - + -rm -f config.h stamp-h1 +po/Makefile.in: $(top_builddir)/config.status $(top_srcdir)/po/Make-in + cd $(top_builddir) && $(SHELL) ./config.status $@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ - $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) - list='$(bin_PROGRAMS)'; for p in $$list; do \ - rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ done -mostlyclean-noinstPROGRAMS: +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done clean-noinstPROGRAMS: - -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) - -distclean-noinstPROGRAMS: - -maintainer-clean-noinstPROGRAMS: - -.c.o: - $(COMPILE) -c $< - -# FIXME: We should only use cygpath when building on Windows, -# and only if it is available. -.c.obj: - $(COMPILE) -c `cygpath -w $<` - -.s.o: - $(COMPILE) -c $< - -.S.o: - $(COMPILE) -c $< - -mostlyclean-compile: - -rm -f *.o core *.core - -rm -f *.$(OBJEXT) - -clean-compile: - -distclean-compile: - -rm -f *.tab.c - -maintainer-clean-compile: - -.c.lo: - $(LIBTOOL) --mode=compile $(COMPILE) -c $< - -.s.lo: - $(LIBTOOL) --mode=compile $(COMPILE) -c $< - -.S.lo: - $(LIBTOOL) --mode=compile $(COMPILE) -c $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -maintainer-clean-libtool: - -nlmconv$(EXEEXT): $(nlmconv_OBJECTS) $(nlmconv_DEPENDENCIES) - @rm -f nlmconv$(EXEEXT) - $(LINK) $(nlmconv_LDFLAGS) $(nlmconv_OBJECTS) $(nlmconv_LDADD) $(LIBS) - -srconv$(EXEEXT): $(srconv_OBJECTS) $(srconv_DEPENDENCIES) - @rm -f srconv$(EXEEXT) - $(LINK) $(srconv_LDFLAGS) $(srconv_OBJECTS) $(srconv_LDADD) $(LIBS) - -sysdump$(EXEEXT): $(sysdump_OBJECTS) $(sysdump_DEPENDENCIES) - @rm -f sysdump$(EXEEXT) - $(LINK) $(sysdump_LDFLAGS) $(sysdump_OBJECTS) $(sysdump_LDADD) $(LIBS) - -coffdump$(EXEEXT): $(coffdump_OBJECTS) $(coffdump_DEPENDENCIES) + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +addr2line$(EXEEXT): $(addr2line_OBJECTS) $(addr2line_DEPENDENCIES) + @rm -f addr2line$(EXEEXT) + $(LINK) $(addr2line_LDFLAGS) $(addr2line_OBJECTS) $(addr2line_LDADD) $(LIBS) +ar$(EXEEXT): $(ar_OBJECTS) $(ar_DEPENDENCIES) + @rm -f ar$(EXEEXT) + $(LINK) $(ar_LDFLAGS) $(ar_OBJECTS) $(ar_LDADD) $(LIBS) +coffdump$(EXEEXT): $(coffdump_OBJECTS) $(coffdump_DEPENDENCIES) @rm -f coffdump$(EXEEXT) $(LINK) $(coffdump_LDFLAGS) $(coffdump_OBJECTS) $(coffdump_LDADD) $(LIBS) - -dlltool$(EXEEXT): $(dlltool_OBJECTS) $(dlltool_DEPENDENCIES) +cxxfilt$(EXEEXT): $(cxxfilt_OBJECTS) $(cxxfilt_DEPENDENCIES) + @rm -f cxxfilt$(EXEEXT) + $(LINK) $(cxxfilt_LDFLAGS) $(cxxfilt_OBJECTS) $(cxxfilt_LDADD) $(LIBS) +dlltool$(EXEEXT): $(dlltool_OBJECTS) $(dlltool_DEPENDENCIES) @rm -f dlltool$(EXEEXT) $(LINK) $(dlltool_LDFLAGS) $(dlltool_OBJECTS) $(dlltool_LDADD) $(LIBS) - -windres$(EXEEXT): $(windres_OBJECTS) $(windres_DEPENDENCIES) - @rm -f windres$(EXEEXT) - $(LINK) $(windres_LDFLAGS) $(windres_OBJECTS) $(windres_LDADD) $(LIBS) - -dllwrap$(EXEEXT): $(dllwrap_OBJECTS) $(dllwrap_DEPENDENCIES) +dllwrap$(EXEEXT): $(dllwrap_OBJECTS) $(dllwrap_DEPENDENCIES) @rm -f dllwrap$(EXEEXT) $(LINK) $(dllwrap_LDFLAGS) $(dllwrap_OBJECTS) $(dllwrap_LDADD) $(LIBS) - -size$(EXEEXT): $(size_OBJECTS) $(size_DEPENDENCIES) - @rm -f size$(EXEEXT) - $(LINK) $(size_LDFLAGS) $(size_OBJECTS) $(size_LDADD) $(LIBS) - -objdump$(EXEEXT): $(objdump_OBJECTS) $(objdump_DEPENDENCIES) +nlmconv$(EXEEXT): $(nlmconv_OBJECTS) $(nlmconv_DEPENDENCIES) + @rm -f nlmconv$(EXEEXT) + $(LINK) $(nlmconv_LDFLAGS) $(nlmconv_OBJECTS) $(nlmconv_LDADD) $(LIBS) +nm-new$(EXEEXT): $(nm_new_OBJECTS) $(nm_new_DEPENDENCIES) + @rm -f nm-new$(EXEEXT) + $(LINK) $(nm_new_LDFLAGS) $(nm_new_OBJECTS) $(nm_new_LDADD) $(LIBS) +objcopy$(EXEEXT): $(objcopy_OBJECTS) $(objcopy_DEPENDENCIES) + @rm -f objcopy$(EXEEXT) + $(LINK) $(objcopy_LDFLAGS) $(objcopy_OBJECTS) $(objcopy_LDADD) $(LIBS) +objdump$(EXEEXT): $(objdump_OBJECTS) $(objdump_DEPENDENCIES) @rm -f objdump$(EXEEXT) $(LINK) $(objdump_LDFLAGS) $(objdump_OBJECTS) $(objdump_LDADD) $(LIBS) - -ar$(EXEEXT): $(ar_OBJECTS) $(ar_DEPENDENCIES) - @rm -f ar$(EXEEXT) - $(LINK) $(ar_LDFLAGS) $(ar_OBJECTS) $(ar_LDADD) $(LIBS) - -strings$(EXEEXT): $(strings_OBJECTS) $(strings_DEPENDENCIES) - @rm -f strings$(EXEEXT) - $(LINK) $(strings_LDFLAGS) $(strings_OBJECTS) $(strings_LDADD) $(LIBS) - -ranlib$(EXEEXT): $(ranlib_OBJECTS) $(ranlib_DEPENDENCIES) +ranlib$(EXEEXT): $(ranlib_OBJECTS) $(ranlib_DEPENDENCIES) @rm -f ranlib$(EXEEXT) $(LINK) $(ranlib_LDFLAGS) $(ranlib_OBJECTS) $(ranlib_LDADD) $(LIBS) +readelf$(EXEEXT): $(readelf_OBJECTS) $(readelf_DEPENDENCIES) + @rm -f readelf$(EXEEXT) + $(LINK) $(readelf_LDFLAGS) $(readelf_OBJECTS) $(readelf_LDADD) $(LIBS) +size$(EXEEXT): $(size_OBJECTS) $(size_DEPENDENCIES) + @rm -f size$(EXEEXT) + $(LINK) $(size_LDFLAGS) $(size_OBJECTS) $(size_LDADD) $(LIBS) +srconv$(EXEEXT): $(srconv_OBJECTS) $(srconv_DEPENDENCIES) + @rm -f srconv$(EXEEXT) + $(LINK) $(srconv_LDFLAGS) $(srconv_OBJECTS) $(srconv_LDADD) $(LIBS) +strings$(EXEEXT): $(strings_OBJECTS) $(strings_DEPENDENCIES) + @rm -f strings$(EXEEXT) + $(LINK) $(strings_LDFLAGS) $(strings_OBJECTS) $(strings_LDADD) $(LIBS) +strip-new$(EXEEXT): $(strip_new_OBJECTS) $(strip_new_DEPENDENCIES) + @rm -f strip-new$(EXEEXT) + $(LINK) $(strip_new_LDFLAGS) $(strip_new_OBJECTS) $(strip_new_LDADD) $(LIBS) +sysdump$(EXEEXT): $(sysdump_OBJECTS) $(sysdump_DEPENDENCIES) + @rm -f sysdump$(EXEEXT) + $(LINK) $(sysdump_LDFLAGS) $(sysdump_OBJECTS) $(sysdump_LDADD) $(LIBS) +windres$(EXEEXT): $(windres_OBJECTS) $(windres_DEPENDENCIES) + @rm -f windres$(EXEEXT) + $(LINK) $(windres_LDFLAGS) $(windres_OBJECTS) $(windres_LDADD) $(LIBS) -objcopy$(EXEEXT): $(objcopy_OBJECTS) $(objcopy_DEPENDENCIES) - @rm -f objcopy$(EXEEXT) - $(LINK) $(objcopy_LDFLAGS) $(objcopy_OBJECTS) $(objcopy_LDADD) $(LIBS) +mostlyclean-compile: + -rm -f *.$(OBJEXT) -addr2line$(EXEEXT): $(addr2line_OBJECTS) $(addr2line_DEPENDENCIES) - @rm -f addr2line$(EXEEXT) - $(LINK) $(addr2line_LDFLAGS) $(addr2line_OBJECTS) $(addr2line_LDADD) $(LIBS) +distclean-compile: + -rm -f *.tab.c -readelf$(EXEEXT): $(readelf_OBJECTS) $(readelf_DEPENDENCIES) - @rm -f readelf$(EXEEXT) - $(LINK) $(readelf_LDFLAGS) $(readelf_OBJECTS) $(readelf_LDADD) $(LIBS) +.c.o: + $(COMPILE) -c $< -nm-new$(EXEEXT): $(nm_new_OBJECTS) $(nm_new_DEPENDENCIES) - @rm -f nm-new$(EXEEXT) - $(LINK) $(nm_new_LDFLAGS) $(nm_new_OBJECTS) $(nm_new_LDADD) $(LIBS) +.c.obj: + $(COMPILE) -c `$(CYGPATH_W) '$<'` -strip-new$(EXEEXT): $(strip_new_OBJECTS) $(strip_new_DEPENDENCIES) - @rm -f strip-new$(EXEEXT) - $(LINK) $(strip_new_LDFLAGS) $(strip_new_OBJECTS) $(strip_new_LDADD) $(LIBS) +.c.lo: + $(LTCOMPILE) -c -o $@ $< -cxxfilt$(EXEEXT): $(cxxfilt_OBJECTS) $(cxxfilt_DEPENDENCIES) - @rm -f cxxfilt$(EXEEXT) - $(LINK) $(cxxfilt_LDFLAGS) $(cxxfilt_OBJECTS) $(cxxfilt_LDADD) $(LIBS) .l.c: - $(SHELL) $(YLWRAP) "$(LEX)" $< $(LEX_OUTPUT_ROOT).c $@ -- $(AM_LFLAGS) $(LFLAGS) + $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) + .y.c: - $(SHELL) $(YLWRAP) "$(YACC)" $< y.tab.c $*.c y.tab.h $*.h -- $(AM_YFLAGS) $(YFLAGS) -arparse.h: arparse.c -defparse.h: defparse.c -nlmheader.h: nlmheader.c -rcparse.h: rcparse.c + $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) + +mostlyclean-libtool: + -rm -f *.lo +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -670,13 +676,14 @@ rcparse.h: rcparse.c # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. - -@SET_MAKE@ - -all-recursive install-data-recursive install-exec-recursive \ -installdirs-recursive install-recursive uninstall-recursive install-info-recursive \ -check-recursive installcheck-recursive info-recursive dvi-recursive: - @set fnord $(MAKEFLAGS); amf=$$2; \ +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -688,7 +695,7 @@ check-recursive installcheck-recursive i local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ @@ -696,13 +703,24 @@ check-recursive installcheck-recursive i mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: - @set fnord $(MAKEFLAGS); amf=$$2; \ + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ dot_seen=no; \ - rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ - rev="$$subdir $$rev"; \ - test "$$subdir" != "." || dot_seen=yes; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ done; \ - test "$$dot_seen" = "no" && rev=". $$rev"; \ + rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ @@ -712,164 +730,123 @@ maintainer-clean-recursive: local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $$unique $(LISP) + mkid -fID $$unique +tags: TAGS -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) $(LISP) +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ - fi; \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ done; \ - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ + list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)config.in$$unique$(LISP)$$tags" \ - || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.in $$unique $(LISP) -o $$here/TAGS) - -mostlyclean-tags: - -clean-tags: + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here distclean-tags: - -rm -f TAGS ID - -maintainer-clean-tags: - -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - -rm -rf $(distdir) - GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz - mkdir $(distdir)/=build - mkdir $(distdir)/=inst - dc_install_base=`cd $(distdir)/=inst && pwd`; \ - cd $(distdir)/=build \ - && ../configure --srcdir=.. --prefix=$$dc_install_base \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) dist - -rm -rf $(distdir) - @banner="$(distdir).tar.gz is ready for distribution"; \ - dashes=`echo "$$banner" | sed s/./=/g`; \ - echo "$$dashes"; \ - echo "$$banner"; \ - echo "$$dashes" -dist: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -dist-all: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -distdir: $(DISTFILES) - -rm -rf $(distdir) - mkdir $(distdir) - -chmod 777 $(distdir) - @for file in $(DISTFILES); do \ - if test -f $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done - for subdir in $(SUBDIRS); do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - chmod 777 $(distdir)/$$subdir; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ - || exit 1; \ - fi; \ - done - -RUNTESTFLAGS = - -DEJATOOL = $(PACKAGE) - -RUNTESTDEFAULTFLAGS = --tool $(DEJATOOL) --srcdir $$srcdir + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags site.exp: Makefile @echo 'Making a new site.exp file...' - @test ! -f site.bak || rm -f site.bak - @echo '## these variables are automatically generated by make ##' > $@-t - @echo '# Do not edit here. If you wish to override these values' >> $@-t - @echo '# edit the last section' >> $@-t - @echo 'set tool $(DEJATOOL)' >> $@-t - @echo 'set srcdir $(srcdir)' >> $@-t - @echo 'set objdir' `pwd` >> $@-t - @echo 'set host_alias $(host_alias)' >> $@-t - @echo 'set host_triplet $(host_triplet)' >> $@-t - @echo 'set target_alias $(target_alias)' >> $@-t - @echo 'set target_triplet $(target_triplet)' >> $@-t - @echo 'set build_alias $(build_alias)' >> $@-t - @echo 'set build_triplet $(build_triplet)' >> $@-t - @echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t - @test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t + @echo '## these variables are automatically generated by make ##' >site.tmp + @echo '# Do not edit here. If you wish to override these values' >>site.tmp + @echo '# edit the last section' >>site.tmp + @echo 'set srcdir $(srcdir)' >>site.tmp + @echo "set objdir `pwd`" >>site.tmp + @echo 'set build_alias "$(build_alias)"' >>site.tmp + @echo 'set build_triplet $(build_triplet)' >>site.tmp + @echo 'set host_alias "$(host_alias)"' >>site.tmp + @echo 'set host_triplet $(host_triplet)' >>site.tmp + @echo 'set target_alias "$(target_alias)"' >>site.tmp + @echo 'set target_triplet $(target_triplet)' >>site.tmp + @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp + @test ! -f site.exp || \ + sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp + @-rm -f site.bak @test ! -f site.exp || mv site.exp site.bak - @mv $@-t site.exp -info-am: -info: info-recursive -dvi-am: -dvi: dvi-recursive + @mv site.tmp site.exp + +distclean-DEJAGNU: + -rm -f site.exp site.bak + -l='$(DEJATOOL)'; for tool in $$l; do \ + rm -f $$tool.sum $$tool.log; \ + done check-am: $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU check: check-recursive -installcheck-am: -installcheck: installcheck-recursive -install-info-am: -install-info: install-info-recursive -all-recursive-am: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -install-exec-am: install-binPROGRAMS install-exec-local +all-am: Makefile $(PROGRAMS) config.h +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-recursive install-exec: install-exec-recursive - -install-data-am: install-data: install-data-recursive +uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-recursive -uninstall-am: uninstall-binPROGRAMS -uninstall: uninstall-recursive -all-am: Makefile $(PROGRAMS) config.h -all-redirect: all-recursive-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: installdirs-recursive -installdirs-am: - $(mkinstalldirs) $(DESTDIR)$(bindir) - - + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) @@ -877,65 +854,93 @@ clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: - -test -z "arlex.cdeflex.crclex.carparse.harparse.cdefparse.hdefparse.cnlmheader.hnlmheader.crcparse.hrcparse.c" || rm -f arlex.c deflex.c rclex.c arparse.h arparse.c defparse.h defparse.c nlmheader.h nlmheader.c rcparse.h rcparse.c -mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \ - mostlyclean-noinstPROGRAMS mostlyclean-compile \ - mostlyclean-libtool mostlyclean-tags \ - mostlyclean-generic mostlyclean-local + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -rm -f arlex.c + -rm -f arparse.c + -rm -f arparse.h + -rm -f deflex.c + -rm -f defparse.c + -rm -f defparse.h + -rm -f nlmheader.c + -rm -f nlmheader.h + -rm -f rclex.c + -rm -f rcparse.c + -rm -f rcparse.h +clean: clean-recursive -mostlyclean: mostlyclean-recursive +clean-am: clean-binPROGRAMS clean-generic clean-libtool \ + clean-noinstPROGRAMS mostlyclean-am -clean-am: clean-hdr clean-binPROGRAMS clean-noinstPROGRAMS \ - clean-compile clean-libtool clean-tags clean-generic \ - mostlyclean-am +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-DEJAGNU distclean-compile \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags -clean: clean-recursive +dvi: dvi-recursive -distclean-am: distclean-hdr distclean-binPROGRAMS \ - distclean-noinstPROGRAMS distclean-compile \ - distclean-libtool distclean-tags distclean-generic \ - clean-am - -rm -f libtool +dvi-am: -distclean: distclean-recursive - -rm -f config.status +html: html-recursive -maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \ - maintainer-clean-noinstPROGRAMS \ - maintainer-clean-compile maintainer-clean-libtool \ - maintainer-clean-tags maintainer-clean-generic \ - distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: install-binPROGRAMS install-exec-local + +install-info: install-info-recursive + +install-man: + +installcheck-am: maintainer-clean: maintainer-clean-recursive - -rm -f config.status + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool mostlyclean-local + +pdf: pdf-recursive + +pdf-am: -.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ -mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ -maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ -mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \ -clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile mostlyclean-libtool distclean-libtool \ -clean-libtool maintainer-clean-libtool install-data-recursive \ -uninstall-data-recursive install-exec-recursive \ -uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ -all-recursive check-recursive installcheck-recursive info-recursive \ -dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ -maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ -distclean-tags clean-tags maintainer-clean-tags distdir check-DEJAGNU \ -info-am info dvi-am dvi check check-am installcheck-am installcheck \ -install-info-am install-info all-recursive-am install-exec-local \ -install-exec-am install-exec install-data-am install-data install-am \ -install uninstall-am uninstall all-redirect all-am all installdirs-am \ -installdirs mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ + check-DEJAGNU check-am clean clean-binPROGRAMS clean-generic \ + clean-libtool clean-noinstPROGRAMS clean-recursive ctags \ + ctags-recursive distclean distclean-DEJAGNU distclean-compile \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-recursive distclean-tags dvi dvi-am html html-am \ + info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-exec install-exec-am \ + install-exec-local install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool mostlyclean-local \ + mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-binPROGRAMS uninstall-info-am po/POTFILES.in: @MAINT@ Makefile for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \ @@ -1045,6 +1050,7 @@ nlmconv.o: nlmconv.c $(INCDIR)/coff/sym. $(COMPILE) -c -DLD_NAME="\"$${ldname}\"" @NLMCONV_DEFS@ $(srcdir)/nlmconv.c diststuff: $(EXTRA_DIST) info +all: info Makefile: $(BFDDIR)/configure.in @@ -1233,6 +1239,7 @@ readelf.o: readelf.c ../bfd/bfd.h $(INCD $(INCDIR)/elf/m32r.h $(INCDIR)/elf/m68k.h $(INCDIR)/elf/m68hc11.h \ $(INCDIR)/elf/mcore.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/mmix.h \ $(INCDIR)/elf/mn10200.h $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/msp430.h \ + $(INCDIR)/elf/ms1.h \ $(INCDIR)/elf/or32.h $(INCDIR)/elf/pj.h $(INCDIR)/elf/ppc.h \ $(INCDIR)/elf/ppc64.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/sh.h \ $(INCDIR)/elf/sparc.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/vax.h \ @@ -1322,7 +1329,6 @@ rclex.o: rclex.c ../bfd/bfd.h $(INCDIR)/ $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ windres.h winduni.h rcparse.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY - # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff -uprN binutils-2.16.90.0.3/binutils/NEWS binutils-2.16.91.0.1/binutils/NEWS --- binutils-2.16.90.0.3/binutils/NEWS 2005-04-09 12:03:01.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/NEWS 2005-06-22 13:53:34.569372821 -0700 @@ -1,5 +1,13 @@ -*- text -*- +* powerpc-linux ld now supports a variant form of PLT and GOT for the security + conscious. This form will automatically be chosen when ld detects that all + code in regular object files was generated by gcc -msecure-plt. The old PLT + and GOT may be forced by a new ld option, --bss-plt. + +* Add "-i/--inlines" to addr2line to print enclosing scope information + for inlined function chains, back to first non-inlined function. + * Add "-N/--full-section-name" to readelf to display full section name. * Add "-M entry:" switch to objdump to specify a function entry address @@ -10,7 +18,7 @@ Changes in 2.16: -* Add "-g/--section-groups" to readelf to display section group. +* Add "-g/--section-groups" to readelf to display section groups. * objcopy recognizes two new options --strip-unneeded-symbol and --strip-unneeded-symbols, namely for use together with the wildcard diff -uprN binutils-2.16.90.0.3/binutils/nm.c binutils-2.16.91.0.1/binutils/nm.c --- binutils-2.16.90.0.3/binutils/nm.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/nm.c 2005-06-22 13:53:34.611365883 -0700 @@ -907,9 +907,10 @@ print_symbol (bfd *abfd, asymbol *sym, b } else if (bfd_get_section (sym)->owner == abfd) { - if (bfd_find_nearest_line (abfd, bfd_get_section (sym), syms, - sym->value, &filename, &functionname, - &lineno) + if ((bfd_find_line (abfd, syms, sym, &filename, &lineno) + || bfd_find_nearest_line (abfd, bfd_get_section (sym), + syms, sym->value, &filename, + &functionname, &lineno)) && filename != NULL && lineno != 0) printf ("\t%s:%u", filename, lineno); diff -uprN binutils-2.16.90.0.3/binutils/objcopy.c binutils-2.16.91.0.1/binutils/objcopy.c --- binutils-2.16.90.0.3/binutils/objcopy.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/objcopy.c 2005-06-22 13:53:34.613365553 -0700 @@ -1120,6 +1120,74 @@ add_redefine_syms_file (const char *file free (buf); } +/* Copy unkown object file IBFD onto OBFD. + Returns TRUE upon success, FALSE otherwise. */ + +static bfd_boolean +copy_unknown_object (bfd *ibfd, bfd *obfd) +{ + char *cbuf; + int tocopy; + long ncopied; + long size; + struct stat buf; + + if (bfd_stat_arch_elt (ibfd, &buf) != 0) + { + bfd_nonfatal (bfd_get_archive_filename (ibfd)); + return FALSE; + } + + size = buf.st_size; + if (size < 0) + { + non_fatal (_("stat returns negative size for `%s'"), + bfd_get_archive_filename (ibfd)); + return FALSE; + } + + if (bfd_seek (ibfd, (file_ptr) 0, SEEK_SET) != 0) + { + bfd_nonfatal (bfd_get_archive_filename (ibfd)); + return FALSE; + } + + if (verbose) + printf (_("copy from `%s' [unknown] to `%s' [unknown]\n"), + bfd_get_archive_filename (ibfd), bfd_get_filename (obfd)); + + cbuf = xmalloc (BUFSIZE); + ncopied = 0; + while (ncopied < size) + { + tocopy = size - ncopied; + if (tocopy > BUFSIZE) + tocopy = BUFSIZE; + + if (bfd_bread (cbuf, (bfd_size_type) tocopy, ibfd) + != (bfd_size_type) tocopy) + { + bfd_nonfatal (bfd_get_archive_filename (ibfd)); + free (cbuf); + return FALSE; + } + + if (bfd_bwrite (cbuf, (bfd_size_type) tocopy, obfd) + != (bfd_size_type) tocopy) + { + bfd_nonfatal (bfd_get_filename (obfd)); + free (cbuf); + return FALSE; + } + + ncopied += tocopy; + } + + chmod (bfd_get_filename (obfd), buf.st_mode); + free (cbuf); + return TRUE; +} + /* Copy object file IBFD onto OBFD. Returns TRUE upon success, FALSE otherwise. */ @@ -1149,8 +1217,8 @@ copy_object (bfd *ibfd, bfd *obfd) } if (verbose) - printf (_("copy from %s(%s) to %s(%s)\n"), - bfd_get_filename (ibfd), bfd_get_target (ibfd), + printf (_("copy from `%s' [%s] to `%s' [%s]\n"), + bfd_get_archive_filename (ibfd), bfd_get_target (ibfd), bfd_get_filename (obfd), bfd_get_target (obfd)); if (set_start_set) @@ -1173,7 +1241,7 @@ copy_object (bfd *ibfd, bfd *obfd) if (!bfd_set_start_address (obfd, start) || !bfd_set_file_flags (obfd, flags)) { - bfd_nonfatal (bfd_get_filename (ibfd)); + bfd_nonfatal (bfd_get_archive_filename (ibfd)); return FALSE; } } @@ -1186,20 +1254,18 @@ copy_object (bfd *ibfd, bfd *obfd) || bfd_get_arch (ibfd) != bfd_get_arch (obfd))) { if (bfd_get_arch (ibfd) == bfd_arch_unknown) - fatal (_("Unable to recognise the format of the input file %s"), - bfd_get_filename (ibfd)); + non_fatal (_("Unable to recognise the format of the input file `%s'"), + bfd_get_archive_filename (ibfd)); else - { - non_fatal (_("Warning: Output file cannot represent architecture %s"), - bfd_printable_arch_mach (bfd_get_arch (ibfd), - bfd_get_mach (ibfd))); - return FALSE; - } + non_fatal (_("Warning: Output file cannot represent architecture `%s'"), + bfd_printable_arch_mach (bfd_get_arch (ibfd), + bfd_get_mach (ibfd))); + return FALSE; } if (!bfd_set_format (obfd, bfd_get_format (ibfd))) { - bfd_nonfatal (bfd_get_filename (ibfd)); + bfd_nonfatal (bfd_get_archive_filename (ibfd)); return FALSE; } @@ -1385,7 +1451,7 @@ copy_object (bfd *ibfd, bfd *obfd) symsize = bfd_get_symtab_upper_bound (ibfd); if (symsize < 0) { - bfd_nonfatal (bfd_get_filename (ibfd)); + bfd_nonfatal (bfd_get_archive_filename (ibfd)); return FALSE; } @@ -1634,13 +1700,35 @@ copy_archive (bfd *ibfd, bfd *obfd, cons RETURN_NONFATAL (output_name); if (bfd_check_format (this_element, bfd_object)) - delete = ! copy_object (this_element, output_bfd); + { + delete = ! copy_object (this_element, output_bfd); - if (!bfd_close (output_bfd)) + if (! delete + || bfd_get_arch (this_element) != bfd_arch_unknown) + { + if (!bfd_close (output_bfd)) + { + bfd_nonfatal (bfd_get_filename (output_bfd)); + /* Error in new object file. Don't change archive. */ + status = 1; + } + } + else + goto copy_unknown_element; + } + else { - bfd_nonfatal (bfd_get_filename (output_bfd)); - /* Error in new object file. Don't change archive. */ - status = 1; + non_fatal (_("Unable to recognise the format of the input file `%s'"), + bfd_get_archive_filename (this_element)); + +copy_unknown_element: + delete = !copy_unknown_object (this_element, output_bfd); + if (!bfd_close_all_done (output_bfd)) + { + bfd_nonfatal (bfd_get_filename (output_bfd)); + /* Error in new object file. Don't change archive. */ + status = 1; + } } if (delete) diff -uprN binutils-2.16.90.0.3/binutils/objdump.c binutils-2.16.91.0.1/binutils/objdump.c --- binutils-2.16.90.0.3/binutils/objdump.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/objdump.c 2005-06-22 13:53:34.620364396 -0700 @@ -1571,7 +1571,12 @@ disassemble_bytes (struct disassemble_in objdump_print_value (section->vma - rel_offset + q->address, info, TRUE); - printf (": %s\t", q->howto->name); + if (q->howto == NULL) + printf (": *unknown*\t"); + else if (q->howto->name) + printf (": %s\t", q->howto->name); + else + printf (": %d\t", q->howto->type); if (q->sym_ptr_ptr == NULL || *q->sym_ptr_ptr == NULL) printf ("*unknown*"); @@ -2466,23 +2471,20 @@ dump_reloc_set (bfd *abfd, asection *sec section_name = NULL; } + bfd_printf_vma (abfd, q->address); + if (q->howto == NULL) + printf (" *unknown* "); + else if (q->howto->name) + printf (" %-16s ", q->howto->name); + else + printf (" %-16d ", q->howto->type); if (sym_name) - { - bfd_printf_vma (abfd, q->address); - if (q->howto->name) - printf (" %-16s ", q->howto->name); - else - printf (" %-16d ", q->howto->type); - objdump_print_symname (abfd, NULL, *q->sym_ptr_ptr); - } + objdump_print_symname (abfd, NULL, *q->sym_ptr_ptr); else { if (section_name == NULL) section_name = "*unknown*"; - bfd_printf_vma (abfd, q->address); - printf (" %-16s [%s]", - q->howto->name, - section_name); + printf ("[%s]", section_name); } if (q->addend) diff -uprN binutils-2.16.90.0.3/binutils/po/zh_TW.po binutils-2.16.91.0.1/binutils/po/zh_TW.po --- binutils-2.16.90.0.3/binutils/po/zh_TW.po 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/binutils/po/zh_TW.po 2005-06-22 13:53:34.660357788 -0700 @@ -0,0 +1,5497 @@ +# Traditional Chinese Messages for binutils +# Copyright (C) 2003, 05 Free Software Foundation, Inc. +# Wang Li , 2003 +# Wei-Lun Chao , 2005 +# +msgid "" +msgstr "" +"Project-Id-Version: binutils 2.15.96\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-03-03 21:03+1030\n" +"PO-Revision-Date: 2005-06-02 09:05+0800\n" +"Last-Translator: Wei-Lun Chao \n" +"Language-Team: Chinese (traditional) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: addr2line.c:73 +#, c-format +msgid "Usage: %s [option(s)] [addr(s)]\n" +msgstr "用法:%s [é¸é …] [ä½å€]\n" + +#: addr2line.c:74 +#, c-format +msgid " Convert addresses into line number/file name pairs.\n" +msgstr " å°‡ä½å€è½‰æ›æˆæª”案å/列號å°ã€‚\n" + +#: addr2line.c:75 +#, c-format +msgid " If no addresses are specified on the command line, they will be read from stdin\n" +msgstr " 如果沒有在命令列中指定ä½å€ï¼Œå°±å¾žæ¨™æº–輸入中讀å–它們\n" + +#: addr2line.c:76 +#, c-format +msgid "" +" The options are:\n" +" -b --target= Set the binary file format\n" +" -e --exe= Set the input file name (default is a.out)\n" +" -s --basenames Strip directory names\n" +" -f --functions Show function names\n" +" -C --demangle[=style] Demangle function names\n" +" -h --help Display this information\n" +" -v --version Display the program's version\n" +"\n" +msgstr "" +" é¸é …為:\n" +" -b --target= 設定二進制檔案格å¼\n" +" -e --exe= 設定輸入檔案å (é è¨­ç‚º a.out)\n" +" -s --basenames 去除目錄å\n" +" -f --functions 顯示函數å\n" +" -C --demangle[=style] 解碼函數å\n" +" -h --help 顯示本資訊\n" +" -v --version 顯示程åºçš„版本號\n" +"\n" + +#: addr2line.c:88 ar.c:263 coffdump.c:467 nlmconv.c:1110 objcopy.c:478 +#: objcopy.c:512 readelf.c:2631 size.c:99 srconv.c:1731 strings.c:667 +#: sysdump.c:655 windres.c:672 +#, c-format +msgid "Report bugs to %s\n" +msgstr "å°‡ bug 報告到 %s\n" + +#: addr2line.c:241 +#, c-format +msgid "%s: can not get addresses from archive" +msgstr "%s:無法從ä¿å­˜æª”中得到ä½å€" + +#: addr2line.c:311 nm.c:1519 objdump.c:2848 +#, c-format +msgid "unknown demangling style `%s'" +msgstr "未知的解碼(demangle)風格「%sã€" + +#: ar.c:205 +#, c-format +msgid "no entry %s in archive\n" +msgstr "ä¿å­˜æª”中沒有æ¢ç›® %s\n" + +#: ar.c:221 +#, c-format +msgid "Usage: %s [emulation options] [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] [count] archive-file file...\n" +msgstr "用法:%s [模擬é¸é …] [-]{dmpqrstx}[abcfilNoPsSuvV] [æˆå“¡å] [計數] ä¿å­˜æª” 文件...\n" + +#: ar.c:224 +#, c-format +msgid " %s -M [\n" +"\n" +msgstr "" +"\n" +"<%s>\n" +"\n" + +#: ar.c:806 ar.c:873 +#, c-format +msgid "%s is not a valid archive" +msgstr "%s ä¸æ˜¯æœ‰æ•ˆçš„ä¿å­˜æª”" + +#: ar.c:841 +#, c-format +msgid "stat returns negative size for %s" +msgstr "stat 回傳 %s 的大å°ç‚ºè² æ•¸" + +#: ar.c:1059 +#, c-format +msgid "No member named `%s'\n" +msgstr "沒有å為「%sã€çš„æˆå“¡\n" + +#: ar.c:1109 +#, c-format +msgid "no entry %s in archive %s!" +msgstr "ä¿å­˜æª” %2$s 中沒有æ¢ç›® %1$sï¼" + +#: ar.c:1246 +#, c-format +msgid "%s: no archive map to update" +msgstr "%s:沒有è¦æ›´æ–°çš„ä¿å­˜æª”映射" + +#: arsup.c:83 +#, c-format +msgid "No entry %s in archive.\n" +msgstr "ä¿å­˜æª”中沒有æ¢ç›® %s。\n" + +#: arsup.c:109 +#, c-format +msgid "Can't open file %s\n" +msgstr "無法打開檔案 %s\n" + +#: arsup.c:162 +#, c-format +msgid "%s: Can't open output archive %s\n" +msgstr "%s:無法打開輸出ä¿å­˜æª” %s\n" + +#: arsup.c:179 +#, c-format +msgid "%s: Can't open input archive %s\n" +msgstr "%s:無法打開輸入ä¿å­˜æª” %s\n" + +#: arsup.c:188 +#, c-format +msgid "%s: file %s is not an archive\n" +msgstr "%s:檔案 %s ä¸æ˜¯ä¿å­˜æª”\n" + +#: arsup.c:227 +#, c-format +msgid "%s: no output archive specified yet\n" +msgstr "%s:尚未指定輸出ä¿å­˜æª”\n" + +#: arsup.c:247 arsup.c:285 arsup.c:327 arsup.c:347 arsup.c:413 +#, c-format +msgid "%s: no open output archive\n" +msgstr "%s:未打開輸出ä¿å­˜æª”\n" + +#: arsup.c:258 arsup.c:368 arsup.c:394 +#, c-format +msgid "%s: can't open file %s\n" +msgstr "%s:無法打開檔案 %s\n" + +#: arsup.c:312 arsup.c:390 arsup.c:471 +#, c-format +msgid "%s: can't find module file %s\n" +msgstr "%s:無法找到模組檔案 %s\n" + +#: arsup.c:422 +#, c-format +msgid "Current open archive is %s\n" +msgstr "ç›®å‰æ‰“é–‹çš„ä¿å­˜æª”是 %s\n" + +#: arsup.c:446 +#, c-format +msgid "%s: no open archive\n" +msgstr "%s:未打開ä¿å­˜æª”\n" + +#: binemul.c:37 +#, c-format +msgid " No emulation specific options\n" +msgstr " 沒有模擬特有的é¸é …\n" + +#. Macros for common output. +#: binemul.h:42 +#, c-format +msgid " emulation options: \n" +msgstr " 模擬é¸é …:\n" + +#: bucomm.c:109 +#, c-format +msgid "can't set BFD default target to `%s': %s" +msgstr "無法將 BFD é è¨­æ¨™çš„設置為「%sã€ï¼š%s" + +#: bucomm.c:120 +#, c-format +msgid "%s: Matching formats:" +msgstr "%s:匹é…æ ¼å¼ï¼š" + +#: bucomm.c:135 +#, c-format +msgid "Supported targets:" +msgstr "支æ´çš„目標:" + +#: bucomm.c:137 +#, c-format +msgid "%s: supported targets:" +msgstr "%s:支æ´çš„目標:" + +#: bucomm.c:153 +#, c-format +msgid "Supported architectures:" +msgstr "支æ´çš„系統架構:" + +#: bucomm.c:155 +#, c-format +msgid "%s: supported architectures:" +msgstr "%s:支æ´çš„系統架構:" + +#: bucomm.c:348 +#, c-format +msgid "BFD header file version %s\n" +msgstr "BFD 標頭檔案版本 %s\n" + +#: bucomm.c:449 +#, c-format +msgid "%s: bad number: %s" +msgstr "%s:錯誤的編號:%s" + +#: bucomm.c:466 strings.c:386 +#, c-format +msgid "'%s': No such file" +msgstr "%s:無此檔案" + +#: bucomm.c:468 strings.c:388 +#, c-format +msgid "Warning: could not locate '%s'. reason: %s" +msgstr "警告:無法找到 %s çš„ä½ç½®ã€‚原因:%s" + +#: bucomm.c:472 +#, c-format +msgid "Warning: '%s' is not an ordinary file" +msgstr "警告:'%s' ä¸æ˜¯ä¸€èˆ¬æª”案" + +#: coffdump.c:105 +#, c-format +msgid "#lines %d " +msgstr "#列號 %d " + +#: coffdump.c:459 sysdump.c:648 +#, c-format +msgid "Usage: %s [option(s)] in-file\n" +msgstr "用法:%s [é¸é …] 輸入檔案\n" + +#: coffdump.c:460 +#, c-format +msgid " Print a human readable interpretation of a SYSROFF object file\n" +msgstr " 列å°é©æ–¼é–±è®€çš„å° SYSROFF 目標檔案的解釋\n" + +#: coffdump.c:461 +#, c-format +msgid "" +" The options are:\n" +" -h --help Display this information\n" +" -v --version Display the program's version\n" +"\n" +msgstr "" +" é¸é …為:\n" +" -h --help 顯示本求助資訊\n" +" -v --version 顯示程åºçš„版本號\n" +"\n" + +#: coffdump.c:527 srconv.c:1819 sysdump.c:710 +msgid "no input file specified" +msgstr "未指定輸入檔案" + +#: debug.c:648 +msgid "debug_add_to_current_namespace: no current file" +msgstr "debug_add_to_current_namespace:沒有目å‰æª”案" + +#: debug.c:727 +msgid "debug_start_source: no debug_set_filename call" +msgstr "debug_start_source:沒有 debug_set_filename 呼å«" + +#: debug.c:783 +msgid "debug_record_function: no debug_set_filename call" +msgstr "debug_record_function:沒有 debug_set_filename 呼å«" + +#: debug.c:835 +msgid "debug_record_parameter: no current function" +msgstr "debug_record_parameter:沒有目å‰å‡½æ•¸" + +#: debug.c:867 +msgid "debug_end_function: no current function" +msgstr "debug_end_function:沒有目å‰å‡½æ•¸" + +#: debug.c:873 +msgid "debug_end_function: some blocks were not closed" +msgstr "debug_end_function:æŸäº›å€å¡Šæ²’有關閉" + +#: debug.c:901 +msgid "debug_start_block: no current block" +msgstr "debug_start_block:沒有目å‰å€å¡Š" + +#: debug.c:937 +msgid "debug_end_block: no current block" +msgstr "debug_end_block:沒有目å‰å€å¡Š" + +#: debug.c:944 +msgid "debug_end_block: attempt to close top level block" +msgstr "debug_end_block:試圖關閉頂層å€å¡Š" + +#: debug.c:967 +msgid "debug_record_line: no current unit" +msgstr "debug_record_line:沒有目å‰å–®å…ƒ" + +#. FIXME +#: debug.c:1020 +msgid "debug_start_common_block: not implemented" +msgstr "debug_start_common_block:未實作" + +#. FIXME +#: debug.c:1031 +msgid "debug_end_common_block: not implemented" +msgstr "debug_end_common_block:未實作" + +#. FIXME. +#: debug.c:1115 +msgid "debug_record_label: not implemented" +msgstr "debug_record_label:未實作" + +#: debug.c:1137 +msgid "debug_record_variable: no current file" +msgstr "debug_record_variable:沒有目å‰æª”案" + +#: debug.c:1665 +msgid "debug_make_undefined_type: unsupported kind" +msgstr "debug_make_undefined_type:ä¸æ”¯æ´çš„種類" + +#: debug.c:1842 +msgid "debug_name_type: no current file" +msgstr "debug_name_type:沒有目å‰æª”案" + +#: debug.c:1887 +msgid "debug_tag_type: no current file" +msgstr "debug_tag_type:沒有目å‰æª”案" + +#: debug.c:1895 +msgid "debug_tag_type: extra tag attempted" +msgstr "debug_tag_type:已嘗試更多的標記" + +#: debug.c:1932 +#, c-format +msgid "Warning: changing type size from %d to %d\n" +msgstr "警告:類型大å°ç”± %d 改為 %d\n" + +#: debug.c:1954 +msgid "debug_find_named_type: no current compilation unit" +msgstr "debug_find_named_type:沒有目å‰ç·¨è­¯å–®å…ƒ" + +#: debug.c:2057 +#, c-format +msgid "debug_get_real_type: circular debug information for %s\n" +msgstr "debug_get_real_type:關於 %s 的循環除錯資訊\n" + +#: debug.c:2484 +msgid "debug_write_type: illegal type encountered" +msgstr "debug_write_type:é‡åˆ°ä¸æ­£ç¢ºé¡žåž‹" + +#: dlltool.c:773 dlltool.c:797 dlltool.c:826 +#, c-format +msgid "Internal error: Unknown machine type: %d" +msgstr "內部錯誤:未知的機器類型:%d" + +#: dlltool.c:862 +#, c-format +msgid "Can't open def file: %s" +msgstr "無法打開 def 檔案:%s" + +#: dlltool.c:867 +#, c-format +msgid "Processing def file: %s" +msgstr "è™•ç† def 檔案:%s" + +#: dlltool.c:871 +msgid "Processed def file" +msgstr "已處ç†çš„ def 檔案" + +#: dlltool.c:895 +#, c-format +msgid "Syntax error in def file %s:%d" +msgstr "def 檔案中語法錯誤 %s:%d" + +#: dlltool.c:930 +#, c-format +msgid "%s: Path components stripped from image name, '%s'." +msgstr "%s:從映åƒæª” '%s' 中截去路徑æˆåˆ†ã€‚" + +#: dlltool.c:939 +#, c-format +msgid "NAME: %s base: %x" +msgstr "å稱:%s 基於:%x" + +#: dlltool.c:942 dlltool.c:958 +msgid "Can't have LIBRARY and NAME" +msgstr "ä¸å…·æœ‰ LIBRARY 與 NAME" + +#: dlltool.c:955 +#, c-format +msgid "LIBRARY: %s base: %x" +msgstr "LIBRARY:%s 基於:%x" + +#: dlltool.c:1191 resrc.c:269 +#, c-format +msgid "wait: %s" +msgstr "等待:%s" + +#: dlltool.c:1196 dllwrap.c:418 resrc.c:274 +#, c-format +msgid "subprocess got fatal signal %d" +msgstr "å­è¡Œç¨‹æ”¶åˆ°è‡´å‘½ä¿¡è™Ÿ %d" + +#: dlltool.c:1202 dllwrap.c:425 resrc.c:281 +#, c-format +msgid "%s exited with status %d" +msgstr "%s 以狀態 %d 離開" + +#: dlltool.c:1233 +#, c-format +msgid "Sucking in info from %s section in %s" +msgstr "從 %2$s 中的 %1$s å€æ®µç²å–資訊" + +#: dlltool.c:1358 +#, c-format +msgid "Excluding symbol: %s" +msgstr "排除符號:%s" + +#: dlltool.c:1447 dlltool.c:1458 nm.c:998 nm.c:1009 +#, c-format +msgid "%s: no symbols" +msgstr "%s:沒有符號" + +#. FIXME: we ought to read in and block out the base relocations. +#: dlltool.c:1484 +#, c-format +msgid "Done reading %s" +msgstr "讀入 %s 完æˆ" + +#: dlltool.c:1494 +#, c-format +msgid "Unable to open object file: %s" +msgstr "無法打開目標檔案:%s" + +#: dlltool.c:1497 +#, c-format +msgid "Scanning object file %s" +msgstr "正在掃瞄目標檔案 %s" + +#: dlltool.c:1512 +#, c-format +msgid "Cannot produce mcore-elf dll from archive file: %s" +msgstr "無法從ä¿å­˜æª”中產生 mcore-elf 動態連接庫:%s" + +#: dlltool.c:1598 +msgid "Adding exports to output file" +msgstr "正在加入導出至輸出檔案" + +#: dlltool.c:1646 +msgid "Added exports to output file" +msgstr "已加入導出至輸出檔案" + +#: dlltool.c:1767 +#, c-format +msgid "Generating export file: %s" +msgstr "正在產生導出檔案:%s" + +#: dlltool.c:1772 +#, c-format +msgid "Unable to open temporary assembler file: %s" +msgstr "無法打開臨時組譯檔案:%s" + +#: dlltool.c:1775 +#, c-format +msgid "Opened temporary file: %s" +msgstr "已打開的臨時檔案:%s" + +#: dlltool.c:1997 +msgid "Generated exports file" +msgstr "已產生的導出檔案" + +#: dlltool.c:2203 +#, c-format +msgid "bfd_open failed open stub file: %s" +msgstr "無法打開輸出檔案 %s" + +#: dlltool.c:2206 +#, c-format +msgid "Creating stub file: %s" +msgstr "正在建立佔ä½æª”案:%s" + +#: dlltool.c:2588 +#, c-format +msgid "failed to open temporary head file: %s" +msgstr "打開臨時標頭檔案失敗:%s" + +#: dlltool.c:2647 +#, c-format +msgid "failed to open temporary tail file: %s" +msgstr "打開臨時標尾檔案失敗:%s" + +#: dlltool.c:2714 +#, c-format +msgid "Can't open .lib file: %s" +msgstr "無法打開 .lib 檔案:%s" + +#: dlltool.c:2717 +#, c-format +msgid "Creating library file: %s" +msgstr "正在建立函å¼åº«æª”案:%s" + +#: dlltool.c:2800 dlltool.c:2806 +#, c-format +msgid "cannot delete %s: %s" +msgstr "無法刪除 %s:%s" + +#: dlltool.c:2811 +msgid "Created lib file" +msgstr "已建立的 lib 檔案" + +#: dlltool.c:2904 +#, c-format +msgid "Warning, ignoring duplicate EXPORT %s %d,%d" +msgstr "警告,正在忽略é‡è¦†çš„ EXPORT %s %d,%d" + +#: dlltool.c:2910 +#, c-format +msgid "Error, duplicate EXPORT with oridinals: %s" +msgstr "錯誤,é‡è¦†çš„ EXPORT 以åŠåŽŸå§‹å‡ºè™•: %s" + +#: dlltool.c:3026 +msgid "Processing definitions" +msgstr "正在處ç†å®šç¾©" + +#: dlltool.c:3058 +msgid "Processed definitions" +msgstr "已處ç†å®šç¾©" + +#. xgetext:c-format +#: dlltool.c:3065 dllwrap.c:479 +#, c-format +msgid "Usage %s \n" +msgstr "用法: %s <é¸é …> <目標檔案>\n" + +#. xgetext:c-format +#: dlltool.c:3067 +#, c-format +msgid " -m --machine Create as DLL for . [default: %s]\n" +msgstr " -m --machine <架構> 為 <架構> 建立 DLL。[é è¨­ï¼š%s]\n" + +#: dlltool.c:3068 +#, c-format +msgid " possible : arm[_interwork], i386, mcore[-elf]{-le|-be}, ppc, thumb\n" +msgstr " å¯èƒ½çš„ <架構>:arm[_interwork]ã€i386ã€mcore[-elf]{-le|-be}ã€ppcã€thumb\n" + +#: dlltool.c:3069 +#, c-format +msgid " -e --output-exp Generate an export file.\n" +msgstr " -e --output-exp <導出檔> 產生導出檔案。\n" + +#: dlltool.c:3070 +#, c-format +msgid " -l --output-lib Generate an interface library.\n" +msgstr " -l --output-lib <導出檔> 產生介é¢å‡½å¼åº«ã€‚\n" + +#: dlltool.c:3071 +#, c-format +msgid " -a --add-indirect Add dll indirects to export file.\n" +msgstr " -a --add-indirect 間接添加 dll 至導出檔案。\n" + +#: dlltool.c:3072 +#, c-format +msgid " -D --dllname Name of input dll to put into interface lib.\n" +msgstr " -D --dllname <å稱> è¦ç½®å…¥ä»‹é¢å‡½å¼åº«çš„輸入 dll å稱。\n" + +#: dlltool.c:3073 +#, c-format +msgid " -d --input-def Name of .def file to be read in.\n" +msgstr " -d --input-def <定義檔> å°‡è¦è®€å…¥çš„ .def 檔案å。\n" + +#: dlltool.c:3074 +#, c-format +msgid " -z --output-def Name of .def file to be created.\n" +msgstr " -z --output-def <定義檔> å°‡è¦å»ºç«‹çš„ .def 檔案å。\n" + +#: dlltool.c:3075 +#, c-format +msgid " --export-all-symbols Export all symbols to .def\n" +msgstr " --export-all-symbols 將所有符號導出到 .def\n" + +#: dlltool.c:3076 +#, c-format +msgid " --no-export-all-symbols Only export listed symbols\n" +msgstr " --no-export-all-symbols åªå°Žå‡ºåˆ—舉的符號\n" + +#: dlltool.c:3077 +#, c-format +msgid " --exclude-symbols Don't export \n" +msgstr " --exclude-symbols <列表> ä¸è¦å°Žå‡º <列表>\n" + +#: dlltool.c:3078 +#, c-format +msgid " --no-default-excludes Clear default exclude symbols\n" +msgstr " --no-default-excludes 清空é è¨­æŽ’除的符號\n" + +#: dlltool.c:3079 +#, c-format +msgid " -b --base-file Read linker generated base file.\n" +msgstr " -b --base-file <基本檔> 讀å–連接程å¼æ‰€ç”¢ç”Ÿçš„ base 檔案。\n" + +#: dlltool.c:3080 +#, c-format +msgid " -x --no-idata4 Don't generate idata$4 section.\n" +msgstr " -x --no-idata4 ä¸ç”¢ç”Ÿ idata$4 å€æ®µã€‚\n" + +#: dlltool.c:3081 +#, c-format +msgid " -c --no-idata5 Don't generate idata$5 section.\n" +msgstr " -c --no-idata5 ä¸ç”¢ç”Ÿ idata$5 å€æ®µã€‚\n" + +#: dlltool.c:3082 +#, c-format +msgid " -U --add-underscore Add underscores to symbols in interface library.\n" +msgstr " -U --add-underscore 於介é¢ä¸­çš„符號添加底線。\n" + +#: dlltool.c:3083 +#, c-format +msgid " -k --kill-at Kill @ from exported names.\n" +msgstr " -k --kill-at 刪去導出å稱中的 @。\n" + +#: dlltool.c:3084 +#, c-format +msgid " -A --add-stdcall-alias Add aliases without @.\n" +msgstr " -A --add-stdcall-alias 添加ä¸å¸¶ @ 的別å。\n" + +#: dlltool.c:3085 +#, c-format +msgid " -p --ext-prefix-alias Add aliases with .\n" +msgstr " -p --ext-prefix-alias <å‰ç½®> 添加附帶 <å‰ç½®> 的別å。\n" + +#: dlltool.c:3086 +#, c-format +msgid " -S --as Use for assembler.\n" +msgstr " -S --as <å稱> 用 <å稱> åšç‚ºçµ„譯程å¼ã€‚\n" + +#: dlltool.c:3087 +#, c-format +msgid " -f --as-flags Pass to the assembler.\n" +msgstr " -f --as-flags <旗標> 把 <旗標> 傳éžçµ¦çµ„譯程å¼ã€‚\n" + +#: dlltool.c:3088 +#, c-format +msgid " -C --compat-implib Create backward compatible import library.\n" +msgstr " -C --compat-implib 建立å‘後相容的導入函å¼åº«ã€‚\n" + +#: dlltool.c:3089 +#, c-format +msgid " -n --no-delete Keep temp files (repeat for extra preservation).\n" +msgstr " -n --no-delete ä¿ç•™è‡¨æ™‚檔案 (é‡è¦†ä»¥é”到é¡å¤–çš„ä¿ç•™)。\n" + +#: dlltool.c:3090 +#, c-format +msgid " -t --temp-prefix Use to construct temp file names.\n" +msgstr " -t --temp-prefix <å‰ç½®> 使用 <å‰ç½®> 來建構臨時檔案å稱。\n" + +#: dlltool.c:3091 +#, c-format +msgid " -v --verbose Be verbose.\n" +msgstr " -v --verbose 輸出更多資訊。\n" + +#: dlltool.c:3092 +#, c-format +msgid " -V --version Display the program version.\n" +msgstr " -V --version 顯示程å¼ç‰ˆæœ¬è™Ÿç¢¼ã€‚\n" + +#: dlltool.c:3093 +#, c-format +msgid " -h --help Display this information.\n" +msgstr " -h --help 顯示本資訊。\n" + +#: dlltool.c:3095 +#, c-format +msgid " -M --mcore-elf Process mcore-elf object files into .\n" +msgstr " -M --mcore-elf <輸出å稱> è™•ç† mcore-elf 物件檔案進入 <輸出å稱>。\n" + +#: dlltool.c:3096 +#, c-format +msgid " -L --linker Use as the linker.\n" +msgstr " -L --linker <å稱> 以 <å稱> åšç‚ºé€£æŽ¥ç¨‹å¼ã€‚\n" + +#: dlltool.c:3097 +#, c-format +msgid " -F --linker-flags Pass to the linker.\n" +msgstr " -F --linker-flags <旗標> 把 <旗標> 傳éžçµ¦é€£æŽ¥ç¨‹å¼ã€‚\n" + +#: dlltool.c:3211 +#, c-format +msgid "Path components stripped from dllname, '%s'." +msgstr "已從 dll å稱 '%s' 中截去路徑部分。" + +#: dlltool.c:3256 +#, c-format +msgid "Unable to open base-file: %s" +msgstr "無法開啟基本檔案:%s" + +#: dlltool.c:3288 +#, c-format +msgid "Machine '%s' not supported" +msgstr "ä¸æ”¯æ´æž¶æ§‹ã€Œ%sã€" + +#: dlltool.c:3392 dllwrap.c:209 +#, c-format +msgid "Tried file: %s" +msgstr "已試檔案:%s" + +#: dlltool.c:3399 dllwrap.c:216 +#, c-format +msgid "Using file: %s" +msgstr "正在處ç†æª”案:%s" + +#: dllwrap.c:299 +#, c-format +msgid "Keeping temporary base file %s" +msgstr "ä¿ç•™è‡¨æ™‚ base 檔案 %s" + +#: dllwrap.c:301 +#, c-format +msgid "Deleting temporary base file %s" +msgstr "刪除臨時 base 檔案 %s" + +#: dllwrap.c:315 +#, c-format +msgid "Keeping temporary exp file %s" +msgstr "ä¿ç•™è‡¨æ™‚ exp 檔案 %s" + +#: dllwrap.c:317 +#, c-format +msgid "Deleting temporary exp file %s" +msgstr "刪除臨時 exp 檔案 %s" + +#: dllwrap.c:330 +#, c-format +msgid "Keeping temporary def file %s" +msgstr "ä¿ç•™è‡¨æ™‚ def 檔案 %s" + +#: dllwrap.c:332 +#, c-format +msgid "Deleting temporary def file %s" +msgstr "刪除臨時 def 檔案 %s" + +#: dllwrap.c:480 +#, c-format +msgid " Generic options:\n" +msgstr " 通用é¸é …:\n" + +#: dllwrap.c:481 +#, c-format +msgid " --quiet, -q Work quietly\n" +msgstr " --quiet, -q 安éœåœ°å·¥ä½œ\n" + +#: dllwrap.c:482 +#, c-format +msgid " --verbose, -v Verbose\n" +msgstr " --verbose, -v 輸出較多資訊\n" + +#: dllwrap.c:483 +#, c-format +msgid " --version Print dllwrap version\n" +msgstr " --version åˆ—å° dllwrap 的版本號\n" + +#: dllwrap.c:484 +#, c-format +msgid " --implib Synonym for --output-lib\n" +msgstr " --implib --output-lib çš„åŒç¾©èªž\n" + +#: dllwrap.c:485 +#, c-format +msgid " Options for %s:\n" +msgstr " %s çš„é¸é …:\n" + +#: dllwrap.c:486 +#, c-format +msgid " --driver-name Defaults to \"gcc\"\n" +msgstr " --driver-name <驅動器> é è¨­ç‚ºã€Œgccã€\n" + +#: dllwrap.c:487 +#, c-format +msgid " --driver-flags Override default ld flags\n" +msgstr " --driver-flags <旗標> 覆蓋é è¨­çš„ ld 旗標\n" + +#: dllwrap.c:488 +#, c-format +msgid " --dlltool-name Defaults to \"dlltool\"\n" +msgstr " --dlltool-name é è¨­ç‚ºã€Œdlltoolã€\n" + +#: dllwrap.c:489 +#, c-format +msgid " --entry Specify alternate DLL entry point\n" +msgstr " --entry <å…¥å£> 指定é¡å¤–çš„ DLL 進入點\n" + +#: dllwrap.c:490 +#, c-format +msgid " --image-base Specify image base address\n" +msgstr " --image-base <基å€> 指定映åƒçš„基本ä½å€\n" + +#: dllwrap.c:491 +#, c-format +msgid " --target i386-cygwin32 or i386-mingw32\n" +msgstr " --target <架構> i386-cygwin32 或 i386-mingw32\n" + +#: dllwrap.c:492 +#, c-format +msgid " --dry-run Show what needs to be run\n" +msgstr " --dry-run åªé¡¯ç¤ºéœ€è¦åŸ·è¡Œé‚£äº›å‹•ä½œ\n" + +#: dllwrap.c:493 +#, c-format +msgid " --mno-cygwin Create Mingw DLL\n" +msgstr " --mno-cygwin 建立 Mingw DLL\n" + +#: dllwrap.c:494 +#, c-format +msgid " Options passed to DLLTOOL:\n" +msgstr " 傳éžçµ¦ DLLTOOL çš„é¸é …:\n" + +#: dllwrap.c:495 +#, c-format +msgid " --machine \n" +msgstr " --machine <架構>\n" + +#: dllwrap.c:496 +#, c-format +msgid " --output-exp Generate export file.\n" +msgstr " --output-exp <導出å> 產生導出檔案。\n" + +#: dllwrap.c:497 +#, c-format +msgid " --output-lib Generate input library.\n" +msgstr " --output-lib <導出å> 產生輸入函å¼åº«ã€‚\n" + +#: dllwrap.c:498 +#, c-format +msgid " --add-indirect Add dll indirects to export file.\n" +msgstr " --add-indirect 間接添加 dll 至導出檔案。\n" + +#: dllwrap.c:499 +#, c-format +msgid " --dllname Name of input dll to put into output lib.\n" +msgstr " --dllname <å稱> è¦ç½®å…¥è¼¸å‡ºå‡½å¼åº«çš„輸入 dll å稱。\n" + +#: dllwrap.c:500 +#, c-format +msgid " --def Name input .def file\n" +msgstr " --def 輸入 .def 檔案的å稱\n" + +#: dllwrap.c:501 +#, c-format +msgid " --output-def Name output .def file\n" +msgstr " --output-def 輸出 .def 檔案的å稱\n" + +#: dllwrap.c:502 +#, c-format +msgid " --export-all-symbols Export all symbols to .def\n" +msgstr " --export-all-symbols 將所有符號導出到 .def 中\n" + +#: dllwrap.c:503 +#, c-format +msgid " --no-export-all-symbols Only export .drectve symbols\n" +msgstr " --no-export-all-symbols åªå°Žå‡ºç¬¦è™Ÿ .drectve\n" + +#: dllwrap.c:504 +#, c-format +msgid " --exclude-symbols Exclude from .def\n" +msgstr " --exclude-symbols <列表> 從 .def 中排除 <列表>\n" + +#: dllwrap.c:505 +#, c-format +msgid " --no-default-excludes Zap default exclude symbols\n" +msgstr " --no-default-excludes 清空é è¨­æŽ’除的符號\n" + +#: dllwrap.c:506 +#, c-format +msgid " --base-file Read linker generated base file\n" +msgstr " --base-file Read linker generated base file\n" + +#: dllwrap.c:507 +#, c-format +msgid " --no-idata4 Don't generate idata$4 section\n" +msgstr " --no-idata4 ä¸ç”¢ç”Ÿ idata$4 å€æ®µ\n" + +#: dllwrap.c:508 +#, c-format +msgid " --no-idata5 Don't generate idata$5 section\n" +msgstr " --no-idata5 ä¸ç”¢ç”Ÿ idata$5 å€æ®µ\n" + +#: dllwrap.c:509 +#, c-format +msgid " -U Add underscores to .lib\n" +msgstr " -U 為 .lib 添加底線\n" + +#: dllwrap.c:510 +#, c-format +msgid " -k Kill @ from exported names\n" +msgstr " -k 刪去導出å字中的 @\n" + +#: dllwrap.c:511 +#, c-format +msgid " --add-stdcall-alias Add aliases without @\n" +msgstr " --add-stdcall-alias 添加ä¸å¸¶ @ 的別å\n" + +#: dllwrap.c:512 +#, c-format +msgid " --as Use for assembler\n" +msgstr " --as <å稱> 以 <å稱> åšç‚ºçµ„譯程å¼\n" + +#: dllwrap.c:513 +#, c-format +msgid " --nodelete Keep temp files.\n" +msgstr " --nodelete ä¿ç•™è‡¨æ™‚檔案。\n" + +#: dllwrap.c:514 +#, c-format +msgid " Rest are passed unmodified to the language driver\n" +msgstr " 其餘的都ä¸åŠ ä»»ä½•ä¿®æ”¹åœ°å‚³éžçµ¦èªžè¨€é©…動器\n" + +#: dllwrap.c:784 +msgid "Must provide at least one of -o or --dllname options" +msgstr "å¿…é ˆæ供至少一個 -o 或 --dllname é¸é …" + +#: dllwrap.c:813 +msgid "" +"no export definition file provided.\n" +"Creating one, but that may not be what you want" +msgstr "" +"未æ供導出定義檔案。\n" +"ç¾åœ¨å»ºç«‹ä¸€å€‹ï¼Œä½†å¯èƒ½ä¸æ˜¯æ‚¨æ‰€è¦çš„" + +#: dllwrap.c:972 +#, c-format +msgid "DLLTOOL name : %s\n" +msgstr "DLLTOOL å稱 :%s\n" + +#: dllwrap.c:973 +#, c-format +msgid "DLLTOOL options : %s\n" +msgstr "DLLTOOL é¸é … :%s\n" + +#: dllwrap.c:974 +#, c-format +msgid "DRIVER name : %s\n" +msgstr "驅動器å稱 :%s\n" + +#: dllwrap.c:975 +#, c-format +msgid "DRIVER options : %s\n" +msgstr "驅動器é¸é … :%s\n" + +#: emul_aix.c:51 +#, c-format +msgid " [-g] - 32 bit small archive\n" +msgstr " [-g] - 32 ä½å…ƒå°åž‹ä¿å­˜æª”\n" + +#: emul_aix.c:52 +#, c-format +msgid " [-X32] - ignores 64 bit objects\n" +msgstr " [-X32] - 忽略 64 ä½å…ƒç‰©ä»¶\n" + +#: emul_aix.c:53 +#, c-format +msgid " [-X64] - ignores 32 bit objects\n" +msgstr " [-X64] - 忽略 32 ä½å…ƒç‰©ä»¶\n" + +#: emul_aix.c:54 +#, c-format +msgid " [-X32_64] - accepts 32 and 64 bit objects\n" +msgstr " [-X32_64] - æŽ¥å— 32 ä½å…ƒå’Œ 64 ä½å…ƒç‰©ä»¶\n" + +#: ieee.c:311 +msgid "unexpected end of debugging information" +msgstr "除錯資訊æ„外çµæŸ" + +#: ieee.c:398 +msgid "invalid number" +msgstr "無效的編號" + +#: ieee.c:451 +msgid "invalid string length" +msgstr "無效的字串長度" + +#: ieee.c:506 ieee.c:547 +msgid "expression stack overflow" +msgstr "表示å¼å †ç–Šå‘上溢出" + +#: ieee.c:526 +msgid "unsupported IEEE expression operator" +msgstr "ä¸æ”¯æ´çš„ IEEE 表示å¼é‹ç®—å­" + +#: ieee.c:541 +msgid "unknown section" +msgstr "未知的å€æ®µ" + +#: ieee.c:562 +msgid "expression stack underflow" +msgstr "表示å¼å †ç–Šå‘下溢出" + +#: ieee.c:576 +msgid "expression stack mismatch" +msgstr "表示å¼å †ç–Šä¸åŒ¹é…" + +#: ieee.c:613 +msgid "unknown builtin type" +msgstr "未知的內建類型" + +#: ieee.c:758 +msgid "BCD float type not supported" +msgstr "ä¸æ”¯æ´çš„ BCD 浮點類型" + +#: ieee.c:895 +msgid "unexpected number" +msgstr "æ„外的編號" + +#: ieee.c:902 +msgid "unexpected record type" +msgstr "æ„外的紀錄類型" + +#: ieee.c:935 +msgid "blocks left on stack at end" +msgstr "çµæŸæ™‚ä»ç•™åœ¨å †ç–Šä¸­çš„å€å¡Š" + +#: ieee.c:1198 +msgid "unknown BB type" +msgstr "未知的 BB é¡žåž‹" + +#: ieee.c:1207 +msgid "stack overflow" +msgstr "堆疊å‘上溢出" + +#: ieee.c:1230 +msgid "stack underflow" +msgstr "堆疊å‘下溢出" + +#: ieee.c:1342 ieee.c:1412 ieee.c:2109 +msgid "illegal variable index" +msgstr "ä¸æ­£ç¢ºçš„變數索引" + +#: ieee.c:1390 +msgid "illegal type index" +msgstr "ä¸æ­£ç¢ºçš„類型索引" + +#: ieee.c:1400 ieee.c:1437 +msgid "unknown TY code" +msgstr "未知的 TY 代碼" + +#: ieee.c:1419 +msgid "undefined variable in TY" +msgstr "TY 中未定義的變é‡" + +#. Pascal file name. FIXME. +#: ieee.c:1830 +msgid "Pascal file name not supported" +msgstr "ä¸æ”¯æ´ Pascal 檔案å" + +#: ieee.c:1878 +msgid "unsupported qualifier" +msgstr "ä¸æ”¯æ´çš„é™å®šç¬¦è™Ÿ" + +#: ieee.c:2147 +msgid "undefined variable in ATN" +msgstr "ATN 中未定義的變數" + +#: ieee.c:2190 +msgid "unknown ATN type" +msgstr "未知的 ATN é¡žåž‹" + +#. Reserved for FORTRAN common. +#: ieee.c:2312 +msgid "unsupported ATN11" +msgstr "ä¸æ”¯æ´ ATN11" + +#. We have no way to record this information. FIXME. +#: ieee.c:2339 +msgid "unsupported ATN12" +msgstr "ä¸æ”¯æ´ ATN12" + +#: ieee.c:2399 +msgid "unexpected string in C++ misc" +msgstr "æ„外的 C++ 雜項字串" + +#: ieee.c:2412 +msgid "bad misc record" +msgstr "ä¸è‰¯çš„雜項記錄" + +#: ieee.c:2453 +msgid "unrecognized C++ misc record" +msgstr "無法識別的 C++ 雜項紀錄" + +#: ieee.c:2568 +msgid "undefined C++ object" +msgstr "未定義的 C++ 物件" + +#: ieee.c:2602 +msgid "unrecognized C++ object spec" +msgstr "無法識別的 C++ 物件è¦æ ¼" + +#: ieee.c:2638 +msgid "unsupported C++ object type" +msgstr "ä¸æ”¯æ´çš„ C++ 物件類型" + +#: ieee.c:2648 +msgid "C++ base class not defined" +msgstr "未定義 C++ 基本類別" + +#: ieee.c:2660 ieee.c:2765 +msgid "C++ object has no fields" +msgstr "C++ 物件沒有欄ä½" + +#: ieee.c:2679 +msgid "C++ base class not found in container" +msgstr "容器中找ä¸åˆ° C++ 基本類別" + +#: ieee.c:2786 +msgid "C++ data member not found in container" +msgstr "容器中找ä¸åˆ° C++ 資料æˆå“¡" + +#: ieee.c:2827 ieee.c:2977 +msgid "unknown C++ visibility" +msgstr "未知的 C++ å¯è¦‹åº¦" + +#: ieee.c:2861 +msgid "bad C++ field bit pos or size" +msgstr "ä¸è‰¯çš„ C++ 欄ä½ä½å…ƒä½ç½®æˆ–大å°" + +#: ieee.c:2953 +msgid "bad type for C++ method function" +msgstr "ä¸è‰¯çš„ C++ 方法函å¼é¡žåž‹" + +#: ieee.c:2963 +msgid "no type information for C++ method function" +msgstr "å°æ–¼ C++ 方法函å¼æ²’有類型資訊" + +#: ieee.c:3002 +msgid "C++ static virtual method" +msgstr "C++ éœæ…‹è™›æ“¬æ–¹æ³•" + +#: ieee.c:3097 +msgid "unrecognized C++ object overhead spec" +msgstr "無法識別的 C++ 物件頂層è¦æ ¼" + +#: ieee.c:3136 +msgid "undefined C++ vtable" +msgstr "未定義的 C++ vtable" + +#: ieee.c:3205 +msgid "C++ default values not in a function" +msgstr "C++ é è¨­å€¼ä¸åœ¨å‡½å¼ä¹‹ä¸­" + +#: ieee.c:3245 +msgid "unrecognized C++ default type" +msgstr "無法識別的 C++ é è¨­é¡žåž‹" + +#: ieee.c:3276 +msgid "reference parameter is not a pointer" +msgstr "åƒè€ƒåƒæ•¸ä¸æ˜¯æŒ‡æ¨™" + +#: ieee.c:3359 +msgid "unrecognized C++ reference type" +msgstr "無法識別的 C++ åƒè€ƒé¡žåž‹" + +#: ieee.c:3441 +msgid "C++ reference not found" +msgstr "找ä¸åˆ° C++ åƒè€ƒ" + +#: ieee.c:3449 +msgid "C++ reference is not pointer" +msgstr "C++ åƒè€ƒä¸æ˜¯æŒ‡æ¨™" + +#: ieee.c:3475 ieee.c:3483 +msgid "missing required ASN" +msgstr "éºå¤±å¿…須的 ASN" + +#: ieee.c:3510 ieee.c:3518 +msgid "missing required ATN65" +msgstr "éºå¤±å¿…須的 ATN65" + +#: ieee.c:3532 +msgid "bad ATN65 record" +msgstr "ä¸è‰¯çš„ ATN65 記錄" + +#: ieee.c:4160 +#, c-format +msgid "IEEE numeric overflow: 0x" +msgstr "IEEE 數值溢出:0x" + +#: ieee.c:4204 +#, c-format +msgid "IEEE string length overflow: %u\n" +msgstr "IEEE 字串長度溢出:%u\n" + +#: ieee.c:5203 +#, c-format +msgid "IEEE unsupported integer type size %u\n" +msgstr "IEEE ä¸æ”¯æ´çš„æ•´æ•¸é¡žåž‹å¤§å° %u\n" + +#: ieee.c:5237 +#, c-format +msgid "IEEE unsupported float type size %u\n" +msgstr "IEEE ä¸æ”¯æ´çš„æµ®é»žé¡žåž‹å¤§å° %u\n" + +#: ieee.c:5271 +#, c-format +msgid "IEEE unsupported complex type size %u\n" +msgstr "IEEE ä¸æ”¯æ´çš„è¤‡æ•¸é¡žåž‹å¤§å° %u\n" + +#: nlmconv.c:267 srconv.c:1810 +msgid "input and output files must be different" +msgstr "輸入輸出檔案必須ä¸åŒ" + +#: nlmconv.c:314 +msgid "input file named both on command line and with INPUT" +msgstr "åŒæ™‚在命令列和 INPUT 中輸入檔案å稱" + +#: nlmconv.c:323 +msgid "no input file" +msgstr "沒有輸入檔案" + +#: nlmconv.c:353 +msgid "no name for output file" +msgstr "輸出檔案沒有å稱" + +#: nlmconv.c:367 +msgid "warning: input and output formats are not compatible" +msgstr "警告:輸入和輸出格å¼ä¸ç›¸å®¹" + +#: nlmconv.c:396 +msgid "make .bss section" +msgstr "產生 .bss å€æ®µ" + +#: nlmconv.c:405 +msgid "make .nlmsections section" +msgstr "產生 .nlmsections å€æ®µ" + +#: nlmconv.c:407 +msgid "set .nlmsections flags" +msgstr "設定 .nlmsections 旗標" + +#: nlmconv.c:435 +msgid "set .bss vma" +msgstr "設定 .bss vma" + +#: nlmconv.c:442 +msgid "set .data size" +msgstr "設定 .data 的大å°" + +#: nlmconv.c:622 +#, c-format +msgid "warning: symbol %s imported but not in import list" +msgstr "警告:導入的符號 %s ä¸åœ¨å°Žå…¥åˆ—表中" + +#: nlmconv.c:642 +msgid "set start address" +msgstr "設定起始ä½å€" + +#: nlmconv.c:691 +#, c-format +msgid "warning: START procedure %s not defined" +msgstr "警告:未定義 START å­ç¨‹åº %s" + +#: nlmconv.c:693 +#, c-format +msgid "warning: EXIT procedure %s not defined" +msgstr "警告:未定義 EXIT å­ç¨‹åº %s" + +#: nlmconv.c:695 +#, c-format +msgid "warning: CHECK procedure %s not defined" +msgstr "警告:未定義 CHECK å­ç¨‹åº %s" + +#: nlmconv.c:716 nlmconv.c:905 +msgid "custom section" +msgstr "自訂å€æ®µ" + +#: nlmconv.c:737 nlmconv.c:934 +msgid "help section" +msgstr "輔助å€æ®µ" + +#: nlmconv.c:759 nlmconv.c:952 +msgid "message section" +msgstr "訊æ¯å€æ®µ" + +#: nlmconv.c:775 nlmconv.c:985 +msgid "module section" +msgstr "模組å€æ®µ" + +#: nlmconv.c:795 nlmconv.c:1001 +msgid "rpc section" +msgstr "rpc å€æ®µ" + +#. There is no place to record this information. +#: nlmconv.c:831 +#, c-format +msgid "%s: warning: shared libraries can not have uninitialized data" +msgstr "%s:警告:共享函å¼åº«ä¸èƒ½å«æœ‰æœªåˆå§‹åŒ–的資料" + +#: nlmconv.c:852 nlmconv.c:1020 +msgid "shared section" +msgstr "共享å€æ®µ" + +#: nlmconv.c:860 +msgid "warning: No version number given" +msgstr "警告:未指定版本號" + +#: nlmconv.c:900 nlmconv.c:929 nlmconv.c:947 nlmconv.c:996 nlmconv.c:1015 +#, c-format +msgid "%s: read: %s" +msgstr "%s:讀å–:%s" + +#: nlmconv.c:922 +msgid "warning: FULLMAP is not supported; try ld -M" +msgstr "警告:ä¸æ”¯æ´ FULLMAP;請試用 ld -M" + +#: nlmconv.c:1098 +#, c-format +msgid "Usage: %s [option(s)] [in-file [out-file]]\n" +msgstr "用法:%s [é¸é …] [輸入檔案 [輸出檔案]]\n" + +#: nlmconv.c:1099 +#, c-format +msgid " Convert an object file into a NetWare Loadable Module\n" +msgstr " 將物件檔案轉æ›ç‚º NetWare å¯è¼‰å…¥æ¨¡çµ„\n" + +#: nlmconv.c:1100 +#, c-format +msgid "" +" The options are:\n" +" -I --input-target= Set the input binary file format\n" +" -O --output-target= Set the output binary file format\n" +" -T --header-file= Read for NLM header information\n" +" -l --linker= Use for any linking\n" +" -d --debug Display on stderr the linker command line\n" +" -h --help Display this information\n" +" -v --version Display the program's version\n" +msgstr "" +" é¸é …為:\n" +" -I --input-target= 設定輸入二進ä½æª”案格å¼\n" +" -O --output-target= 設定輸出二進ä½æª”案格å¼\n" +" -T --header-file= 從 中讀入 NLM 頭資訊\n" +" -l --linker= 在所有連接中使用 \n" +" -d --debug 在標準錯誤輸出中顯示連接器命令列\n" +" -h --help 顯示本資訊\n" +" -v --version 顯示程å¼çš„版本號\n" + +#: nlmconv.c:1140 +#, c-format +msgid "support not compiled in for %s" +msgstr "未將å°æ–¼ %s 的支æ´ç·¨è­¯é€²åŽ»" + +#: nlmconv.c:1177 +msgid "make section" +msgstr "製作å€æ®µ" + +#: nlmconv.c:1191 +msgid "set section size" +msgstr "設定å€æ®µå¤§å°" + +#: nlmconv.c:1197 +msgid "set section alignment" +msgstr "設定å€æ®µå°é½Š" + +#: nlmconv.c:1201 +msgid "set section flags" +msgstr "設定å€æ®µæ——標" + +#: nlmconv.c:1212 +msgid "set .nlmsections size" +msgstr "設定 .nlmsections 大å°" + +#: nlmconv.c:1293 nlmconv.c:1301 nlmconv.c:1310 nlmconv.c:1315 +msgid "set .nlmsection contents" +msgstr "設定 .nlmsection 內容" + +#: nlmconv.c:1794 +msgid "stub section sizes" +msgstr "ä½”ä½å€æ®µå¤§å°" + +#: nlmconv.c:1841 +msgid "writing stub" +msgstr "正在寫入佔ä½å€æ®µ" + +#: nlmconv.c:1925 +#, c-format +msgid "unresolved PC relative reloc against %s" +msgstr "無法解æžçš„以 %s 為準之 PC 相å°é‡å®šä½" + +#: nlmconv.c:1989 +#, c-format +msgid "overflow when adjusting relocation against %s" +msgstr "以 %s 為準å°é½Šé‡å®šä½æ™‚發生溢出" + +#: nlmconv.c:2116 +#, c-format +msgid "%s: execution of %s failed: " +msgstr "%s:執行 %s 失敗:" + +#: nlmconv.c:2131 +#, c-format +msgid "Execution of %s failed" +msgstr "執行 %s 失敗" + +#: nm.c:224 size.c:80 strings.c:651 +#, c-format +msgid "Usage: %s [option(s)] [file(s)]\n" +msgstr "用法:%s [é¸é …] [檔案]\n" + +#: nm.c:225 +#, c-format +msgid " List symbols in [file(s)] (a.out by default).\n" +msgstr "列舉 [檔案] 中的符號 (é è¨­ç‚º a.out)。\n" + +#: nm.c:226 +#, c-format +msgid "" +" The options are:\n" +" -a, --debug-syms Display debugger-only symbols\n" +" -A, --print-file-name Print name of the input file before every symbol\n" +" -B Same as --format=bsd\n" +" -C, --demangle[=STYLE] Decode low-level symbol names into user-level names\n" +" The STYLE, if specified, can be `auto' (the default),\n" +" `gnu', `lucid', `arm', `hp', `edg', `gnu-v3', `java'\n" +" or `gnat'\n" +" --no-demangle Do not demangle low-level symbol names\n" +" -D, --dynamic Display dynamic symbols instead of normal symbols\n" +" --defined-only Display only defined symbols\n" +" -e (ignored)\n" +" -f, --format=FORMAT Use the output format FORMAT. FORMAT can be `bsd',\n" +" `sysv' or `posix'. The default is `bsd'\n" +" -g, --extern-only Display only external symbols\n" +" -l, --line-numbers Use debugging information to find a filename and\n" +" line number for each symbol\n" +" -n, --numeric-sort Sort symbols numerically by address\n" +" -o Same as -A\n" +" -p, --no-sort Do not sort the symbols\n" +" -P, --portability Same as --format=posix\n" +" -r, --reverse-sort Reverse the sense of the sort\n" +" -S, --print-size Print size of defined symbols\n" +" -s, --print-armap Include index for symbols from archive members\n" +" --size-sort Sort symbols by size\n" +" --special-syms Include special symbols in the output\n" +" --synthetic Display synthetic symbols as well\n" +" -t, --radix=RADIX Use RADIX for printing symbol values\n" +" --target=BFDNAME Specify the target object format as BFDNAME\n" +" -u, --undefined-only Display only undefined symbols\n" +" -X 32_64 (ignored)\n" +" -h, --help Display this information\n" +" -V, --version Display this program's version number\n" +"\n" +msgstr "" +" é¸é …為:\n" +" -a, --debug-syms 顯示åªç”¨æ–¼é™¤éŒ¯çš„符號\n" +" -A, --print-file-name 在æ¯å€‹ç¬¦è™Ÿå‰å°å‡ºè¼¸å…¥æª”案å\n" +" -B 與 --format=bsd 相åŒ\n" +" -C, --demangle[=STYLE] 將低階符號å稱解碼為用戶階層å稱\n" +" 如果指定 STYLE,STYLE å¯èƒ½ç‚ºã€Œautoã€(é è¨­)ã€\n" +" 「gnuã€ã€ã€Œlucidã€ã€ã€Œarmã€ã€ã€Œhpã€ã€ã€Œedgã€ã€\n" +" 「gnu-v3ã€ã€ã€Œjavaã€æˆ–「gnatã€\n" +" --no-demangle ä¸è¦è§£ç¢¼ä½ŽéšŽç¬¦è™Ÿå稱\n" +" -D, --dynamic 顯示動態符號而ä¸æ˜¯æ™®é€šç¬¦è™Ÿ\n" +" --defined-only åªé¡¯ç¤ºå·²å®šç¾©çš„符號\n" +" -e (忽略)\n" +" -f, --format=FORMAT ä½¿ç”¨è¼¸å‡ºæ ¼å¼ FORMAT。FORMAT å¯èƒ½æ˜¯ã€Œbsdã€ã€\n" +" 「sysvã€æˆ–「posixã€ã€‚é è¨­ç‚ºã€Œbsdã€\n" +" -g, --extern-only åªé¡¯ç¤ºå¤–部符號\n" +" -l, --line-numbers 使用除錯資訊以便為æ¯å€‹ç¬¦è™Ÿå°‹æ‰¾æª”案å和列號\n" +" -n, --numeric-sort 按ä½å€æŽ’åºç¬¦è™Ÿ\n" +" -o 與 -A 相åŒ\n" +" -p, --no-sort ä¸è¦å°ç¬¦è™Ÿé€²è¡ŒæŽ’åº\n" +" -P, --portability 與 --format=posix 相åŒ\n" +" -r, --reverse-sort å轉排åºé †åº\n" +" -S, --print-size 列å°å®šç¾©äº†çš„符號的大å°\n" +" -s, --print-armap 列å°ä¿å­˜æª”æˆå“¡ä¸­ç¬¦è™Ÿçš„索引\n" +" --size-sort 按大å°æŽ’åºç¬¦è™Ÿ\n" +" --special-syms 在輸出中包å«ç‰¹æ®Šç¬¦è™Ÿ\n" +" --synthetic åŒæ¨£ä¹Ÿé¡¯ç¤ºåˆæˆçš„符號\n" +" -t, --radix=RADIX å°‡ RADIX 用於å°å‡ºç¬¦è™Ÿå€¼\n" +" --target=BFDNAME 將標的目標物件格å¼æŒ‡å®šç‚º BFDNAME\n" +" -u, --undefined-only åªé¡¯ç¤ºæœªå®šç¾©çš„符號\n" +" -X 32_64 (忽略)\n" +" -h, --help 顯示本資訊\n" +" -V, --version 顯示本程å¼çš„版本號碼\n" +"\n" + +#: nm.c:262 objdump.c:232 +#, c-format +msgid "Report bugs to %s.\n" +msgstr "將程å¼éŒ¯èª¤å ±å‘Šåˆ° %s。\n" + +#: nm.c:294 +#, c-format +msgid "%s: invalid radix" +msgstr "%s:無效的基數" + +#: nm.c:318 +#, c-format +msgid "%s: invalid output format" +msgstr "%s:無效的輸出格å¼" + +#: nm.c:339 readelf.c:6342 readelf.c:6378 +#, c-format +msgid ": %d" +msgstr "<特定處ç†å™¨>:%d" + +#: nm.c:341 readelf.c:6345 readelf.c:6390 +#, c-format +msgid ": %d" +msgstr "<特定作業系統>:%d" + +#: nm.c:343 readelf.c:6347 readelf.c:6393 +#, c-format +msgid ": %d" +msgstr "<未知>:%d" + +#: nm.c:380 +#, c-format +msgid "" +"\n" +"Archive index:\n" +msgstr "" +"\n" +"ä¿å­˜æª”索引:\n" + +#: nm.c:1225 +#, c-format +msgid "" +"\n" +"\n" +"Undefined symbols from %s:\n" +"\n" +msgstr "" +"\n" +"\n" +"來自 %s 的未定義符號:\n" +"\n" + +#: nm.c:1227 +#, c-format +msgid "" +"\n" +"\n" +"Symbols from %s:\n" +"\n" +msgstr "" +"\n" +"\n" +"來自 %s 的符號:\n" +"\n" + +#: nm.c:1229 nm.c:1280 +#, c-format +msgid "" +"Name Value Class Type Size Line Section\n" +"\n" +msgstr "" +"å稱 值 類別 åž‹æ…‹ å¤§å° åˆ—è™Ÿ å€æ®µ\n" +"\n" + +#: nm.c:1232 nm.c:1283 +#, c-format +msgid "" +"Name Value Class Type Size Line Section\n" +"\n" +msgstr "" +"å稱 值 類別 åž‹æ…‹ å¤§å° åˆ—è™Ÿ å€æ®µ\n" +"\n" + +#: nm.c:1276 +#, c-format +msgid "" +"\n" +"\n" +"Undefined symbols from %s[%s]:\n" +"\n" +msgstr "" +"\n" +"\n" +"來自 %s[%s] 的未定義的符號:\n" +"\n" + +#: nm.c:1278 +#, c-format +msgid "" +"\n" +"\n" +"Symbols from %s[%s]:\n" +"\n" +msgstr "" +"\n" +"\n" +"來自 %s[%s] 的符號:\n" +"\n" + +#: nm.c:1580 +msgid "Only -X 32_64 is supported" +msgstr "åªæ”¯æ´ -X 32_64" + +#: nm.c:1600 +msgid "Using the --size-sort and --undefined-only options together" +msgstr "åŒæ™‚使用 --size-sort 與 --undefined-only é¸é …" + +#: nm.c:1601 +msgid "will produce no output, since undefined symbols have no size." +msgstr "由於未定義的符號ä¸å…·å¤§å°ï¼Œå°‡ä¸æœƒç”¢ç”Ÿè¼¸å‡º" + +#: nm.c:1629 +#, c-format +msgid "data size %ld" +msgstr "è³‡æ–™å¤§å° %ld" + +#: objcopy.c:396 srconv.c:1721 +#, c-format +msgid "Usage: %s [option(s)] in-file [out-file]\n" +msgstr "用法:%s [é¸é …] 輸入檔案 [輸出檔案]\n" + +#: objcopy.c:397 +#, c-format +msgid " Copies a binary file, possibly transforming it in the process\n" +msgstr " 複製二進ä½æª”案,它å¯èƒ½åœ¨æ­¤éŽç¨‹ä¸­é€²è¡Œè®Šæ›\n" + +#: objcopy.c:398 objcopy.c:487 +#, c-format +msgid " The options are:\n" +msgstr " é¸é …為:\n" + +#: objcopy.c:399 +#, c-format +msgid "" +" -I --input-target Assume input file is in format \n" +" -O --output-target Create an output file in format \n" +" -B --binary-architecture Set arch of output file, when input is binary\n" +" -F --target Set both input and output format to \n" +" --debugging Convert debugging information, if possible\n" +" -p --preserve-dates Copy modified/access timestamps to the output\n" +" -j --only-section Only copy section into the output\n" +" --add-gnu-debuglink= Add section .gnu_debuglink linking to \n" +" -R --remove-section Remove section from the output\n" +" -S --strip-all Remove all symbol and relocation information\n" +" -g --strip-debug Remove all debugging symbols & sections\n" +" --strip-unneeded Remove all symbols not needed by relocations\n" +" -N --strip-symbol Do not copy symbol \n" +" --strip-unneeded-symbol \n" +" Do not copy symbol unless needed by\n" +" relocations\n" +" --only-keep-debug Strip everything but the debug information\n" +" -K --keep-symbol Only copy symbol \n" +" -L --localize-symbol Force symbol to be marked as a local\n" +" -G --keep-global-symbol Localize all symbols except \n" +" -W --weaken-symbol Force symbol to be marked as a weak\n" +" --weaken Force all global symbols to be marked as weak\n" +" -w --wildcard Permit wildcard in symbol comparison\n" +" -x --discard-all Remove all non-global symbols\n" +" -X --discard-locals Remove any compiler-generated symbols\n" +" -i --interleave Only copy one out of every bytes\n" +" -b --byte Select byte in every interleaved block\n" +" --gap-fill Fill gaps between sections with \n" +" --pad-to Pad the last section up to address \n" +" --set-start Set the start address to \n" +" {--change-start|--adjust-start} \n" +" Add to the start address\n" +" {--change-addresses|--adjust-vma} \n" +" Add to LMA, VMA and start addresses\n" +" {--change-section-address|--adjust-section-vma} {=|+|-}\n" +" Change LMA and VMA of section by \n" +" --change-section-lma {=|+|-}\n" +" Change the LMA of section by \n" +" --change-section-vma {=|+|-}\n" +" Change the VMA of section by \n" +" {--[no-]change-warnings|--[no-]adjust-warnings}\n" +" Warn if a named section does not exist\n" +" --set-section-flags =\n" +" Set section 's properties to \n" +" --add-section = Add section found in to output\n" +" --rename-section =[,] Rename section to \n" +" --change-leading-char Force output format's leading character style\n" +" --remove-leading-char Remove leading character from global symbols\n" +" --redefine-sym = Redefine symbol name to \n" +" --redefine-syms --redefine-sym for all symbol pairs \n" +" listed in \n" +" --srec-len Restrict the length of generated Srecords\n" +" --srec-forceS3 Restrict the type of generated Srecords to S3\n" +" --strip-symbols -N for all symbols listed in \n" +" --strip-unneeded-symbols \n" +" --strip-unneeded-symbol for all symbols listed\n" +" in \n" +" --keep-symbols -K for all symbols listed in \n" +" --localize-symbols -L for all symbols listed in \n" +" --keep-global-symbols -G for all symbols listed in \n" +" --weaken-symbols -W for all symbols listed in \n" +" --alt-machine-code Use alternate machine code for output\n" +" --writable-text Mark the output text as writable\n" +" --readonly-text Make the output text write protected\n" +" --pure Mark the output file as demand paged\n" +" --impure Mark the output file as impure\n" +" --prefix-symbols Add to start of every symbol name\n" +" --prefix-sections Add to start of every section name\n" +" --prefix-alloc-sections \n" +" Add to start of every allocatable\n" +" section name\n" +" -v --verbose List all object files modified\n" +" -V --version Display this program's version number\n" +" -h --help Display this output\n" +" --info List object formats & architectures supported\n" +msgstr "" +" -I --input-target å‡å®šè¼¸å…¥æª”案的格å¼ç‚º \n" +" -O --output-target 建立格å¼ç‚º 的輸出檔案\n" +" -B --binary-architecture 當輸入檔案為二進ä½æª”案時,設定輸出檔案的系統架構\n" +" -F --target 將輸入輸出格å¼è¨­å®šç‚º \n" +" --debugging 如果å¯èƒ½ï¼Œè½‰æ›é™¤éŒ¯è³‡è¨Š\n" +" -p --preserve-dates 將修改/å­˜å–時間戳記複製到輸出檔案\n" +" -j --only-section åªå°‡ å€æ®µè¤‡è£½åˆ°è¼¸å‡ºæª”案中\n" +" --add-gnu-debuglink= 添加å€æ®µ .gnu_debuglink 的連çµåˆ° \n" +" -R --remove-section 從輸出中刪除 å€æ®µ\n" +" -S --strip-all 除去所有符號和é‡å®šä½è³‡è¨Š\n" +" -g --strip-debug 除去所有除錯符號\n" +" --strip-unneeded 除去所有é‡å®šä½ä¸éœ€è¦çš„符號\n" +" -N --strip-symbol ä¸è¦è¤‡è£½ç¬¦è™Ÿ \n" +" --strip-unneeded-symbol \n" +" ä¸è¦è¤‡è£½ç¬¦è™Ÿ 除éžé‡å®šä½æ™‚需è¦\n" +" --only-keep-debug 除去除錯相關以外的所有資訊\n" +" -K --keep-symbol åªè¤‡è£½ç¬¦è™Ÿ \n" +" -L --localize-symbol 將符號 強制標識為本地符號\n" +" -G --keep-global-symbol 將除了 以外的所有符號標識為本地\n" +" -W --weaken-symbol 將符號 強制標識為弱符號\n" +" --weaken 將所有全域符號標識為弱符號\n" +" -x --discard-all 刪除所有éžå…¨åŸŸç¬¦è™Ÿ\n" +" -X --discard-locals 刪除所有編譯器產生的符號\n" +" -i --interleave åªåœ¨æ¯ 個ä½å…ƒçµ„中複製一個\n" +" -b --byte 在æ¯å€‹æ’å…¥å€å¡Šä¸­é¸æ“‡ä½å…ƒçµ„ \n" +" --gap-fill 在å€æ®µç©ºéš™ä¸­ä»¥ å¡«å……\n" +" --pad-to 補充最後一å€æ®µç›´åˆ°ä½å€ \n" +" --set-start 將起始ä½å€è¨­ç½®ç‚º \n" +" {--change-start|--adjust-start} \n" +" å°‡ 增加到起始ä½å€\n" +" {--change-addresses|--adjust-vma} \n" +" å°‡ 增加到 LMAã€VMA 和起始ä½å€\n" +" {--change-section-address|--adjust-section-vma} {=|+|-}\n" +" 以 修改 å€æ®µçš„ LMA å’Œ VMA\n" +" --change-section-lma {=|+|-}\n" +" 以 修改 å€æ®µçš„ LMA\n" +" --change-section-vma {=|+|-}\n" +" 以 修改 å€æ®µçš„ VMA\n" +" {--[no-]change-warnings|--[no-]adjust-warnings}\n" +" 如果命åå€æ®µä¸å­˜åœ¨å°±ç”¢ç”Ÿè­¦å‘Š\n" +" --set-section-flags =\n" +" å°‡ å€æ®µçš„屬性設置為 \n" +" --add-section = å°‡ 中的 å€æ®µæ·»åŠ åˆ°è¼¸å‡ºä¸­\n" +" --rename-section =[,] å°‡å€æ®µç”± 改å為 \n" +" --change-leading-char 強行設定輸出格å¼çš„å‰å°Žå­—元風格\n" +" --remove-leading-char 刪除全域符號的å‰å°Žå­—å…ƒ\n" +" --redefine-sym = 將符號由 改å為 \n" +" --redefine-syms å°æ‰€æœ‰åˆ—æ–¼ 中的符號執行 --redefine-sym\n" +" --srec-len é™åˆ¶æ‰€ç”¢ç”Ÿ Srecords 的長度\n" +" --srec-forceS3 將所產生 Srecords çš„é¡žåž‹é™åˆ¶ç‚º S3\n" +" --strip-symbols å°åˆ—舉在 中的所有符號執行 -N\n" +" --strip-unneeded-symbols \n" +" å°æ‰€æœ‰åˆ—æ–¼ 中的符號執行 --strip-unneeded-symbol\n" +" --keep-symbols å°åˆ—舉在 中的所有符號執行 -K\n" +" --localize-symbols å°åˆ—舉在 中的所有符號執行 -L\n" +" --keep-global-symbols å°åˆ—舉在 中的所有符號執行 -G\n" +" --weaken-symbols å°åˆ—舉在 中的所有符號執行 -W\n" +" --alt-machine-code 輸出使用替代的機器碼\n" +" --writable-text 將輸出文字標記為å¯å¯«\n" +" --readonly-text 將輸出文字標記為防寫\n" +" --pure 將輸出檔案標記為需è¦åˆ†é \n" +" --impure 將輸出檔案標記為混雜的\n" +" --prefix-symbols 添加 至æ¯å€‹ç¬¦è™Ÿå稱的å‰ç«¯\n" +" --prefix-sections 添加 至æ¯å€‹å€æ®µå稱的å‰ç«¯\n" +" --prefix-alloc-sections \n" +" 添加 至æ¯å€‹å®šä½è¡¨å€æ®µå稱的å‰ç«¯\n" +" -v --verbose 列出所有修改的目標檔案\n" +" -V --version 顯示本程åºçš„版本號碼\n" +" -h --help 顯示本輸出\n" +" --info 列出支æ´çš„ç‰©ä»¶æ ¼å¼ & 系統架構\n" + +#: objcopy.c:485 +#, c-format +msgid "Usage: %s in-file(s)\n" +msgstr "用法:%s <é¸é …> 輸入檔案\n" + +#: objcopy.c:486 +#, c-format +msgid " Removes symbols and sections from files\n" +msgstr "從檔案中刪除符號和å€æ®µ\n" + +#: objcopy.c:488 +#, c-format +msgid "" +" -I --input-target= Assume input file is in format \n" +" -O --output-target= Create an output file in format \n" +" -F --target= Set both input and output format to \n" +" -p --preserve-dates Copy modified/access timestamps to the output\n" +" -R --remove-section= Remove section from the output\n" +" -s --strip-all Remove all symbol and relocation information\n" +" -g -S -d --strip-debug Remove all debugging symbols & sections\n" +" --strip-unneeded Remove all symbols not needed by relocations\n" +" --only-keep-debug Strip everything but the debug information\n" +" -N --strip-symbol= Do not copy symbol \n" +" -K --keep-symbol= Only copy symbol \n" +" -w --wildcard Permit wildcard in symbol comparison\n" +" -x --discard-all Remove all non-global symbols\n" +" -X --discard-locals Remove any compiler-generated symbols\n" +" -v --verbose List all object files modified\n" +" -V --version Display this program's version number\n" +" -h --help Display this output\n" +" --info List object formats & architectures supported\n" +" -o Place stripped output into \n" +msgstr "" +" -I --input-target= å‡å®šè¼¸å…¥æª”案的格å¼ç‚º \n" +" -O --output-target= 建立格å¼ç‚º 的輸出檔案\n" +" -F --target= 將輸入和輸出的格å¼è¨­å®šç‚º \n" +" -p --preserve-dates å°‡ 修改/å­˜å– æ™‚é–“æˆ³è¤‡è£½åˆ°è¼¸å‡ºæª”æ¡ˆ\n" +" -R --remove-section= 從輸出中刪除 å€æ®µ\n" +" -s --strip-all 除去所有符號和é‡å®šä½è³‡è¨Š\n" +" -g -S -d --strip-debug 除去所有除錯符號\n" +" --strip-unneeded 除去所有é‡å®šä½ä¸éœ€è¦çš„符號\n" +" --only-keep-debug 除去除錯以外的所有資訊\n" +" -N --strip-symbol= ä¸è¦è¤‡è£½ç¬¦è™Ÿ \n" +" -K --keep-symbol= åªè¤‡è£½ç¬¦è™Ÿ \n" +" -w --wildcard 符號比較時容許è¬ç”¨å­—å…ƒ\n" +" -x --discard-all 刪除所有éžå…¨åŸŸç¬¦è™Ÿ\n" +" -X --discard-locals 刪除所有編譯器產生的符號\n" +" -v --verbose 列出所有修改éŽçš„目標檔案\n" +" -V --version 顯示本程åºçš„版本號碼\n" +" -h --help 顯示本輸出\n" +" --info 列出支æ´çš„ç‰©ä»¶æ ¼å¼ & 系統架構\n" +" -o å°‡ strip éŽçš„輸出置於 \n" + +#: objcopy.c:560 +#, c-format +msgid "unrecognized section flag `%s'" +msgstr "ä¸èƒ½è­˜åˆ¥çš„å€æ®µæ——標「%sã€" + +#: objcopy.c:561 +#, c-format +msgid "supported flags: %s" +msgstr "支æ´çš„旗標:%s" + +#: objcopy.c:638 +#, c-format +msgid "cannot open '%s': %s" +msgstr "無法開啟:%s:%s" + +#: objcopy.c:641 objcopy.c:2629 +#, c-format +msgid "%s: fread failed" +msgstr "%s:fread 失敗" + +#: objcopy.c:714 +#, c-format +msgid "%s:%d: Ignoring rubbish found on this line" +msgstr "%s:%d: 忽略本列所å«ç„¡ç”¨è³‡æ–™" + +#: objcopy.c:976 +#, c-format +msgid "%s: Multiple redefinition of symbol \"%s\"" +msgstr "%s:多次é‡è¤‡å®šç¾©ç¬¦è™Ÿã€Œ%sã€" + +#: objcopy.c:980 +#, c-format +msgid "%s: Symbol \"%s\" is target of more than one redefinition" +msgstr "%s:符號「%sã€æ˜¯å¤šæ¬¡é‡è¤‡å®šç¾©çš„標的" + +#: objcopy.c:1008 +#, c-format +msgid "couldn't open symbol redefinition file %s (error: %s)" +msgstr "無法開啟符號é‡å®šç¾©æª” %s (錯誤: %s)" + +#: objcopy.c:1086 +#, c-format +msgid "%s:%d: garbage found at end of line" +msgstr "%s:%d: 列尾出ç¾ç„¡ç”¨å­—å…ƒ" + +#: objcopy.c:1089 +#, c-format +msgid "%s:%d: missing new symbol name" +msgstr "%s:%d: 缺少新的符號å稱" + +#: objcopy.c:1099 +#, c-format +msgid "%s:%d: premature end of file" +msgstr "%s:%d: 檔案末尾ä¸å®Œæ•´" + +#: objcopy.c:1124 +msgid "Unable to change endianness of input file(s)" +msgstr "無法改變輸入檔案的çµå°¾æ ¼å¼" + +#: objcopy.c:1133 +#, c-format +msgid "copy from %s(%s) to %s(%s)\n" +msgstr "從 %s(%s) 複製到 %s(%s)\n" + +#: objcopy.c:1170 +#, c-format +msgid "Unable to recognise the format of the input file %s" +msgstr "無法確èªè¼¸å…¥æª”案 %s çš„æ ¼å¼" + +#: objcopy.c:1174 +#, c-format +msgid "Warning: Output file cannot represent architecture %s" +msgstr "警告:輸出檔案無法代表系統架構 %s" + +#: objcopy.c:1211 +#, c-format +msgid "can't create section `%s': %s" +msgstr "無法建立å€æ®µã€Œ%sã€ï¼š%s" + +#: objcopy.c:1277 +msgid "there are no sections to be copied!" +msgstr "沒有å¯ä¾›è¤‡è£½çš„å€æ®µï¼" + +#: objcopy.c:1323 +#, c-format +msgid "Can't fill gap after %s: %s" +msgstr "無法填充 %s 之後的間隙:%s" + +#: objcopy.c:1348 +#, c-format +msgid "Can't add padding to %s: %s" +msgstr "無法添加 %s æ—邊的空隙:%s" + +#: objcopy.c:1514 +#, c-format +msgid "%s: error copying private BFD data: %s" +msgstr "%s:複製 BFD ç§æœ‰è³‡æ–™å‡ºéŒ¯ï¼š%s" + +#: objcopy.c:1525 +msgid "unknown alternate machine code, ignored" +msgstr "ä¸æ˜Žçš„é¡å¤–機器碼,將它忽略" + +#: objcopy.c:1555 objcopy.c:1585 +#, c-format +msgid "cannot mkdir %s for archive copying (error: %s)" +msgstr "無法為ä¿å­˜æª”複製建立目錄 %s (錯誤:%s)" + +#: objcopy.c:1790 +#, c-format +msgid "Multiple renames of section %s" +msgstr "多次將å€æ®µ %s 改å" + +#: objcopy.c:1841 +msgid "private header data" +msgstr "ç§æœ‰æ¨™é ­è³‡æ–™" + +#: objcopy.c:1849 +#, c-format +msgid "%s: error in %s: %s" +msgstr "%s:å€æ®µ %s 中出錯:%s" + +#: objcopy.c:1903 +msgid "making" +msgstr "製作中" + +#: objcopy.c:1912 +msgid "size" +msgstr "大å°" + +#: objcopy.c:1926 +msgid "vma" +msgstr "vma" + +#: objcopy.c:1951 +msgid "alignment" +msgstr "å°é½Š" + +#: objcopy.c:1966 +msgid "flags" +msgstr "旗標" + +#: objcopy.c:1988 +msgid "private data" +msgstr "ç§æœ‰è³‡æ–™" + +#: objcopy.c:1996 +#, c-format +msgid "%s: section `%s': error in %s: %s" +msgstr "%s:å€æ®µã€Œ%sã€ï¼š%s 中出錯:%s" + +#: objcopy.c:2274 +#, c-format +msgid "%s: can't create debugging section: %s" +msgstr "%s:無法建立除錯å€æ®µï¼š%s" + +#: objcopy.c:2288 +#, c-format +msgid "%s: can't set debugging section contents: %s" +msgstr "%s:無法設定除錯å€æ®µå…§å®¹ï¼š%s" + +#: objcopy.c:2297 +#, c-format +msgid "%s: don't know how to write debugging information for %s" +msgstr "%s:ä¸çŸ¥é“如何為 %s 寫入除錯資訊" + +#: objcopy.c:2472 +msgid "byte number must be non-negative" +msgstr "ä½å…ƒçµ„編號必須是éžè² æ•¸" + +#: objcopy.c:2482 +msgid "interleave must be positive" +msgstr "間斷值必須是正數。" + +#: objcopy.c:2502 objcopy.c:2510 +#, c-format +msgid "%s both copied and removed" +msgstr "å³è¦è¤‡è£½ %s åˆè¦åˆªé™¤å®ƒ" + +#: objcopy.c:2603 objcopy.c:2674 objcopy.c:2774 objcopy.c:2805 objcopy.c:2829 +#: objcopy.c:2833 objcopy.c:2853 +#, c-format +msgid "bad format for %s" +msgstr "%s æ ¼å¼éŒ¯èª¤" + +#: objcopy.c:2624 +#, c-format +msgid "cannot open: %s: %s" +msgstr "無法開啟:%s:%s" + +#: objcopy.c:2743 +#, c-format +msgid "Warning: truncating gap-fill from 0x%s to 0x%x" +msgstr "警告:將間隙填充由 0x%s 截短到 0x%x" + +#: objcopy.c:2903 +msgid "alternate machine code index must be positive" +msgstr "é¡å¤–機器碼索引值必須是正數。" + +#: objcopy.c:2961 +msgid "byte number must be less than interleave" +msgstr "ä½å…ƒçµ„編號必須å°æ–¼é–“斷值" + +#: objcopy.c:2991 +#, c-format +msgid "architecture %s unknown" +msgstr "未知的系統架構 %s" + +#: objcopy.c:2995 +msgid "Warning: input target 'binary' required for binary architecture parameter." +msgstr "警告:二進ä½çš„系統架構åƒæ•¸éœ€è¦è¼¸å…¥ç›®æ¨™ 'binary'" + +#: objcopy.c:2996 +#, c-format +msgid " Argument %s ignored" +msgstr " 忽略引數 %s" + +#: objcopy.c:3002 +#, c-format +msgid "warning: could not locate '%s'. System error message: %s" +msgstr "警告:無法找到 '%s' çš„ä½ç½®ã€‚系統錯誤訊æ¯ç‚ºï¼š%s" + +#: objcopy.c:3042 objcopy.c:3056 +#, c-format +msgid "%s %s%c0x%s never used" +msgstr "%s %s%c0x%s 完全沒用éŽ" + +#: objdump.c:176 +#, c-format +msgid "Usage: %s \n" +msgstr "用法:%s <é¸é …> <檔案>\n" + +#: objdump.c:177 +#, c-format +msgid " Display information from object .\n" +msgstr " 顯示來自目標 <檔案> 的資訊。\n" + +#: objdump.c:178 +#, c-format +msgid " At least one of the following switches must be given:\n" +msgstr " 至少必須指定以下é¸é …之一:\n" + +#: objdump.c:179 +#, c-format +msgid "" +" -a, --archive-headers Display archive header information\n" +" -f, --file-headers Display the contents of the overall file header\n" +" -p, --private-headers Display object format specific file header contents\n" +" -h, --[section-]headers Display the contents of the section headers\n" +" -x, --all-headers Display the contents of all headers\n" +" -d, --disassemble Display assembler contents of executable sections\n" +" -D, --disassemble-all Display assembler contents of all sections\n" +" -S, --source Intermix source code with disassembly\n" +" -s, --full-contents Display the full contents of all sections requested\n" +" -g, --debugging Display debug information in object file\n" +" -e, --debugging-tags Display debug information using ctags style\n" +" -G, --stabs Display (in raw form) any STABS info in the file\n" +" -t, --syms Display the contents of the symbol table(s)\n" +" -T, --dynamic-syms Display the contents of the dynamic symbol table\n" +" -r, --reloc Display the relocation entries in the file\n" +" -R, --dynamic-reloc Display the dynamic relocation entries in the file\n" +" -v, --version Display this program's version number\n" +" -i, --info List object formats and architectures supported\n" +" -H, --help Display this information\n" +msgstr "" +" -a, --archive-headers 顯示ä¿å­˜æª”頭資訊\n" +" -f, --file-headers 顯示整體檔案頭的內容\n" +" -p, --private-headers 顯示目標格å¼ç‰¹æœ‰çš„檔案頭內容\n" +" -h, --[section-]headers 顯示å€æ®µé ­çš„內容\n" +" -x, --all-headers 顯示所有標頭的內容\n" +" -d, --disassemble 顯示å¯åŸ·è¡Œå€æ®µçš„組譯內容\n" +" -D, --disassemble-all 顯示所有å€æ®µçš„組譯內容\n" +" -S, --source 將原始碼和å組譯混åˆèµ·ä¾†\n" +" -s, --full-contents 顯示所有請求å€æ®µçš„完整內容\n" +" -g, --debugging 顯示目標檔案的除錯資訊\n" +" -e, --debugging-tags 顯示使用 ctags 風格的除錯資訊\n" +" -G, --stabs 以原始形å¼é¡¯ç¤ºæª”案中所有的 STABS 資訊\n" +" -t, --syms 顯示符號表的內容\n" +" -T, --dynamic-syms 顯示動態符號表的內容\n" +" -r, --reloc 顯示檔案中的é‡å®šä½æ¢ç›®\n" +" -R, --dynamic-reloc 顯示檔案中的動態é‡å®šä½æ¢ç›®\n" +" -v, --version 顯示本程å¼çš„版本號碼\n" +" -i, --info 列舉支æ´çš„目標格å¼å’Œç³»çµ±æž¶æ§‹\n" +" -H, --help 顯示本資訊\n" + +#: objdump.c:202 +#, c-format +msgid "" +"\n" +" The following switches are optional:\n" +msgstr "" +"\n" +" 以下é¸é …是å¯é¸çš„:\n" + +#: objdump.c:203 +#, c-format +msgid "" +" -b, --target=BFDNAME Specify the target object format as BFDNAME\n" +" -m, --architecture=MACHINE Specify the target architecture as MACHINE\n" +" -j, --section=NAME Only display information for section NAME\n" +" -M, --disassembler-options=OPT Pass text OPT on to the disassembler\n" +" -EB --endian=big Assume big endian format when disassembling\n" +" -EL --endian=little Assume little endian format when disassembling\n" +" --file-start-context Include context from start of file (with -S)\n" +" -I, --include=DIR Add DIR to search list for source files\n" +" -l, --line-numbers Include line numbers and filenames in output\n" +" -C, --demangle[=STYLE] Decode mangled/processed symbol names\n" +" The STYLE, if specified, can be `auto', `gnu',\n" +" `lucid', `arm', `hp', `edg', `gnu-v3', `java'\n" +" or `gnat'\n" +" -w, --wide Format output for more than 80 columns\n" +" -z, --disassemble-zeroes Do not skip blocks of zeroes when disassembling\n" +" --start-address=ADDR Only process data whose address is >= ADDR\n" +" --stop-address=ADDR Only process data whose address is <= ADDR\n" +" --prefix-addresses Print complete address alongside disassembly\n" +" --[no-]show-raw-insn Display hex alongside symbolic disassembly\n" +" --adjust-vma=OFFSET Add OFFSET to all displayed section addresses\n" +" --special-syms Include special symbols in symbol dumps\n" +"\n" +msgstr "" +" -b, --target=BFDNAME 將目標物件檔案格å¼æŒ‡å®šç‚º BFDNAME\n" +" -m, --architecture=MACHINE 將目標系統架構指定為 MACHINE\n" +" -j, --section=NAME åªé¡¯ç¤º NAME å€æ®µçš„資訊\n" +" -M, --disassembler-options=OPT 將文字傳éžåˆ° OPT å組譯程åº\n" +" -EB --endian=big å組譯時å‡å®šé«˜ä½ä½å…ƒçµ„在å‰\n" +" -EL --endian=little å組譯時å‡å®šä½Žä½ä½å…ƒçµ„在å‰\n" +" --file-start-context 從檔案的起點引入上下文 (帶有 -S)\n" +" -I, --include=DIR å°‡ DIR 加入æœå°‹åŽŸå§‹ç¢¼æª”案的列表\n" +" -l, --line-numbers 在輸出中指定列號和檔案å\n" +" -C, --demangle[=STYLE] å°æ–¼å·²æ壞/處ç†éŽçš„符號å稱進行解碼\n" +" 如果指定了 STYLE,STYLE å¯èƒ½ç‚ºã€Œautoã€ã€ã€Œgnuã€ã€\n" +" 「lucidã€ã€ã€Œarmã€ã€ã€Œhpã€ã€ã€Œedgã€ã€ã€Œgnu-v3ã€ã€ã€Œjavaã€æˆ–「gnatã€\n" +" -w, --wide 以多於 80 行的寬度å°è¼¸å‡ºé€²è¡Œæ ¼å¼åŒ–\n" +" -z, --disassemble-zeroes å組譯時ä¸è¦è·³éŽç‚ºé›¶çš„å€å¡Š\n" +" --start-address=ADDR åªæœ‰è¡Œç¨‹è³‡æ–™çš„ä½å€ >= ADDR\n" +" --stop-address=ADDR åªæœ‰è¡Œç¨‹è³‡æ–™çš„ä½å€ <= ADDR\n" +" --prefix-addresses åŒå組譯代碼並列顯示完整的ä½å€\n" +" --[no-]show-raw-insn åŒç¬¦è™Ÿå組譯並列顯示å六進ä½å€¼\n" +" --adjust-vma=OFFSET 為所有顯示的å€æ®µä½å€å¢žåŠ  OFFSET\n" +" --special-syms 在符號傾å°ä¸­åŒ…å«ç‰¹æ®Šç¬¦è™Ÿ\n" +"\n" + +#: objdump.c:378 +#, c-format +msgid "Sections:\n" +msgstr "å€æ®µï¼š\n" + +#: objdump.c:381 objdump.c:385 +#, c-format +msgid "Idx Name Size VMA LMA File off Algn" +msgstr "索引å稱 å¤§å° VMA LMA 檔案關閉 å°é½Š" + +#: objdump.c:387 +#, c-format +msgid "Idx Name Size VMA LMA File off Algn" +msgstr "索引å稱 å¤§å° VMA LMA 檔案關閉 å°é½Š" + +#: objdump.c:391 +#, c-format +msgid " Flags" +msgstr " 旗標" + +#: objdump.c:393 +#, c-format +msgid " Pg" +msgstr " é " + +#: objdump.c:436 +#, c-format +msgid "%s: not a dynamic object" +msgstr "%s:ä¸æ˜¯å‹•æ…‹ç‰©ä»¶" + +#: objdump.c:1722 +#, c-format +msgid "Disassembly of section %s:\n" +msgstr "å組譯 %s å€æ®µï¼š\n" + +#: objdump.c:1884 +#, c-format +msgid "Can't use supplied machine %s" +msgstr "無法使用支æ´çš„機器 %s" + +#: objdump.c:1903 +#, c-format +msgid "Can't disassemble for architecture %s\n" +msgstr "無法å組譯系統架構 %s\n" + +#: objdump.c:1973 +#, c-format +msgid "" +"No %s section present\n" +"\n" +msgstr "" +"%s å€æ®µä¸å­˜åœ¨\n" +"\n" + +#: objdump.c:1982 +#, c-format +msgid "Reading %s section of %s failed: %s" +msgstr "讀入 %2$s çš„ %1$s å€æ®µå¤±æ•—:%3$s" + +#: objdump.c:2026 +#, c-format +msgid "" +"Contents of %s section:\n" +"\n" +msgstr "" +"%s å€æ®µçš„內容:\n" +"\n" + +#: objdump.c:2153 +#, c-format +msgid "architecture: %s, " +msgstr "系統架構:%s," + +#: objdump.c:2156 +#, c-format +msgid "flags 0x%08x:\n" +msgstr "旗標 0x%08x:\n" + +#: objdump.c:2170 +#, c-format +msgid "" +"\n" +"start address 0x" +msgstr "" +"\n" +"起始ä½å€ 0x" + +#: objdump.c:2210 +#, c-format +msgid "Contents of section %s:\n" +msgstr "%s å€æ®µçš„內容:\n" + +#: objdump.c:2335 +#, c-format +msgid "no symbols\n" +msgstr "無符號\n" + +#: objdump.c:2342 +#, c-format +msgid "no information for symbol number %ld\n" +msgstr "沒有關於符號號碼 %ld 的資訊\n" + +#: objdump.c:2345 +#, c-format +msgid "could not determine the type of symbol number %ld\n" +msgstr "無法確定符號號碼「%ldã€çš„é¡žåž‹\n" + +#: objdump.c:2611 +#, c-format +msgid "" +"\n" +"%s: file format %s\n" +msgstr "" +"\n" +"%s: æª”æ¡ˆæ ¼å¼ %s\n" + +#: objdump.c:2662 +#, c-format +msgid "%s: printing debugging information failed" +msgstr "%s:列å°é™¤éŒ¯è³‡è¨Šå¤±æ•—" + +#: objdump.c:2753 +#, c-format +msgid "In archive %s:\n" +msgstr "在ä¿å­˜æª” %s 中:\n" + +#: objdump.c:2873 +msgid "unrecognized -E option" +msgstr "無法識別的 -E é¸é …" + +#: objdump.c:2884 +#, c-format +msgid "unrecognized --endian type `%s'" +msgstr "無法識別的 --endian 類型「%sã€" + +#: rdcoff.c:196 +#, c-format +msgid "parse_coff_type: Bad type code 0x%x" +msgstr "parse_coff_type:ä¸è‰¯çš„類型碼 0x%x" + +#: rdcoff.c:404 rdcoff.c:509 rdcoff.c:697 +#, c-format +msgid "bfd_coff_get_syment failed: %s" +msgstr "bfd_coff_get_syment 失敗:%s" + +#: rdcoff.c:420 rdcoff.c:717 +#, c-format +msgid "bfd_coff_get_auxent failed: %s" +msgstr "bfd_coff_get_auxent 失敗:%s" + +#: rdcoff.c:784 +#, c-format +msgid "%ld: .bf without preceding function" +msgstr "%ld: .bf 未å«å‰å°Žå‡½æ•¸" + +#: rdcoff.c:834 +#, c-format +msgid "%ld: unexpected .ef\n" +msgstr "%ld:æ„外的 .ef\n" + +#: rddbg.c:85 +#, c-format +msgid "%s: no recognized debugging information" +msgstr "%s:未識別的除錯資訊" + +#: rddbg.c:394 +#, c-format +msgid "Last stabs entries before error:\n" +msgstr "錯誤發生å‰æœ€å¾Œçš„ stabs 進入點:\n" + +#: readelf.c:272 +#, c-format +msgid "%s: Error: " +msgstr "%s:錯誤:" + +#: readelf.c:283 +#, c-format +msgid "%s: Warning: " +msgstr "%s:警告:" + +#: readelf.c:298 +#, c-format +msgid "Unable to seek to 0x%x for %s\n" +msgstr "無法定ä½åˆ° %2$s çš„ 0x%1$x\n" + +#: readelf.c:310 +#, c-format +msgid "Out of memory allocating 0x%x bytes for %s\n" +msgstr "åˆ†é… 0x%x ä½å…ƒçµ„給 %s 時產生記憶體ä¸è¶³\n" + +#: readelf.c:318 +#, c-format +msgid "Unable to read in 0x%x bytes of %s\n" +msgstr "無法讀入 %2$s çš„ 0x%1$x ä½å…ƒçµ„\n" + +#: readelf.c:364 readelf.c:412 readelf.c:615 readelf.c:647 +#, c-format +msgid "Unhandled data length: %d\n" +msgstr "未處ç†çš„資料長度:%d\n" + +#: readelf.c:752 +msgid "Don't know about relocations on this machine architecture\n" +msgstr "ä¸çŸ¥é“關於本機器系統架構中é‡å®šä½çš„情æ³\n" + +#: readelf.c:772 readelf.c:799 readelf.c:842 readelf.c:869 +msgid "relocs" +msgstr "é‡å®šä½" + +#: readelf.c:782 readelf.c:809 readelf.c:852 readelf.c:879 +msgid "out of memory parsing relocs" +msgstr "解æžé‡å®šä½æ™‚記憶體ä¸è¶³" + +#: readelf.c:933 +#, c-format +msgid " Offset Info Type Sym. Value Symbol's Name + Addend\n" +msgstr " åç§»é‡ è³‡è¨Š é¡žåž‹ 符號值 符號å稱 + 加數\n" + +#: readelf.c:935 +#, c-format +msgid " Offset Info Type Sym.Value Sym. Name + Addend\n" +msgstr " åç§»é‡ è³‡è¨Š é¡žåž‹ 符號值 符號å稱 + 加數\n" + +#: readelf.c:940 +#, c-format +msgid " Offset Info Type Sym. Value Symbol's Name\n" +msgstr " åç§»é‡ è³‡è¨Š é¡žåž‹ 符號值 符號å稱\n" + +#: readelf.c:942 +#, c-format +msgid " Offset Info Type Sym.Value Sym. Name\n" +msgstr " åç§»é‡ è³‡è¨Š é¡žåž‹ 符號值 符號å稱\n" + +#: readelf.c:950 +#, c-format +msgid " Offset Info Type Symbol's Value Symbol's Name + Addend\n" +msgstr " åç§»é‡ è³‡è¨Š é¡žåž‹ 符號值 符號å稱 + 加數\n" + +#: readelf.c:952 +#, c-format +msgid " Offset Info Type Sym. Value Sym. Name + Addend\n" +msgstr " åç§»é‡ è³‡è¨Š é¡žåž‹ 符號值 符號å稱 + 加數\n" + +#: readelf.c:957 +#, c-format +msgid " Offset Info Type Symbol's Value Symbol's Name\n" +msgstr " åç§»é‡ è³‡è¨Š é¡žåž‹ 符號值 符號å稱\n" + +#: readelf.c:959 +#, c-format +msgid " Offset Info Type Sym. Value Sym. Name\n" +msgstr " åç§»é‡ è³‡è¨Š é¡žåž‹ 符號值 符號å稱\n" + +#: readelf.c:1239 readelf.c:1241 readelf.c:1324 readelf.c:1326 readelf.c:1335 +#: readelf.c:1337 +#, c-format +msgid "unrecognized: %-7lx" +msgstr "ä¸èƒ½è­˜åˆ¥çš„:%-7lx" + +#: readelf.c:1295 +#, c-format +msgid "" +msgstr "<字串表索引:%3ld>" + +#: readelf.c:1297 +#, c-format +msgid "" +msgstr "<毀æ字串表索引:%3ld>" + +#: readelf.c:1569 +#, c-format +msgid "Processor Specific: %lx" +msgstr "特定處ç†å™¨ï¼š%lx" + +#: readelf.c:1588 +#, c-format +msgid "Operating System specific: %lx" +msgstr "特定作業系統:%lx" + +#: readelf.c:1592 readelf.c:2370 +#, c-format +msgid ": %lx" +msgstr "<未知>:%lx" + +#: readelf.c:1605 +msgid "NONE (None)" +msgstr "NONE (ç„¡)" + +#: readelf.c:1606 +msgid "REL (Relocatable file)" +msgstr "REL (å¯é‡å®šä½æª”案)" + +#: readelf.c:1607 +msgid "EXEC (Executable file)" +msgstr "EXEC (å¯åŸ·è¡Œæª”案)" + +#: readelf.c:1608 +msgid "DYN (Shared object file)" +msgstr "DYN (共享物件檔案)" + +#: readelf.c:1609 +msgid "CORE (Core file)" +msgstr "CORE (核心檔案)" + +#: readelf.c:1613 +#, c-format +msgid "Processor Specific: (%x)" +msgstr "特定處ç†å™¨ï¼š(%x)" + +#: readelf.c:1615 +#, c-format +msgid "OS Specific: (%x)" +msgstr "特定作業系統:(%x)" + +#: readelf.c:1617 readelf.c:1724 readelf.c:2554 +#, c-format +msgid ": %x" +msgstr "<未知>:%x" + +#: readelf.c:1629 +msgid "None" +msgstr "ç„¡" + +#: readelf.c:2229 +msgid "Standalone App" +msgstr "ç¨ç«‹æ‡‰ç”¨ç¨‹å¼" + +#: readelf.c:2232 readelf.c:2952 readelf.c:2968 +#, c-format +msgid "" +msgstr "<未知:%x>" + +#: readelf.c:2597 +#, c-format +msgid "Usage: readelf elf-file(s)\n" +msgstr "用法:readelf <é¸é …> elf-檔案\n" + +#: readelf.c:2598 +#, c-format +msgid " Display information about the contents of ELF format files\n" +msgstr " 顯示關於 ELF æ ¼å¼æª”案內容的資訊\n" + +#: readelf.c:2599 +#, c-format +msgid "" +" Options are:\n" +" -a --all Equivalent to: -h -l -S -s -r -d -V -A -I\n" +" -h --file-header Display the ELF file header\n" +" -l --program-headers Display the program headers\n" +" --segments An alias for --program-headers\n" +" -S --section-headers Display the sections' header\n" +" --sections An alias for --section-headers\n" +" -g --section-groups Display the section groups\n" +" -e --headers Equivalent to: -h -l -S\n" +" -s --syms Display the symbol table\n" +" --symbols An alias for --syms\n" +" -n --notes Display the core notes (if present)\n" +" -r --relocs Display the relocations (if present)\n" +" -u --unwind Display the unwind info (if present)\n" +" -d --dynamic Display the dynamic section (if present)\n" +" -V --version-info Display the version sections (if present)\n" +" -A --arch-specific Display architecture specific information (if any).\n" +" -D --use-dynamic Use the dynamic section info when displaying symbols\n" +" -x --hex-dump= Dump the contents of section \n" +" -w[liaprmfFsoR] or\n" +" --debug-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=str,=loc,=Ranges]\n" +" Display the contents of DWARF2 debug sections\n" +msgstr "" +" é¸é …為:\n" +" -a --all ç­‰åŒæ–¼ï¼š-h -l -S -s -r -d -V -A -I\n" +" -h --file-header 顯示 ELF 檔案標頭\n" +" -l --program-headers 顯示程å¼æ¨™é ­\n" +" --segments --program-headers 的別å\n" +" -S --section-headers 顯示å€æ®µæ¨™é ­\n" +" --sections --section-headers 的別å\n" +" -g --section-groups 顯示å€æ®µç¾¤çµ„\n" +" -e --headers ç­‰åŒæ–¼ï¼š-h -l -S\n" +" -s --syms 顯示符號表\n" +" --symbols --syms 的別å\n" +" -n --notes 顯示核心備註 (如果有的話)\n" +" -r --relocs 顯示é‡å®šä½ (如果有的話)\n" +" -u --unwind 顯示展開(unwind)資訊 (如果有的話)\n" +" -d --dynamic 顯示動態å€æ®µ (如果有的話)\n" +" -V --version-info 顯示版本å€æ®µ (如果有的話)\n" +" -A --arch-specific 顯示系統架構特有的資訊 (如果有的話)\n" +" -D --use-dynamic 顯示符號的時候使用動態å€æ®µè³‡è¨Š\n" +" -x --hex-dump=<編號> 輸出 <編號> å€æ®µçš„內容\n" +" -w[liaprmfFsoR] 或\n" +" --debug-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=str,=loc,=Ranges]\n" +" 顯示 DWARF2 除錯å€æ®µçš„內容\n" + +#: readelf.c:2622 +#, c-format +msgid "" +" -i --instruction-dump=\n" +" Disassemble the contents of section \n" +msgstr "" +" -i --instruction-dump=<編號>\n" +" å組譯å€æ®µ <編號> 的內容\n" + +#: readelf.c:2626 +#, c-format +msgid "" +" -I --histogram Display histogram of bucket list lengths\n" +" -W --wide Allow output width to exceed 80 characters\n" +" -H --help Display this information\n" +" -v --version Display the version number of readelf\n" +msgstr "" +" -I --histogram 顯示存儲桶列表長度的長æ¢åœ–\n" +" -W --wide å…è¨±è¼¸å‡ºå¯¬åº¦è¶…éŽ 80 個字元\n" +" -H --help 顯示本資訊\n" +" -v --version 顯示 readelf 的版本號碼\n" + +#: readelf.c:2651 readelf.c:12118 +msgid "Out of memory allocating dump request table." +msgstr "傾å°éœ€æ±‚表時記憶體定ä½ä¸è¶³ã€‚" + +#: readelf.c:2820 readelf.c:2888 +#, c-format +msgid "Unrecognized debug option '%s'\n" +msgstr "無法識別的除錯é¸é …「%sã€\n" + +#: readelf.c:2922 +#, c-format +msgid "Invalid option '-%c'\n" +msgstr "無效的é¸é …「-%cã€\n" + +#: readelf.c:2936 +msgid "Nothing to do.\n" +msgstr "無事å¯åšã€‚\n" + +#: readelf.c:2948 readelf.c:2964 readelf.c:5906 +msgid "none" +msgstr "ç„¡" + +#: readelf.c:2965 +msgid "2's complement, little endian" +msgstr "2 的補數,å°å°¾åº(little endian)" + +#: readelf.c:2966 +msgid "2's complement, big endian" +msgstr "2 的補數,大尾åº(big endian)" + +#: readelf.c:2984 +msgid "Not an ELF file - it has the wrong magic bytes at the start\n" +msgstr "ä¸æ˜¯ ELF 檔案 - 它開頭的魔術ä½å…ƒçµ„錯誤\n" + +#: readelf.c:2992 +#, c-format +msgid "ELF Header:\n" +msgstr "ELF 檔頭:\n" + +#: readelf.c:2993 +#, c-format +msgid " Magic: " +msgstr "魔術ä½å…ƒçµ„:" + +#: readelf.c:2997 +#, c-format +msgid " Class: %s\n" +msgstr " 類別: %s\n" + +#: readelf.c:2999 +#, c-format +msgid " Data: %s\n" +msgstr " 資料: %s\n" + +#: readelf.c:3001 +#, c-format +msgid " Version: %d %s\n" +msgstr " 版本: %d %s\n" + +#: readelf.c:3008 +#, c-format +msgid " OS/ABI: %s\n" +msgstr " OS/ABI: %s\n" + +#: readelf.c:3010 +#, c-format +msgid " ABI Version: %d\n" +msgstr " ABI 版本: %d\n" + +#: readelf.c:3012 +#, c-format +msgid " Type: %s\n" +msgstr " é¡žåž‹: %s\n" + +#: readelf.c:3014 +#, c-format +msgid " Machine: %s\n" +msgstr " 系統架構: %s\n" + +#: readelf.c:3016 +#, c-format +msgid " Version: 0x%lx\n" +msgstr " 版本: 0x%lx\n" + +#: readelf.c:3019 +#, c-format +msgid " Entry point address: " +msgstr " 進入點ä½å€ï¼š " + +#: readelf.c:3021 +#, c-format +msgid "" +"\n" +" Start of program headers: " +msgstr "" +"\n" +" 程å¼æ¨™é ­èµ·é»žï¼š " + +#: readelf.c:3023 +#, c-format +msgid "" +" (bytes into file)\n" +" Start of section headers: " +msgstr "" +" (檔案內之ä½å…ƒçµ„)\n" +" å€æ®µæ¨™é ­èµ·é»žï¼š " + +#: readelf.c:3025 +#, c-format +msgid " (bytes into file)\n" +msgstr " (檔案內之ä½å…ƒçµ„)\n" + +#: readelf.c:3027 +#, c-format +msgid " Flags: 0x%lx%s\n" +msgstr " 旗標: 0x%lx%s\n" + +#: readelf.c:3030 +#, c-format +msgid " Size of this header: %ld (bytes)\n" +msgstr " 此標頭的大å°ï¼š %ld (ä½å…ƒçµ„)\n" + +#: readelf.c:3032 +#, c-format +msgid " Size of program headers: %ld (bytes)\n" +msgstr " 程å¼æ¨™é ­å¤§å°ï¼š %ld (ä½å…ƒçµ„)\n" + +#: readelf.c:3034 +#, c-format +msgid " Number of program headers: %ld\n" +msgstr " 程å¼æ¨™é ­æ•¸é‡ï¼š %ld\n" + +#: readelf.c:3036 +#, c-format +msgid " Size of section headers: %ld (bytes)\n" +msgstr " å€æ®µæ¨™é ­å¤§å°ï¼š %ld (ä½å…ƒçµ„)\n" + +#: readelf.c:3038 +#, c-format +msgid " Number of section headers: %ld" +msgstr " å€æ®µæ¨™é ­æ•¸é‡ï¼š %ld" + +#: readelf.c:3043 +#, c-format +msgid " Section header string table index: %ld" +msgstr " 字串表索引å€æ®µæ¨™é ­ï¼š %ld" + +#: readelf.c:3074 readelf.c:3107 +msgid "program headers" +msgstr "程å¼æ¨™é ­" + +#: readelf.c:3145 readelf.c:3446 readelf.c:3487 readelf.c:3546 readelf.c:3609 +#: readelf.c:3993 readelf.c:4017 readelf.c:5247 readelf.c:5291 readelf.c:5489 +#: readelf.c:6450 readelf.c:6464 readelf.c:11493 readelf.c:11912 +#: readelf.c:11979 +msgid "Out of memory\n" +msgstr "記憶體ä¸è¶³\n" + +#: readelf.c:3172 +#, c-format +msgid "" +"\n" +"There are no program headers in this file.\n" +msgstr "" +"\n" +"本檔案中沒有程å¼æ¨™é ­ã€‚\n" + +#: readelf.c:3178 +#, c-format +msgid "" +"\n" +"Elf file type is %s\n" +msgstr "" +"\n" +"Elf 檔案類型為 %s\n" + +#: readelf.c:3179 +#, c-format +msgid "Entry point " +msgstr "進入點 " + +#: readelf.c:3181 +#, c-format +msgid "" +"\n" +"There are %d program headers, starting at offset " +msgstr "" +"\n" +"共有 %d 個程å¼æ¨™é ­ï¼Œé–‹å§‹æ–¼å移é‡" + +#: readelf.c:3193 readelf.c:3195 +#, c-format +msgid "" +"\n" +"Program Headers:\n" +msgstr "" +"\n" +"程å¼æ¨™é ­ï¼š\n" + +#: readelf.c:3199 +#, c-format +msgid " Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align\n" +msgstr " é¡žåž‹ åç§»é‡ è™›æ“¬ä½å€ 實體ä½å€ æª”æ¡ˆå¤§å° è¨˜æ†¶å¤§å° æ——æ¨™ å°é½Š\n" + +#: readelf.c:3202 +#, c-format +msgid " Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align\n" +msgstr " é¡žåž‹ åç§»é‡ è™›æ“¬ä½å€ 實體ä½å€ æª”æ¡ˆå¤§å° è¨˜æ†¶å¤§å° æ——æ¨™ å°é½Š\n" + +#: readelf.c:3206 +#, c-format +msgid " Type Offset VirtAddr PhysAddr\n" +msgstr " é¡žåž‹ åç§»é‡ è™›æ“¬ä½å€ 實體ä½å€\n" + +#: readelf.c:3208 +#, c-format +msgid " FileSiz MemSiz Flags Align\n" +msgstr " æª”æ¡ˆå¤§å° è¨˜æ†¶å¤§å° æ——æ¨™ å°é½Š\n" + +#: readelf.c:3301 +msgid "more than one dynamic segment\n" +msgstr "多於一個動態節å€\n" + +#: readelf.c:3312 +msgid "no .dynamic section in the dynamic segment" +msgstr "在動態節å€ä¸­æ²’有動態å€æ®µ" + +#: readelf.c:3321 +msgid "the .dynamic section is not contained within the dynamic segment" +msgstr "在動態節å€ä¸­æœªåŒ…å«å‹•æ…‹å€æ®µ" + +#: readelf.c:3323 +msgid "the .dynamic section is not the first section in the dynamic segment." +msgstr "動態節å€ä¸­çš„第一å€æ®µä¸¦éžå‹•æ…‹å€æ®µ" + +#: readelf.c:3337 +msgid "Unable to find program interpreter name\n" +msgstr "無法找到程å¼è§£è­¯å™¨å稱\n" + +#: readelf.c:3344 +#, c-format +msgid "" +"\n" +" [Requesting program interpreter: %s]" +msgstr "" +"\n" +" [正在è¦æ±‚程å¼è§£è­¯å™¨ï¼š%s]" + +#: readelf.c:3356 +#, c-format +msgid "" +"\n" +" Section to Segment mapping:\n" +msgstr "" +"\n" +" å€æ®µåˆ°ç¯€å€æ˜ å°„中:\n" + +#: readelf.c:3357 +#, c-format +msgid " Segment Sections...\n" +msgstr " 節å€æ®µ...\n" + +#: readelf.c:3408 +msgid "Cannot interpret virtual addresses without program headers.\n" +msgstr "無法ä¸é ç¨‹å¼æ¨™é ­è€Œè§£è­¯è™›æ“¬ä½å€\n" + +#: readelf.c:3424 +#, c-format +msgid "Virtual address 0x%lx not located in any PT_LOAD segment.\n" +msgstr "虛擬ä½å€ 0x%lx ä¸ä½æ–¼ä»»ä½• PT_LOAD 節å€ä¸­ã€‚\n" + +#: readelf.c:3438 readelf.c:3479 +msgid "section headers" +msgstr "å€æ®µæ¨™é ­" + +#: readelf.c:3523 readelf.c:3586 +msgid "symbols" +msgstr "符號" + +#: readelf.c:3533 readelf.c:3596 +msgid "symtab shndx" +msgstr "符號分é ç´¢å¼•" + +#: readelf.c:3697 readelf.c:3977 +#, c-format +msgid "" +"\n" +"There are no sections in this file.\n" +msgstr "" +"\n" +"本檔案中沒有å€æ®µã€‚\n" + +#: readelf.c:3703 +#, c-format +msgid "There are %d section headers, starting at offset 0x%lx:\n" +msgstr "共有 %d 個å€æ®µæ¨™é ­ï¼Œå¾žåç§»é‡ 0x%lx 開始:\n" + +#: readelf.c:3720 readelf.c:4079 readelf.c:4290 readelf.c:4591 readelf.c:5011 +#: readelf.c:6618 +msgid "string table" +msgstr "字串表" + +#: readelf.c:3765 +msgid "File contains multiple dynamic symbol tables\n" +msgstr "檔案å«æœ‰å¤šå€‹å‹•æ…‹ç¬¦è™Ÿè¡¨\n" + +#: readelf.c:3777 +msgid "File contains multiple dynamic string tables\n" +msgstr "檔案å«æœ‰å¤šå€‹å‹•æ…‹å­—串表\n" + +#: readelf.c:3782 +msgid "dynamic strings" +msgstr "動態字串" + +#: readelf.c:3789 +msgid "File contains multiple symtab shndx tables\n" +msgstr "檔案å«æœ‰å¤šå€‹ç¬¦è™Ÿåˆ†é ç´¢å¼•è¡¨\n" + +#: readelf.c:3828 +#, c-format +msgid "" +"\n" +"Section Headers:\n" +msgstr "" +"\n" +"å€æ®µæ¨™é ­ï¼š\n" + +#: readelf.c:3830 +#, c-format +msgid "" +"\n" +"Section Header:\n" +msgstr "" +"\n" +"å€æ®µæ¨™é ­ï¼š\n" + +#: readelf.c:3834 +#, c-format +msgid " [Nr] Name Type Addr Off Size ES Flg Lk Inf Al\n" +msgstr " [號] å稱 é¡žåž‹ ä½å€ å移 å¤§å° å…¨ 旗標 é€£çµ è³‡ 齊\n" + +#: readelf.c:3837 +#, c-format +msgid " [Nr] Name Type Address Off Size ES Flg Lk Inf Al\n" +msgstr " [號] å稱 é¡žåž‹ ä½å€ å移 å¤§å° å…¨ 標 連 資 齊\n" + +#: readelf.c:3840 +#, c-format +msgid " [Nr] Name Type Address Offset\n" +msgstr " [號] å稱 é¡žåž‹ ä½å€ å移é‡\n" + +#: readelf.c:3841 +#, c-format +msgid " Size EntSize Flags Link Info Align\n" +msgstr " å¤§å° å…¨é«”å¤§å° æ——æ¨™ é€£çµ è³‡è¨Š å°é½Š\n" + +#: readelf.c:3936 +#, c-format +msgid "" +"Key to Flags:\n" +" W (write), A (alloc), X (execute), M (merge), S (strings)\n" +" I (info), L (link order), G (group), x (unknown)\n" +" O (extra OS processing required) o (OS specific), p (processor specific)\n" +msgstr "" +"旗標關éµå­—:\n" +" W (寫入), A (定ä½), X (執行), M (èžåˆ), S (字串)\n" +" I (資訊), L (連çµé †åº), G (群組), x (未知)\n" +" O (è¦æ±‚é¡å¤–的作業系統處ç†) o (特定作業系統), p (特定處ç†å™¨)\n" + +#: readelf.c:3954 +#, c-format +msgid "[: 0x%x]" +msgstr "[<未知>: 0x%x]" + +#: readelf.c:3984 +msgid "Section headers are not available!\n" +msgstr "å€æ®µæ¨™é ­ç„¡æ³•å–用ï¼\n" + +#: readelf.c:4008 +#, c-format +msgid "" +"\n" +"There are no section groups in this file.\n" +msgstr "" +"\n" +"本檔案中沒有å€æ®µç¾¤çµ„。\n" + +#: readelf.c:4042 +#, c-format +msgid "Bad sh_link in group section `%s'\n" +msgstr "在群組å€æ®µã€Œ%sã€ä¸­ä¸è‰¯çš„ sh_link\n" + +#: readelf.c:4061 +#, c-format +msgid "Bad sh_info in group section `%s'\n" +msgstr "在群組å€æ®µã€Œ%sã€ä¸­ä¸è‰¯çš„ sh_info\n" + +#: readelf.c:4085 readelf.c:6947 +msgid "section data" +msgstr "å€æ®µè³‡æ–™" + +#: readelf.c:4097 +#, c-format +msgid " [Index] Name\n" +msgstr " [索引] å稱\n" + +#: readelf.c:4114 +#, c-format +msgid "section [%5u] already in group section [%5u]\n" +msgstr "å€æ®µ [%5u] 已在群組å€æ®µ [%5u] 之中\n" + +#: readelf.c:4127 +#, c-format +msgid "section 0 in group section [%5u]\n" +msgstr "å€æ®µ 0 在群組å€æ®µ [%5u] 之中\n" + +#: readelf.c:4224 +#, c-format +msgid "" +"\n" +"'%s' relocation section at offset 0x%lx contains %ld bytes:\n" +msgstr "" +"\n" +"「%sã€ä½æ–¼åç§»é‡ 0x%lx çš„é‡å®šä½å€æ®µå«æœ‰ %ld 個ä½å…ƒçµ„:\n" + +#: readelf.c:4236 +#, c-format +msgid "" +"\n" +"There are no dynamic relocations in this file.\n" +msgstr "" +"\n" +"本檔案中沒有動態é‡å®šä½ã€‚\n" + +#: readelf.c:4260 +#, c-format +msgid "" +"\n" +"Relocation section " +msgstr "" +"\n" +"é‡å®šä½å€æ®µ " + +#: readelf.c:4265 readelf.c:4666 readelf.c:4680 readelf.c:5025 +#, c-format +msgid "'%s'" +msgstr "「%sã€" + +#: readelf.c:4267 readelf.c:4682 readelf.c:5027 +#, c-format +msgid " at offset 0x%lx contains %lu entries:\n" +msgstr " ä½æ–¼åç§»é‡ 0x%lx å«æœ‰ %lu 個æ¢ç›®ï¼š\n" + +#: readelf.c:4308 +#, c-format +msgid "" +"\n" +"There are no relocations in this file.\n" +msgstr "" +"\n" +"該檔案中沒有é‡å®šä½è³‡è¨Šã€‚\n" + +#: readelf.c:4482 readelf.c:4862 +msgid "unwind table" +msgstr "展開表格" + +#: readelf.c:4540 readelf.c:4959 +#, c-format +msgid "Skipping unexpected relocation type %s\n" +msgstr "è·³éŽæ„外的é‡å®šä½é¡žåž‹ %s\n" + +#: readelf.c:4598 readelf.c:5018 readelf.c:5069 +#, c-format +msgid "" +"\n" +"There are no unwind sections in this file.\n" +msgstr "" +"\n" +"本檔案中沒有展開的å€æ®µã€‚\n" + +#: readelf.c:4661 +#, c-format +msgid "" +"\n" +"Could not find unwind info section for " +msgstr "" +"\n" +"找ä¸åˆ°å±•é–‹çš„資訊å€æ®µä¹‹æ–¼" + +#: readelf.c:4673 +msgid "unwind info" +msgstr "展開的資訊" + +#: readelf.c:4675 readelf.c:5024 +#, c-format +msgid "" +"\n" +"Unwind section " +msgstr "" +"\n" +"展開的å€æ®µ" + +#: readelf.c:5228 readelf.c:5272 +msgid "dynamic section" +msgstr "å‹•æ…‹å€æ®µ" + +#: readelf.c:5349 +#, c-format +msgid "" +"\n" +"There is no dynamic section in this file.\n" +msgstr "" +"\n" +"本檔案沒有動態å€æ®µã€‚\n" + +#: readelf.c:5387 +msgid "Unable to seek to end of file!" +msgstr "無法æœç´¢çš„檔案çµå°¾ï¼" + +#: readelf.c:5400 +msgid "Unable to determine the number of symbols to load\n" +msgstr "無法確定è¦è®€å…¥çš„符號數é‡\n" + +#: readelf.c:5435 +msgid "Unable to seek to end of file\n" +msgstr "無法æœç´¢åˆ°æª”案末尾\n" + +#: readelf.c:5442 +msgid "Unable to determine the length of the dynamic string table\n" +msgstr "無法確定動態字串表的長度\n" + +#: readelf.c:5447 +msgid "dynamic string table" +msgstr "動態字串表" + +#: readelf.c:5482 +msgid "symbol information" +msgstr "符號資訊" + +#: readelf.c:5507 +#, c-format +msgid "" +"\n" +"Dynamic section at offset 0x%lx contains %u entries:\n" +msgstr "" +"\n" +"ä½æ–¼åç§»é‡ 0x%lx 處的動態å€æ®µå«æœ‰ %u 個æ¢ç›®ï¼š\n" + +#: readelf.c:5510 +#, c-format +msgid " Tag Type Name/Value\n" +msgstr " 標記 é¡žåž‹ å稱/值\n" + +#: readelf.c:5546 +#, c-format +msgid "Auxiliary library" +msgstr "附加函å¼åº«" + +#: readelf.c:5550 +#, c-format +msgid "Filter library" +msgstr "éŽæ¿¾å™¨å‡½å¼åº«" + +#: readelf.c:5554 +#, c-format +msgid "Configuration file" +msgstr "é…置檔案" + +#: readelf.c:5558 +#, c-format +msgid "Dependency audit library" +msgstr "ä¾å­˜å¯©æŸ¥å‡½å¼åº«" + +#: readelf.c:5562 +#, c-format +msgid "Audit library" +msgstr "審查函å¼åº«" + +#: readelf.c:5580 readelf.c:5608 readelf.c:5636 +#, c-format +msgid "Flags:" +msgstr "旗標:" + +#: readelf.c:5583 readelf.c:5611 readelf.c:5638 +#, c-format +msgid " None\n" +msgstr " ç„¡\n" + +#: readelf.c:5759 +#, c-format +msgid "Shared library: [%s]" +msgstr "共享函å¼åº«ï¼š[%s]" + +#: readelf.c:5762 +#, c-format +msgid " program interpreter" +msgstr " 程å¼è§£è­¯å™¨" + +#: readelf.c:5766 +#, c-format +msgid "Library soname: [%s]" +msgstr "函å¼åº«æª”å:[%s]" + +#: readelf.c:5770 +#, c-format +msgid "Library rpath: [%s]" +msgstr "函å¼åº«è·¯å¾‘:[%s]" + +#: readelf.c:5774 +#, c-format +msgid "Library runpath: [%s]" +msgstr "函å¼åº«åŸ·è¡Œè·¯å¾‘:[%s]" + +#: readelf.c:5837 +#, c-format +msgid "Not needed object: [%s]\n" +msgstr "ä¸éœ€è¦çš„物件:[%s]\n" + +#: readelf.c:5951 +#, c-format +msgid "" +"\n" +"Version definition section '%s' contains %ld entries:\n" +msgstr "" +"\n" +"版本定義å€æ®µã€Œ%sã€å«æœ‰ %ld 個æ¢ç›®ï¼š\n" + +#: readelf.c:5954 +#, c-format +msgid " Addr: 0x" +msgstr " ä½å€ï¼š0x" + +#: readelf.c:5956 readelf.c:6148 +#, c-format +msgid " Offset: %#08lx Link: %lx (%s)\n" +msgstr " å移é‡ï¼š%#08lx 連çµï¼š%lx (%s)\n" + +#: readelf.c:5961 +msgid "version definition section" +msgstr "版本定義å€æ®µ" + +#: readelf.c:5987 +#, c-format +msgid " %#06x: Rev: %d Flags: %s" +msgstr " %#06x: 修訂: %d 旗標: %s" + +#: readelf.c:5990 +#, c-format +msgid " Index: %d Cnt: %d " +msgstr " 索引: %d 計數: %d " + +#: readelf.c:6001 +#, c-format +msgid "Name: %s\n" +msgstr "å稱:%s\n" + +#: readelf.c:6003 +#, c-format +msgid "Name index: %ld\n" +msgstr "å稱索引:%ld\n" + +#: readelf.c:6018 +#, c-format +msgid " %#06x: Parent %d: %s\n" +msgstr " %#06x: å‰ä¸€ç‰ˆ %d: %s\n" + +#: readelf.c:6021 +#, c-format +msgid " %#06x: Parent %d, name index: %ld\n" +msgstr " %#06x: å‰ä¸€ç‰ˆ %d, å稱索引: %ld\n" + +#: readelf.c:6040 +#, c-format +msgid "" +"\n" +"Version needs section '%s' contains %ld entries:\n" +msgstr "" +"\n" +"版本需è¦å€æ®µã€Œ%sã€å«æœ‰ %ld 個æ¢ç›®ï¼š\n" + +#: readelf.c:6043 +#, c-format +msgid " Addr: 0x" +msgstr " ä½å€ï¼š0x" + +#: readelf.c:6045 +#, c-format +msgid " Offset: %#08lx Link to section: %ld (%s)\n" +msgstr " å移é‡ï¼š%#08lx 連接到å€æ®µï¼š%ld (%s)\n" + +#: readelf.c:6050 +msgid "version need section" +msgstr "版本需è¦å€æ®µ" + +#: readelf.c:6072 +#, c-format +msgid " %#06x: Version: %d" +msgstr " %#06x: 版本: %d" + +#: readelf.c:6075 +#, c-format +msgid " File: %s" +msgstr " 檔案:%s" + +#: readelf.c:6077 +#, c-format +msgid " File: %lx" +msgstr " 檔案:%lx" + +#: readelf.c:6079 +#, c-format +msgid " Cnt: %d\n" +msgstr " 計數:%d\n" + +#: readelf.c:6097 +#, c-format +msgid " %#06x: Name: %s" +msgstr " %#06x:å稱:%s" + +#: readelf.c:6100 +#, c-format +msgid " %#06x: Name index: %lx" +msgstr " %#06x:å稱索引:%lx" + +#: readelf.c:6103 +#, c-format +msgid " Flags: %s Version: %d\n" +msgstr " 旗標:%s 版本:%d\n" + +#: readelf.c:6139 +msgid "version string table" +msgstr "版本字串表" + +#: readelf.c:6143 +#, c-format +msgid "" +"\n" +"Version symbols section '%s' contains %d entries:\n" +msgstr "" +"\n" +"版本符號å€æ®µã€Œ%sã€å«æœ‰ %d 個æ¢ç›®ï¼š\n" + +#: readelf.c:6146 +#, c-format +msgid " Addr: " +msgstr " ä½å€ï¼š" + +#: readelf.c:6156 +msgid "version symbol data" +msgstr "版本符號資料" + +#: readelf.c:6183 +msgid " 0 (*local*) " +msgstr " 0 (*本地*) " + +#: readelf.c:6187 +msgid " 1 (*global*) " +msgstr " 1 (*全域*) " + +#: readelf.c:6223 readelf.c:6677 +msgid "version need" +msgstr "版本需è¦" + +#: readelf.c:6233 +msgid "version need aux (2)" +msgstr "版本需è¦å¤–部 (2)" + +#: readelf.c:6275 readelf.c:6740 +msgid "version def" +msgstr "版本定義" + +#: readelf.c:6294 readelf.c:6755 +msgid "version def aux" +msgstr "版本定義外部" + +#: readelf.c:6325 +#, c-format +msgid "" +"\n" +"No version information found in this file.\n" +msgstr "" +"\n" +"本檔案中沒有å€æ®µè³‡è¨Šã€‚\n" + +#: readelf.c:6456 +msgid "Unable to read in dynamic data\n" +msgstr "無法讀入動態資料\n" + +#: readelf.c:6509 +msgid "Unable to seek to start of dynamic information" +msgstr "無法定ä½åˆ°å‹•æ…‹è³‡è¨Šçš„起點" + +#: readelf.c:6515 +msgid "Failed to read in number of buckets\n" +msgstr "讀入存儲桶數é‡å¤±æ•—\n" + +#: readelf.c:6521 +msgid "Failed to read in number of chains\n" +msgstr "讀入éˆçµæ•¸é‡å¤±æ•—\n" + +#: readelf.c:6541 +#, c-format +msgid "" +"\n" +"Symbol table for image:\n" +msgstr "" +"\n" +"映åƒç¬¦è™Ÿè¡¨ï¼š\n" + +#: readelf.c:6543 +#, c-format +msgid " Num Buc: Value Size Type Bind Vis Ndx Name\n" +msgstr " 存儲桶號: 值 å¤§å° é¡žåž‹ ç´„æŸ ç‰ˆæœ¬ 索引å稱\n" + +#: readelf.c:6545 +#, c-format +msgid " Num Buc: Value Size Type Bind Vis Ndx Name\n" +msgstr " 存儲桶號: 值 å¤§å° é¡žåž‹ ç´„æŸ ç‰ˆæœ¬ 索引å稱\n" + +#: readelf.c:6597 +#, c-format +msgid "" +"\n" +"Symbol table '%s' contains %lu entries:\n" +msgstr "" +"\n" +"符號表「%sã€å«æœ‰ %lu 個æ¢ç›®ï¼š\n" + +#: readelf.c:6601 +#, c-format +msgid " Num: Value Size Type Bind Vis Ndx Name\n" +msgstr " 編號: 值 å¤§å° é¡žåž‹ ç´„æŸ ç‰ˆæœ¬ 索引å稱\n" + +#: readelf.c:6603 +#, c-format +msgid " Num: Value Size Type Bind Vis Ndx Name\n" +msgstr " 編號: 值 å¤§å° é¡žåž‹ ç´„æŸ ç‰ˆæœ¬ 索引å稱\n" + +#: readelf.c:6649 +msgid "version data" +msgstr "版本資料" + +#: readelf.c:6690 +msgid "version need aux (3)" +msgstr "版本需è¦å¤–部 (3)" + +#: readelf.c:6715 +msgid "bad dynamic symbol" +msgstr "ä¸è‰¯çš„動態符號" + +#: readelf.c:6778 +#, c-format +msgid "" +"\n" +"Dynamic symbol information is not available for displaying symbols.\n" +msgstr "" +"\n" +"無法å–得顯示符號所需之動態符號資訊。\n" + +#: readelf.c:6790 +#, c-format +msgid "" +"\n" +"Histogram for bucket list length (total of %lu buckets):\n" +msgstr "" +"\n" +"存儲桶列表長度的長æ¢åœ– (總計 %lu 存儲桶):\n" + +#: readelf.c:6792 +#, c-format +msgid " Length Number %% of total Coverage\n" +msgstr " 長度 編號 總計之%% 覆蓋度\n" + +#: readelf.c:6797 readelf.c:6813 readelf.c:10967 readelf.c:11159 +msgid "Out of memory" +msgstr "記憶體ä¸è¶³" + +#: readelf.c:6862 +#, c-format +msgid "" +"\n" +"Dynamic info segment at offset 0x%lx contains %d entries:\n" +msgstr "" +"\n" +"ä½æ–¼åç§»é‡ 0x%lx 的動態資訊節å€å«æœ‰ %d 個æ¢ç›®ï¼š\n" + +#: readelf.c:6865 +#, c-format +msgid " Num: Name BoundTo Flags\n" +msgstr "編號: å稱 ç›¸ç´„æŸ æ——æ¨™\n" + +#: readelf.c:6917 +#, c-format +msgid "" +"\n" +"Assembly dump of section %s\n" +msgstr "" +"\n" +"「%sã€å€æ®µçš„組åˆèªžè¨€å‚¾å°ï¼š\n" + +#: readelf.c:6938 +#, c-format +msgid "" +"\n" +"Section '%s' has no data to dump.\n" +msgstr "" +"\n" +"「%sã€å€æ®µæ²’有å¯å‚¾å°çš„資料。\n" + +#: readelf.c:6943 +#, c-format +msgid "" +"\n" +"Hex dump of section '%s':\n" +msgstr "" +"\n" +"「%sã€å€æ®µçš„å六進ä½å‚¾å°ï¼š\n" + +#: readelf.c:7090 +msgid "badly formed extended line op encountered!\n" +msgstr "é‡åˆ°ä¸æ­£å¸¸çš„擴充型列æ“作碼ï¼\n" + +#: readelf.c:7097 +#, c-format +msgid " Extended opcode %d: " +msgstr " æ“´å……æ“作碼 %d: " + +#: readelf.c:7102 +#, c-format +msgid "" +"End of Sequence\n" +"\n" +msgstr "" +"åºåˆ—çµå°¾\n" +"\n" + +#: readelf.c:7108 +#, c-format +msgid "set Address to 0x%lx\n" +msgstr "設定ä½å€è‡³ 0x%lx\n" + +#: readelf.c:7113 +#, c-format +msgid " define new File Table entry\n" +msgstr " 定義新檔案表æ¢ç›®\n" + +#: readelf.c:7114 readelf.c:9032 +#, c-format +msgid " Entry\tDir\tTime\tSize\tName\n" +msgstr " æ¢ç›®\t目錄\t時間\t大å°\tå稱\n" + +#: readelf.c:7116 +#, c-format +msgid " %d\t" +msgstr " %d\t" + +#: readelf.c:7119 readelf.c:7121 readelf.c:7123 readelf.c:9044 readelf.c:9046 +#: readelf.c:9048 +#, c-format +msgid "%lu\t" +msgstr "%lu\t" + +#: readelf.c:7124 +#, c-format +msgid "" +"%s\n" +"\n" +msgstr "" +"%s\n" +"\n" + +#: readelf.c:7128 +#, c-format +msgid "UNKNOWN: length %d\n" +msgstr "未知:長度 %d\n" + +#: readelf.c:7155 +msgid "debug_str section data" +msgstr "debug_str å€æ®µè³‡æ–™" + +#: readelf.c:7173 +msgid "" +msgstr "<沒有 .debug_str å€æ®µ>" + +#: readelf.c:7176 +msgid "" +msgstr "<å移é‡éŽå¤§>" + +#: readelf.c:7201 +msgid "debug_loc section data" +msgstr "debug_loc å€æ®µè³‡æ–™" + +#: readelf.c:7235 +msgid "debug_range section data" +msgstr "debug_range å€æ®µè³‡æ–™" + +#: readelf.c:7307 +#, c-format +msgid "%s: skipping unexpected symbol type %s in relocation in section .rela%s\n" +msgstr "%1$s: 在å€æ®µ .rela%3$s 中跳éŽæ„外的é‡å®šä½ç¬¦è™Ÿé¡žåž‹ %2$s\n" + +#: readelf.c:7321 +#, c-format +msgid "skipping unexpected symbol type %s in relocation in section .rela.%s\n" +msgstr "在å€æ®µ .rela.%2$s 中跳éŽæ„外的é‡å®šä½ç¬¦è™Ÿé¡žåž‹ %1$s\n" + +#: readelf.c:7565 +#, c-format +msgid "Unknown TAG value: %lx" +msgstr "未知的 TAG 值:%lx" + +#: readelf.c:7601 +#, c-format +msgid "Unknown FORM value: %lx" +msgstr "未知的 FORM 值:%lx" + +#: readelf.c:7610 +#, c-format +msgid " %lu byte block: " +msgstr " %lu ä½å…ƒçµ„çš„å€å¡Šï¼š" + +#: readelf.c:7944 +#, c-format +msgid "(User defined location op)" +msgstr "(使用者定義的定ä½æ“作碼)" + +#: readelf.c:7946 +#, c-format +msgid "(Unknown location op)" +msgstr "(未知的定ä½æ“作碼)" + +#: readelf.c:8015 +msgid "Internal error: DWARF version is not 2 or 3.\n" +msgstr "內部錯誤:DWARF ç‰ˆæœ¬è™Ÿç¢¼ä¸¦éž 2 或 3。\n" + +#: readelf.c:8113 +msgid "DW_FORM_data8 is unsupported when sizeof (unsigned long) != 8\n" +msgstr "當 sizeof (unsigned long) != 8 時,ä¸æ”¯æ´ DW_FORM_data8\n" + +#: readelf.c:8162 +#, c-format +msgid " (indirect string, offset: 0x%lx): %s" +msgstr " (間接字串,å移é‡ï¼š0x%lx): %s" + +#: readelf.c:8171 +#, c-format +msgid "Unrecognized form: %d\n" +msgstr "無法識別的形å¼ï¼š%d\n" + +#: readelf.c:8256 +#, c-format +msgid "(not inlined)" +msgstr "(éžå…§åµŒçš„)" + +#: readelf.c:8259 +#, c-format +msgid "(inlined)" +msgstr "(內嵌的)" + +#: readelf.c:8262 +#, c-format +msgid "(declared as inline but ignored)" +msgstr "(è²æ˜Žç‚ºå…§åµŒä½†è¢«å¿½ç•¥)" + +#: readelf.c:8265 +#, c-format +msgid "(declared as inline and inlined)" +msgstr "(è²æ˜Žç‚ºå…§åµŒä¸¦å·²å…§åµŒ)" + +#: readelf.c:8268 +#, c-format +msgid " (Unknown inline attribute value: %lx)" +msgstr " (未知的內嵌屬性值:%lx)" + +#: readelf.c:8413 readelf.c:9537 +#, c-format +msgid " [without DW_AT_frame_base]" +msgstr " [ä¸å…· DW_AT_frame_base]" + +#: readelf.c:8416 +#, c-format +msgid "(location list)" +msgstr "(ä½ç½®åˆ—表)" + +#: readelf.c:8534 +#, c-format +msgid "Unknown AT value: %lx" +msgstr "未知的 AT 值:%lx" + +#: readelf.c:8602 +msgid "No comp units in .debug_info section ?" +msgstr " 在 .debug_info å€æ®µä¸­æ²’有編譯單元?" + +#: readelf.c:8611 +#, c-format +msgid "Not enough memory for a debug info array of %u entries" +msgstr "記憶體ä¸è¶³ä»¥å®¹ç´ %u 個æ¢ç›®çš„除錯資訊陣列" + +#: readelf.c:8619 readelf.c:9630 +#, c-format +msgid "" +"The section %s contains:\n" +"\n" +msgstr "" +"%s å€æ®µå«æœ‰ï¼š\n" +"\n" + +#: readelf.c:8693 +#, c-format +msgid " Compilation Unit @ %lx:\n" +msgstr " 編譯單元 @ %lx:\n" + +#: readelf.c:8694 +#, c-format +msgid " Length: %ld\n" +msgstr " 長度: %ld\n" + +#: readelf.c:8695 +#, c-format +msgid " Version: %d\n" +msgstr " 版本: %d\n" + +#: readelf.c:8696 +#, c-format +msgid " Abbrev Offset: %ld\n" +msgstr " 縮寫å移é‡ï¼š %ld\n" + +#: readelf.c:8697 +#, c-format +msgid " Pointer Size: %d\n" +msgstr " 指標大å°ï¼š %d\n" + +#: readelf.c:8702 +msgid "Only version 2 and 3 DWARF debug information is currently supported.\n" +msgstr "ç›®å‰åªæ”¯æ´ç¬¬äºŒèˆ‡ç¬¬ä¸‰ç‰ˆ DWARF 除錯資訊。\n" + +#: readelf.c:8717 +msgid "Unable to locate .debug_abbrev section!\n" +msgstr "無法找到 .debug_abbrev å€æ®µçš„ä½ç½®ï¼\n" + +#: readelf.c:8722 +msgid "debug_abbrev section data" +msgstr "debug_abbrev å€æ®µè³‡æ–™" + +#: readelf.c:8759 +#, c-format +msgid "Unable to locate entry %lu in the abbreviation table\n" +msgstr "無法在縮寫表中找到æ¢ç›® %lu çš„ä½ç½®\n" + +#: readelf.c:8765 +#, c-format +msgid " <%d><%lx>: Abbrev Number: %lu (%s)\n" +msgstr " <%d><%lx>:縮寫編號:%lu (%s)\n" + +#: readelf.c:8838 +#, c-format +msgid "%s section needs a populated .debug_info section\n" +msgstr "å€æ®µ %s 需è¦å…¬é–‹çš„ .debug_info å€æ®µ\n" + +#: readelf.c:8845 +#, c-format +msgid "%s section has more comp units than .debug_info section\n" +msgstr "å€æ®µ %s 具有比 .debug_info å€æ®µæ›´å¤šçš„編譯單元\n" + +#: readelf.c:8847 +#, c-format +msgid "" +"assuming that the pointer size is %d, from the last comp unit in .debug_info\n" +"\n" +msgstr "" +"從å‰ä¸€å€‹ .debug_info 中的編譯單元,å‡å®šæŒ‡æ¨™å¤§å°ç‚º %d\n" +"\n" + +#: readelf.c:8891 +msgid "extracting information from .debug_info section" +msgstr "從 .debug_info å€æ®µè§£é–‹è³‡è¨Š" + +#: readelf.c:8909 +#, c-format +msgid "" +"\n" +"Dump of debug contents of section %s:\n" +"\n" +msgstr "" +"\n" +"å‚¾å° %s å€æ®µçš„除錯內容:\n" +"\n" + +#: readelf.c:8948 +msgid "The line info appears to be corrupt - the section is too small\n" +msgstr "列資訊似乎已æ壞 - å€æ®µéŽå°\n" + +#: readelf.c:8957 +msgid "Only DWARF version 2 and 3 line info is currently supported.\n" +msgstr "ç›®å‰åªæ”¯æ´ç¬¬äºŒèˆ‡ç¬¬ä¸‰ç‰ˆçš„ DWARF 列資訊。\n" + +#: readelf.c:8984 +#, c-format +msgid " Length: %ld\n" +msgstr " 長度: %ld\n" + +#: readelf.c:8985 +#, c-format +msgid " DWARF Version: %d\n" +msgstr " DWARF 版本: %d\n" + +#: readelf.c:8986 +#, c-format +msgid " Prologue Length: %d\n" +msgstr " å‰è¨€é•·åº¦ï¼š %d\n" + +#: readelf.c:8987 +#, c-format +msgid " Minimum Instruction Length: %d\n" +msgstr " 最å°æŒ‡ä»¤é•·åº¦ï¼š %d\n" + +#: readelf.c:8988 +#, c-format +msgid " Initial value of 'is_stmt': %d\n" +msgstr " 「is_stmtã€çš„åˆå§‹å€¼ï¼š %d\n" + +#: readelf.c:8989 +#, c-format +msgid " Line Base: %d\n" +msgstr " 列基數: %d\n" + +#: readelf.c:8990 +#, c-format +msgid " Line Range: %d\n" +msgstr " 列範åœï¼š %d\n" + +#: readelf.c:8991 +#, c-format +msgid " Opcode Base: %d\n" +msgstr " æ“作碼基數: %d\n" + +#: readelf.c:8992 +#, c-format +msgid " (Pointer size: %u)\n" +msgstr " (指標大å°: %u)\n" + +#: readelf.c:9001 +#, c-format +msgid "" +"\n" +" Opcodes:\n" +msgstr "" +"\n" +" æ“作碼:\n" + +#: readelf.c:9004 +#, c-format +msgid " Opcode %d has %d args\n" +msgstr " æ“作碼 %d 具有 %d 個引數\n" + +#: readelf.c:9010 +#, c-format +msgid "" +"\n" +" The Directory Table is empty.\n" +msgstr "" +"\n" +" 目錄表為空。\n" + +#: readelf.c:9013 +#, c-format +msgid "" +"\n" +" The Directory Table:\n" +msgstr "" +"\n" +" 目錄表:\n" + +#: readelf.c:9017 +#, c-format +msgid " %s\n" +msgstr " %s\n" + +#: readelf.c:9028 +#, c-format +msgid "" +"\n" +" The File Name Table is empty.\n" +msgstr "" +"\n" +" 檔案å表為空。\n" + +#: readelf.c:9031 +#, c-format +msgid "" +"\n" +" The File Name Table:\n" +msgstr "" +"\n" +" 檔案å稱表:\n" + +#: readelf.c:9039 +#, c-format +msgid " %d\t" +msgstr " %d\t" + +#: readelf.c:9050 +#, c-format +msgid "%s\n" +msgstr "%s\n" + +#. Now display the statements. +#: readelf.c:9058 +#, c-format +msgid "" +"\n" +" Line Number Statements:\n" +msgstr "" +"\n" +" 列號æ•è¿°å¥ï¼š\n" + +#: readelf.c:9073 +#, c-format +msgid " Special opcode %d: advance Address by %d to 0x%lx" +msgstr " 特殊æ“作碼 %d: 增加ä½å€ç”± %d 到 0x%lx" + +#: readelf.c:9077 +#, c-format +msgid " and Line by %d to %d\n" +msgstr "以åŠåˆ—號由 %d 到 %d\n" + +#: readelf.c:9088 +#, c-format +msgid " Copy\n" +msgstr " 複製\n" + +#: readelf.c:9095 +#, c-format +msgid " Advance PC by %d to %lx\n" +msgstr " 增加 PC ç”± %d 到 %lx\n" + +#: readelf.c:9103 +#, c-format +msgid " Advance Line by %d to %d\n" +msgstr " 增加列號由 %d 到 %d\n" + +#: readelf.c:9110 +#, c-format +msgid " Set File Name to entry %d in the File Name Table\n" +msgstr " 設定檔案å稱為檔å表中的第 %d æ¢\n" + +#: readelf.c:9118 +#, c-format +msgid " Set column to %d\n" +msgstr " 將行設定為 %d\n" + +#: readelf.c:9125 +#, c-format +msgid " Set is_stmt to %d\n" +msgstr " å°‡ is_stmt 設定為 %d\n" + +#: readelf.c:9130 +#, c-format +msgid " Set basic block\n" +msgstr " 設定基本å€å¡Š\n" + +#: readelf.c:9138 +#, c-format +msgid " Advance PC by constant %d to 0x%lx\n" +msgstr " 增加 PC 常數 %d 到 0x%lx\n" + +#: readelf.c:9146 +#, c-format +msgid " Advance PC by fixed size amount %d to 0x%lx\n" +msgstr " 增加 PC 固定大å°çš„é‡ %d 到 0x%lx\n" + +#: readelf.c:9151 +#, c-format +msgid " Set prologue_end to true\n" +msgstr " å°‡ prologue_end 設定為真\n" + +#: readelf.c:9155 +#, c-format +msgid " Set epilogue_begin to true\n" +msgstr " å°‡ epilogue_begin 設定為真\n" + +#: readelf.c:9161 +#, c-format +msgid " Set ISA to %d\n" +msgstr " å°‡ ISA 設定為 %d\n" + +#: readelf.c:9165 +#, c-format +msgid " Unknown opcode %d with operands: " +msgstr " 未知æ“作碼 %d 應用於é‹ç®—å­ï¼š" + +#: readelf.c:9193 readelf.c:9279 readelf.c:9354 +#, c-format +msgid "" +"Contents of the %s section:\n" +"\n" +msgstr "" +"%s å€æ®µçš„內容:\n" +"\n" + +#: readelf.c:9233 +msgid "Only DWARF 2 and 3 pubnames are currently supported\n" +msgstr "ç›®å‰åªæ”¯æ´ç¬¬äºŒèˆ‡ç¬¬ä¸‰ç‰ˆ DWARF çš„ pubname\n" + +#: readelf.c:9240 +#, c-format +msgid " Length: %ld\n" +msgstr " 長度: %ld\n" + +#: readelf.c:9242 +#, c-format +msgid " Version: %d\n" +msgstr " 版本: %d\n" + +#: readelf.c:9244 +#, c-format +msgid " Offset into .debug_info section: %ld\n" +msgstr " 在 .debug_info å€æ®µä¸­çš„å移é‡ï¼š %ld\n" + +#: readelf.c:9246 +#, c-format +msgid " Size of area in .debug_info section: %ld\n" +msgstr " 在 .debug_info å€æ®µä¸­å€åŸŸçš„大å°ï¼š %ld\n" + +#: readelf.c:9249 +#, c-format +msgid "" +"\n" +" Offset\tName\n" +msgstr "" +"\n" +" å移é‡\tå稱\n" + +#: readelf.c:9300 +#, c-format +msgid " DW_MACINFO_start_file - lineno: %d filenum: %d\n" +msgstr " DW_MACINFO_start_file - 列號:%d 檔案編號:%d\n" + +#: readelf.c:9306 +#, c-format +msgid " DW_MACINFO_end_file\n" +msgstr " DW_MACINFO_end_file\n" + +#: readelf.c:9314 +#, c-format +msgid " DW_MACINFO_define - lineno : %d macro : %s\n" +msgstr " DW_MACINFO_define - 列號:%d 巨集:%s\n" + +#: readelf.c:9323 +#, c-format +msgid " DW_MACINFO_undef - lineno : %d macro : %s\n" +msgstr " DW_MACINFO_undef - 列號:%d 巨集:%s\n" + +#: readelf.c:9335 +#, c-format +msgid " DW_MACINFO_vendor_ext - constant : %d string : %s\n" +msgstr " DW_MACINFO_vendor_ext - 常數:%d 字串:%s\n" + +#: readelf.c:9363 +#, c-format +msgid " Number TAG\n" +msgstr " 數字標記\n" + +#: readelf.c:9369 +#, c-format +msgid " %ld %s [%s]\n" +msgstr " %ld %s [%s]\n" + +#: readelf.c:9372 +msgid "has children" +msgstr "å«æœ‰å­æ ¼ä½" + +#: readelf.c:9372 +msgid "no children" +msgstr "沒有å­æ ¼ä½" + +#: readelf.c:9375 +#, c-format +msgid " %-18s %s\n" +msgstr " %-18s %s\n" + +#: readelf.c:9410 +#, c-format +msgid "" +"\n" +"The .debug_loc section is empty.\n" +msgstr "" +"\n" +".debug_loc å€æ®µç‚ºç©ºã€‚\n" + +#. FIXME: Should we handle this case? +#: readelf.c:9455 +msgid "Location lists in .debug_info section aren't in ascending order!\n" +msgstr ".debug_info å€æ®µä¸­çš„定ä½åˆ—表未ä¾ç”±å°åˆ°å¤§é †åºï¼\n" + +#: readelf.c:9458 +msgid "No location lists in .debug_info section!\n" +msgstr ".debug_info å€æ®µä¸­æ²’有定ä½åˆ—表ï¼\n" + +#: readelf.c:9461 +#, c-format +msgid "Location lists in .debug_loc section start at 0x%lx\n" +msgstr ".debug_info å€æ®µä¸­çš„定ä½åˆ—表起始自 0x%lx\n" + +#: readelf.c:9464 +#, c-format +msgid "" +"Contents of the .debug_loc section:\n" +"\n" +msgstr "" +".debug_loc å€æ®µçš„內容:\n" +"\n" + +#: readelf.c:9465 +#, c-format +msgid " Offset Begin End Expression\n" +msgstr " åç§»é‡ èµ·å§‹ çµæŸ 表示å¼\n" + +#: readelf.c:9495 +#, c-format +msgid "There is a hole [0x%lx - 0x%lx] in .debug_loc section.\n" +msgstr "在 .debug_loc å€æ®µä¸­æœ‰ä¸€å€‹æ¼æ´ž [0x%lx - 0x%lx]。\n" + +#: readelf.c:9498 +#, c-format +msgid "There is an overlap [0x%lx - 0x%lx] in .debug_loc section.\n" +msgstr "在 .debug_loc å€æ®µä¸­æœ‰ä¸€å€‹é‡ç–Š [0x%lx - 0x%lx]。\n" + +#: readelf.c:9512 readelf.c:9837 +#, c-format +msgid " %8.8lx \n" +msgstr " %8.8lx <表列尾端>\n" + +#: readelf.c:9540 readelf.c:9854 +msgid " (start == end)" +msgstr " (開始 == çµæŸ)" + +#: readelf.c:9542 readelf.c:9856 +msgid " (start > end)" +msgstr " (開始 > çµæŸ)" + +#: readelf.c:9566 +#, c-format +msgid "" +"\n" +"The .debug_str section is empty.\n" +msgstr "" +"\n" +".debug_str å€æ®µç‚ºç©ºã€‚\n" + +#: readelf.c:9570 +#, c-format +msgid "" +"Contents of the .debug_str section:\n" +"\n" +msgstr "" +".debug_str å€æ®µçš„內容:\n" +"\n" + +#: readelf.c:9675 +msgid "Only DWARF 2 and 3 aranges are currently supported.\n" +msgstr "ç›®å‰åªæ”¯æ´ç¬¬äºŒèˆ‡ç¬¬ä¸‰ç‰ˆ DWARF çš„ arange。\n" + +#: readelf.c:9679 +#, c-format +msgid " Length: %ld\n" +msgstr " 長度: %ld\n" + +#: readelf.c:9680 +#, c-format +msgid " Version: %d\n" +msgstr " 版本: %d\n" + +#: readelf.c:9681 +#, c-format +msgid " Offset into .debug_info: %lx\n" +msgstr " 在 .debug_info å€æ®µä¸­çš„å移é‡ï¼š %lx\n" + +#: readelf.c:9682 +#, c-format +msgid " Pointer Size: %d\n" +msgstr " 指標大å°: %d\n" + +#: readelf.c:9683 +#, c-format +msgid " Segment Size: %d\n" +msgstr " 節å€å¤§å°: %d\n" + +#: readelf.c:9685 +#, c-format +msgid "" +"\n" +" Address Length\n" +msgstr "" +"\n" +" 地å€é•·åº¦\n" + +#: readelf.c:9741 +#, c-format +msgid "" +"\n" +"The .debug_ranges section is empty.\n" +msgstr "" +"\n" +".debug_ranges å€æ®µç‚ºç©ºã€‚\n" + +#. FIXME: Should we handle this case? +#: readelf.c:9786 +msgid "Range lists in .debug_info section aren't in ascending order!\n" +msgstr ".debug_info å€æ®µä¸­çš„範åœåˆ—表未ä¾ç”±å°åˆ°å¤§é †åºï¼\n" + +#: readelf.c:9789 +msgid "No range lists in .debug_info section!\n" +msgstr ".debug_info å€æ®µä¸­æ²’有範åœåˆ—表ï¼\n" + +#: readelf.c:9792 +#, c-format +msgid "Range lists in .debug_ranges section start at 0x%lx\n" +msgstr ".debug_ranges å€æ®µä¸­çš„範åœåˆ—表起始自 0x%lx\n" + +#: readelf.c:9795 +#, c-format +msgid "" +"Contents of the .debug_ranges section:\n" +"\n" +msgstr "" +".debug_ranges å€æ®µçš„內容:\n" +"\n" + +#: readelf.c:9796 +#, c-format +msgid " Offset Begin End\n" +msgstr " åç§»é‡ èµ·å§‹ çµæŸ\n" + +#: readelf.c:9820 +#, c-format +msgid "There is a hole [0x%lx - 0x%lx] in .debug_ranges section.\n" +msgstr "在 .debug_ranges å€æ®µä¸­æœ‰ä¸€å€‹æ¼æ´ž [0x%lx - 0x%lx]。\n" + +#: readelf.c:9823 +#, c-format +msgid "There is an overlap [0x%lx - 0x%lx] in .debug_ranges section.\n" +msgstr "在 .debug_ranges å€æ®µä¸­æœ‰ä¸€å€‹é‡ç–Š [0x%lx - 0x%lx]。\n" + +#: readelf.c:10017 +#, c-format +msgid "The section %s contains:\n" +msgstr "%s å€æ®µå«æœ‰ï¼š\n" + +#: readelf.c:10663 +#, c-format +msgid "unsupported or unknown DW_CFA_%d\n" +msgstr "ä¸æ”¯æ´æˆ–未知的 DW_CFA_%d\n" + +#: readelf.c:10688 +#, c-format +msgid "Displaying the debug contents of section %s is not yet supported.\n" +msgstr "å°šä¸æ”¯æ´é¡¯ç¤º %s å€æ®µçš„除錯內容。\n" + +#: readelf.c:10732 +#, c-format +msgid "" +"\n" +"Section '%s' has no debugging data.\n" +msgstr "" +"\n" +"「%sã€å€æ®µæ²’有正在除錯的資料。\n" + +#: readelf.c:10746 +msgid "debug section data" +msgstr "除錯å€æ®µè³‡æ–™" + +#: readelf.c:10765 +#, c-format +msgid "Unrecognized debug section: %s\n" +msgstr "無法識別的除錯å€æ®µï¼š%s\n" + +#: readelf.c:10800 +#, c-format +msgid "Section %d was not dumped because it does not exist!\n" +msgstr "沒有傾å°å€æ®µ %d 是因為它們並ä¸å­˜åœ¨ï¼\n" + +#: readelf.c:10872 readelf.c:11236 +msgid "liblist" +msgstr "函å¼åº«æ¸…å–®" + +#: readelf.c:10961 +msgid "options" +msgstr "é¸é …" + +#: readelf.c:10991 +#, c-format +msgid "" +"\n" +"Section '%s' contains %d entries:\n" +msgstr "" +"\n" +"「%sã€å€æ®µå«æœ‰ %d 個æ¢ç›®ï¼š\n" + +#: readelf.c:11152 +msgid "conflict list found without a dynamic symbol table" +msgstr "ä¸å…·å‹•æ…‹ç¬¦è™Ÿè¡¨å»ç™¼ç¾è¡çªçš„表列" + +#: readelf.c:11168 readelf.c:11182 +msgid "conflict" +msgstr "è¡çª" + +#: readelf.c:11192 +#, c-format +msgid "" +"\n" +"Section '.conflict' contains %lu entries:\n" +msgstr "" +"\n" +"「.conflictã€å€æ®µå«æœ‰ %lu 個æ¢ç›®ï¼š\n" + +#: readelf.c:11194 +msgid " Num: Index Value Name" +msgstr " 編號: 索引 值 å稱" + +#: readelf.c:11243 +msgid "liblist string table" +msgstr "函å¼åº«å­—串表" + +#: readelf.c:11252 +#, c-format +msgid "" +"\n" +"Library list section '%s' contains %lu entries:\n" +msgstr "" +"\n" +"「%sã€å‡½å¼åº«åˆ—表å€æ®µå«æœ‰ %lu 個æ¢ç›®ï¼š\n" + +#: readelf.c:11303 +msgid "NT_AUXV (auxiliary vector)" +msgstr "NT_AUXV (auxiliary å‘é‡)" + +#: readelf.c:11305 +msgid "NT_PRSTATUS (prstatus structure)" +msgstr "NT_PRSTATUS (prstatus çµæ§‹)" + +#: readelf.c:11307 +msgid "NT_FPREGSET (floating point registers)" +msgstr "NT_FPREGSET (浮點暫存器)" + +#: readelf.c:11309 +msgid "NT_PRPSINFO (prpsinfo structure)" +msgstr "NT_PRPSINFO (prpsinfo çµæ§‹)" + +#: readelf.c:11311 +msgid "NT_TASKSTRUCT (task structure)" +msgstr "NT_TASKSTRUCT (任務çµæ§‹)" + +#: readelf.c:11313 +msgid "NT_PRXFPREG (user_xfpregs structure)" +msgstr "NT_PRXFPREG (user_xfpregs çµæ§‹)" + +#: readelf.c:11315 +msgid "NT_PSTATUS (pstatus structure)" +msgstr "NT_PSTATUS (pstatus çµæ§‹)" + +#: readelf.c:11317 +msgid "NT_FPREGS (floating point registers)" +msgstr "NT_FPREGS (浮點暫存器)" + +#: readelf.c:11319 +msgid "NT_PSINFO (psinfo structure)" +msgstr "NT_PSINFO (psinfo çµæ§‹)" + +#: readelf.c:11321 +msgid "NT_LWPSTATUS (lwpstatus_t structure)" +msgstr "NT_LWPSTATUS (lwpstatus_t çµæ§‹)" + +#: readelf.c:11323 +msgid "NT_LWPSINFO (lwpsinfo_t structure)" +msgstr "NT_LWPSINFO (lwpsinfo_t çµæ§‹)" + +#: readelf.c:11325 +msgid "NT_WIN32PSTATUS (win32_pstatus structure)" +msgstr "NT_WIN32PSTATUS (win32_pstatus çµæ§‹)" + +#: readelf.c:11333 +msgid "NT_VERSION (version)" +msgstr "NT_VERSION (版本)" + +#: readelf.c:11335 +msgid "NT_ARCH (architecture)" +msgstr "NT_ARCH (系統架構)" + +#: readelf.c:11340 readelf.c:11362 +#, c-format +msgid "Unknown note type: (0x%08x)" +msgstr "未知的備註類型:(0x%08x)" + +#. NetBSD core "procinfo" structure. +#: readelf.c:11352 +msgid "NetBSD procinfo structure" +msgstr "NetBSD procinfo çµæ§‹" + +#: readelf.c:11379 readelf.c:11393 +msgid "PT_GETREGS (reg structure)" +msgstr "PT_GETREGS (reg çµæ§‹)" + +#: readelf.c:11381 readelf.c:11395 +msgid "PT_GETFPREGS (fpreg structure)" +msgstr "PT_GETFPREGS (fpreg çµæ§‹)" + +#: readelf.c:11401 +#, c-format +msgid "PT_FIRSTMACH+%d" +msgstr "PT_FIRSTMACH+%d" + +#: readelf.c:11447 +msgid "notes" +msgstr "備註" + +#: readelf.c:11453 +#, c-format +msgid "" +"\n" +"Notes at offset 0x%08lx with length 0x%08lx:\n" +msgstr "" +"\n" +"備註ä½æ–¼åç§»é‡ 0x%08lx 長度為 0x%08lx:\n" + +#: readelf.c:11455 +#, c-format +msgid " Owner\t\tData size\tDescription\n" +msgstr " 所有者\t\t資料大å°\tæè¿°\n" + +#: readelf.c:11474 +#, c-format +msgid "corrupt note found at offset %x into core notes\n" +msgstr "核心備註中ä½æ–¼åç§»é‡ %x 處發ç¾æ毀的備註\n" + +#: readelf.c:11476 +#, c-format +msgid " type: %x, namesize: %08lx, descsize: %08lx\n" +msgstr " 類型:%x,å稱大å°ï¼š%08lx,æ述大å°ï¼š%08lx\n" + +#: readelf.c:11574 +#, c-format +msgid "No note segments present in the core file.\n" +msgstr "核心檔案中沒有備註節å€ã€‚\n" + +#: readelf.c:11653 +msgid "" +"This instance of readelf has been built without support for a\n" +"64 bit data type and so it cannot read 64 bit ELF files.\n" +msgstr "" +"本 readelf 實例於編譯時未加入 64 ä½å…ƒè³‡æ–™é¡žåž‹æ”¯æ´ï¼Œ\n" +"因而無法讀入 64 ä½å…ƒ ELF 檔案。\n" + +#: readelf.c:11700 readelf.c:12059 +#, c-format +msgid "%s: Failed to read file header\n" +msgstr "%s:讀入檔案頭標失敗\n" + +#: readelf.c:11713 +#, c-format +msgid "" +"\n" +"File: %s\n" +msgstr "" +"\n" +"檔案:%s\n" + +#: readelf.c:11876 readelf.c:11897 readelf.c:11934 readelf.c:12014 +#, c-format +msgid "%s: failed to read archive header\n" +msgstr "%s:讀入ä¿å­˜æª”標頭失敗\n" + +#: readelf.c:11887 +#, c-format +msgid "%s: failed to skip archive symbol table\n" +msgstr "%s:跳éŽä¿å­˜æª”符號表失敗\n" + +#: readelf.c:11919 +#, c-format +msgid "%s: failed to read string table\n" +msgstr "%s:讀入字串表失敗\n" + +#: readelf.c:11955 +#, c-format +msgid "%s: invalid archive string table offset %lu\n" +msgstr "%s:無效的ä¿å­˜æª”字串表åç§»é‡ %lu\n" + +#: readelf.c:11971 +#, c-format +msgid "%s: bad archive file name\n" +msgstr "%s:ä¸è‰¯çš„ä¿å­˜æª”案å稱\n" + +#: readelf.c:12003 +#, c-format +msgid "%s: failed to seek to next archive header\n" +msgstr "%s:æœç´¢è‡³ä¸‹ä¸€å€‹ä¿å­˜æª”標頭失敗\n" + +#: readelf.c:12037 +#, c-format +msgid "'%s': No such file\n" +msgstr "「%sã€ï¼šæ‰¾ä¸åˆ°æ­¤æª”案\n" + +#: readelf.c:12039 +#, c-format +msgid "Could not locate '%s'. System error message: %s\n" +msgstr "無法找到「%sã€çš„ä½ç½®ã€‚錯誤訊æ¯ç‚ºï¼š%s\n" + +#: readelf.c:12046 +#, c-format +msgid "'%s' is not an ordinary file\n" +msgstr "「%sã€ä¸æ˜¯ä¸€èˆ¬çš„檔案\n" + +#: readelf.c:12053 +#, c-format +msgid "Input file '%s' is not readable.\n" +msgstr "輸入檔案「%sã€ä¸¦ä¸å¯è®€ã€‚\n" + +#: rename.c:127 +#, c-format +msgid "%s: cannot set time: %s" +msgstr "%s:無法設置時間:%s" + +#. We have to clean up here. +#: rename.c:162 rename.c:200 +#, c-format +msgid "unable to rename '%s' reason: %s" +msgstr "無法更改「%sã€çš„å稱,原因:%s" + +#: rename.c:208 +#, c-format +msgid "unable to copy file '%s' reason: %s" +msgstr "無法複製檔案「%sã€ï¼ŒåŽŸå› ï¼š%s" + +#: resbin.c:132 +#, c-format +msgid "%s: not enough binary data" +msgstr "%s:ä¸è¶³çš„二進ä½è³‡æ–™" + +#: resbin.c:148 +msgid "null terminated unicode string" +msgstr "以 null çµæŸçš„ unicode 字串" + +#: resbin.c:175 resbin.c:181 +msgid "resource ID" +msgstr "è³‡æº ID" + +#: resbin.c:221 +msgid "cursor" +msgstr "游標" + +#: resbin.c:253 resbin.c:260 +msgid "menu header" +msgstr "é¸å–®æ¨™é ­" + +#: resbin.c:270 +msgid "menuex header" +msgstr "擴展é¸å–®æ¨™é ­" + +#: resbin.c:274 +msgid "menuex offset" +msgstr "擴展é¸å–®å移é‡" + +#: resbin.c:281 +#, c-format +msgid "unsupported menu version %d" +msgstr "ä¸æ”¯æ´çš„é¸å–®ç‰ˆæœ¬ %d" + +#: resbin.c:306 resbin.c:321 resbin.c:384 +msgid "menuitem header" +msgstr "é¸å–®ç´°é …標頭" + +#: resbin.c:414 +msgid "menuitem" +msgstr "é¸å–®ç´°é …" + +#: resbin.c:453 resbin.c:481 +msgid "dialog header" +msgstr "å°è©±æ¡†æ¨™é ­" + +#: resbin.c:471 +#, c-format +msgid "unexpected DIALOGEX version %d" +msgstr "æ„外的 DIALOGEX 版本 %d" + +#: resbin.c:516 +msgid "dialog font point size" +msgstr "å°è©±æ¡†å­—型點數大å°" + +#: resbin.c:524 +msgid "dialogex font information" +msgstr "å°è©±æ¡†æ“´å±•å­—型資訊" + +#: resbin.c:550 resbin.c:568 +msgid "dialog control" +msgstr "å°è©±æ¡†æŽ§åˆ¶" + +#: resbin.c:560 +msgid "dialogex control" +msgstr "å°è©±æ¡†æ“´å±•æŽ§åˆ¶" + +#: resbin.c:589 +msgid "dialog control end" +msgstr "å°è©±æ¡†æŽ§åˆ¶çµæŸ" + +#: resbin.c:601 +msgid "dialog control data" +msgstr "å°è©±æ¡†æŽ§åˆ¶è³‡æ–™" + +#: resbin.c:642 +msgid "stringtable string length" +msgstr "字串表字串長度" + +#: resbin.c:652 +msgid "stringtable string" +msgstr "字串表字串" + +#: resbin.c:683 +msgid "fontdir header" +msgstr "字型目錄標頭" + +#: resbin.c:696 +msgid "fontdir" +msgstr "字型目錄" + +#: resbin.c:712 +msgid "fontdir device name" +msgstr "字型目錄設備å稱" + +#: resbin.c:718 +msgid "fontdir face name" +msgstr "字型目錄字é¢å稱" + +#: resbin.c:759 +msgid "accelerator" +msgstr "加速éµ" + +#: resbin.c:819 +msgid "group cursor header" +msgstr "群組游標標頭" + +#: resbin.c:823 +#, c-format +msgid "unexpected group cursor type %d" +msgstr "æ„外的群組游標類型 %d" + +#: resbin.c:838 +msgid "group cursor" +msgstr "群組游標" + +#: resbin.c:875 +msgid "group icon header" +msgstr "群組圖示標頭" + +#: resbin.c:879 +#, c-format +msgid "unexpected group icon type %d" +msgstr "æ„外的群組圖示類型 %d" + +#: resbin.c:894 +msgid "group icon" +msgstr "群組圖示" + +#: resbin.c:957 resbin.c:1174 +msgid "unexpected version string" +msgstr "æ„外的版本字串" + +#: resbin.c:989 +#, c-format +msgid "version length %d does not match resource length %lu" +msgstr "版本長度 %d ä¸ç¬¦åˆè³‡æºé•·åº¦ %lu" + +#: resbin.c:993 +#, c-format +msgid "unexpected version type %d" +msgstr "æ„外的版本類型 %d" + +#: resbin.c:1005 +#, c-format +msgid "unexpected fixed version information length %d" +msgstr "æ„外的固定版本資訊長度 %d" + +#: resbin.c:1008 +msgid "fixed version info" +msgstr "固定版本資訊" + +#: resbin.c:1012 +#, c-format +msgid "unexpected fixed version signature %lu" +msgstr "æ„外的固定版本簽å %lu" + +#: resbin.c:1016 +#, c-format +msgid "unexpected fixed version info version %lu" +msgstr "æ„外的固定版本資訊版本 %lu" + +#: resbin.c:1045 +msgid "version var info" +msgstr "版本變動資訊" + +#: resbin.c:1062 +#, c-format +msgid "unexpected stringfileinfo value length %d" +msgstr "æ„外的字串檔資訊值長度 %d" + +#: resbin.c:1072 +#, c-format +msgid "unexpected version stringtable value length %d" +msgstr "æ„外的版本字串表格值長度 %d" + +#: resbin.c:1106 +#, c-format +msgid "unexpected version string length %d != %d + %d" +msgstr "æ„外的版本字串長度 %d != %d + %d" + +#: resbin.c:1117 +#, c-format +msgid "unexpected version string length %d < %d" +msgstr "æ„外的版本字串長度 %d < %d" + +#: resbin.c:1134 +#, c-format +msgid "unexpected varfileinfo value length %d" +msgstr "æ„外的變動檔資訊值長度 %d" + +#: resbin.c:1153 +msgid "version varfileinfo" +msgstr "版本變動檔資訊" + +#: resbin.c:1168 +#, c-format +msgid "unexpected version value length %d" +msgstr "æ„外的版本值長度 %d" + +#: rescoff.c:126 +msgid "filename required for COFF input" +msgstr "COFF 輸入需è¦æª”å" + +#: rescoff.c:143 +#, c-format +msgid "%s: no resource section" +msgstr "%s:沒有資æºå€æ®µ" + +#: rescoff.c:150 +msgid "can't read resource section" +msgstr "無法讀入資æºå€æ®µ" + +#: rescoff.c:174 +#, c-format +msgid "%s: %s: address out of bounds" +msgstr "%s:%s:ä½å€è¶…出界é™" + +#: rescoff.c:190 +msgid "directory" +msgstr "目錄" + +#: rescoff.c:218 +msgid "named directory entry" +msgstr "已命å的目錄æ¢ç›®" + +#: rescoff.c:227 +msgid "directory entry name" +msgstr "目錄æ¢ç›®å稱" + +#: rescoff.c:247 +msgid "named subdirectory" +msgstr "已命åçš„å­ç›®éŒ„" + +#: rescoff.c:255 +msgid "named resource" +msgstr "已命å的資æº" + +#: rescoff.c:270 +msgid "ID directory entry" +msgstr "ID 目錄項目" + +#: rescoff.c:287 +msgid "ID subdirectory" +msgstr "ID å­ç›®éŒ„" + +#: rescoff.c:295 +msgid "ID resource" +msgstr "ID 資æº" + +#: rescoff.c:318 +msgid "resource type unknown" +msgstr "資æºé¡žåž‹æœªçŸ¥" + +#: rescoff.c:321 +msgid "data entry" +msgstr "資料æ¢ç›®" + +#: rescoff.c:329 +msgid "resource data" +msgstr "資æºè³‡æ–™" + +#: rescoff.c:334 +msgid "resource data size" +msgstr "資æºè³‡æ–™å¤§å°" + +#: rescoff.c:427 +msgid "filename required for COFF output" +msgstr "COFF 輸出需è¦æª”å" + +#: rescoff.c:719 +msgid "can't get BFD_RELOC_RVA relocation type" +msgstr "無法得到 BFD_RELOC_RVA é‡å®šå‘é¡žåž‹" + +#: resrc.c:238 resrc.c:309 +#, c-format +msgid "can't open temporary file `%s': %s" +msgstr "無法開啟臨時檔案「%sã€ï¼š%s" + +#: resrc.c:244 +#, c-format +msgid "can't redirect stdout: `%s': %s" +msgstr "無法é‡å®šå‘標準輸出:「%sã€ï¼š%s" + +#: resrc.c:260 +#, c-format +msgid "%s %s: %s" +msgstr "%s %s:%s" + +#: resrc.c:305 +#, c-format +msgid "can't execute `%s': %s" +msgstr "無法執行「%sã€ï¼š%s" + +#: resrc.c:314 +#, c-format +msgid "Using temporary file `%s' to read preprocessor output\n" +msgstr "使用臨時檔案「%sã€ä»¥è®€å…¥å‰ç½®è™•ç†å™¨è¼¸å‡º\n" + +#: resrc.c:321 +#, c-format +msgid "can't popen `%s': %s" +msgstr "無法 popen「%sã€ï¼š%s" + +#: resrc.c:323 +#, c-format +msgid "Using popen to read preprocessor output\n" +msgstr "使用 popen 讀入å‰ç½®è™•ç†å™¨è¼¸å‡º\n" + +#: resrc.c:362 +#, c-format +msgid "Tried `%s'\n" +msgstr "已嘗試「%sã€\n" + +#: resrc.c:373 +#, c-format +msgid "Using `%s'\n" +msgstr "正使用「%sã€\n" + +#: resrc.c:529 +#, c-format +msgid "%s:%d: %s\n" +msgstr "%s:%d:%s\n" + +#: resrc.c:537 +#, c-format +msgid "%s: unexpected EOF" +msgstr "%s:檔案æ„外çµå°¾" + +#: resrc.c:586 +#, c-format +msgid "%s: read of %lu returned %lu" +msgstr "%sï¼šè®€å– %lu 返回 %lu" + +#: resrc.c:624 resrc.c:1134 +#, c-format +msgid "stat failed on bitmap file `%s': %s" +msgstr "å°ä½å…ƒåœ–檔案「%sã€é€²è¡Œ stat æ“作失敗:%s" + +#: resrc.c:675 +#, c-format +msgid "cursor file `%s' does not contain cursor data" +msgstr "游標檔案「%sã€ä¸å«æœ‰æ¸¸æ¨™è³‡æ–™" + +#: resrc.c:707 resrc.c:1003 +#, c-format +msgid "%s: fseek to %lu failed: %s" +msgstr "%s: fseek 到 %lu æ“作失敗: %s" + +#: resrc.c:831 +msgid "help ID requires DIALOGEX" +msgstr "輔助 ID è¦æ±‚ DIALOGEX" + +#: resrc.c:833 +msgid "control data requires DIALOGEX" +msgstr "控制資料è¦æ±‚ DIALOGEX" + +#: resrc.c:861 +#, c-format +msgid "stat failed on font file `%s': %s" +msgstr "å°å­—型檔案「%sã€é€²è¡Œ stat æ“作失敗:%s" + +#: resrc.c:972 +#, c-format +msgid "icon file `%s' does not contain icon data" +msgstr "圖示檔案「%sã€ä¸å«æœ‰åœ–示資料" + +#: resrc.c:1273 resrc.c:1308 +#, c-format +msgid "stat failed on file `%s': %s" +msgstr "å°æª”案「%sã€é€²è¡Œ stat æ“作失敗:%s" + +#: resrc.c:1494 +#, c-format +msgid "can't open `%s' for output: %s" +msgstr "無法為輸出而開啟「%sã€ï¼š%s" + +#: size.c:81 +#, c-format +msgid " Displays the sizes of sections inside binary files\n" +msgstr " 顯示二進ä½æª”案中å€æ®µçš„大å°\n" + +#: size.c:82 +#, c-format +msgid " If no input file(s) are specified, a.out is assumed\n" +msgstr " 如果沒有指定輸入檔案,é è¨­ç‚º a.out\n" + +#: size.c:83 +#, c-format +msgid "" +" The options are:\n" +" -A|-B --format={sysv|berkeley} Select output style (default is %s)\n" +" -o|-d|-x --radix={8|10|16} Display numbers in octal, decimal or hex\n" +" -t --totals Display the total sizes (Berkeley only)\n" +" --target= Set the binary file format\n" +" -h --help Display this information\n" +" -v --version Display the program's version\n" +"\n" +msgstr "" +" é¸é …為:\n" +" -A|-B --format={sysv|berkeley} é¸æ“‡è¼¸å‡ºé¢¨æ ¼ (é è¨­ç‚º %s)\n" +" -o|-d|-x --radix={8|10|16} 以八進ä½ã€å進ä½æˆ–å六進ä½é¡¯ç¤ºæ•¸å€¼\n" +" -t --totals é¡¯ç¤ºç¸½è¨ˆå¤§å° (åªç”¨æ–¼ Berkeley 風格)\n" +" --target= 設定二進ä½æª”案格å¼\n" +" -h --help 顯示本資訊\n" +" -v --version 顯示程å¼çš„版本號碼\n" +"\n" + +#: size.c:153 +#, c-format +msgid "invalid argument to --format: %s" +msgstr "--format 的無效引數:%s" + +#: size.c:180 +#, c-format +msgid "Invalid radix: %s\n" +msgstr "無效的 radix: %s\n" + +#: srconv.c:1722 +#, c-format +msgid "Convert a COFF object file into a SYSROFF object file\n" +msgstr "å°‡ COFF 目標檔案轉æ›ç‚º SYSROFF 目標檔案\n" + +#: srconv.c:1723 +#, c-format +msgid "" +" The options are:\n" +" -q --quick (Obsolete - ignored)\n" +" -n --noprescan Do not perform a scan to convert commons into defs\n" +" -d --debug Display information about what is being done\n" +" -h --help Display this information\n" +" -v --version Print the program's version number\n" +msgstr "" +" é¸é …為:\n" +" -q --quick (éŽæœŸ - 忽略)\n" +" -n --noprescan ä¸åŸ·è¡ŒæŽƒçž„以將 commons 轉æ›ç‚º defs\n" +" -d --debug 顯示關於已完æˆäº‹ä»¶çš„資訊\n" +" -h --help 顯示本資訊\n" +" -v --version 列å°ç¨‹å¼çš„版本號碼\n" + +#: srconv.c:1866 +#, c-format +msgid "unable to open output file %s" +msgstr "無法打開輸出檔案 %s" + +#: stabs.c:330 stabs.c:1708 +msgid "numeric overflow" +msgstr "數值溢出" + +#: stabs.c:340 +#, c-format +msgid "Bad stab: %s\n" +msgstr "ä¸è‰¯ stab: %s\n" + +#: stabs.c:348 +#, c-format +msgid "Warning: %s: %s\n" +msgstr "警告:%s:%s\n" + +#: stabs.c:458 +#, c-format +msgid "N_LBRAC not within function\n" +msgstr "N_LBRAC ä¸åœ¨å‡½æ•¸ä¸­\n" + +#: stabs.c:497 +#, c-format +msgid "Too many N_RBRACs\n" +msgstr "éŽå¤šçš„ N_RBRAC\n" + +#: stabs.c:738 +msgid "unknown C++ encoded name" +msgstr "未知的 C++ 編碼å稱" + +#. Complain and keep going, so compilers can invent new +#. cross-reference types. +#: stabs.c:1253 +msgid "unrecognized cross reference type" +msgstr "無法識別的交å‰åƒè€ƒé¡žåž‹" + +#. Does this actually ever happen? Is that why we are worrying +#. about dealing with it rather than just calling error_type? +#: stabs.c:1800 +msgid "missing index type" +msgstr "éºæ¼çš„索引類型" + +#: stabs.c:2114 +msgid "unknown virtual character for baseclass" +msgstr "ä¸æ˜Žä¹‹åšç‚ºåŸºæœ¬é¡žåˆ¥çš„虚擬字元" + +#: stabs.c:2132 +msgid "unknown visibility character for baseclass" +msgstr "ä¸æ˜Žä¹‹åšç‚ºåŸºæœ¬é¡žåˆ¥çš„å¯è¦‹å­—å…ƒ" + +#: stabs.c:2318 +msgid "unnamed $vb type" +msgstr "未命åçš„ $vb é¡žåž‹" + +#: stabs.c:2324 +msgid "unrecognized C++ abbreviation" +msgstr "無法識別的 C++ 縮寫" + +#: stabs.c:2400 +msgid "unknown visibility character for field" +msgstr "欄ä½ä¸­æœªçŸ¥çš„å¯è¦‹å­—å…ƒ" + +#: stabs.c:2652 +msgid "const/volatile indicator missing" +msgstr "éºæ¼ const/volatile 指示符號" + +#: stabs.c:2888 +#, c-format +msgid "No mangling for \"%s\"\n" +msgstr "\"%s\" 沒有æ壞\n" + +#: stabs.c:3188 +msgid "Undefined N_EXCL" +msgstr "未定義 N_EXCL" + +#: stabs.c:3268 +#, c-format +msgid "Type file number %d out of range\n" +msgstr "類型檔案編號 %d 超出範åœ\n" + +#: stabs.c:3273 +#, c-format +msgid "Type index number %d out of range\n" +msgstr "類型索引編號 %d 超出範åœ\n" + +#: stabs.c:3352 +#, c-format +msgid "Unrecognized XCOFF type %d\n" +msgstr "無法識別的 XCOFF é¡žåž‹ %d\n" + +#: stabs.c:3644 +#, c-format +msgid "bad mangled name `%s'\n" +msgstr "ä¸è‰¯çš„æ毀å稱「%sã€\n" + +#: stabs.c:3739 +#, c-format +msgid "no argument types in mangled string\n" +msgstr "å·²æ毀字串中沒有引數類型\n" + +#: stabs.c:5093 +#, c-format +msgid "Demangled name is not a function\n" +msgstr "æ毀後修復的å稱ä¸æ˜¯å‡½æ•¸\n" + +#: stabs.c:5135 +#, c-format +msgid "Unexpected type in v3 arglist demangling\n" +msgstr "在 v3 引數表修復æ毀時有æ„外的類型\n" + +#: stabs.c:5202 +#, c-format +msgid "Unrecognized demangle component %d\n" +msgstr "無法識別的ææ¯€ä¿®å¾©çµ„æˆ %d\n" + +#: stabs.c:5254 +#, c-format +msgid "Failed to print demangled template\n" +msgstr "å°å‡ºæ毀修復之模版失敗\n" + +#: stabs.c:5334 +#, c-format +msgid "Couldn't get demangled builtin type\n" +msgstr "無法å–å¾—æ毀修復之內建類型\n" + +#: stabs.c:5383 +#, c-format +msgid "Unexpected demangled varargs\n" +msgstr "æ„外的æ毀修復變數\n" + +#: stabs.c:5390 +#, c-format +msgid "Unrecognized demangled builtin type\n" +msgstr "無法識別的æ毀修復之內建類型\n" + +#: strings.c:206 +#, c-format +msgid "invalid number %s" +msgstr "無效的編號 %s" + +#: strings.c:643 +#, c-format +msgid "invalid integer argument %s" +msgstr "無效的整數引數 %s" + +#: strings.c:652 +#, c-format +msgid " Display printable strings in [file(s)] (stdin by default)\n" +msgstr " 顯示 [檔案] (é è¨­ç‚ºæ¨™æº–輸入) 中å¯åˆ—å°çš„字串\n" + +#: strings.c:653 +#, c-format +msgid "" +" The options are:\n" +" -a - --all Scan the entire file, not just the data section\n" +" -f --print-file-name Print the name of the file before each string\n" +" -n --bytes=[number] Locate & print any NUL-terminated sequence of at\n" +" - least [number] characters (default 4).\n" +" -t --radix={o,d,x} Print the location of the string in base 8, 10 or 16\n" +" -o An alias for --radix=o\n" +" -T --target= Specify the binary file format\n" +" -e --encoding={s,S,b,l,B,L} Select character size and endianness:\n" +" s = 7-bit, S = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit\n" +" -h --help Display this information\n" +" -v --version Print the program's version number\n" +msgstr "" +" é¸é …為:\n" +" -a - --all 掃瞄整個檔案,而éžåªæœ‰è³‡æ–™å€æ®µ\n" +" -f --print-file-name 在æ¯å€‹å­—串之å‰å°å‡ºæª”案的å稱\n" +" -n --bytes=[number] å®šå€ & å°å‡ºä»»ä½•ä»¥ NUL çµå°¾çš„åºåˆ—æ–¼ number\n" +" - 至少 [number] 個字元 (é è¨­ 4)\n" +" -t --radix={o,d,x} 以八進ä½ã€å進ä½æˆ–å六進ä½å°å‡ºå­—串ä½ç½®\n" +" -o --radix=o 的別å\n" +" -T --target= 指定二進ä½æª”案格å¼\n" +" -e --encoding={s,S,b,l,B,L} é¸æ“‡å­—元大å°èˆ‡å°¾åºï¼š\n" +" s=7ä½å…ƒ, S=8ä½å…ƒ, {b,l}=16ä½å…ƒ, {B,L}=32ä½å…ƒ\n" +" -h --help 顯示本資訊\n" +" -v --version 顯示程å¼çš„版本號碼\n" + +#: sysdump.c:649 +#, c-format +msgid "Print a human readable interpretation of a SYSROFF object file\n" +msgstr "å°å‡ºé©æ–¼é–±è®€ä¹‹ SYSROFF 目標檔案的解釋\n" + +#: sysdump.c:650 +#, c-format +msgid "" +" The options are:\n" +" -h --help Display this information\n" +" -v --version Print the program's version number\n" +msgstr "" +" é¸é …為:\n" +" -h --help 顯示本資訊\n" +" -v --version 列å°ç¨‹å¼çš„版本號碼\n" + +#: sysdump.c:715 +#, c-format +msgid "cannot open input file %s" +msgstr "無法開啟輸入檔案 %s" + +#: version.c:35 +#, c-format +msgid "Copyright 2005 Free Software Foundation, Inc.\n" +msgstr "版權所有 2005 自由軟體基金會。\n" + +#: version.c:36 +#, c-format +msgid "" +"This program is free software; you may redistribute it under the terms of\n" +"the GNU General Public License. This program has absolutely no warranty.\n" +msgstr "" +"本程å¼æ˜¯è‡ªç”±è»Ÿé«”;您å¯ä»¥æŒ‰ç…§ GNU 通用公共許å¯è­‰\n" +"çš„æ¢æ¬¾å°å…¶é€²è¡Œå†ç™¼ä½ˆã€‚本程å¼å®Œå…¨æ²’有任何擔ä¿ã€‚\n" + +#: windres.c:204 +#, c-format +msgid "can't open %s `%s': %s" +msgstr "無法開啟 %s「%sã€ï¼š%s" + +#: windres.c:370 +#, c-format +msgid ": expected to be a directory\n" +msgstr ":應該是目錄\n" + +#: windres.c:382 +#, c-format +msgid ": expected to be a leaf\n" +msgstr ":應該是分支\n" + +#: windres.c:391 +#, c-format +msgid "%s: warning: " +msgstr "%s:警告:" + +#: windres.c:393 +#, c-format +msgid ": duplicate value\n" +msgstr ":é‡è¦†çš„值\n" + +#: windres.c:543 +#, c-format +msgid "unknown format type `%s'" +msgstr "未知的格å¼é¡žåž‹ã€Œ%sã€" + +#: windres.c:544 +#, c-format +msgid "%s: supported formats:" +msgstr "%s:支æ´çš„æ ¼å¼ï¼š" + +#. Otherwise, we give up. +#: windres.c:627 +#, c-format +msgid "can not determine type of file `%s'; use the -J option" +msgstr "無法確定檔案「%sã€çš„類型;請使用 -J é¸é …" + +#: windres.c:639 +#, c-format +msgid "Usage: %s [option(s)] [input-file] [output-file]\n" +msgstr "用法:%s [é¸é …] [輸入檔案] [輸出檔案]\n" + +#: windres.c:641 +#, c-format +msgid "" +" The options are:\n" +" -i --input= Name input file\n" +" -o --output= Name output file\n" +" -J --input-format= Specify input format\n" +" -O --output-format= Specify output format\n" +" -F --target= Specify COFF target\n" +" --preprocessor= Program to use to preprocess rc file\n" +" -I --include-dir= Include directory when preprocessing rc file\n" +" -D --define [=] Define SYM when preprocessing rc file\n" +" -U --undefine Undefine SYM when preprocessing rc file\n" +" -v --verbose Verbose - tells you what it's doing\n" +" -l --language= Set language when reading rc file\n" +" --use-temp-file Use a temporary file instead of popen to read\n" +" the preprocessor output\n" +" --no-use-temp-file Use popen (default)\n" +msgstr "" +" é¸é …為:\n" +" -i --input= 指å輸入檔案\n" +" -o --output= 指å輸出檔案\n" +" -J --input-format= 指定輸入格å¼\n" +" -O --output-format= 指定輸出格å¼\n" +" -F --target= 指定 COFF 目標\n" +" --preprocessor= 用於å‰ç½®è™•ç† rc 檔案的程å¼\n" +" -I --include-dir= å‰ç½®è™•ç† rc 檔案時包å«çš„目錄\n" +" -D --define [=] å‰ç½®è™•ç† rc 檔案時定義 SYM\n" +" -U --undefine å‰ç½®è™•ç† rc 檔案時解除 SYM\n" +" -v --verbose 詳細 - 告訴您正在åšä»€éº¼\n" +" -l --language= è®€å– rc 檔案時設定之語言\n" +" --use-temp-file ä½¿ç”¨è‡¨æ™‚æª”æ¡ˆè€Œéž popen 來讀å–å‰ç½®è™•ç†å™¨è¼¸å‡º\n" +" --no-use-temp-file 使用 popen (é è¨­)\n" + +#: windres.c:657 +#, c-format +msgid " --yydebug Turn on parser debugging\n" +msgstr " --yydebug 打開解æžå™¨é™¤éŒ¯\n" + +#: windres.c:660 +#, c-format +msgid "" +" -r Ignored for compatibility with rc\n" +" -h --help Print this help message\n" +" -V --version Print version information\n" +msgstr "" +" é¸é …為:\n" +" -r 忽略與 rc 的相容性\n" +" -h --help 列å°æœ¬æ±‚助訊æ¯\n" +" -V --version 列å°ç‰ˆæœ¬è³‡è¨Š\n" + +#: windres.c:664 +#, c-format +msgid "" +"FORMAT is one of rc, res, or coff, and is deduced from the file name\n" +"extension if not specified. A single file name is an input file.\n" +"No input-file is stdin, default rc. No output-file is stdout, default rc.\n" +msgstr "" +"FORMAT 是 rcã€res 或 coff 之一,在未指定時根據檔案的擴展å進行判斷。\n" +"單一檔å被èªç‚ºæ˜¯è¼¸å…¥æª”案。沒有輸入檔案時就使用標準輸入,é è¨­æ ¼å¼\n" +"為 rc。沒有輸出檔案時就使用標準輸出,é è¨­æ ¼å¼ç‚º rc。\n" + +#: windres.c:800 +msgid "invalid option -f\n" +msgstr "無效的é¸é …「-fã€\n" + +#: windres.c:805 +msgid "No filename following the -fo option.\n" +msgstr "在é¸é … -fo 之後沒有檔å。\n" + +#: windres.c:863 +#, c-format +msgid "Option -I is deprecated for setting the input format, please use -J instead.\n" +msgstr "é¸é … -I 用åšè¨­å®šè¼¸å…¥æ ¼å¼å·²éŽæ™‚,請使用 -J 代替。\n" + +#: windres.c:981 +msgid "no resources" +msgstr "沒有資æº" + +#: wrstabs.c:354 wrstabs.c:1915 +#, c-format +msgid "string_hash_lookup failed: %s" +msgstr "string_hash_lookup 失敗:%s" + +#: wrstabs.c:635 +#, c-format +msgid "stab_int_type: bad size %u" +msgstr "stab_int_typeï¼šéŒ¯èª¤å¤§å° %u" + +#: wrstabs.c:1393 +#, c-format +msgid "%s: warning: unknown size for field `%s' in struct" +msgstr "%s:警告:çµæ§‹ä¸­ã€Œ%sã€æ¬„ä½çš„大å°æœªçŸ¥" diff -uprN binutils-2.16.90.0.3/binutils/readelf.c binutils-2.16.91.0.1/binutils/readelf.c --- binutils-2.16.90.0.3/binutils/readelf.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/readelf.c 2005-06-22 13:53:34.631362579 -0700 @@ -94,6 +94,7 @@ #include "elf/mmix.h" #include "elf/mn10200.h" #include "elf/mn10300.h" +#include "elf/ms1.h" #include "elf/msp430.h" #include "elf/or32.h" #include "elf/pj.h" @@ -206,7 +207,7 @@ unsigned int num_dump_sects = 0; #define DISASS_DUMP (1 << 1) #define DEBUG_DUMP (1 << 2) -/* How to rpint a vma value. */ +/* How to print a vma value. */ typedef enum print_mode { HEX, @@ -286,11 +287,42 @@ warn (const char *message, ...) } static void * -get_data (void *var, FILE *file, long offset, size_t size, const char *reason) +cmalloc (size_t nmemb, size_t size) +{ + /* Check for overflow. */ + if (nmemb >= ~(size_t) 0 / size) + return NULL; + else + return malloc (nmemb * size); +} + +static void * +xcmalloc (size_t nmemb, size_t size) +{ + /* Check for overflow. */ + if (nmemb >= ~(size_t) 0 / size) + return NULL; + else + return xmalloc (nmemb * size); +} + +static void * +xcrealloc (void *ptr, size_t nmemb, size_t size) +{ + /* Check for overflow. */ + if (nmemb >= ~(size_t) 0 / size) + return NULL; + else + return xrealloc (ptr, nmemb * size); +} + +static void * +get_data (void *var, FILE *file, long offset, size_t size, size_t nmemb, + const char *reason) { void *mvar; - if (size == 0) + if (size == 0 || nmemb == 0) return NULL; if (fseek (file, archive_file_offset + offset, SEEK_SET)) @@ -303,19 +335,24 @@ get_data (void *var, FILE *file, long of mvar = var; if (mvar == NULL) { - mvar = malloc (size); + /* Check for overflow. */ + if (nmemb < (~(size_t) 0 - 1) / size) + /* + 1 so that we can '\0' terminate invalid string table sections. */ + mvar = malloc (size * nmemb + 1); if (mvar == NULL) { error (_("Out of memory allocating 0x%x bytes for %s\n"), - size, reason); + size * nmemb, reason); return NULL; } + + ((char *) mvar)[size * nmemb] = '\0'; } - if (fread (mvar, size, 1, file) != 1) + if (fread (mvar, size, nmemb, file) != nmemb) { - error (_("Unable to read in 0x%x bytes of %s\n"), size, reason); + error (_("Unable to read in 0x%x bytes of %s\n"), size * nmemb, reason); if (mvar != var) free (mvar); return NULL; @@ -729,6 +766,7 @@ guess_is_rela (unsigned long e_machine) case EM_XTENSA: case EM_XTENSA_OLD: case EM_M32R: + case EM_MS1: return TRUE; case EM_MMA: @@ -769,16 +807,17 @@ slurp_rela_relocs (FILE *file, { Elf32_External_Rela *erelas; - erelas = get_data (NULL, file, rel_offset, rel_size, _("relocs")); + erelas = get_data (NULL, file, rel_offset, 1, rel_size, _("relocs")); if (!erelas) return 0; nrelas = rel_size / sizeof (Elf32_External_Rela); - relas = malloc (nrelas * sizeof (Elf_Internal_Rela)); + relas = cmalloc (nrelas, sizeof (Elf_Internal_Rela)); if (relas == NULL) { + free (erelas); error (_("out of memory parsing relocs")); return 0; } @@ -796,16 +835,17 @@ slurp_rela_relocs (FILE *file, { Elf64_External_Rela *erelas; - erelas = get_data (NULL, file, rel_offset, rel_size, _("relocs")); + erelas = get_data (NULL, file, rel_offset, 1, rel_size, _("relocs")); if (!erelas) return 0; nrelas = rel_size / sizeof (Elf64_External_Rela); - relas = malloc (nrelas * sizeof (Elf_Internal_Rela)); + relas = cmalloc (nrelas, sizeof (Elf_Internal_Rela)); if (relas == NULL) { + free (erelas); error (_("out of memory parsing relocs")); return 0; } @@ -839,16 +879,17 @@ slurp_rel_relocs (FILE *file, { Elf32_External_Rel *erels; - erels = get_data (NULL, file, rel_offset, rel_size, _("relocs")); + erels = get_data (NULL, file, rel_offset, 1, rel_size, _("relocs")); if (!erels) return 0; nrels = rel_size / sizeof (Elf32_External_Rel); - rels = malloc (nrels * sizeof (Elf_Internal_Rela)); + rels = cmalloc (nrels, sizeof (Elf_Internal_Rela)); if (rels == NULL) { + free (erels); error (_("out of memory parsing relocs")); return 0; } @@ -866,16 +907,17 @@ slurp_rel_relocs (FILE *file, { Elf64_External_Rel *erels; - erels = get_data (NULL, file, rel_offset, rel_size, _("relocs")); + erels = get_data (NULL, file, rel_offset, 1, rel_size, _("relocs")); if (!erels) return 0; nrels = rel_size / sizeof (Elf64_External_Rel); - rels = malloc (nrels * sizeof (Elf_Internal_Rela)); + rels = cmalloc (nrels, sizeof (Elf_Internal_Rela)); if (rels == NULL) { + free (erels); error (_("out of memory parsing relocs")); return 0; } @@ -1232,6 +1274,10 @@ dump_relocations (FILE *file, case EM_XTENSA: rtype = elf_xtensa_reloc_type (type); break; + + case EM_MS1: + rtype = elf_ms1_reloc_type (type); + break; } if (rtype == NULL) @@ -1243,7 +1289,31 @@ dump_relocations (FILE *file, else printf (do_wide ? "%-22.22s" : "%-17.17s", rtype); - if (symtab_index) + if (elf_header.e_machine == EM_ALPHA + && streq (rtype, "R_ALPHA_LITUSE") + && is_rela) + { + switch (rels[i].r_addend) + { + case LITUSE_ALPHA_ADDR: rtype = "ADDR"; break; + case LITUSE_ALPHA_BASE: rtype = "BASE"; break; + case LITUSE_ALPHA_BYTOFF: rtype = "BYTOFF"; break; + case LITUSE_ALPHA_JSR: rtype = "JSR"; break; + case LITUSE_ALPHA_TLSGD: rtype = "TLSGD"; break; + case LITUSE_ALPHA_TLSLDM: rtype = "TLSLDM"; break; + case LITUSE_ALPHA_JSRDIRECT: rtype = "JSRDIRECT"; break; + default: rtype = NULL; + } + if (rtype) + printf (" (%s)", rtype); + else + { + putchar (' '); + printf (_(""), + (unsigned long) rels[i].r_addend); + } + } + else if (symtab_index) { if (symtab == NULL || symtab_index >= nsyms) printf (" bad symbol index: %08lx", (unsigned long) symtab_index); @@ -1293,7 +1363,7 @@ dump_relocations (FILE *file, } else if (strtab == NULL) printf (_(""), psym->st_name); - else if (psym->st_name > strtablen) + else if (psym->st_name >= strtablen) printf (_(""), psym->st_name); else print_symbol (22, strtab + psym->st_name); @@ -1309,8 +1379,7 @@ dump_relocations (FILE *file, print_vma (rels[i].r_addend, LONG_HEX); } - if (elf_header.e_machine == EM_SPARCV9 - && streq (rtype, "R_SPARC_OLO10")) + if (elf_header.e_machine == EM_SPARCV9 && streq (rtype, "R_SPARC_OLO10")) printf (" + %lx", (unsigned long) ELF64_R_TYPE_DATA (info)); putchar ('\n'); @@ -1413,6 +1482,17 @@ get_sparc64_dynamic_type (unsigned long } static const char * +get_ppc_dynamic_type (unsigned long type) +{ + switch (type) + { + case DT_PPC_GOT: return "PPC_GOT"; + default: + return NULL; + } +} + +static const char * get_ppc64_dynamic_type (unsigned long type) { switch (type) @@ -1460,6 +1540,17 @@ get_ia64_dynamic_type (unsigned long typ } static const char * +get_alpha_dynamic_type (unsigned long type) +{ + switch (type) + { + case DT_ALPHA_PLTRO: return "ALPHA_PLTRO"; + default: + return NULL; + } +} + +static const char * get_dynamic_type (unsigned long type) { static char buff[64]; @@ -1552,12 +1643,18 @@ get_dynamic_type (unsigned long type) case EM_SPARCV9: result = get_sparc64_dynamic_type (type); break; + case EM_PPC: + result = get_ppc_dynamic_type (type); + break; case EM_PPC64: result = get_ppc64_dynamic_type (type); break; case EM_IA_64: result = get_ia64_dynamic_type (type); break; + case EM_ALPHA: + result = get_alpha_dynamic_type (type); + break; default: result = NULL; break; @@ -1720,6 +1817,7 @@ get_machine_name (unsigned e_machine) case EM_IQ2000: return "Vitesse IQ2000"; case EM_XTENSA_OLD: case EM_XTENSA: return "Tensilica Xtensa Processor"; + case EM_MS1: return "Morpho Techologies MS1 processor"; default: snprintf (buff, sizeof (buff), _(": %x"), e_machine); return buff; @@ -3093,7 +3191,7 @@ get_32bit_program_headers (FILE *file, E unsigned int i; phdrs = get_data (NULL, file, elf_header.e_phoff, - elf_header.e_phentsize * elf_header.e_phnum, + elf_header.e_phentsize, elf_header.e_phnum, _("program headers")); if (!phdrs) return 0; @@ -3126,7 +3224,7 @@ get_64bit_program_headers (FILE *file, E unsigned int i; phdrs = get_data (NULL, file, elf_header.e_phoff, - elf_header.e_phentsize * elf_header.e_phnum, + elf_header.e_phentsize, elf_header.e_phnum, _("program headers")); if (!phdrs) return 0; @@ -3161,7 +3259,7 @@ get_program_headers (FILE *file) if (program_headers != NULL) return 1; - phdrs = malloc (elf_header.e_phnum * sizeof (Elf_Internal_Phdr)); + phdrs = cmalloc (elf_header.e_phnum, sizeof (Elf_Internal_Phdr)); if (phdrs == NULL) { @@ -3374,13 +3472,11 @@ process_program_headers (FILE *file) putc ('\n', stdout); } - if (do_segments && section_headers != NULL) + if (do_segments && section_headers != NULL && string_table != NULL) { printf (_("\n Section to Segment mapping:\n")); printf (_(" Segment Sections...\n")); - assert (string_table != NULL); - for (i = 0; i < elf_header.e_phnum; i++) { unsigned int j; @@ -3458,11 +3554,11 @@ get_32bit_section_headers (FILE *file, u unsigned int i; shdrs = get_data (NULL, file, elf_header.e_shoff, - elf_header.e_shentsize * num, _("section headers")); + elf_header.e_shentsize, num, _("section headers")); if (!shdrs) return 0; - section_headers = malloc (num * sizeof (Elf_Internal_Shdr)); + section_headers = cmalloc (num, sizeof (Elf_Internal_Shdr)); if (section_headers == NULL) { @@ -3499,11 +3595,11 @@ get_64bit_section_headers (FILE *file, u unsigned int i; shdrs = get_data (NULL, file, elf_header.e_shoff, - elf_header.e_shentsize * num, _("section headers")); + elf_header.e_shentsize, num, _("section headers")); if (!shdrs) return 0; - section_headers = malloc (num * sizeof (Elf_Internal_Shdr)); + section_headers = cmalloc (num, sizeof (Elf_Internal_Shdr)); if (section_headers == NULL) { @@ -3542,7 +3638,7 @@ get_32bit_elf_symbols (FILE *file, Elf_I Elf_Internal_Sym *psym; unsigned int j; - esyms = get_data (NULL, file, section->sh_offset, section->sh_size, + esyms = get_data (NULL, file, section->sh_offset, 1, section->sh_size, _("symbols")); if (!esyms) return NULL; @@ -3553,7 +3649,7 @@ get_32bit_elf_symbols (FILE *file, Elf_I == (unsigned long) SECTION_HEADER_NUM (section - section_headers))) { shndx = get_data (NULL, file, symtab_shndx_hdr->sh_offset, - symtab_shndx_hdr->sh_size, _("symtab shndx")); + 1, symtab_shndx_hdr->sh_size, _("symtab shndx")); if (!shndx) { free (esyms); @@ -3562,7 +3658,7 @@ get_32bit_elf_symbols (FILE *file, Elf_I } number = section->sh_size / section->sh_entsize; - isyms = malloc (number * sizeof (Elf_Internal_Sym)); + isyms = cmalloc (number, sizeof (Elf_Internal_Sym)); if (isyms == NULL) { @@ -3605,7 +3701,7 @@ get_64bit_elf_symbols (FILE *file, Elf_I Elf_Internal_Sym *psym; unsigned int j; - esyms = get_data (NULL, file, section->sh_offset, section->sh_size, + esyms = get_data (NULL, file, section->sh_offset, 1, section->sh_size, _("symbols")); if (!esyms) return NULL; @@ -3616,7 +3712,7 @@ get_64bit_elf_symbols (FILE *file, Elf_I == (unsigned long) SECTION_HEADER_NUM (section - section_headers))) { shndx = get_data (NULL, file, symtab_shndx_hdr->sh_offset, - symtab_shndx_hdr->sh_size, _("symtab shndx")); + 1, symtab_shndx_hdr->sh_size, _("symtab shndx")); if (!shndx) { free (esyms); @@ -3625,7 +3721,7 @@ get_64bit_elf_symbols (FILE *file, Elf_I } number = section->sh_size / section->sh_entsize; - isyms = malloc (number * sizeof (Elf_Internal_Sym)); + isyms = cmalloc (number, sizeof (Elf_Internal_Sym)); if (isyms == NULL) { @@ -3735,17 +3831,17 @@ process_section_headers (FILE *file) return 0; /* Read in the string table, so that we have names to display. */ - section = SECTION_HEADER (elf_header.e_shstrndx); - - if (section->sh_size != 0) + if (SECTION_HEADER_INDEX (elf_header.e_shstrndx) < elf_header.e_shnum) { - string_table = get_data (NULL, file, section->sh_offset, - section->sh_size, _("string table")); + section = SECTION_HEADER (elf_header.e_shstrndx); - if (string_table == NULL) - return 0; + if (section->sh_size != 0) + { + string_table = get_data (NULL, file, section->sh_offset, + 1, section->sh_size, _("string table")); - string_table_length = section->sh_size; + string_table_length = string_table != NULL ? section->sh_size : 0; + } } /* Scan the sections for the dynamic symbol table @@ -3775,6 +3871,22 @@ process_section_headers (FILE *file) break; } +#define CHECK_ENTSIZE_VALUES(section, i, size32, size64) \ + do \ + { \ + size_t expected_entsize \ + = is_32bit_elf ? size32 : size64; \ + if (section->sh_entsize != expected_entsize) \ + error (_("Section %d has invalid sh_entsize %lx (expected %lx)\n"), \ + i, (unsigned long int) section->sh_entsize, \ + (unsigned long int) expected_entsize); \ + section->sh_entsize = expected_entsize; \ + } \ + while (0) +#define CHECK_ENTSIZE(section, i, type) \ + CHECK_ENTSIZE_VALUES (section, i, sizeof (Elf32_External_##type), \ + sizeof (Elf64_External_##type)) + for (i = 0, section = section_headers; i < elf_header.e_shnum; i++, section++) @@ -3789,6 +3901,7 @@ process_section_headers (FILE *file) continue; } + CHECK_ENTSIZE (section, i, Sym); num_dynamic_syms = section->sh_size / section->sh_entsize; dynamic_symbols = GET_ELF_SYMBOLS (file, section); } @@ -3802,7 +3915,7 @@ process_section_headers (FILE *file) } dynamic_strings = get_data (NULL, file, section->sh_offset, - section->sh_size, _("dynamic strings")); + 1, section->sh_size, _("dynamic strings")); dynamic_strings_length = section->sh_size; } else if (section->sh_type == SHT_SYMTAB_SHNDX) @@ -3814,6 +3927,14 @@ process_section_headers (FILE *file) } symtab_shndx_hdr = section; } + else if (section->sh_type == SHT_SYMTAB) + CHECK_ENTSIZE (section, i, Sym); + else if (section->sh_type == SHT_GROUP) + CHECK_ENTSIZE_VALUES (section, i, GRP_ENTRY_SIZE, GRP_ENTRY_SIZE); + else if (section->sh_type == SHT_REL) + CHECK_ENTSIZE (section, i, Rel); + else if (section->sh_type == SHT_RELA) + CHECK_ENTSIZE (section, i, Rela); else if ((do_debugging || do_debug_info || do_debug_abbrevs || do_debug_lines || do_debug_pubnames || do_debug_aranges || do_debug_frames || do_debug_macinfo || do_debug_str @@ -4048,6 +4169,7 @@ process_section_groups (FILE *file) Elf_Internal_Shdr *symtab_sec, *strtab_sec; Elf_Internal_Sym *symtab; char *strtab; + size_t strtab_size; /* Don't process section groups unless needed. */ if (!do_unwind && !do_section_groups) @@ -4104,6 +4226,7 @@ process_section_groups (FILE *file) strtab_sec = NULL; symtab = NULL; strtab = NULL; + strtab_size = 0; for (i = 0, section = section_headers, group = section_groups; i < elf_header.e_shnum; i++, section++) @@ -4118,8 +4241,9 @@ process_section_groups (FILE *file) Elf_Internal_Sym *sym; /* Get the symbol table. */ - sec = SECTION_HEADER (section->sh_link); - if (sec->sh_type != SHT_SYMTAB) + if (SECTION_HEADER_INDEX (section->sh_link) >= elf_header.e_shnum + || ((sec = SECTION_HEADER (section->sh_link))->sh_type + != SHT_SYMTAB)) { error (_("Bad sh_link in group section `%s'\n"), name); continue; @@ -4145,26 +4269,41 @@ process_section_groups (FILE *file) } group_name = SECTION_NAME (section_headers + sec_index); + strtab_sec = NULL; + if (strtab) + free (strtab); strtab = NULL; + strtab_size = 0; } else { /* Get the string table. */ - sec = SECTION_HEADER (symtab_sec->sh_link); - if (strtab_sec != sec) + if (SECTION_HEADER_INDEX (symtab_sec->sh_link) + >= elf_header.e_shnum) + { + strtab_sec = NULL; + if (strtab) + free (strtab); + strtab = NULL; + strtab_size = 0; + } + else if (strtab_sec + != (sec = SECTION_HEADER (symtab_sec->sh_link))) { strtab_sec = sec; if (strtab) free (strtab); strtab = get_data (NULL, file, strtab_sec->sh_offset, - strtab_sec->sh_size, + 1, strtab_sec->sh_size, _("string table")); + strtab_size = strtab != NULL ? strtab_sec->sh_size : 0; } - group_name = strtab + sym->st_name; + group_name = sym->st_name < strtab_size + ? strtab + sym->st_name : ""; } start = get_data (NULL, file, section->sh_offset, - section->sh_size, _("section data")); + 1, section->sh_size, _("section data")); indices = start; size = (section->sh_size / section->sh_entsize) - 1; @@ -4173,8 +4312,8 @@ process_section_groups (FILE *file) if (do_section_groups) { - printf ("\n%s group section `%s' [%s] contains %u sections:\n", - get_group_flags (entry), name, group_name, size); + printf ("\n%s group section [%5u] `%s' [%s] contains %u sections:\n", + get_group_flags (entry), i, name, group_name, size); printf (_(" [Index] Name\n")); } @@ -4188,13 +4327,26 @@ process_section_groups (FILE *file) entry = byte_get (indices, 4); indices += 4; + if (SECTION_HEADER_INDEX (entry) >= elf_header.e_shnum) + { + error (_("section [%5u] in group section [%5u] > maximum section [%5u]\n"), + entry, i, elf_header.e_shnum - 1); + continue; + } + else if (entry >= SHN_LORESERVE && entry <= SHN_HIRESERVE) + { + error (_("invalid section [%5u] in group section [%5u]\n"), + entry, i); + continue; + } + if (section_headers_groups [SECTION_HEADER_INDEX (entry)] != NULL) { if (entry) { - error (_("section [%5u] already in group section [%5u]\n"), - entry, + error (_("section [%5u] in group section [%5u] already in group section [%5u]\n"), + entry, i, section_headers_groups [SECTION_HEADER_INDEX (entry)]->group_index); continue; } @@ -4219,8 +4371,7 @@ process_section_groups (FILE *file) if (do_section_groups) { sec = SECTION_HEADER (entry); - printf (" [%5u] %s\n", - entry, SECTION_NAME (sec)); + printf (" [%5u] %s\n", entry, SECTION_NAME (sec)); } g = xmalloc (sizeof (struct group_list)); @@ -4351,26 +4502,37 @@ process_relocs (FILE *file) is_rela = section->sh_type == SHT_RELA; - if (section->sh_link) + if (section->sh_link + && SECTION_HEADER_INDEX (section->sh_link) + < elf_header.e_shnum) { Elf_Internal_Shdr *symsec; Elf_Internal_Sym *symtab; unsigned long nsyms; - unsigned long strtablen; + unsigned long strtablen = 0; char *strtab = NULL; symsec = SECTION_HEADER (section->sh_link); + if (symsec->sh_type != SHT_SYMTAB + && symsec->sh_type != SHT_DYNSYM) + continue; + nsyms = symsec->sh_size / symsec->sh_entsize; symtab = GET_ELF_SYMBOLS (file, symsec); if (symtab == NULL) continue; - strsec = SECTION_HEADER (symsec->sh_link); + if (SECTION_HEADER_INDEX (symsec->sh_link) + < elf_header.e_shnum) + { + strsec = SECTION_HEADER (symsec->sh_link); - strtab = get_data (NULL, file, strsec->sh_offset, - strsec->sh_size, _("string table")); - strtablen = strtab == NULL ? 0 : strsec->sh_size; + strtab = get_data (NULL, file, strsec->sh_offset, + 1, strsec->sh_size, + _("string table")); + strtablen = strtab == NULL ? 0 : strsec->sh_size; + } dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, strtablen, is_rela); @@ -4500,7 +4662,7 @@ dump_ia64_unwind (struct ia64_unw_aux_in (unsigned long) (tp->info.offset - aux->seg_base)); head = aux->info + (tp->info.offset - aux->info_addr); - stamp = BYTE_GET ((unsigned char *) head); + stamp = byte_get ((unsigned char *) head, sizeof (stamp)); printf (" v%u, flags=0x%lx (%s%s), len=%lu bytes\n", (unsigned) UNW_VER (stamp), @@ -4561,11 +4723,11 @@ slurp_ia64_unwind_table (FILE *file, /* Second, build the unwind table from the contents of the unwind section: */ size = sec->sh_size; - table = get_data (NULL, file, sec->sh_offset, size, _("unwind table")); + table = get_data (NULL, file, sec->sh_offset, 1, size, _("unwind table")); if (!table) return 0; - aux->table = xmalloc (size / (3 * eh_addr_size) * sizeof (aux->table[0])); + aux->table = xcmalloc (size / (3 * eh_addr_size), sizeof (aux->table[0])); tep = aux->table; for (tp = table; tp < table + size; tp += 3 * eh_addr_size, ++tep) { @@ -4597,6 +4759,7 @@ slurp_ia64_unwind_table (FILE *file, ++relsec) { if (relsec->sh_type != SHT_RELA + || SECTION_HEADER_INDEX (relsec->sh_info) >= elf_header.e_shnum || SECTION_HEADER (relsec->sh_info) != sec) continue; @@ -4662,15 +4825,16 @@ ia64_process_unwind (FILE *file) for (i = 0, sec = section_headers; i < elf_header.e_shnum; ++i, ++sec) { - if (sec->sh_type == SHT_SYMTAB) + if (sec->sh_type == SHT_SYMTAB + && SECTION_HEADER_INDEX (sec->sh_link) < elf_header.e_shnum) { aux.nsyms = sec->sh_size / sec->sh_entsize; aux.symtab = GET_ELF_SYMBOLS (file, sec); strsec = SECTION_HEADER (sec->sh_link); - aux.strtab_size = strsec->sh_size; aux.strtab = get_data (NULL, file, strsec->sh_offset, - aux.strtab_size, _("string table")); + 1, strsec->sh_size, _("string table")); + aux.strtab_size = aux.strtab != NULL ? strsec->sh_size : 0; } else if (sec->sh_type == SHT_IA_64_UNWIND) unwcount++; @@ -4751,7 +4915,7 @@ ia64_process_unwind (FILE *file) { aux.info_size = sec->sh_size; aux.info_addr = sec->sh_addr; - aux.info = get_data (NULL, file, sec->sh_offset, aux.info_size, + aux.info = get_data (NULL, file, sec->sh_offset, 1, aux.info_size, _("unwind info")); printf (_("\nUnwind section ")); @@ -4941,13 +5105,13 @@ slurp_hppa_unwind_table (FILE *file, /* Second, build the unwind table from the contents of the unwind section. */ size = sec->sh_size; - table = get_data (NULL, file, sec->sh_offset, size, _("unwind table")); + table = get_data (NULL, file, sec->sh_offset, 1, size, _("unwind table")); if (!table) return 0; unw_ent_size = 2 * eh_addr_size + 8; - tep = aux->table = xmalloc (size / unw_ent_size * sizeof (aux->table[0])); + tep = aux->table = xcmalloc (size / unw_ent_size, sizeof (aux->table[0])); for (tp = table; tp < table + size; tp += (2 * eh_addr_size + 8), ++tep) { @@ -5015,6 +5179,7 @@ slurp_hppa_unwind_table (FILE *file, ++relsec) { if (relsec->sh_type != SHT_RELA + || SECTION_HEADER_INDEX (relsec->sh_info) >= elf_header.e_shnum || SECTION_HEADER (relsec->sh_info) != sec) continue; @@ -5078,19 +5243,21 @@ hppa_process_unwind (FILE *file) memset (& aux, 0, sizeof (aux)); - assert (string_table != NULL); + if (string_table == NULL) + return 1; for (i = 0, sec = section_headers; i < elf_header.e_shnum; ++i, ++sec) { - if (sec->sh_type == SHT_SYMTAB) + if (sec->sh_type == SHT_SYMTAB + && SECTION_HEADER_INDEX (sec->sh_link) < elf_header.e_shnum) { aux.nsyms = sec->sh_size / sec->sh_entsize; aux.symtab = GET_ELF_SYMBOLS (file, sec); strsec = SECTION_HEADER (sec->sh_link); - aux.strtab_size = strsec->sh_size; aux.strtab = get_data (NULL, file, strsec->sh_offset, - aux.strtab_size, _("string table")); + 1, strsec->sh_size, _("string table")); + aux.strtab_size = aux.strtab != NULL ? strsec->sh_size : 0; } else if (streq (SECTION_NAME (sec), ".PARISC.unwind")) unwsec = sec; @@ -5306,7 +5473,7 @@ get_32bit_dynamic_section (FILE *file) Elf32_External_Dyn *edyn, *ext; Elf_Internal_Dyn *entry; - edyn = get_data (NULL, file, dynamic_addr, dynamic_size, + edyn = get_data (NULL, file, dynamic_addr, 1, dynamic_size, _("dynamic section")); if (!edyn) return 0; @@ -5323,7 +5490,7 @@ get_32bit_dynamic_section (FILE *file) break; } - dynamic_section = malloc (dynamic_nent * sizeof (*entry)); + dynamic_section = cmalloc (dynamic_nent, sizeof (*entry)); if (dynamic_section == NULL) { error (_("Out of memory\n")); @@ -5350,7 +5517,7 @@ get_64bit_dynamic_section (FILE *file) Elf64_External_Dyn *edyn, *ext; Elf_Internal_Dyn *entry; - edyn = get_data (NULL, file, dynamic_addr, dynamic_size, + edyn = get_data (NULL, file, dynamic_addr, 1, dynamic_size, _("dynamic section")); if (!edyn) return 0; @@ -5367,7 +5534,7 @@ get_64bit_dynamic_section (FILE *file) break; } - dynamic_section = malloc (dynamic_nent * sizeof (*entry)); + dynamic_section = cmalloc (dynamic_nent, sizeof (*entry)); if (dynamic_section == NULL) { error (_("Out of memory\n")); @@ -5525,7 +5692,7 @@ process_dynamic_section (FILE *file) continue; } - dynamic_strings = get_data (NULL, file, offset, str_tab_len, + dynamic_strings = get_data (NULL, file, offset, 1, str_tab_len, _("dynamic string table")); dynamic_strings_length = str_tab_len; break; @@ -5560,8 +5727,8 @@ process_dynamic_section (FILE *file) Elf_Internal_Syminfo *syminfo; /* There is a syminfo section. Read the data. */ - extsyminfo = get_data (NULL, file, dynamic_syminfo_offset, syminsz, - _("symbol information")); + extsyminfo = get_data (NULL, file, dynamic_syminfo_offset, 1, + syminsz, _("symbol information")); if (!extsyminfo) return 0; @@ -6037,9 +6204,13 @@ process_version_sections (FILE *file) printf_vma (section->sh_addr); printf (_(" Offset: %#08lx Link: %lx (%s)\n"), (unsigned long) section->sh_offset, section->sh_link, - SECTION_NAME (SECTION_HEADER (section->sh_link))); + SECTION_HEADER_INDEX (section->sh_link) + < elf_header.e_shnum + ? SECTION_NAME (SECTION_HEADER (section->sh_link)) + : ""); - edefs = get_data (NULL, file, section->sh_offset, section->sh_size, + edefs = get_data (NULL, file, section->sh_offset, 1, + section->sh_size, _("version definition section")); if (!edefs) break; @@ -6126,9 +6297,13 @@ process_version_sections (FILE *file) printf_vma (section->sh_addr); printf (_(" Offset: %#08lx Link to section: %ld (%s)\n"), (unsigned long) section->sh_offset, section->sh_link, - SECTION_NAME (SECTION_HEADER (section->sh_link))); + SECTION_HEADER_INDEX (section->sh_link) + < elf_header.e_shnum + ? SECTION_NAME (SECTION_HEADER (section->sh_link)) + : ""); - eneed = get_data (NULL, file, section->sh_offset, section->sh_size, + eneed = get_data (NULL, file, section->sh_offset, 1, + section->sh_size, _("version need section")); if (!eneed) break; @@ -6208,8 +6383,15 @@ process_version_sections (FILE *file) Elf_Internal_Shdr *string_sec; long off; + if (SECTION_HEADER_INDEX (section->sh_link) >= elf_header.e_shnum) + break; + link_section = SECTION_HEADER (section->sh_link); - total = section->sh_size / section->sh_entsize; + total = section->sh_size / sizeof (Elf_External_Versym); + + if (SECTION_HEADER_INDEX (link_section->sh_link) + >= elf_header.e_shnum) + break; found = 1; @@ -6217,7 +6399,7 @@ process_version_sections (FILE *file) string_sec = SECTION_HEADER (link_section->sh_link); - strtab = get_data (NULL, file, string_sec->sh_offset, + strtab = get_data (NULL, file, string_sec->sh_offset, 1, string_sec->sh_size, _("version string table")); if (!strtab) break; @@ -6234,7 +6416,7 @@ process_version_sections (FILE *file) off = offset_from_vma (file, version_info[DT_VERSIONTAGIDX (DT_VERSYM)], total * sizeof (short)); - edata = get_data (NULL, file, off, total * sizeof (short), + edata = get_data (NULL, file, off, total, sizeof (short), _("version symbol data")); if (!edata) { @@ -6242,7 +6424,7 @@ process_version_sections (FILE *file) break; } - data = malloc (total * sizeof (short)); + data = cmalloc (total, sizeof (short)); for (cnt = total; cnt --;) data[cnt] = byte_get (edata + cnt * sizeof (short), @@ -6275,8 +6457,10 @@ process_version_sections (FILE *file) check_def = 1; check_need = 1; - if (SECTION_HEADER (symbols[cnt + j].st_shndx)->sh_type - != SHT_NOBITS) + if (SECTION_HEADER_INDEX (symbols[cnt + j].st_shndx) + >= elf_header.e_shnum + || SECTION_HEADER (symbols[cnt + j].st_shndx)->sh_type + != SHT_NOBITS) { if (symbols[cnt + j].st_shndx == SHN_UNDEF) check_def = 0; @@ -6301,7 +6485,7 @@ process_version_sections (FILE *file) Elf_External_Vernaux evna; unsigned long a_off; - get_data (&evn, file, offset, sizeof (evn), + get_data (&evn, file, offset, sizeof (evn), 1, _("version need")); ivn.vn_aux = BYTE_GET (evn.vn_aux); @@ -6312,7 +6496,7 @@ process_version_sections (FILE *file) do { get_data (&evna, file, a_off, sizeof (evna), - _("version need aux (2)")); + 1, _("version need aux (2)")); ivna.vna_next = BYTE_GET (evna.vna_next); ivna.vna_other = BYTE_GET (evna.vna_other); @@ -6353,7 +6537,7 @@ process_version_sections (FILE *file) do { - get_data (&evd, file, offset, sizeof (evd), + get_data (&evd, file, offset, sizeof (evd), 1, _("version def")); ivd.vd_next = BYTE_GET (evd.vd_next); @@ -6373,7 +6557,8 @@ process_version_sections (FILE *file) get_data (&evda, file, offset - ivd.vd_next + ivd.vd_aux, - sizeof (evda), _("version def aux")); + sizeof (evda), 1, + _("version def aux")); ivda.vda_name = BYTE_GET (evda.vda_name); @@ -6525,7 +6710,7 @@ get_dynamic_data (FILE *file, unsigned i unsigned char *e_data; bfd_vma *i_data; - e_data = malloc (number * ent_size); + e_data = cmalloc (number, ent_size); if (e_data == NULL) { @@ -6539,7 +6724,7 @@ get_dynamic_data (FILE *file, unsigned i return NULL; } - i_data = malloc (number * sizeof (*i_data)); + i_data = cmalloc (number, sizeof (*i_data)); if (i_data == NULL) { @@ -6667,7 +6852,8 @@ process_symbol_table (FILE *file) i++, section++) { unsigned int si; - char *strtab; + char *strtab = NULL; + unsigned long int strtab_size = 0; Elf_Internal_Sym *symtab; Elf_Internal_Sym *psym; @@ -6689,15 +6875,19 @@ process_symbol_table (FILE *file) continue; if (section->sh_link == elf_header.e_shstrndx) - strtab = string_table; - else + { + strtab = string_table; + strtab_size = string_table_length; + } + else if (SECTION_HEADER_INDEX (section->sh_link) < elf_header.e_shnum) { Elf_Internal_Shdr *string_sec; string_sec = SECTION_HEADER (section->sh_link); strtab = get_data (NULL, file, string_sec->sh_offset, - string_sec->sh_size, _("string table")); + 1, string_sec->sh_size, _("string table")); + strtab_size = strtab != NULL ? string_sec->sh_size : 0; } for (si = 0, psym = symtab; @@ -6712,7 +6902,8 @@ process_symbol_table (FILE *file) printf (" %-6s", get_symbol_binding (ELF_ST_BIND (psym->st_info))); printf (" %-3s", get_symbol_visibility (ELF_ST_VISIBILITY (psym->st_other))); printf (" %4s ", get_symbol_index_type (psym->st_shndx)); - print_symbol (25, strtab + psym->st_name); + print_symbol (25, psym->st_name < strtab_size + ? strtab + psym->st_name : ""); if (section->sh_type == SHT_DYNSYM && version_info[DT_VERSIONTAGIDX (DT_VERSYM)] != 0) @@ -6728,12 +6919,14 @@ process_symbol_table (FILE *file) sizeof data + si * sizeof (vers_data)); get_data (&data, file, offset + si * sizeof (vers_data), - sizeof (data), _("version data")); + sizeof (data), 1, _("version data")); vers_data = byte_get (data, 2); - is_nobits = (SECTION_HEADER (psym->st_shndx)->sh_type - == SHT_NOBITS); + is_nobits = (SECTION_HEADER_INDEX (psym->st_shndx) + < elf_header.e_shnum + && SECTION_HEADER (psym->st_shndx)->sh_type + == SHT_NOBITS); check_def = (psym->st_shndx != SHN_UNDEF); @@ -6755,7 +6948,7 @@ process_symbol_table (FILE *file) { unsigned long vna_off; - get_data (&evn, file, offset, sizeof (evn), + get_data (&evn, file, offset, sizeof (evn), 1, _("version need")); ivn.vn_aux = BYTE_GET (evn.vn_aux); @@ -6768,7 +6961,7 @@ process_symbol_table (FILE *file) Elf_External_Vernaux evna; get_data (&evna, file, vna_off, - sizeof (evna), + sizeof (evna), 1, _("version need aux (3)")); ivna.vna_other = BYTE_GET (evna.vna_other); @@ -6790,7 +6983,9 @@ process_symbol_table (FILE *file) if (ivna.vna_other == vers_data) { printf ("@%s (%d)", - strtab + ivna.vna_name, ivna.vna_other); + ivna.vna_name < strtab_size + ? strtab + ivna.vna_name : "", + ivna.vna_other); check_def = 0; } else if (! is_nobits) @@ -6819,7 +7014,7 @@ process_symbol_table (FILE *file) Elf_External_Verdef evd; get_data (&evd, file, offset, sizeof (evd), - _("version def")); + 1, _("version def")); ivd.vd_ndx = BYTE_GET (evd.vd_ndx); ivd.vd_aux = BYTE_GET (evd.vd_aux); @@ -6834,14 +7029,15 @@ process_symbol_table (FILE *file) offset += ivd.vd_aux; get_data (&evda, file, offset, sizeof (evda), - _("version def aux")); + 1, _("version def aux")); ivda.vda_name = BYTE_GET (evda.vda_name); if (psym->st_name != ivda.vda_name) printf ((vers_data & 0x8000) ? "@%s" : "@@%s", - strtab + ivda.vda_name); + ivda.vda_name < strtab_size + ? strtab + ivda.vda_name : ""); } } } @@ -7026,7 +7222,8 @@ dump_section (Elf_Internal_Shdr *section addr = section->sh_addr; - start = get_data (NULL, file, section->sh_offset, bytes, _("section data")); + start = get_data (NULL, file, section->sh_offset, 1, bytes, + _("section data")); if (!start) return 0; @@ -7152,8 +7349,8 @@ reset_state_machine (int is_stmt) state_machine_regs.last_file_entry = 0; } -/* Handled an extend line op. Returns true if this is the end - of sequence. */ +/* Handled an extend line op. + Returns the number of bytes read. */ static int process_extended_line_op (unsigned char *data, int is_stmt, int pointer_size) @@ -7233,7 +7430,7 @@ load_debug_str (FILE *file) debug_str_size = sec->sh_size; - debug_str_contents = get_data (NULL, file, sec->sh_offset, sec->sh_size, + debug_str_contents = get_data (NULL, file, sec->sh_offset, 1, sec->sh_size, _("debug_str section data")); } @@ -7255,7 +7452,10 @@ fetch_indirect_string (unsigned long off return _(""); if (offset > debug_str_size) - return _(""); + { + warn (_("DW_FORM_strp offset too big: %x\n"), offset); + return _(""); + } return debug_str_contents + offset; } @@ -7279,7 +7479,7 @@ load_debug_loc (FILE *file) debug_loc_size = sec->sh_size; - debug_loc_contents = get_data (NULL, file, sec->sh_offset, sec->sh_size, + debug_loc_contents = get_data (NULL, file, sec->sh_offset, 1, sec->sh_size, _("debug_loc section data")); } @@ -7306,14 +7506,14 @@ load_debug_range (FILE *file) if (debug_range_contents != NULL) return; - /* Locate the .debug_str section. */ + /* Locate the .debug_ranges section. */ sec = find_section (".debug_ranges"); if (sec == NULL) return; debug_range_size = sec->sh_size; - debug_range_contents = get_data (NULL, file, sec->sh_offset, sec->sh_size, + debug_range_contents = get_data (NULL, file, sec->sh_offset, 1, sec->sh_size, _("debug_range section data")); } @@ -7354,8 +7554,10 @@ debug_apply_rela_addends (FILE *file, Elf_Internal_Sym *sym; if (relsec->sh_type != SHT_RELA + || SECTION_HEADER_INDEX (relsec->sh_info) >= elf_header.e_shnum || SECTION_HEADER (relsec->sh_info) != section - || relsec->sh_size == 0) + || relsec->sh_size == 0 + || SECTION_HEADER_INDEX (relsec->sh_link) >= elf_header.e_shnum) continue; if (!slurp_rela_relocs (file, relsec->sh_offset, relsec->sh_size, @@ -8293,11 +8495,11 @@ read_and_display_attr_value (unsigned lo { max += 1024; debug_info_p->loc_offsets - = xrealloc (debug_info_p->loc_offsets, - max * sizeof (*debug_info_p->loc_offsets)); + = xcrealloc (debug_info_p->loc_offsets, + max, sizeof (*debug_info_p->loc_offsets)); debug_info_p->have_frame_base - = xrealloc (debug_info_p->have_frame_base, - max * sizeof (*debug_info_p->have_frame_base)); + = xcrealloc (debug_info_p->have_frame_base, + max, sizeof (*debug_info_p->have_frame_base)); debug_info_p->max_loc_offsets = max; } debug_info_p->loc_offsets [num] = uvalue; @@ -8322,8 +8524,8 @@ read_and_display_attr_value (unsigned lo { max += 1024; debug_info_p->range_lists - = xrealloc (debug_info_p->range_lists, - max * sizeof (*debug_info_p->range_lists)); + = xcrealloc (debug_info_p->range_lists, + max, sizeof (*debug_info_p->range_lists)); debug_info_p->max_range_lists = max; } debug_info_p->range_lists [num] = uvalue; @@ -8405,6 +8607,8 @@ read_and_display_attr_value (unsigned lo case DW_ATE_unsigned_char: printf ("(unsigned char)"); break; /* DWARF 2.1 value. */ case DW_ATE_imaginary_float: printf ("(imaginary float)"); break; + /* GNU extension. */ + case DW_ATE_GNU_decimal_float: printf ("(decimal float)"); break; default: if (uvalue >= DW_ATE_lo_user && uvalue <= DW_ATE_hi_user) @@ -8698,8 +8902,8 @@ process_debug_info (Elf_Internal_Shdr *s } /* Then allocate an array to hold the information. */ - debug_information = malloc (num_units * - sizeof (* debug_information)); + debug_information = cmalloc (num_units, + sizeof (* debug_information)); if (debug_information == NULL) { error (_("Not enough memory for a debug info array of %u entries"), @@ -8784,7 +8988,7 @@ process_debug_info (Elf_Internal_Shdr *s if (!do_loc) { - printf (_(" Compilation Unit @ %lx:\n"), cu_offset); + printf (_(" Compilation Unit @ offset 0x%lx:\n"), cu_offset); printf (_(" Length: %ld\n"), compunit.cu_length); printf (_(" Version: %d\n"), compunit.cu_version); printf (_(" Abbrev Offset: %ld\n"), compunit.cu_abbrev_offset); @@ -8812,7 +9016,7 @@ process_debug_info (Elf_Internal_Shdr *s return 0; } - begin = get_data (NULL, file, sec->sh_offset, sec->sh_size, + begin = get_data (NULL, file, sec->sh_offset, 1, sec->sh_size, _("debug_abbrev section data")); if (!begin) return 0; @@ -8896,7 +9100,7 @@ process_debug_info (Elf_Internal_Shdr *s } /* Set num_debug_info_entries here so that it can be used to check if - we need to proecess .debug_loc and .debug_ranges sections. */ + we need to process .debug_loc and .debug_ranges sections. */ if ((do_loc || do_debug_loc || do_debug_ranges) && num_debug_info_entries == 0) num_debug_info_entries = num_units; @@ -8981,7 +9185,7 @@ get_debug_info (FILE * file) if (section == NULL) return 0; - start = get_data (NULL, file, section->sh_offset, section->sh_size, + start = get_data (NULL, file, section->sh_offset, 1, section->sh_size, _("extracting information from .debug_info section")); if (start == NULL) return 0; @@ -9072,7 +9276,7 @@ display_debug_lines (Elf_Internal_Shdr * /* Get the pointer size from the comp unit associated with this block of line number information. */ pointer_size = get_pointer_size_and_offset_of_comp_unit - (comp_unit, ".debug_lines", NULL); + (comp_unit, ".debug_line", NULL); comp_unit ++; printf (_(" Length: %ld\n"), info.li_length); @@ -9083,7 +9287,9 @@ display_debug_lines (Elf_Internal_Shdr * printf (_(" Line Base: %d\n"), info.li_line_base); printf (_(" Line Range: %d\n"), info.li_line_range); printf (_(" Opcode Base: %d\n"), info.li_opcode_base); - printf (_(" (Pointer size: %u)\n"), pointer_size); + printf (_(" (Pointer size: %u)%s\n"), + pointer_size, + warned_about_missing_comp_units ? " [assumed]" : "" ); end_of_sequence = data + info.li_length + initial_length_size; @@ -9174,6 +9380,12 @@ display_debug_lines (Elf_Internal_Shdr * else switch (op_code) { case DW_LNS_extended_op: + if (pointer_size == 0) + { + warn (_("Extend line ops need a valid pointer size, guessing at 4\n")); + pointer_size = 4; + } + data += process_extended_line_op (data, info.li_default_is_stmt, pointer_size); break; @@ -9594,8 +9806,22 @@ display_debug_loc (Elf_Internal_Shdr *se } start = next; + if (offset >= bytes) + { + warn (_("Offset 0x%lx is bigger than .debug_loc section size.\n"), + offset); + continue; + } + while (1) { + if (start + 2 * pointer_size > section_end) + { + warn (_("Location list starting at offset 0x%lx is not terminated.\n"), + offset); + break; + } + begin = byte_get (start, pointer_size); start += pointer_size; end = byte_get (start, pointer_size); @@ -9611,14 +9837,28 @@ display_debug_loc (Elf_Internal_Shdr *se if (begin == -1UL && end != -1UL) { base_address = end; - printf (" %8.8lx %8.8lx %8.8lx (base address)\n", + printf (_(" %8.8lx %8.8lx %8.8lx (base address)\n"), offset, begin, end); continue; } + if (start + 2 > section_end) + { + warn (_("Location list starting at offset 0x%lx is not terminated.\n"), + offset); + break; + } + length = byte_get (start, 2); start += 2; + if (start + length > section_end) + { + warn (_("Location list starting at offset 0x%lx is not terminated.\n"), + offset); + break; + } + printf (" %8.8lx %8.8lx %8.8lx (", offset, begin + base_address, end + base_address); need_frame_base = decode_location_expression (start, @@ -9991,8 +10231,8 @@ frame_need_space (Frame_Chunk *fc, int r return; fc->ncols = reg + 1; - fc->col_type = xrealloc (fc->col_type, fc->ncols * sizeof (short int)); - fc->col_offset = xrealloc (fc->col_offset, fc->ncols * sizeof (int)); + fc->col_type = xcrealloc (fc->col_type, fc->ncols, sizeof (short int)); + fc->col_offset = xcrealloc (fc->col_offset, fc->ncols, sizeof (int)); while (prev < fc->ncols) { @@ -10302,8 +10542,8 @@ display_debug_frames (Elf_Internal_Shdr else { fc->ncols = cie->ncols; - fc->col_type = xmalloc (fc->ncols * sizeof (short int)); - fc->col_offset = xmalloc (fc->ncols * sizeof (int)); + fc->col_type = xcmalloc (fc->ncols, sizeof (short int)); + fc->col_offset = xcmalloc (fc->ncols, sizeof (int)); memcpy (fc->col_type, cie->col_type, fc->ncols * sizeof (short int)); memcpy (fc->col_offset, cie->col_offset, fc->ncols * sizeof (int)); fc->augmentation = cie->augmentation; @@ -10615,8 +10855,8 @@ display_debug_frames (Elf_Internal_Shdr printf (" DW_CFA_remember_state\n"); rs = xmalloc (sizeof (Frame_Chunk)); rs->ncols = fc->ncols; - rs->col_type = xmalloc (rs->ncols * sizeof (short int)); - rs->col_offset = xmalloc (rs->ncols * sizeof (int)); + rs->col_type = xcmalloc (rs->ncols, sizeof (short int)); + rs->col_offset = xcmalloc (rs->ncols, sizeof (int)); memcpy (rs->col_type, fc->col_type, rs->ncols); memcpy (rs->col_offset, fc->col_offset, rs->ncols * sizeof (int)); rs->next = remembered_state; @@ -10838,7 +11078,7 @@ display_debug_section (Elf_Internal_Shdr { unsigned char *start; - start = get_data (NULL, file, section->sh_offset, length, + start = get_data (NULL, file, section->sh_offset, 1, length, _("debug section data")); if (start == NULL) { @@ -10964,7 +11204,7 @@ process_mips_specific (FILE *file) size_t cnt; elib = get_data (NULL, file, liblist_offset, - liblistno * sizeof (Elf32_External_Lib), + liblistno, sizeof (Elf32_External_Lib), _("liblist")); if (elib) { @@ -11053,11 +11293,11 @@ process_mips_specific (FILE *file) while (sect->sh_type != SHT_MIPS_OPTIONS) ++sect; - eopt = get_data (NULL, file, options_offset, sect->sh_size, + eopt = get_data (NULL, file, options_offset, 1, sect->sh_size, _("options")); if (eopt) { - iopt = malloc ((sect->sh_size / sizeof (eopt)) * sizeof (*iopt)); + iopt = cmalloc ((sect->sh_size / sizeof (eopt)), sizeof (*iopt)); if (iopt == NULL) { error (_("Out of memory")); @@ -11249,7 +11489,7 @@ process_mips_specific (FILE *file) return 0; } - iconf = malloc (conflictsno * sizeof (*iconf)); + iconf = cmalloc (conflictsno, sizeof (*iconf)); if (iconf == NULL) { error (_("Out of memory")); @@ -11261,7 +11501,7 @@ process_mips_specific (FILE *file) Elf32_External_Conflict *econf32; econf32 = get_data (NULL, file, conflicts_offset, - conflictsno * sizeof (*econf32), _("conflict")); + conflictsno, sizeof (*econf32), _("conflict")); if (!econf32) return 0; @@ -11275,7 +11515,7 @@ process_mips_specific (FILE *file) Elf64_External_Conflict *econf64; econf64 = get_data (NULL, file, conflicts_offset, - conflictsno * sizeof (*econf64), _("conflict")); + conflictsno, sizeof (*econf64), _("conflict")); if (!econf64) return 0; @@ -11315,6 +11555,7 @@ process_gnu_liblist (FILE *file) Elf_Internal_Shdr *section, *string_sec; Elf32_External_Lib *elib; char *strtab; + size_t strtab_size; size_t cnt; unsigned i; @@ -11328,15 +11569,19 @@ process_gnu_liblist (FILE *file) switch (section->sh_type) { case SHT_GNU_LIBLIST: - elib = get_data (NULL, file, section->sh_offset, section->sh_size, + if (SECTION_HEADER_INDEX (section->sh_link) >= elf_header.e_shnum) + break; + + elib = get_data (NULL, file, section->sh_offset, 1, section->sh_size, _("liblist")); if (elib == NULL) break; string_sec = SECTION_HEADER (section->sh_link); - strtab = get_data (NULL, file, string_sec->sh_offset, + strtab = get_data (NULL, file, string_sec->sh_offset, 1, string_sec->sh_size, _("liblist string table")); + strtab_size = string_sec->sh_size; if (strtab == NULL || section->sh_entsize != sizeof (Elf32_External_Lib)) @@ -11373,9 +11618,11 @@ process_gnu_liblist (FILE *file) printf ("%3lu: ", (unsigned long) cnt); if (do_wide) - printf ("%-20s", strtab + liblist.l_name); + printf ("%-20s", liblist.l_name < strtab_size + ? strtab + liblist.l_name : ""); else - printf ("%-20.20s", strtab + liblist.l_name); + printf ("%-20.20s", liblist.l_name < strtab_size + ? strtab + liblist.l_name : ""); printf (" %s %#010lx %-7ld %-7ld\n", timebuf, liblist.l_checksum, liblist.l_version, liblist.l_flags); } @@ -11540,7 +11787,7 @@ process_corefile_note_segment (FILE *fil if (length <= 0) return 0; - pnotes = get_data (NULL, file, offset, length, _("notes")); + pnotes = get_data (NULL, file, offset, 1, length, _("notes")); if (!pnotes) return 0; diff -uprN binutils-2.16.90.0.3/binutils/rename.c binutils-2.16.91.0.1/binutils/rename.c --- binutils-2.16.90.0.3/binutils/rename.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/rename.c 2005-06-22 13:53:34.633362249 -0700 @@ -37,6 +37,7 @@ #define O_BINARY 0 #endif +#if ! defined (_WIN32) || defined (__CYGWIN32__) static int simple_copy (const char *, const char *); /* The number of bytes to copy at once. */ @@ -88,6 +89,7 @@ simple_copy (const char *from, const cha } return 0; } +#endif /* __CYGWIN32__ or not _WIN32 */ /* Set the times of the file DESTINATION to be the same as those in STATBUF. */ @@ -140,7 +142,7 @@ set_times (const char *destination, cons Return 0 if ok, -1 if error. */ int -smart_rename (const char *from, const char *to, int preserve_dates) +smart_rename (const char *from, const char *to, int preserve_dates ATTRIBUTE_UNUSED) { bfd_boolean exists; struct stat s; diff -uprN binutils-2.16.90.0.3/binutils/resres.c binutils-2.16.91.0.1/binutils/resres.c --- binutils-2.16.90.0.3/binutils/resres.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/resres.c 2005-06-22 13:53:34.636361753 -0700 @@ -408,7 +408,7 @@ write_res_data (data, size, count) size_t size; int count; { - if (fwrite (data, size, count, fres) != (size_t) count) + if ((size_t) fwrite (data, size, count, fres) != (size_t) count) fatal ("%s: could not write to file", filename); } diff -uprN binutils-2.16.90.0.3/binutils/strings.c binutils-2.16.91.0.1/binutils/strings.c --- binutils-2.16.90.0.3/binutils/strings.c 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/binutils/strings.c 2005-06-22 13:53:34.637361588 -0700 @@ -447,7 +447,12 @@ get_char (FILE *stream, file_off *addres { if (stream == NULL) return EOF; -#ifdef HAVE_GETC_UNLOCKED + + /* Only use getc_unlocked if we found a declaration for it. + Otherwise, libc is not thread safe by default, and we + should not use it. */ + +#if defined(HAVE_GETC_UNLOCKED) && HAVE_DECL_GETC_UNLOCKED c = getc_unlocked (stream); #else c = getc (stream); diff -uprN binutils-2.16.90.0.3/binutils.spec binutils-2.16.91.0.1/binutils.spec --- binutils-2.16.90.0.3/binutils.spec 2005-05-10 08:17:17.000000000 -0700 +++ binutils-2.16.91.0.1/binutils.spec 2005-06-22 13:18:33.417537275 -0700 @@ -12,7 +12,7 @@ Summary: A GNU collection of binary utilities. Name: binutils -Version: 2.16.90.0.3 +Version: 2.16.91.0.1 Release: 1 License: GPLv2 Group: Development/Tools diff -uprN binutils-2.16.90.0.3/ChangeLog binutils-2.16.91.0.1/ChangeLog --- binutils-2.16.90.0.3/ChangeLog 2005-05-10 15:46:40.000000000 -0700 +++ binutils-2.16.91.0.1/ChangeLog 2005-06-22 13:53:34.001466654 -0700 @@ -1,3 +1,60 @@ +2005-06-13 Zack Weinberg + + * depcomp: Update from automake CVS. Add 'ia64hp' stanza. + In 'cpp' stanza, support '#line' as well as '# '. + +2005-06-07 Hans-Peter Nilsson + + * configure.in (unsupported_languages): New macro. + : Set unsupported_languages. Name explicit + non-ported target libraries in noconfigdirs. + Ditto, except for non-aout, non-elf, + non-linux-gnu. Remove libgcj_ex_libffi. + : Set add_this_lang=no if the language is in + unsupported_languages. + * configure: Regenerate. + +2005-06-04 Tobias Schl"uter + + * configure.in: Fix typo in handling of --with-mpfr-dir. + * configure: Regenerate. + +2005-06-02 Jim Blandy + + * config.sub: Add cases for the Renesas m32c. (This patch has been + accepted into the master sources.) + +2005-06-02 Aldy Hernandez + Michael Snyder + Stan Cox + + * configure.in: Set noconfigdirs for ms1. + + * configure: Regenerate. + +2005-05-25 Paolo Bonzini + + * Makefile.tpl (stage[+id+]-start): Iterate over target module as well. + (Dependencies): Consider target modules for bootstrap dependencies. + Make target bootstrap modules depend on each stage's gcc. + * Makefile.in: Regenerate. + +2005-05-20 Paolo Bonzini + + * Makefile.def (configure-gcc): Depend on binutils having been built. + (all-gcc): No need to do it here. + * Makefile.in: Regenerate. + +2005-05-19 Paul Brook + + * configure.in: Rewrite misleading error message when requested + language cannot be built. + * configure: Regenerate. + +2005-05-15 Daniel Jacobowitz + + * ylwrap: Import from Automake 1.9.5. + 2005-05-04 Mike Stump * configure.in: Always pass --target to target configures as diff -uprN binutils-2.16.90.0.3/config/accross.m4 binutils-2.16.91.0.1/config/accross.m4 --- binutils-2.16.90.0.3/config/accross.m4 2004-04-12 12:56:34.000000000 -0700 +++ binutils-2.16.91.0.1/config/accross.m4 1969-12-31 16:00:00.000000000 -0800 @@ -1,98 +0,0 @@ -AC_DEFUN([AC_COMPILE_CHECK_SIZEOF], -[changequote(<<, >>)dnl -dnl The name to #define. -define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl -dnl The cache variable name. -define(<>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl -changequote([, ])dnl -AC_MSG_CHECKING(size of $1) -AC_CACHE_VAL(AC_CV_NAME, -[for ac_size in 4 8 1 2 16 12 $2 ; do # List sizes in rough order of prevalence. - AC_TRY_COMPILE([#include "confdefs.h" -#include -$2 -], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size) - if test x$AC_CV_NAME != x ; then break; fi -done -]) -if test x$AC_CV_NAME = x ; then - AC_MSG_ERROR([cannot determine a size for $1]) -fi -AC_MSG_RESULT($AC_CV_NAME) -AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1]) -undefine([AC_TYPE_NAME])dnl -undefine([AC_CV_NAME])dnl -]) - -AC_DEFUN([AC_C_BIGENDIAN_CROSS], -[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian, -[ac_cv_c_bigendian=unknown -# See if sys/param.h defines the BYTE_ORDER macro. -AC_TRY_COMPILE([#include -#include ], [ -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros -#endif], [# It does; now see whether it defined to BIG_ENDIAN or not. -AC_TRY_COMPILE([#include -#include ], [ -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)]) -if test $ac_cv_c_bigendian = unknown; then -AC_TRY_RUN([main () { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long l; - char c[sizeof (long)]; - } u; - u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); -}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes, -[ echo $ac_n "cross-compiling... " 2>&AC_FD_MSG ]) -fi]) -if test $ac_cv_c_bigendian = unknown; then -AC_MSG_CHECKING(to probe for byte ordering) -[ -cat >conftest.c <&AC_FD_MSG - ac_cv_c_bigendian=yes - fi - if test `grep -l LiTTleEnDian conftest.o` ; then - echo $ac_n ' little endian probe OK, ' 1>&AC_FD_MSG - if test $ac_cv_c_bigendian = yes ; then - ac_cv_c_bigendian=unknown; - else - ac_cv_c_bigendian=no - fi - fi - echo $ac_n 'guessing bigendian ... ' >&AC_FD_MSG - fi - fi -AC_MSG_RESULT($ac_cv_c_bigendian) -fi -if test $ac_cv_c_bigendian = yes; then - AC_DEFINE(WORDS_BIGENDIAN, 1, [whether byteorder is bigendian]) - AC_DEFINE(HOST_WORDS_BIG_ENDIAN, 1, - [Define if the host machine stores words of multi-word integers in - big-endian order.]) - BYTEORDER=4321 -else - BYTEORDER=1234 -fi -AC_DEFINE_UNQUOTED(BYTEORDER, $BYTEORDER, [1234 = LIL_ENDIAN, 4321 = BIGENDIAN]) -if test $ac_cv_c_bigendian = unknown; then - AC_MSG_ERROR([unknown endianess - sorry, please pre-set ac_cv_c_bigendian]) -fi -]) diff -uprN binutils-2.16.90.0.3/config/ChangeLog binutils-2.16.91.0.1/config/ChangeLog --- binutils-2.16.90.0.3/config/ChangeLog 2005-04-29 10:50:27.000000000 -0700 +++ binutils-2.16.91.0.1/config/ChangeLog 2005-06-22 13:53:34.661357623 -0700 @@ -1,3 +1,23 @@ +2005-06-14 Tom Tromey + + PR libgcj/19877: + * no-executables.m4: Call real AC_FUNC_MMAP when cache variable + is set but not 'no'. + +2005-06-13 Zack Weinberg + + * depstand.m4, lead-dot.m4: New files. + +2005-05-19 Kelley Cook + + * accross.m4: Delete file. + +2005-05-12 Ryota Kunisawa + + PR bootstrap/21230 + * warnings.m4 (ACX_PROG_CC_WARNING_ALMOST_PEDANTIC): Add + double quotes around GCC variable. + 2005-04-29 Paolo Bonzini * acx.m4 (ACX_PROG_GNAT): Remove stray break. diff -uprN binutils-2.16.90.0.3/config/depstand.m4 binutils-2.16.91.0.1/config/depstand.m4 --- binutils-2.16.90.0.3/config/depstand.m4 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/config/depstand.m4 2005-06-22 13:53:34.664357127 -0700 @@ -0,0 +1,136 @@ +## -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# Based on depend.m4 from automake 1.9, modified for standalone use in +# an environment where GNU make is required. + +# ZW_PROG_COMPILER_DEPENDENCIES +# ----------------------------- +# Variant of _AM_DEPENDENCIES which just does the dependency probe and +# sets fooDEPMODE accordingly. Cache-variable compatible with +# original; not side-effect compatible. As the users of this macro +# may require accurate dependencies for correct builds, it does *not* +# honor --disable-dependency-checking, and failure to detect a usable +# method is an error. depcomp is assumed to be located in +# $ac_aux_dir. +# +# FIXME: Should use the Autoconf 2.5x language-selection mechanism. + +AC_DEFUN([ZW_PROG_COMPILER_DEPENDENCIES], +[ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +am_depcomp=$ac_aux_dir/depcomp +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + if test $depmode = none; then break; fi + + _AS_ECHO([$as_me:$LINENO: trying $depmode], AS_MESSAGE_LOG_FD) + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "include sub/conftest.Po" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + depcmd="depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c" + echo "| $depcmd" | sed -e 's/ */ /g' >&AS_MESSAGE_LOG_FD + if env $depcmd > conftest.err 2>&1 && + grep sub/conftst6.h sub/conftest.Po >>conftest.err 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po >>conftest.err 2>&1 && + ${MAKE-make} -s -f confmf >>conftest.err 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + _AS_ECHO([$as_me:$LINENO: success], AS_MESSAGE_LOG_FD) + break + fi + fi + _AS_ECHO([$as_me:$LINENO: failure, diagnostics are:], AS_MESSAGE_LOG_FD) + sed -e 's/^/| /' < conftest.err >&AS_MESSAGE_LOG_FD + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +if test x${am_cv_$1_dependencies_compiler_type-none} = xnone +then AC_MSG_ERROR([no usable dependency style found]) +else AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +fi +]) + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + +# ZW_CREATE_DEPDIR +# ---------------- +# As AM_SET_DEPDIR, but also create the directory at config.status time. +AC_DEFUN([ZW_CREATE_DEPDIR], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_CONFIG_COMMANDS([depdir], [mkdir $DEPDIR], [DEPDIR=$DEPDIR]) +]) diff -uprN binutils-2.16.90.0.3/config/lead-dot.m4 binutils-2.16.91.0.1/config/lead-dot.m4 --- binutils-2.16.90.0.3/config/lead-dot.m4 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/config/lead-dot.m4 2005-06-22 13:53:34.665356962 -0700 @@ -0,0 +1,32 @@ +# -*- Autoconf -*- +# Copyright (C) 2003 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 +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 1 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) diff -uprN binutils-2.16.90.0.3/config/no-executables.m4 binutils-2.16.91.0.1/config/no-executables.m4 --- binutils-2.16.90.0.3/config/no-executables.m4 2004-01-14 13:07:45.000000000 -0800 +++ binutils-2.16.91.0.1/config/no-executables.m4 2005-06-22 13:53:34.665356962 -0700 @@ -53,7 +53,7 @@ if test x$gcc_no_link = xyes; then ac_cv_func_mmap_fixed_mapped=no fi fi -if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then +if test "x${ac_cv_func_mmap_fixed_mapped}" != xno; then m4_defn([AC_FUNC_MMAP]) fi) diff -uprN binutils-2.16.90.0.3/config/warnings.m4 binutils-2.16.91.0.1/config/warnings.m4 --- binutils-2.16.90.0.3/config/warnings.m4 2005-04-09 12:03:02.000000000 -0700 +++ binutils-2.16.91.0.1/config/warnings.m4 2005-06-22 13:53:34.672355806 -0700 @@ -50,7 +50,7 @@ AC_DEFUN([ACX_PROG_CC_WARNING_ALMOST_PED AC_SUBST([WARN_PEDANTIC])dnl AS_VAR_PUSHDEF([acx_Pedantic], [acx_cv_prog_cc_pedantic_$1])dnl WARN_PEDANTIC= -AS_IF([test $GCC = yes], +AS_IF([test "$GCC" = yes], [AC_CACHE_CHECK([whether $CC supports -pedantic $1], acx_Pedantic, [save_CFLAGS="$CFLAGS" CFLAGS="-pedantic $1" diff -uprN binutils-2.16.90.0.3/config.sub binutils-2.16.91.0.1/config.sub --- binutils-2.16.90.0.3/config.sub 2005-04-29 10:50:23.000000000 -0700 +++ binutils-2.16.91.0.1/config.sub 2005-06-22 13:53:34.063456412 -0700 @@ -277,6 +277,9 @@ case $basic_machine in | z8k) basic_machine=$basic_machine-unknown ;; + m32c) + basic_machine=$basic_machine-unknown + ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown @@ -355,6 +358,8 @@ case $basic_machine in | ymp-* \ | z8k-*) ;; + m32c-*) + ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) diff -uprN binutils-2.16.90.0.3/configure binutils-2.16.91.0.1/configure --- binutils-2.16.90.0.3/configure 2005-05-10 15:46:40.000000000 -0700 +++ binutils-2.16.91.0.1/configure 2005-06-22 13:53:34.077454099 -0700 @@ -1036,6 +1036,10 @@ case "${host}" in configdirs="$configdirs libtermcap" ;; esac +# A target can indicate whether a language isn't supported for some reason. +# Only spaces may be used in this macro; not newlines or tabs. +unsupported_languages= + # Remove more programs from consideration, based on the host or # target this usually means that a port of the program doesn't # exist yet. @@ -1264,15 +1268,18 @@ case "${target}" in noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib" ;; cris-*-* | crisv32-*-*) - libgcj_ex_libffi=`echo ${libgcj} | sed -e 's/target-libffi//'` + unsupported_languages="$unsupported_languages java" case "${target}" in *-*-aout) - noconfigdirs="$noconfigdirs ${libgcj}";; + unsupported_languages="$unsupported_languages f95" + noconfigdirs="$noconfigdirs target-libffi target-boehm-gc";; *-*-elf) - noconfigdirs="$noconfigdirs ${libgcj_ex_libffi}";; + unsupported_languages="$unsupported_languages f95" + noconfigdirs="$noconfigdirs target-boehm-gc";; *-*-linux*) - noconfigdirs="$noconfigdirs ${libgcj_ex_libffi} target-newlib target-libgloss";; + noconfigdirs="$noconfigdirs target-newlib target-libgloss";; *) + unsupported_languages="$unsupported_languages f95" noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss";; esac ;; @@ -1422,7 +1429,8 @@ case "${target}" in noconfigdirs="$noconfigdirs target-libstdc++-v3" ;; mmix-*-*) - noconfigdirs="$noconfigdirs ${libgcj} gdb libgloss target-libgfortran" + noconfigdirs="$noconfigdirs target-libffi target-boehm-gc gdb libgloss" + unsupported_languages="$unsupported_languages f95 java" ;; mn10200-*-*) noconfigdirs="$noconfigdirs ${libgcj}" @@ -1430,6 +1438,9 @@ case "${target}" in mn10300-*-*) noconfigdirs="$noconfigdirs ${libgcj}" ;; + ms1-*-*) + noconfigdirs="$noconfigdirs sim" + ;; powerpc-*-aix*) # copied from rs6000-*-* entry noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" @@ -1778,7 +1789,7 @@ else # 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:1782: checking for $ac_word" >&5 +echo "configure:1793: 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 @@ -1808,7 +1819,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:1812: checking for $ac_word" >&5 +echo "configure:1823: 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 @@ -1859,7 +1870,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:1863: checking for $ac_word" >&5 +echo "configure:1874: 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 @@ -1891,7 +1902,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1895: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1906: 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. @@ -1902,12 +1913,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1906 "configure" +#line 1917 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1922: \"$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 @@ -1933,12 +1944,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:1937: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1948: 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:1942: checking whether we are using GNU C" >&5 +echo "configure:1953: 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 @@ -1947,7 +1958,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1951: \"$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:1962: \"$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 @@ -1966,7 +1977,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:1970: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1981: 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 @@ -2033,7 +2044,7 @@ fi # Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args. set dummy ${ac_tool_prefix}gnatbind; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2037: checking for $ac_word" >&5 +echo "configure:2048: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2065,7 +2076,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "gnatbind", so it can be a program name with args. set dummy gnatbind; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2069: checking for $ac_word" >&5 +echo "configure:2080: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2098,7 +2109,7 @@ fi fi echo $ac_n "checking whether compiler driver understands Ada""... $ac_c" 1>&6 -echo "configure:2102: checking whether compiler driver understands Ada" >&5 +echo "configure:2113: checking whether compiler driver understands Ada" >&5 if eval "test \"`echo '$''{'acx_cv_cc_gcc_supports_ada'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2130,7 +2141,7 @@ else fi echo $ac_n "checking how to compare bootstrapped objects""... $ac_c" 1>&6 -echo "configure:2134: checking how to compare bootstrapped objects" >&5 +echo "configure:2145: checking how to compare bootstrapped objects" >&5 if eval "test \"`echo '$''{'gcc_cv_prog_cmp_skip'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2174,7 +2185,7 @@ fi if test "x$with_mpfr_dir" != x; then - gmpinc="-I$with_mpfr_dir/mpfr" + gmpinc="-I$with_mpfr_dir" gmplibs="$with_mpfr_dir/libmpfr.a" else gmplibs="-lmpfr" @@ -2228,9 +2239,9 @@ saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $gmpinc" # Check GMP actually works echo $ac_n "checking for correct version of gmp.h""... $ac_c" 1>&6 -echo "configure:2232: checking for correct version of gmp.h" >&5 +echo "configure:2243: checking for correct version of gmp.h" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2256: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -2254,12 +2265,12 @@ rm -f conftest* if test x"$have_gmp" = xyes; then echo $ac_n "checking for MPFR""... $ac_c" 1>&6 -echo "configure:2258: checking for MPFR" >&5 +echo "configure:2269: checking for MPFR" >&5 saved_LIBS="$LIBS" LIBS="$LIBS $gmplibs" cat > conftest.$ac_ext < #include @@ -2267,7 +2278,7 @@ int main() { mpfr_t n; mpfr_init(n); ; return 0; } EOF -if { (eval echo configure:2271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -2400,7 +2411,14 @@ if test -d ${srcdir}/gcc; then add_this_lang=no ;; esac - + + # Disable a language that is unsupported by the target. + case " $unsupported_languages " in + *" $language "*) + add_this_lang=no + ;; + esac + case $add_this_lang in no) # Remove language-dependent dirs. @@ -2424,8 +2442,8 @@ if test -d ${srcdir}/gcc; then missing_languages=`echo "$missing_languages" | sed -e "s/^,//" -e "s/,$//"` if test "x$missing_languages" != x; then { echo "configure: error: -The following requested languages were not found: ${missing_languages} -The available languages are: ${potential_languages}" 1>&2; exit 1; } +The following requested languages could not be built: ${missing_languages} +Recognised languages are: ${potential_languages}" 1>&2; exit 1; } fi if test "x$new_enable_languages" != "x$enable_languages"; then @@ -2754,7 +2772,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:2758: checking for $ac_word" >&5 +echo "configure:2776: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_BISON'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2789,7 +2807,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:2793: checking for $ac_word" >&5 +echo "configure:2811: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2824,7 +2842,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:2828: checking for $ac_word" >&5 +echo "configure:2846: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_M4'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2859,7 +2877,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:2863: checking for $ac_word" >&5 +echo "configure:2881: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_FLEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2894,7 +2912,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:2898: checking for $ac_word" >&5 +echo "configure:2916: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2929,7 +2947,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:2933: checking for $ac_word" >&5 +echo "configure:2951: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_MAKEINFO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3536,7 +3554,7 @@ test -n "$target_alias" && ncn_target_to # Extract the first word of "${ncn_tool_prefix}ar", so it can be a program name with args. set dummy ${ncn_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3540: checking for $ac_word" >&5 +echo "configure:3558: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3569,7 +3587,7 @@ if test -z "$ac_cv_prog_AR" ; then # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3573: checking for $ac_word" >&5 +echo "configure:3591: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3608,7 +3626,7 @@ fi # Extract the first word of "${ncn_tool_prefix}as", so it can be a program name with args. set dummy ${ncn_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3612: checking for $ac_word" >&5 +echo "configure:3630: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3641,7 +3659,7 @@ if test -z "$ac_cv_prog_AS" ; then # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3645: checking for $ac_word" >&5 +echo "configure:3663: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3680,7 +3698,7 @@ fi # Extract the first word of "${ncn_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ncn_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3684: checking for $ac_word" >&5 +echo "configure:3702: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3713,7 +3731,7 @@ if test -z "$ac_cv_prog_DLLTOOL" ; then # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3717: checking for $ac_word" >&5 +echo "configure:3735: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3752,7 +3770,7 @@ fi # Extract the first word of "${ncn_tool_prefix}ld", so it can be a program name with args. set dummy ${ncn_tool_prefix}ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3756: checking for $ac_word" >&5 +echo "configure:3774: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3785,7 +3803,7 @@ if test -z "$ac_cv_prog_LD" ; then # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3789: checking for $ac_word" >&5 +echo "configure:3807: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3824,7 +3842,7 @@ fi # Extract the first word of "${ncn_tool_prefix}nm", so it can be a program name with args. set dummy ${ncn_tool_prefix}nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3828: checking for $ac_word" >&5 +echo "configure:3846: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3857,7 +3875,7 @@ if test -z "$ac_cv_prog_NM" ; then # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3861: checking for $ac_word" >&5 +echo "configure:3879: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3896,7 +3914,7 @@ fi # Extract the first word of "${ncn_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ncn_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3900: checking for $ac_word" >&5 +echo "configure:3918: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3929,7 +3947,7 @@ if test -z "$ac_cv_prog_RANLIB" ; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3933: checking for $ac_word" >&5 +echo "configure:3951: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3968,7 +3986,7 @@ fi # Extract the first word of "${ncn_tool_prefix}windres", so it can be a program name with args. set dummy ${ncn_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3972: checking for $ac_word" >&5 +echo "configure:3990: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4001,7 +4019,7 @@ if test -z "$ac_cv_prog_WINDRES" ; then # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4005: checking for $ac_word" >&5 +echo "configure:4023: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4040,7 +4058,7 @@ fi # Extract the first word of "${ncn_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ncn_tool_prefix}objcopy; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4044: checking for $ac_word" >&5 +echo "configure:4062: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4073,7 +4091,7 @@ if test -z "$ac_cv_prog_OBJCOPY" ; then # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4077: checking for $ac_word" >&5 +echo "configure:4095: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJCOPY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4112,7 +4130,7 @@ fi # Extract the first word of "${ncn_tool_prefix}objdump", so it can be a program name with args. set dummy ${ncn_tool_prefix}objdump; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4116: checking for $ac_word" >&5 +echo "configure:4134: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4145,7 +4163,7 @@ if test -z "$ac_cv_prog_OBJDUMP" ; then # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4149: checking for $ac_word" >&5 +echo "configure:4167: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJDUMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4191,7 +4209,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}ar", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4195: checking for $ac_word" >&5 +echo "configure:4213: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_AR_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4224,7 +4242,7 @@ if test -z "$ac_cv_prog_CONFIGURED_AR_FO # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4228: checking for $ac_word" >&5 +echo "configure:4246: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_AR_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4263,7 +4281,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}as", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4267: checking for $ac_word" >&5 +echo "configure:4285: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_AS_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4296,7 +4314,7 @@ if test -z "$ac_cv_prog_CONFIGURED_AS_FO # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4300: checking for $ac_word" >&5 +echo "configure:4318: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_AS_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4335,7 +4353,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4339: checking for $ac_word" >&5 +echo "configure:4357: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4368,7 +4386,7 @@ if test -z "$ac_cv_prog_CONFIGURED_DLLTO # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4372: checking for $ac_word" >&5 +echo "configure:4390: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4407,7 +4425,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}ld", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4411: checking for $ac_word" >&5 +echo "configure:4429: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_LD_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4440,7 +4458,7 @@ if test -z "$ac_cv_prog_CONFIGURED_LD_FO # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4444: checking for $ac_word" >&5 +echo "configure:4462: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_LD_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4479,7 +4497,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}nm", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4483: checking for $ac_word" >&5 +echo "configure:4501: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_NM_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4512,7 +4530,7 @@ if test -z "$ac_cv_prog_CONFIGURED_NM_FO # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4516: checking for $ac_word" >&5 +echo "configure:4534: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_NM_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4551,7 +4569,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4555: checking for $ac_word" >&5 +echo "configure:4573: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_RANLIB_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4584,7 +4602,7 @@ if test -z "$ac_cv_prog_CONFIGURED_RANLI # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4588: checking for $ac_word" >&5 +echo "configure:4606: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_RANLIB_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4623,7 +4641,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}windres", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4627: checking for $ac_word" >&5 +echo "configure:4645: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_WINDRES_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4656,7 +4674,7 @@ if test -z "$ac_cv_prog_CONFIGURED_WINDR # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4660: checking for $ac_word" >&5 +echo "configure:4678: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_WINDRES_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4741,7 +4759,7 @@ RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${ NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target} echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:4745: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:4763: 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" @@ -4788,7 +4806,7 @@ esac # gcc for stageN-gcc and stagePREV-gcc for stage(N-1). In case this is not # possible, however, we can resort to mv. echo $ac_n "checking if symbolic links between directories work""... $ac_c" 1>&6 -echo "configure:4792: checking if symbolic links between directories work" >&5 +echo "configure:4810: checking if symbolic links between directories work" >&5 if eval "test \"`echo '$''{'gcc_cv_prog_ln_s_dir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4902,15 +4920,34 @@ trap 'rm -f $CONFIG_STATUS conftest*; ex # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. -cat > conftest.defs <<\EOF -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g -s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g -s%\[%\\&%g -s%\]%\\&%g -s%\$%$$%g -EOF -DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` -rm -f conftest.defs +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then we branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +cat >confdef2opt.sed <<\_ACEOF +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +t quote +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +t quote +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +_ACEOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed # Without the "./", some shells look in PATH for config.status. diff -uprN binutils-2.16.90.0.3/configure.in binutils-2.16.91.0.1/configure.in --- binutils-2.16.90.0.3/configure.in 2005-05-10 15:46:40.000000000 -0700 +++ binutils-2.16.91.0.1/configure.in 2005-06-22 13:53:34.088452282 -0700 @@ -257,6 +257,10 @@ case "${host}" in configdirs="$configdirs libtermcap" ;; esac +# A target can indicate whether a language isn't supported for some reason. +# Only spaces may be used in this macro; not newlines or tabs. +unsupported_languages= + # Remove more programs from consideration, based on the host or # target this usually means that a port of the program doesn't # exist yet. @@ -481,15 +485,18 @@ case "${target}" in noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib" ;; cris-*-* | crisv32-*-*) - libgcj_ex_libffi=`echo ${libgcj} | sed -e 's/target-libffi//'` + unsupported_languages="$unsupported_languages java" case "${target}" in *-*-aout) - noconfigdirs="$noconfigdirs ${libgcj}";; + unsupported_languages="$unsupported_languages f95" + noconfigdirs="$noconfigdirs target-libffi target-boehm-gc";; *-*-elf) - noconfigdirs="$noconfigdirs ${libgcj_ex_libffi}";; + unsupported_languages="$unsupported_languages f95" + noconfigdirs="$noconfigdirs target-boehm-gc";; *-*-linux*) - noconfigdirs="$noconfigdirs ${libgcj_ex_libffi} target-newlib target-libgloss";; + noconfigdirs="$noconfigdirs target-newlib target-libgloss";; *) + unsupported_languages="$unsupported_languages f95" noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss";; esac ;; @@ -639,7 +646,8 @@ case "${target}" in noconfigdirs="$noconfigdirs target-libstdc++-v3" ;; mmix-*-*) - noconfigdirs="$noconfigdirs ${libgcj} gdb libgloss target-libgfortran" + noconfigdirs="$noconfigdirs target-libffi target-boehm-gc gdb libgloss" + unsupported_languages="$unsupported_languages f95 java" ;; mn10200-*-*) noconfigdirs="$noconfigdirs ${libgcj}" @@ -647,6 +655,9 @@ case "${target}" in mn10300-*-*) noconfigdirs="$noconfigdirs ${libgcj}" ;; + ms1-*-*) + noconfigdirs="$noconfigdirs sim" + ;; powerpc-*-aix*) # copied from rs6000-*-* entry noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" @@ -1030,7 +1041,7 @@ have_gmp=yes AC_ARG_WITH(mpfr-dir, [ --with-mpfr-dir=PATH Specify source directory for MPFR library]) if test "x$with_mpfr_dir" != x; then - gmpinc="-I$with_mpfr_dir/mpfr" + gmpinc="-I$with_mpfr_dir" gmplibs="$with_mpfr_dir/libmpfr.a" else gmplibs="-lmpfr" @@ -1207,7 +1218,14 @@ if test -d ${srcdir}/gcc; then add_this_lang=no ;; esac - + + # Disable a language that is unsupported by the target. + case " $unsupported_languages " in + *" $language "*) + add_this_lang=no + ;; + esac + case $add_this_lang in no) # Remove language-dependent dirs. @@ -1231,8 +1249,8 @@ if test -d ${srcdir}/gcc; then missing_languages=`echo "$missing_languages" | sed -e "s/^,//" -e "s/,$//"` if test "x$missing_languages" != x; then AC_MSG_ERROR([ -The following requested languages were not found: ${missing_languages} -The available languages are: ${potential_languages}]) +The following requested languages could not be built: ${missing_languages} +Recognised languages are: ${potential_languages}]) fi if test "x$new_enable_languages" != "x$enable_languages"; then diff -uprN binutils-2.16.90.0.3/cpu/ChangeLog binutils-2.16.91.0.1/cpu/ChangeLog --- binutils-2.16.90.0.3/cpu/ChangeLog 2005-05-10 15:46:43.000000000 -0700 +++ binutils-2.16.91.0.1/cpu/ChangeLog 2005-06-22 13:53:34.675355310 -0700 @@ -1,3 +1,9 @@ +2005-06-15 Dave Brolley + + Contributed by Red Hat. + * ms1.cpu: New file. Written by Nick Clifton, Stan Cox. + * ms1.opc: New file. Written by Stan Cox. + 2005-05-10 Nick Clifton * Update the address and phone number of the FSF organization in diff -uprN binutils-2.16.90.0.3/cpu/ms1.cpu binutils-2.16.91.0.1/cpu/ms1.cpu --- binutils-2.16.90.0.3/cpu/ms1.cpu 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/cpu/ms1.cpu 2005-06-22 13:53:34.676355145 -0700 @@ -0,0 +1,1240 @@ +; Morpho Technologies mRISC CPU description. -*- Scheme -*- +; Copyright 2001 Free Software Foundation, Inc. +; +; Contributed by Red Hat Inc; developed under contract from +; Morpho Technologies. +; +; This file is part of the GNU Binutils. +; +; This program is free software; you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 2 of the License, or +; (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program; if not, write to the Free Software +; Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + +(include "simplify.inc") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Define The Architecture, Attributes, ISA, CPU, Machine, And Model. ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; define-arch must appear first +(define-arch + (name ms1) ; name of cpu family + (comment "Morpho Technologies mRISC family") + (default-alignment aligned) + (insn-lsb0? #t) + (machs ms1 ms1-003) + (isas ms1) +) + +; Instruction set parameters. + +(define-isa + (name ms1) + (comment "Morpho Technologies mrisc ISA") + (default-insn-word-bitsize 32) + (default-insn-bitsize 32) + (base-insn-bitsize 32) + (parallel-insns 2) +) + +; Cpu family definitions. + + +(define-cpu + ; cpu names must be distinct from the architecture name and machine names. + (name ms1bf) + (comment "Morpho Technologies mRISC family") + (endian big) + (word-bitsize 32) +) + +(define-cpu + ; cpu names must be distinct from the architecture name and machine names. + (name ms1-003bf) + (comment "Morpho Technologies mRISC family") + (endian big) + (word-bitsize 32) +) + +(define-mach + (name ms1) + (comment "Morpho Technologies mrisc") + (cpu ms1bf) + (isas ms1) +) + +(define-mach + (name ms1-003) + (comment "Morpho Technologies mrisc") + (cpu ms1-003bf) + (isas ms1) +) + + +; Model descriptions. +; Can probably take the u-exec out. We'll see. +(define-model + (name ms1) + (comment "Morpho Technologies mrisc") + (mach ms1) + (unit u-exec "Execution Unit" () + 1 1 ; issue done + () ; state + () ; inputs + () ; outputs + () ; profile action (default) + ) +) + +(define-model + (name ms1-003) + (comment "Morpho Technologies mrisc") + (mach ms1-003) + (unit u-exec "Execution Unit" () + 1 1 ; issue done + () ; state + () ; inputs + () ; outputs + () ; profile action (default) + ) +) + +; Macros to simplify MACH attribute specification. + +(define-pmacro MACHMS1 (MACH ms1)) +(define-pmacro MACHMS1-003 (MACH ms1-003)) + +; FIXME: It might simplify things to separate the execute process from the +; one that updates the PC. + + +;;;;;;;;;;;;;;;;;;;;;;;; +;; Instruction Fields ;; +;;;;;;;;;;;;;;;;;;;;;;;; + +; Attributes: +; PCREL-ADDR: pc relative value (for reloc and disassembly purposes) +; ABS-ADDR: absolute address (for reloc and disassembly purposes?) +; RESERVED: bits are not used to decode insn, must be all 0 +; RELOC: there is a relocation associated with this field (experiment) +; +; f-msys: Identify a a morphosys insns. 1 if msys, 0 if not. +; f-opc: 6 bit opcode for non-morphosys instructions. +; f-msopc: 6 bit opcode for morphosys instructions. +; f-imm: flag to indicate use of an immediate operand. 1 if yes, 0 if no. +; f-sr1: source resgister 1. (also used for MSYS insns) +; f-sr2: source register 2. (also used for MSYS insns) +; f-dr: destination register when located in bits 19:16. +; f-drrr: destination register when located in bits 15:12. (also for MSYS insns) +; f-imm16: 16 bit immediate value when not an offset. +; f-imm16a: 16 bit immediate value when it's a pc-rel offset. +; f-uu4a: unused 4 bit field. +; f-uu4b: second unsed 4 bit field. +; f-uu12: unused 12 bit field. +; f-uu16: unused 16 bit field. +; f-uu24: unused 24 bit field. + +(dnf f-msys "morphosys insn flag" () 31 1) +(dnf f-opc "opcode field" () 30 6) +(dnf f-imm "immedate flag" () 24 1) +(dnf f-uu24 "unused 24 bits" () 23 24) +(dnf f-sr1 "sr1 register field" (ABS-ADDR) 23 4) +(dnf f-sr2 "sr2 register field" (ABS-ADDR) 19 4) +(dnf f-dr "dr register field" (ABS-ADDR) 19 4) +(dnf f-drrr "drrr register field" (ABS-ADDR) 15 4) +(dnf f-imm16u "unsigned 16 bit immediate" () 15 16) +(df f-imm16s "signed 16 bit immediate" () 15 16 INT ((value pc) (add HI value 0)) ((value pc) (add HI value 0))) +(dnf f-imm16a "pc-rel offset" (PCREL-ADDR) 15 16) +(dnf f-uu4a "unused 4 bit field" () 19 4) +(dnf f-uu4b "unused 4 bit field" () 23 4) +(dnf f-uu12 "unused 12 bit field" () 11 12) +(dnf f-uu16 "unused 16 bit field" () 15 16) + +; The following ifields are used exclusively for the MorphoSys instructions. +; In a few cases, a bit field is used for something in addition to what its +; name suggests. For the most part, the names are meaningful though. + +(dnf f-msopc "opcode field" () 30 5) +(dnf f-uu-26-25 "unused 26 bits" () 25 26) +(dnf f-mask "mask" () 25 16) +(dnf f-bankaddr "bank address" () 25 13) +(dnf f-rda "rda" () 25 1) +(dnf f-uu-2-25 "unused bits 25 & 24" () 25 2) +(dnf f-rbbc "Omega network configuration" () 25 2) +(dnf f-perm "perm" () 25 2) +(dnf f-mode "mode" () 25 2) +(dnf f-uu-1-24 "testing" () 24 1) +(dnf f-wr "wr" () 24 1) +(dnf f-fbincr "fb incr" () 23 4) +(dnf f-uu-2-23 "unused bits 23 and 22" () 23 2) +(dnf f-xmode "xmode" () 23 1) +(dnf f-a23 "a23" () 23 1) +(dnf f-mask1 "mask1" () 22 3) +(dnf f-cr "cr" () 22 3) +(dnf f-type "type" () 21 2) +(dnf f-incamt "increment amount" () 19 8) +(dnf f-cbs "cbs" () 19 2) +(dnf f-uu-1-19 "unused bit 19" () 19 1) +(dnf f-ball "b_all" () 19 1) +(dnf f-colnum "column number" () 18 3) +(dnf f-brc "b_r_c" () 18 3) +(dnf f-incr "incr" () 17 6) +(dnf f-fbdisp "frame buffer displacement" () 15 6) +(dnf f-uu-4-15 "unused bits 15,14,13,12" () 15 4) +(dnf f-length "length" () 15 3) +(dnf f-uu-1-15 "unused bit 15" () 15 1) +(dnf f-rc "row/column context" () 15 1) +(dnf f-rcnum "starting cell of cntxt mem." () 14 3) +(dnf f-rownum "row number" () 14 3) +(dnf f-cbx "cbx" () 14 3) +(dnf f-id "id" () 14 1) +(dnf f-size "size" () 13 14) +(dnf f-rownum1 "row number" () 12 3) +(dnf f-uu-3-11 "unused 3 bits (11-9)" () 11 3) +(dnf f-rc1 "row/column context" () 11 1) +(dnf f-ccb "ccb" () 11 1) +(dnf f-cbrb "data-bus orientation" () 10 1) +(dnf f-cdb "cdb" () 10 1) +(dnf f-rownum2 "row number" () 9 3) +(dnf f-cell "cell" () 9 3) +(dnf f-uu-3-9 "unused 3 bits (9-7)" () 9 3) +(dnf f-contnum "context number" () 8 9) +(dnf f-uu-1-6 "unused bit 6" () 6 1) +(dnf f-dup "dup" () 6 1) +(dnf f-rc2 "rc2" () 6 1) +(dnf f-ctxdisp "context displacement" () 5 6) + + +; The following is just for a test +(dnf f-msysfrsr2 "sr2 for msys" () 19 4) +(dnf f-brc2 "b_r_c2" () 14 3) +(dnf f-ball2 "b_all2" () 15 1) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Enumerations Of Instruction Fields ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; insn-msys: bit 31. 1 for Morphosys Insns, 0 if not. +(define-normal-insn-enum insn-msys "msys enums" () MSYS_ f-msys + (NO YES) +) + +; insn-opc: bits 30 through 25 . Non-MorphoSys Instructions +; Note - the documentation is wrong for the encoding of the DBNZ +; instruction. It is actually 011110. See Issue 67699. +(define-normal-insn-enum insn-opc "opc enums" () OPC_ f-opc + (ADD ADDU SUB SUBU MUL - - - + AND OR XOR NAND NOR XNOR LDUI - + LSL LSR ASR - - - - - + BRLT BRLE BREQ JMP JAL BRNEQ DBNZ - + LDW STW - - - - - - + - - - - - - - - + EI DI SI RETI BREAK IFLUSH - - + ) +) + +; insn-msopc: bits 30 through 26 . MorphoSys Instructions +(define-normal-insn-enum insn-msopc "msopc enums" () MSOPC_ f-msopc + (LDCTXT LDFB STFB FBCB MFBCB FBCCI FBRCI FBCRI + FBRRI MFBCCI MFBRCI MFBCRI MFBRRI FBCBDR RCFBCB MRCFBCB + CBCAST DUPCBCAST WFBI WFB RCRISC FBCBINC RCXMODE INTLVR + WFBINC MWFBINC WFBINCR MWFBINCR FBCBINCS MFBCBINCS FBCBINCRS MFBCBINCRS + - - - - - - - - + ) +) + +; insn-imm: bit 24. Immediate operand indicator. +(define-normal-insn-enum insn-imm "imm enums" () IMM_ f-imm + ; This bit specifies whether and immediate operand will be present. + ; It's 1 if ther is, 0 if there is not. + (NO YES) +) +;;;;;;;;;;;;;;;; +;; Attributes ;; +;;;;;;;;;;;;;;;; + +; Might not need this. Keep if for the sim just in case. +;(define-attr +; (for insn) +; (type boolean) +; (name EXT-SKIP-INSN) +; (comment "instruction is a PAGE, LOADL or LOADH instruction") +;) + +(define-attr + (for insn) + (type boolean) + (name LOAD-DELAY) + (comment "insn has a load delay") +) + +(define-attr + (for insn) + (type boolean) + (name MEMORY-ACCESS) + (comment "insn performs a memory access") +) + +(define-attr + (for insn) + (type boolean) + (name AL-INSN) + (comment "insn is an arithmetic or logic insn.") +) + +(define-attr + (for insn) + (type boolean) + (name IO-INSN) + (comment "insn performs an I/O operation") +) + +(define-attr + (for insn) + (type boolean) + (name BR-INSN) + (comment "insn performs an I/O operation") +) + +(define-pmacro (define-reg-use-attr regfield) + (define-attr + (for insn) + (type boolean) + (name (.sym "USES-" (.upcase regfield))) + (comment ("insn accesses register operand " regfield)))) + +(define-reg-use-attr "frdr") +(define-reg-use-attr "frdrrr") +(define-reg-use-attr "frsr1") +(define-reg-use-attr "frsr2") + + +; Might not need this. Keep it for the sim just in case. +(define-attr + (for insn) + (type boolean) + (name SKIPA) + (comment "instruction is a SKIP instruction") +) + + +;;;;;;;;;;;;;;;;;;;;; +;; Hardware Pieces ;; +;;;;;;;;;;;;;;;;;;;;; + +;(define-pmacro (build-reg-name n) (.splice (.str "$" n) n)) + +; These are the 16 registers that the chip has. In later versions +; where there will be more registers, this will need to be expanded. +; Note that there are two entries for the registers with two names. +(define-hardware + (name h-spr) + (comment "special-purpose registers") + (type register SI (16)) + (indices keyword "" (("R0" 0) ("R1" 1) ("R2" 2) ("R3" 3) ("R4" 4) ("R5" 5) + ("R6" 6) ("R7" 7) ("R8" 8) ("R9" 9) ("R10" 10) ("R11" 11) ("R12" 12) ("fp" 12) + ("R13" 13) ("sp" 13) ("R14" 14) ("ra" 14) ("R15" 15) ("ira" 15))) +; (get (index) (and (raw-reg h-spr) #xffffffff)) +; (set (index value) (set (raw-reg h-spr) (and value #xffffffff))) +) + +; This is the program counter. +(dnh h-pc "program counter" (PC PROFILE) (pc) () () ()) + +(define-keyword + (name msys-syms) + (print-name h-nil) + (prefix "") + (values (DUP 1) (XX 0)) +) + +;;;;;;;;;;;;;; +;; Operands ;; +;;;;;;;;;;;;;; + +(define-operand (name frsr1) (comment "register") (attrs) + (type h-spr) (index f-sr1) ) +(define-operand (name frsr2) (comment "register") (attrs) + (type h-spr) (index f-sr2) ) +(define-operand (name frdr) (comment "register") (attrs) + (type h-spr) (index f-dr) ) +(define-operand (name frdrrr) (comment "register") (attrs) + (type h-spr) (index f-drrr) ) +(define-operand (name imm16) (comment "immediate value - sign extd") (attrs) + (type h-sint) (index f-imm16s) (handlers (parse "imm16") (print "dollarhex"))) +(define-operand (name imm16z) (comment "immediate value - zero extd") (attrs) + (type h-uint) (index f-imm16u) (handlers (parse "imm16") (print "dollarhex"))) +(define-operand (name imm16o) (comment "immediate value") (attrs) + (type h-uint) (index f-imm16s) (handlers (parse "imm16") (print "dollarhex"))) + +; Operands for MorphoSys Instructions + +(define-operand (name rc) (comment "rc") (attrs) + (type h-uint) (index f-rc) (handlers (parse "rc") (print "dollarhex"))) + +(define-operand (name rcnum) (comment "rcnum") (attrs) + (type h-uint) (index f-rcnum) (handlers (print "dollarhex"))) + +(define-operand (name contnum) (comment "context number") (attrs) + (type h-uint) (index f-contnum) (handlers (print "dollarhex"))) + +(define-operand (name rbbc) (comment "omega network configuration") (attrs) + (type h-uint) (index f-rbbc) (handlers (parse "rbbc") (print "dollarhex"))) + +(define-operand (name colnum) (comment "column number") (attrs) + (type h-uint) (index f-colnum) (handlers (print "dollarhex"))) + +(define-operand (name rownum) (comment "row number") (attrs) + (type h-uint) (index f-rownum) (handlers (print "dollarhex"))) + +(define-operand (name rownum1) (comment "row number") (attrs) + (type h-uint) (index f-rownum1) (handlers (print "dollarhex"))) + +(define-operand (name rownum2) (comment "row number") (attrs) + (type h-uint) (index f-rownum2) (handlers (print "dollarhex"))) + +(define-operand (name rc1) (comment "rc1") (attrs) + (type h-uint) (index f-rc1) (handlers (parse "rc") (print "dollarhex"))) + +(define-operand (name rc2) (comment "rc2") (attrs) + (type h-uint) (index f-rc2) (handlers (parse "rc") (print "dollarhex"))) + +(define-operand (name cbrb) (comment "data-bus orientation") (attrs) + (type h-uint) (index f-cbrb) (handlers (parse "cbrb") (print "dollarhex"))) + +(define-operand (name cell) (comment "cell") (attrs) + (type h-uint) (index f-cell) (handlers (print "dollarhex"))) + +(define-operand (name dup) (comment "dup") (attrs) + (type h-uint) (index f-dup) (handlers (parse "dup") (print "dollarhex"))) + +(define-operand (name ctxdisp) (comment "context displacement") (attrs) + (type h-uint) (index f-ctxdisp) (handlers (print "dollarhex"))) + +(define-operand (name fbdisp) (comment "frame buffer displacement") (attrs) + (type h-uint) (index f-fbdisp) (handlers (print "dollarhex"))) + +(define-operand (name type) (comment "type") (attrs) + (type h-uint) (index f-type) (handlers (parse "type") (print "dollarhex"))) + +(define-operand (name mask) (comment "mask") (attrs) + (type h-uint) (index f-mask) (handlers (print "dollarhex"))) + +(define-operand (name bankaddr) (comment "bank address") (attrs) + (type h-uint) (index f-bankaddr) (handlers (print "dollarhex"))) + +(define-operand (name incamt) (comment "increment amount") (attrs) + (type h-uint) (index f-incamt) (handlers (print "dollarhex"))) + +(define-operand (name xmode) (comment "xmode") (attrs) + (type h-uint) (index f-xmode) (handlers (parse "xmode") (print "dollarhex"))) + +(define-operand (name mask1) (comment "mask1") (attrs) + (type h-uint) (index f-mask1) (handlers (print "dollarhex"))) + +(define-operand (name ball) (comment "b_all") (attrs) + (type h-uint) (index f-ball) (handlers (parse "ball") (print "dollarhex"))) + +(define-operand (name brc) (comment "b_r_c") (attrs) + (type h-uint) (index f-brc) (handlers (print "dollarhex"))) + +(define-operand (name rda) (comment "rd") (attrs) + (type h-uint) (index f-rda) (handlers (print "dollarhex"))) + +(define-operand (name wr) (comment "wr") (attrs) + (type h-uint) (index f-wr) (handlers (print "dollarhex"))) + +(define-operand (name ball2) (comment "b_all2") (attrs) + (type h-uint) (index f-ball2) (handlers (parse "ball") (print "dollarhex"))) + +(define-operand (name brc2) (comment "b_r_c2") (attrs) + (type h-uint) (index f-brc2) (handlers (print "dollarhex"))) +(define-operand (name perm) (comment "perm") (attrs) + (type h-uint) (index f-perm) (handlers (print "dollarhex"))) +(define-operand (name a23) (comment "a23") (attrs) + (type h-uint) (index f-a23) (handlers (print "dollarhex"))) +(define-operand (name cr) (comment "c-r") (attrs) + (type h-uint) (index f-cr) (handlers (print "dollarhex"))) +(define-operand (name cbs) (comment "cbs") (attrs) + (type h-uint) (index f-cbs) (handlers (print "dollarhex"))) +(define-operand (name incr) (comment "incr") (attrs) + (type h-uint) (index f-incr) (handlers (print "dollarhex"))) +(define-operand (name length) (comment "length") (attrs) + (type h-uint) (index f-length) (handlers (print "dollarhex"))) +(define-operand (name cbx) (comment "cbx") (attrs) + (type h-uint) (index f-cbx) (handlers (print "dollarhex"))) +(define-operand (name ccb) (comment "ccb") (attrs) + (type h-uint) (index f-ccb) (handlers (print "dollarhex"))) +(define-operand (name cdb) (comment "cdb") (attrs) + (type h-uint) (index f-cdb) (handlers (print "dollarhex"))) + +; For the INTLVR insn +(define-operand (name mode) (comment "mode") (attrs) + (type h-uint) (index f-mode) (handlers (print "dollarhex"))) +(define-operand (name id) (comment "i/d") (attrs) + (type h-uint) (index f-id) (handlers (print "dollarhex"))) +(define-operand (name size) (comment "size") (attrs) + (type h-uint) (index f-size) (handlers (print "dollarhex"))) + +(define-operand (name fbincr) (comment "fb incr") (attrs) + (type h-uint) (index f-fbincr) (handlers (print "dollarhex"))) + +; Probaby won't need most of these. +(define-pmacro r0 (reg h-spr #x0)) +(define-pmacro r1 (reg h-spr #x01)) +(define-pmacro r2 (reg h-spr #x02)) +(define-pmacro r3 (reg h-spr #x03)) +(define-pmacro r4 (reg h-spr #x04)) +(define-pmacro r5 (reg h-spr #x05)) +(define-pmacro r6 (reg h-spr #x06)) +(define-pmacro r7 (reg h-spr #x07)) +(define-pmacro r8 (reg h-spr #x08)) +(define-pmacro r9 (reg h-spr #x09)) +(define-pmacro r10 (reg h-spr #xA)) +(define-pmacro r11 (reg h-spr #xB)) +(define-pmacro r12 (reg h-spr #xC)) +(define-pmacro fp (reg h-spr #xC)) +(define-pmacro r13 (reg h-spr #xD)) +(define-pmacro sp (reg h-spr #xD)) +(define-pmacro r14 (reg h-spr #xE)) +(define-pmacro ra (reg h-spr #xE)) +(define-pmacro r15 (reg h-spr #xF)) +(define-pmacro ira (reg h-spr #xF)) + +; delayed set +(define-pmacro (dset dest src) (set (delay 1 dest) src)) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Instructions As Defined In the MorphoRisc ISA Document ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; Arithmetic Instructions + +(dni add "ADD DstReg, SrcReg1, SrcReg2" + (AL-INSN USES-FRDRRR USES-FRSR1 USES-FRSR2) + "add $frdrrr,$frsr1,$frsr2" + (+ MSYS_NO OPC_ADD IMM_NO frsr1 frsr2 frdrrr (f-uu12 0)) + (set frdrrr (add SI frsr1 frsr2)) + () +) + +(dni addu "ADDU DstReg, SrcReg1, SrcReg2" + (AL-INSN USES-FRDRRR USES-FRSR1 USES-FRSR2) + "addu $frdrrr,$frsr1,$frsr2" + (+ MSYS_NO OPC_ADDU IMM_NO frsr1 frsr2 frdrrr (f-uu12 0)) + (set frdrrr (add USI frsr1 frsr2)) + () +) + +(dni addi "ADDI DstReg, SrcReg1 UnsImm" + (AL-INSN USES-FRDR USES-FRSR1) + "addi $frdr,$frsr1,#$imm16" + (+ MSYS_NO OPC_ADD IMM_YES frsr1 frdr imm16) + (sequence((HI tmp)) + (set HI tmp (and imm16 #xffff)) + (set frdr (add SI frsr1 (ext SI tmp))) + ) + () +) + +(dni addui "ADDUI DstReg, SrcReg1, UnsImm" + (AL-INSN USES-FRDR USES-FRSR1) + "addui $frdr,$frsr1,#$imm16z" + (+ MSYS_NO OPC_ADDU IMM_YES frsr1 frdr imm16z) + (set frdr (add USI frsr1 (ext USI imm16z))) + () +) + +(dni sub "SUB DstReg, SrcReg1, SrcReg2" + (AL-INSN USES-FRDRRR USES-FRSR1 USES-FRSR2) + "sub $frdrrr,$frsr1,$frsr2" + (+ MSYS_NO OPC_SUB IMM_NO frsr1 frsr2 frdrrr (f-uu12 0)) + (set frdrrr (sub SI frsr1 frsr2)) + () +) + +(dni subu "SUBU DstReg, SrcReg1, SrcReg2" + (AL-INSN USES-FRDRRR USES-FRSR1 USES-FRSR2) + "subu $frdrrr,$frsr1,$frsr2" + (+ MSYS_NO OPC_SUBU IMM_NO frsr1 frsr2 frdrrr (f-uu12 0)) + (set frdrrr (sub USI frsr1 frsr2)) + () +) + +(dni subi "SUBI DstReg, SrcReg1, UnsImm" + (AL-INSN USES-FRDR USES-FRSR1) + "subi $frdr,$frsr1,#$imm16" + (+ MSYS_NO OPC_SUB IMM_YES frsr1 frdr imm16) + (sequence((HI tmp)) + (set HI tmp (and imm16 #xffff)) + (set frdr (sub SI frsr1 (ext SI tmp))) + ) + ;(set frdr (sub SI frsr1 (ext SI imm16))) + () +) + +(dni subui "SUBUI DstReg, SrcReg1, UnsImm" + (AL-INSN USES-FRDR USES-FRSR1) + "subui $frdr,$frsr1,#$imm16z" + (+ MSYS_NO OPC_SUBU IMM_YES frsr1 frdr imm16z) + (set frdr (sub USI frsr1 (ext USI imm16z))) + () +) + +(dni mul "MUL DstReg, SrcReg1, SrcReg2" + (MACHMS1-003 AL-INSN USES-FRDRRR USES-FRSR1 USES-FRSR2) + "mul $frdrrr,$frsr1,$frsr2" + (+ MSYS_NO OPC_MUL IMM_NO frsr1 frsr2 frdrrr (f-uu12 0)) + (sequence((HI op1) (HI op2)) + (set op1 (and frsr1 #xffff)) + (if (or (lt op1 (const -32768)) (gt op1 (const 32767))) + (error "operand out of range") + ) + (set op2 (and frsr2 #xffff)) + (if (or (lt op2 (const -32768)) (gt op2 (const 32767))) + (error "operand out of range") + ) + (set frdrrr (mul SI (ext SI op1) (ext SI op2))) + ) + () +) + +(dni muli "MULI DstReg, SrcReg1, UnsImm" + (MACHMS1-003 AL-INSN USES-FRDR USES-FRSR1) + "muli $frdr,$frsr1,#$imm16" + (+ MSYS_NO OPC_MUL IMM_YES frsr1 frdr imm16) + (sequence((HI op1) (HI op2)) + (set op1 (and frsr1 #xffff)) + (if (or (lt op1 (const -32768)) (gt op1 (const 32767))) + (error "operand out of range") + ) + (set op2 (and imm16 #xffff)) + (if (eq op1 (const 0)) + (error "op1 is 0") + ) + (if (eq op2 (const 0)) + (error "op2 is 0") + ) + (set frdr (mul SI (ext SI op1) (ext SI op2))) + ) + () +) + +; Logical Instructions + +(dni and "AND DstReg, SrcReg1, SrcReg2" + (AL-INSN USES-FRDRRR USES-FRSR1 USES-FRSR2) + "and $frdrrr,$frsr1,$frsr2" + (+ MSYS_NO OPC_AND IMM_NO frsr1 frsr2 frdrrr (f-uu12 0)) + (set frdrrr (and frsr1 frsr2)) + () +) + +(dni andi "ANDI DstReg, SrcReg1, UnsImm" + (AL-INSN USES-FRDR USES-FRSR1) + "andi $frdr,$frsr1,#$imm16z" + (+ MSYS_NO OPC_AND IMM_YES frsr1 frdr imm16z) + (set frdr (and frsr1 (ext USI imm16z))) + () +) + +(dni or "OR DstReg, SrcReg1, SrcReg2" + (AL-INSN USES-FRDRRR USES-FRSR1 USES-FRSR2) + "or $frdrrr,$frsr1,$frsr2" + (+ MSYS_NO OPC_OR IMM_NO frsr1 frsr2 frdrrr (f-uu12 0)) + (set frdrrr (or frsr1 frsr2)) + () +) + +(dni nop "nop" + () + "nop" + (+ MSYS_NO OPC_OR IMM_NO (f-uu24 0)) + (nop) + () +) + +(dni ori "ORI DstReg, SrcReg1, UnsImm" + (AL-INSN USES-FRDR USES-FRSR1) + "ori $frdr,$frsr1,#$imm16z" + (+ MSYS_NO OPC_OR IMM_YES frsr1 frdr imm16z) + (set frdr (or frsr1 (ext USI imm16z))) + () +) + +(dni xor "XOR DstReg, SrcReg1, SrcReg2" + (AL-INSN USES-FRDRRR USES-FRSR1 USES-FRSR2) + "xor $frdrrr,$frsr1,$frsr2" + (+ MSYS_NO OPC_XOR IMM_NO frsr1 frsr2 frdrrr (f-uu12 0)) + (set frdrrr (xor frsr1 frsr2)) + () +) + +(dni xori "XORI DstReg, SrcReg1, UnsImm" + (AL-INSN USES-FRDR USES-FRSR1) + "xori $frdr,$frsr1,#$imm16z" + (+ MSYS_NO OPC_XOR IMM_YES frsr1 frdr imm16z) + (set frdr (xor frsr1 (ext USI imm16z))) + () +) + +(dni nand "NAND DstReg, SrcReg1, SrcReg2" + (AL-INSN USES-FRDRRR USES-FRSR1 USES-FRSR2) + "nand $frdrrr,$frsr1,$frsr2" + (+ MSYS_NO OPC_NAND IMM_NO frsr1 frsr2 frdrrr (f-uu12 0)) + (set frdrrr (inv (and frsr1 frsr2))) + () +) + +(dni nandi "NANDI DstReg, SrcReg1, UnsImm" + (AL-INSN USES-FRDR USES-FRSR1) + "nandi $frdr,$frsr1,#$imm16z" + (+ MSYS_NO OPC_NAND IMM_YES frsr1 frdr imm16z) + (set frdr (inv (and frsr1 (ext USI imm16z)))) + () +) + +(dni nor "NOR DstReg, SrcReg1, SrcReg2" + (AL-INSN USES-FRDRRR USES-FRSR1 USES-FRSR2) + "nor $frdrrr,$frsr1,$frsr2" + (+ MSYS_NO OPC_NOR IMM_NO frsr1 frsr2 frdrrr (f-uu12 0)) + (set frdrrr (inv (or frsr1 frsr2))) + () +) + +(dni nori "NORI DstReg, SrcReg1, UnsImm" + (AL-INSN USES-FRDR USES-FRSR1) + "nori $frdr,$frsr1,#$imm16z" + (+ MSYS_NO OPC_NOR IMM_YES frsr1 frdr imm16z) + (set frdr (inv (or frsr1 (ext USI imm16z)))) + () +) + +(dni xnor "XNOR DstReg, SrcReg1, SrcReg2" + (AL-INSN USES-FRDRRR USES-FRSR1 USES-FRSR2) + "xnor $frdrrr,$frsr1,$frsr2" + (+ MSYS_NO OPC_XNOR IMM_NO frsr1 frsr2 frdrrr (f-uu12 0)) + (set frdrrr (inv (xor frsr1 frsr2))) + () +) + +(dni xnori "XNORI DstReg, SrcReg1, UnsImm" + (AL-INSN USES-FRDR USES-FRSR1) + "xnori $frdr,$frsr1,#$imm16z" + (+ MSYS_NO OPC_XNOR IMM_YES frsr1 frdr imm16z) + (set frdr (inv (xor frsr1 (ext USI imm16z)))) + () +) + +(dni ldui "LDUI DstReg, UnsImm" + (AL-INSN USES-FRDR) + "ldui $frdr,#$imm16z" + (+ MSYS_NO OPC_LDUI IMM_YES (f-uu4b 0) frdr imm16z) + (set frdr (and (sll imm16z 16) #xffff0000)) + () +) + +; Shift Instructions + +(dni lsl "LSL DstReg, SrcReg1, SrcReg2" + (USES-FRDRRR USES-FRSR1 USES-FRSR2) + "lsl $frdrrr,$frsr1,$frsr2" + (+ MSYS_NO OPC_LSL IMM_NO frsr1 frsr2 frdrrr (f-uu12 0)) + (set frdrrr (sll frsr1 frsr2)) + () +) + +(dni lsli "LSLI DstReg, SrcReg1, UnsImm" + (USES-FRDR USES-FRSR1) + "lsli $frdr,$frsr1,#$imm16" + (+ MSYS_NO OPC_LSL IMM_YES frsr1 frdr imm16) + (set frdr (sll frsr1 imm16)) + () +) + +(dni lsr "LSR DstReg, SrcReg1, SrcReg2" + (USES-FRDRRR USES-FRSR1 USES-FRSR2) + "lsr $frdrrr,$frsr1,$frsr2" + (+ MSYS_NO OPC_LSR IMM_NO frsr1 frsr2 frdrrr (f-uu12 0)) + (set frdrrr (srl frsr1 frsr2)) + () +) + +(dni lsri "LSRI DstReg, SrcReg1, UnsImm" + (USES-FRDR USES-FRSR1) + "lsri $frdr,$frsr1,#$imm16" + (+ MSYS_NO OPC_LSR IMM_YES frsr1 frdr imm16) + (set frdr (srl frsr1 imm16)) + () +) + +(dni asr "ASR DstReg, SrcReg1, SrcReg2" + (USES-FRDRRR USES-FRSR1 USES-FRSR2) + "asr $frdrrr,$frsr1,$frsr2" + (+ MSYS_NO OPC_ASR IMM_NO frsr1 frsr2 frdrrr (f-uu12 0)) + (set frdrrr (sra frsr1 frsr2)) + () +) + +(dni asri "ASRI DstReg, SrcReg1, UnsImm" + (USES-FRDR USES-FRSR1) + "asri $frdr,$frsr1,#$imm16" + (+ MSYS_NO OPC_ASR IMM_YES frsr1 frdr imm16) + (set frdr (sra frsr1 imm16)) + () +) + +; Control Transfer Instructions + +(dni brlt "BRLT SrcReg1, SrcReg2, label" + (BR-INSN DELAY-SLOT USES-FRDRRR USES-FRSR1 USES-FRSR2) + "brlt $frsr1,$frsr2,$imm16o" + (+ MSYS_NO OPC_BRLT IMM_YES frsr1 frsr2 imm16o) + (sequence() + (if (lt USI frsr1 frsr2) + (dset pc (add pc (ext SI imm16o)))) + ) + () +) + +(dni brle "BRLE SrcReg1, SrcReg2, label" + (BR-INSN DELAY-SLOT USES-FRSR1 USES-FRSR2) + "brle $frsr1,$frsr2,$imm16o" + (+ MSYS_NO OPC_BRLE IMM_YES frsr1 frsr2 imm16o) + (sequence() + (if (le USI frsr1 frsr2) + (dset pc (add pc (ext SI imm16o)))) + ) + () +) + +(dni breq "BREQ SrcReg1, SrcReg2, label" + (BR-INSN DELAY-SLOT USES-FRSR1 USES-FRSR2) + "breq $frsr1,$frsr2,$imm16o" + (+ MSYS_NO OPC_BREQ IMM_YES frsr1 frsr2 imm16o) + (sequence() + (if (eq USI frsr1 frsr2) + (dset pc (add pc (ext SI imm16o)))) + ) + () +) + +(dni brne "BRNE SrcReg1, SrcReg2, label" + (BR-INSN DELAY-SLOT USES-FRSR1 USES-FRSR2) + "brne $frsr1,$frsr2,$imm16o" + (+ MSYS_NO OPC_BRNEQ IMM_YES frsr1 frsr2 imm16o) + (sequence() + (if (not (eq USI frsr1 frsr2)) + (dset pc (add pc (ext SI imm16o)))) + ) + () +) + +(dni jmp "JMP, label" + (DELAY-SLOT BR-INSN) + "jmp $imm16o" + (+ MSYS_NO OPC_JMP IMM_YES (f-uu4b 0) (f-uu4a 0) imm16o) + (dset pc (add pc (ext SI imm16o))) + () +) + +(dni jal "JAL DstReg, SrcReg1" + (BR-INSN DELAY-SLOT BR-INSN USES-FRDR USES-FRSR1) + "jal $frdrrr,$frsr1" + (+ MSYS_NO OPC_JAL IMM_NO frsr1 (f-uu4a 0) frdrrr (f-uu12 0)) + (sequence() + (if (eq frsr1 #x0) + (c-call VOID "do_syscall" pc) + (sequence() ; else part. Do non-syscall stuff here. + (dset frdrrr (add pc #x8)) + (dset pc frsr1) + ) + ) + ) + () +) + +(dni dbnz "DBNZ SrcReg1, label" + (MACHMS1-003 BR-INSN DELAY-SLOT USES-FRSR1) + "dbnz $frsr1,$imm16o" + (+ MSYS_NO OPC_DBNZ IMM_YES frsr1 (f-uu4a 0) imm16o) + (sequence() + (if (not (eq USI frsr1 0)) + (dset pc (add pc (ext SI imm16o)))) + ) + () +) + +; Interrupt Control Instructions + +(dni ei "EI - Enable Interrupt Processing" + () + "ei" + (+ MSYS_NO OPC_EI IMM_NO (f-uu4b 0) (f-uu4a 0) (f-uu16 0)) + (c-call VOID "enable_interrupts") + () +) + +(dni di "DI - Disable Interrupt Processing" + () + "di" + (+ MSYS_NO OPC_DI IMM_NO (f-uu4b 0) (f-uu4a 0) (f-uu16 0)) + (c-call VOID "disable_interrupts") + () +) + +(dni si "SI - Send software Interrupt" + (DELAY-SLOT BR-INSN USES-FRDR) + "si $frdrrr" + (+ MSYS_NO OPC_SI IMM_NO (f-uu4b 0) (f-uu4a 0) frdrrr (f-uu12 0)) + ;(sequence() + ; (dset frdr (add pc #x4)) + ; (c-call VOID "do_syscall1" pc) + ; ; (dset pc frsr1) Do this later when we have the address. + ;) + (sequence() + (set frdrrr (add pc #x4)) + (c-call VOID "do_syscall" pc) + ; (set pc frsr1) Do this later when we have the address. + ) + () +) + +(dni reti "RETI SrcReg1" + (DELAY-SLOT BR-INSN USES-FRSR1) + "reti $frsr1" + (+ MSYS_NO OPC_RETI IMM_NO frsr1 (f-uu4a 0) (f-uu16 0)) + (sequence() + (c-call VOID "enable_interrupts") + (dset pc frsr1) + ) + () +) + +; Memory Access Instructions + +(dni ldw "LDW DstReg, SrcReg1, Imm" + (LOAD-DELAY MEMORY-ACCESS USES-FRDR USES-FRSR1) + "ldw $frdr,$frsr1,#$imm16" + (+ MSYS_NO OPC_LDW IMM_YES frsr1 frdr imm16) + (sequence((USI ea) (HI tmp)) + (set HI tmp (and imm16 #xffff)) + (set ea (and (add SI frsr1 (ext SI tmp)) #xfffffffc)) + (set frdr (mem SI ea)) + ) + () +) + +(dni stw "STW SrcReg2, SrcReg1, Imm" + (MEMORY-ACCESS USES-FRSR1 USES-FRSR2) + "stw $frsr2,$frsr1,#$imm16" + (+ MSYS_NO OPC_STW IMM_YES frsr1 frsr2 imm16) + (sequence((USI ea) (HI tmp)) + (set HI tmp (and imm16 #xffff)) + (set ea (and (add SI frsr1 (ext SI tmp)) #xfffffffc)) + (set (mem SI ea) frsr2) + ) + () +) + +; Break Instruction + +(dni break "BREAK" + () + "break" + (+ MSYS_NO OPC_BREAK (f-imm 0) (f-uu24 0)) + (c-call VOID "do_break" pc) + () +) + +; Cache Flush Instruction + +(dni iflush "IFLUSH" + (MACHMS1-003) + "iflush" + (+ MSYS_NO OPC_IFLUSH (f-imm 0) (f-uu24 0)) + (nop) + () +) + +; MorphoSys Instructions + +(dni ldctxt "LDCTXT SRC1, SRC2, r/c, r/c#, context#" + () + "ldctxt $frsr1,$frsr2,#$rc,#$rcnum,#$contnum" + (+ MSYS_YES MSOPC_LDCTXT (f-uu-2-25 0) frsr1 frsr2 rc rcnum (f-uu-3-11 0) + contnum ) + (nop) + () +) + +(dni ldfb "LDFB SRC1, byte#" + () + "ldfb $frsr1,$frsr2,#$imm16z" + (+ MSYS_YES MSOPC_LDFB (f-uu-2-25 0) frsr1 frsr2 imm16z) + (nop) + () +) + +(dni stfb "STFB SRC1, SRC2, byte " + () + "stfb $frsr1,$frsr2,#$imm16z" + (+ MSYS_YES MSOPC_STFB (f-uu-2-25 0) frsr1 frsr2 imm16z) + (nop) + () +) + +(dni fbcb "FBCB SRC1, RT/BR1/BR2/CS, B_all, B_r_c, r/c, CB/RB, cell, dup, ctx_disp" + () + "fbcb $frsr1,#$rbbc,#$ball,#$brc,#$rc1,#$cbrb,#$cell,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_FBCB rbbc frsr1 ball brc (f-uu-4-15 0) rc cbrb cell dup ctxdisp) + (nop) + () +) + +(dni mfbcb "MFBCB SRC1, RT/BR1/BR2/CS, SRC2, r/c, CB/RB, cell, dup, ctx_disp" + () + "mfbcb $frsr1,#$rbbc,$frsr2,#$rc1,#$cbrb,#$cell,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_MFBCB rbbc frsr1 frsr2 (f-uu-4-15 0) rc1 cbrb cell dup ctxdisp) + (nop) + () +) + +(dni fbcci "FBCCI SRC1, RT/BR1/BR2/CS, B_all, B_r_c, FB_disp, cell, dup, ctx_disp" + () + "fbcci $frsr1,#$rbbc,#$ball,#$brc,#$fbdisp,#$cell,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_FBCCI rbbc frsr1 ball brc fbdisp cell dup ctxdisp) + (nop) + () +) + +(dni fbrci "FBRCI SRC1, RT/BR1/BR2/CS, B_all, B_r_c, FB_disp, cell, dup, ctx_disp" + () + "fbrci $frsr1,#$rbbc,#$ball,#$brc,#$fbdisp,#$cell,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_FBRCI rbbc frsr1 ball brc fbdisp cell dup ctxdisp) + (nop) + () +) + +(dni fbcri "FBCRI SRC1, RT/BR1/BR2/CS, B_all, B_r_c, FB_disp, cell, dup, ctx_disp" + () + "fbcri $frsr1,#$rbbc,#$ball,#$brc,#$fbdisp,#$cell,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_FBCRI rbbc frsr1 ball brc fbdisp cell dup ctxdisp) + (nop) + () +) + +(dni fbrri "FBRRI SRC1, RT/BR1/BR2/CS, B_all, B_r_c, FB_disp, cell, dup, ctx_disp" + () + "fbrri $frsr1,#$rbbc,#$ball,#$brc,#$fbdisp,#$cell,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_FBRRI rbbc frsr1 ball brc fbdisp cell dup ctxdisp) + (nop) + () +) + +(dni mfbcci "MFBCCI SRC1, RT/BR1/BR2/CS, SRC2, FB_disp, cell, dup, ctx_disp" + () + "mfbcci $frsr1,#$rbbc,$frsr2,#$fbdisp,#$cell,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_MFBCCI rbbc frsr1 frsr2 fbdisp cell dup ctxdisp) + (nop) + () +) + +(dni mfbrci "MFBRCI SRC1, RT/BR1/BR2/CS, SRC2, FB_disp, cell, dup, ctx_disp" + () + "mfbrci $frsr1,#$rbbc,$frsr2,#$fbdisp,#$cell,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_MFBRCI rbbc frsr1 frsr2 fbdisp cell dup ctxdisp) + (nop) + () +) + +(dni mfbcri "MFBCRI SRC1, RT/BR1/BR2/CS, SRC2, FB_disp, cell, dup, ctx_disp" + () + "mfbcri $frsr1,#$rbbc,$frsr2,#$fbdisp,#$cell,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_MFBCRI rbbc frsr1 frsr2 fbdisp cell dup ctxdisp) + (nop) + () +) + +(dni mfbrri "MFBRRI SRC1, RT/BR1/BR2/CS, SRC2, FB_disp, cell, dup, ctx_disp" + () + "mfbrri $frsr1,#$rbbc,$frsr2,#$fbdisp,#$cell,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_MFBRRI rbbc frsr1 frsr2 fbdisp cell dup ctxdisp) + (nop) + () +) + +(dni fbcbdr "FBCBDR SRC1, RT/BR1/BR2/CS, SRC2, B_all, B_r_c, r/c, CB/RB, cell, dup, ctx_disp" + () + "fbcbdr $frsr1,#$rbbc,$frsr2,#$ball2,#$brc2,#$rc1,#$cbrb,#$cell,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_FBCBDR rbbc frsr1 frsr2 ball2 brc2 rc1 cbrb cell dup ctxdisp) + (nop) + () +) + +(dni rcfbcb "RCFBCB RT/BR1/BR2/CS, type, B_all, B_r_c, row#, r/c, CB/RB, cell, dup, ctx_disp" + () + "rcfbcb #$rbbc,#$type,#$ball,#$brc,#$rownum,#$rc1,#$cbrb,#$cell,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_RCFBCB rbbc (f-uu-2-23 0) type ball brc (f-uu-1-15 0) rownum rc1 cbrb cell dup ctxdisp) + (nop) + () +) + +(dni mrcfbcb "MRCFBCB SRC2, RT/BR1/BR2/CS, type, row#, r/c, CB/RB, cell, dup, ctx_disp" + () + "mrcfbcb $frsr2,#$rbbc,#$type,#$rownum,#$rc1,#$cbrb,#$cell,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_MRCFBCB rbbc (f-uu-2-23 0) type frsr2 (f-uu-1-15 0) rownum rc1 cbrb cell dup ctxdisp) + (nop) + () +) + +(dni cbcast "CBCAST mask, r/c, ctx_disp " + () + "cbcast #$mask,#$rc2,#$ctxdisp" + (+ MSYS_YES MSOPC_CBCAST mask (f-uu-3-9 0) rc2 ctxdisp) + (nop) + () +) + +(dni dupcbcast "DUPCBCAST mask, cell, r/c, ctx_disp " + () + "dupcbcast #$mask,#$cell,#$rc2,#$ctxdisp" + (+ MSYS_YES MSOPC_DUPCBCAST mask cell rc2 ctxdisp) + (nop) + () +) + +(dni wfbi "WFBI Bank_address, row#, cell, dup, ctx_disp " + () + "wfbi #$bankaddr,#$rownum1,#$cell,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_WFBI bankaddr rownum1 cell dup ctxdisp) + (nop) + () +) + +;(dni wfb "WFB SRC1, SRC2, FB_disp, row#, ctx_disp" +; () +; "wfb $frsr1,$frsr2,#$fbdisp,#$rownum,#$ctxdisp" +; (+ MSYS_YES MSOPC_WFB (f-uu-2-25 0) frsr1 frsr2 fbdisp rownum (f-uu-1-6 0) ctxdisp) +; (nop) +; () +;) + +(dni wfb "WFB, DRC1,SRC2,FB_disp,row#,ctx_disp" + () + "wfb $frsr1,$frsr2,#$fbdisp,#$rownum2,#$ctxdisp" + (+ MSYS_YES MSOPC_WFB (f-uu-2-25 0) frsr1 frsr2 fbdisp rownum2 (f-uu-1-6 0) ctxdisp) + (nop) + () +) + + +(dni rcrisc "RCRISC DEST, RT/BR1/BR2/CS, SRC1, column#, r/c, CB/RB, cell, dup, ctx_disp" + () + "rcrisc $frdrrr,#$rbbc,$frsr1,#$colnum,#$rc1,#$cbrb,#$cell,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_RCRISC rbbc frsr1 (f-uu-1-19 0) colnum frdrrr rc1 cbrb cell dup ctxdisp) + (nop) + () +) + +(dni fbcbinc "FBCBINC SRC1, RT/BR1/BR2/CS, Incr_amount, r/c, CB/RB, cell, dup, ctx_disp " + () + "fbcbinc $frsr1,#$rbbc,#$incamt,#$rc1,#$cbrb,#$cell,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_FBCBINC rbbc frsr1 incamt rc1 cbrb cell dup ctxdisp) + (nop) + () +) + +(dni rcxmode "RCXMODE SRC2, rd, wr, xmode, mask, FB_disp, row#, r/c, ctx_disp" + () + "rcxmode $frsr2,#$rda,#$wr,#$xmode,#$mask1,#$fbdisp,#$rownum2,#$rc2,#$ctxdisp" + (+ MSYS_YES MSOPC_RCXMODE rda wr xmode mask1 frsr2 fbdisp rownum2 rc2 ctxdisp) + (nop) + () +) + +(dni interleaver "INTLVR ireg, mode, ireg, i/d, size" + () + "intlvr $frsr1,#$mode,$frsr2,#$id,#$size" + (+ MSYS_YES MSOPC_INTLVR mode frsr1 frsr2 (f-uu-1-15 0) id size) + (nop) + () +) + +;; Issue 66262: The documenatation gives the wrong order for +;; the arguments to the WFBINC instruction. +(dni wfbinc "WFBINC type, ccb/rcb, incr, all, c/r, length, rca_row, word, dup, ctxt_disp" + (MACHMS1-003) + "wfbinc #$rda,#$wr,#$fbincr,#$ball,#$colnum,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_WFBINC rda wr fbincr ball colnum length rownum1 rownum2 dup ctxdisp) + (nop) + () +) + +(dni mwfbinc "MWFBINC mreg, type, ccb/rcb, incr, length, rca_row, word, dup, ctxt_disp" + (MACHMS1-003) + "mwfbinc $frsr2,#$rda,#$wr,#$fbincr,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_MWFBINC rda wr fbincr frsr2 length rownum1 rownum2 dup ctxdisp) + (nop) + () +) + +(dni wfbincr "WFBINCR ireg, type, ccb/rcb, all, c/r, length, rca_row, word, dup, ctxt_disp" + (MACHMS1-003) + "wfbincr $frsr1,#$rda,#$wr,#$ball,#$colnum,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_WFBINCR rda wr frsr1 ball colnum length rownum1 rownum2 dup ctxdisp) + (nop) + () +) + +(dni mwfbincr "MWFBINCR ireg, mreg, type, ccb/rcb, length, rca_row, word, dup, ctxt_disp" + (MACHMS1-003) + "mwfbincr $frsr1,$frsr2,#$rda,#$wr,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_MWFBINCR rda wr frsr1 frsr2 length rownum1 rownum2 dup ctxdisp) + (nop) + () +) + +(dni fbcbincs "FBCBINCS perm, all, c/r, cbs, incr, ccb/rcb, cdb/rdb, word, dup, ctxt_disp" + (MACHMS1-003) + "fbcbincs #$perm,#$a23,#$cr,#$cbs,#$incr,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_FBCBINCS perm a23 cr cbs incr ccb cdb rownum2 dup ctxdisp) + (nop) + () +) + +(dni mfbcbincs "MFBCBINCS ireg, perm, cbs, incr, ccb/rcb, cdb/rdb, word, dup, ctxt_disp" + (MACHMS1-003) + "mfbcbincs $frsr1,#$perm,#$cbs,#$incr,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_MFBCBINCS perm frsr1 cbs incr ccb cdb rownum2 dup ctxdisp) + (nop) + () +) + +(dni fbcbincrs "FBCBINCRS ireg, perm, all, c/r, cbs, ccb/rcb, cdb/rdb, word, dup, ctxt_disp" + (MACHMS1-003) + "fbcbincrs $frsr1,#$perm,#$ball,#$colnum,#$cbx,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_FBCBINCRS perm frsr1 ball colnum (f-uu-1-15 0) cbx ccb cdb rownum2 dup ctxdisp) + (nop) + () +) + +(dni mfbcbincrs "MFBCBINCRS ireg, mreg, perm, cbs, ccb/rcb, cdb/rdb, word, dup, ctxt_disp" + (MACHMS1-003) + "mfbcbincrs $frsr1,$frsr2,#$perm,#$cbx,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp" + (+ MSYS_YES MSOPC_MFBCBINCRS perm frsr1 frsr2 (f-uu-1-15 0) cbx ccb cdb rownum2 dup ctxdisp) + (nop) + () +) diff -uprN binutils-2.16.90.0.3/cpu/ms1.opc binutils-2.16.91.0.1/cpu/ms1.opc --- binutils-2.16.90.0.3/cpu/ms1.opc 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/cpu/ms1.opc 2005-06-22 13:53:34.676355145 -0700 @@ -0,0 +1,446 @@ +/* Morpho Technologies mRISC opcode support, for GNU Binutils. -*- C -*- + Copyright 2001 Free Software Foundation, Inc. + + Contributed by Red Hat Inc; developed under contract from + Morpho Technologies. + + This file is part of the GNU Binutils. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +/* + Each section is delimited with start and end markers. + + -opc.h additions use: "-- opc.h" + -opc.c additions use: "-- opc.c" + -asm.c additions use: "-- asm.c" + -dis.c additions use: "-- dis.c" + -ibd.h additions use: "-- ibd.h" +*/ + +/* -- opc.h */ + +/* Check applicability of instructions against machines. */ +#define CGEN_VALIDATE_INSN_SUPPORTED + +/* Allows reason codes to be output when assembler errors occur. */ +#define CGEN_VERBOSE_ASSEMBLER_ERRORS + +/* Override disassembly hashing - there are variable bits in the top + byte of these instructions. */ +#define CGEN_DIS_HASH_SIZE 8 +#define CGEN_DIS_HASH(buf, value) (((* (unsigned char *) (buf)) >> 5) % CGEN_DIS_HASH_SIZE) + +#define CGEN_ASM_HASH_SIZE 127 +#define CGEN_ASM_HASH(insn) ms1_asm_hash (insn) + +extern unsigned int ms1_asm_hash (const char *); + +extern int ms1_cgen_insn_supported (CGEN_CPU_DESC, const CGEN_INSN *); + + +/* -- opc.c */ +#include "safe-ctype.h" + +/* Special check to ensure that instruction exists for given machine. */ + +int +ms1_cgen_insn_supported (CGEN_CPU_DESC cd, + const CGEN_INSN *insn) +{ + int machs = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_MACH); + + /* No mach attribute? Assume it's supported for all machs. */ + if (machs == 0) + return 1; + + return ((machs & cd->machs) != 0); +} + +/* A better hash function for instruction mnemonics. */ + +unsigned int +ms1_asm_hash (const char* insn) +{ + unsigned int hash; + const char* m = insn; + + for (hash = 0; *m && ! ISSPACE (*m); m++) + hash = (hash * 23) ^ (0x1F & TOLOWER (*m)); + + /* printf ("%s %d\n", insn, (hash % CGEN_ASM_HASH_SIZE)); */ + + return hash % CGEN_ASM_HASH_SIZE; +} + + +/* -- asm.c */ +static int signed_out_of_bounds (long); +static const char * parse_imm16 (CGEN_CPU_DESC, const char **, int, long *); +static const char * parse_dup (CGEN_CPU_DESC, const char **, int, long *); +static const char * parse_ball (CGEN_CPU_DESC, const char **, int, long *); +static const char * parse_xmode (CGEN_CPU_DESC, const char **, int, long *); +static const char * parse_rc (CGEN_CPU_DESC, const char **, int, long *); +static const char * parse_cbrb (CGEN_CPU_DESC, const char **, int, long *); +static const char * parse_rbbc (CGEN_CPU_DESC, const char **, int, long *); +static const char * parse_type (CGEN_CPU_DESC, const char **, int, long *); + +/* Range checking for signed numbers. Returns 0 if acceptable + and 1 if the value is out of bounds for a signed quantity. */ + +static int +signed_out_of_bounds (long val) +{ + if ((val < -32768) || (val > 32767)) + return 1; + return 0; +} + +static const char * +parse_imm16 (CGEN_CPU_DESC cd, + const char **strp, + int opindex, + long *valuep) +{ + const char *errmsg; + enum cgen_parse_operand_result result_type; + bfd_reloc_code_real_type code = BFD_RELOC_NONE; + bfd_vma value; + + /* Is it a control transfer instructions? */ + if (opindex == (CGEN_OPERAND_TYPE) MS1_OPERAND_IMM16O) + { + code = BFD_RELOC_16_PCREL; + errmsg = cgen_parse_address (cd, strp, opindex, code, + & result_type, & value); + if (errmsg == NULL) + { + if (signed_out_of_bounds (value)) + errmsg = _("Operand out of range. Must be between -32768 and 32767."); + } + *valuep = value; + return errmsg; + } + + /* If it's not a control transfer instruction, then + we have to check for %OP relocating operators. */ + if (strncmp (*strp, "%hi16", 5) == 0) + { + *strp += 5; + code = BFD_RELOC_HI16; + } + else if (strncmp (*strp, "%lo16", 5) == 0) + { + *strp += 5; + code = BFD_RELOC_LO16; + } + + /* If we found a %OP relocating operator, then parse it as an address. + If not, we need to parse it as an integer, either signed or unsigned + depending on which operand type we have. */ + if (code != BFD_RELOC_NONE) + { + /* %OP relocating operator found. */ + errmsg = cgen_parse_address (cd, strp, opindex, code, + & result_type, & value); + if (errmsg == NULL) + { + switch (result_type) + { + case (CGEN_PARSE_OPERAND_RESULT_NUMBER): + if (code == BFD_RELOC_HI16) + value = (value >> 16) & 0xFFFF; + else if (code == BFD_RELOC_LO16) + value = value & 0xFFFF; + else + errmsg = _("Biiiig Trouble in parse_imm16!"); + break; + + case (CGEN_PARSE_OPERAND_RESULT_QUEUED): + /* No special processing for this case. */ + break; + + default: + errmsg = _("%operator operand is not a symbol"); + break; + } + } + *valuep = value; + } + else + { + /* Parse hex values like 0xffff as unsigned, and sign extend + them manually. */ + int parse_signed = (opindex == (CGEN_OPERAND_TYPE)MS1_OPERAND_IMM16); + + if ((*strp)[0] == '0' + && ((*strp)[1] == 'x' || (*strp)[1] == 'X')) + parse_signed = 0; + + /* No relocating operator. Parse as an number. */ + if (parse_signed) + { + /* Parse as as signed integer. */ + + errmsg = cgen_parse_signed_integer (cd, strp, opindex, valuep); + + if (errmsg == NULL) + { +#if 0 + /* Manual range checking is needed for the signed case. */ + if (*valuep & 0x8000) + value = 0xffff0000 | *valuep; + else + value = *valuep; + + if (signed_out_of_bounds (value)) + errmsg = _("Operand out of range. Must be between -32768 and 32767."); + /* Truncate to 16 bits. This is necessary + because cgen will have sign extended *valuep. */ + *valuep &= 0xFFFF; +#endif + } + } + else + { + /* MS1_OPERAND_IMM16Z. Parse as an unsigned integer. */ + errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, valuep); + + if (opindex == (CGEN_OPERAND_TYPE)MS1_OPERAND_IMM16 + && *valuep >= 0x8000 + && *valuep <= 0xffff) + *valuep -= 0x10000; + } + } + + return errmsg; +} + + +static const char * +parse_dup (CGEN_CPU_DESC cd, + const char **strp, + int opindex, + long *valuep) +{ + const char *errmsg = NULL; + + if (strncmp (*strp, "dup", 3) == 0 || strncmp (*strp, "DUP", 3) == 0) + { + *strp += 3; + *valuep = 1; + } + else if (strncmp (*strp, "xx", 2) == 0 || strncmp (*strp, "XX", 2) == 0) + { + *strp += 2; + *valuep = 0; + } + else + errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, valuep); + + return errmsg; +} + + +static const char * +parse_ball (CGEN_CPU_DESC cd, + const char **strp, + int opindex, + long *valuep) +{ + const char *errmsg = NULL; + + if (strncmp (*strp, "all", 3) == 0 || strncmp (*strp, "ALL", 3) == 0) + { + *strp += 3; + *valuep = 1; + } + else if (strncmp (*strp, "one", 3) == 0 || strncmp (*strp, "ONE", 3) == 0) + { + *strp += 3; + *valuep = 0; + } + else + errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, valuep); + + return errmsg; +} + +static const char * +parse_xmode (CGEN_CPU_DESC cd, + const char **strp, + int opindex, + long *valuep) +{ + const char *errmsg = NULL; + + if (strncmp (*strp, "pm", 2) == 0 || strncmp (*strp, "PM", 2) == 0) + { + *strp += 2; + *valuep = 1; + } + else if (strncmp (*strp, "xm", 2) == 0 || strncmp (*strp, "XM", 2) == 0) + { + *strp += 2; + *valuep = 0; + } + else + errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, valuep); + + return errmsg; +} + +static const char * +parse_rc (CGEN_CPU_DESC cd, + const char **strp, + int opindex, + long *valuep) +{ + const char *errmsg = NULL; + + if (strncmp (*strp, "r", 1) == 0 || strncmp (*strp, "R", 1) == 0) + { + *strp += 1; + *valuep = 1; + } + else if (strncmp (*strp, "c", 1) == 0 || strncmp (*strp, "C", 1) == 0) + { + *strp += 1; + *valuep = 0; + } + else + errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, valuep); + + return errmsg; +} + +static const char * +parse_cbrb (CGEN_CPU_DESC cd, + const char **strp, + int opindex, + long *valuep) +{ + const char *errmsg = NULL; + + if (strncmp (*strp, "rb", 2) == 0 || strncmp (*strp, "RB", 2) == 0) + { + *strp += 2; + *valuep = 1; + } + else if (strncmp (*strp, "cb", 2) == 0 || strncmp (*strp, "CB", 2) == 0) + { + *strp += 2; + *valuep = 0; + } + else + errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, valuep); + + return errmsg; +} + +static const char * +parse_rbbc (CGEN_CPU_DESC cd, + const char **strp, + int opindex, + long *valuep) +{ + const char *errmsg = NULL; + + if (strncmp (*strp, "rt", 2) == 0 || strncmp (*strp, "RT", 2) == 0) + { + *strp += 2; + *valuep = 0; + } + else if (strncmp (*strp, "br1", 3) == 0 || strncmp (*strp, "BR1", 3) == 0) + { + *strp += 3; + *valuep = 1; + } + else if (strncmp (*strp, "br2", 3) == 0 || strncmp (*strp, "BR2", 3) == 0) + { + *strp += 3; + *valuep = 2; + } + else if (strncmp (*strp, "cs", 2) == 0 || strncmp (*strp, "CS", 2) == 0) + { + *strp += 2; + *valuep = 3; + } + else + errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, valuep); + + return errmsg; +} + +static const char * +parse_type (CGEN_CPU_DESC cd, + const char **strp, + int opindex, + long *valuep) +{ + const char *errmsg = NULL; + + if (strncmp (*strp, "odd", 3) == 0 || strncmp (*strp, "ODD", 3) == 0) + { + *strp += 3; + *valuep = 0; + } + else if (strncmp (*strp, "even", 4) == 0 || strncmp (*strp, "EVEN", 4) == 0) + { + *strp += 4; + *valuep = 1; + } + else if (strncmp (*strp, "oe", 2) == 0 || strncmp (*strp, "OE", 2) == 0) + { + *strp += 2; + *valuep = 2; + } + else + errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, valuep); + + if ((errmsg == NULL) && (*valuep == 3)) + errmsg = _("invalid operand. type may have values 0,1,2 only."); + + return errmsg; +} + +/* -- dis.c */ +static void print_dollarhex (CGEN_CPU_DESC, PTR, long, unsigned, bfd_vma, int); + +static void +print_dollarhex (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, + void * dis_info, + long value, + unsigned int attrs ATTRIBUTE_UNUSED, + bfd_vma pc ATTRIBUTE_UNUSED, + int length ATTRIBUTE_UNUSED) +{ + disassemble_info *info = (disassemble_info *) dis_info; + + info->fprintf_func (info->stream, "$%x", value); + + if (0) + print_normal (cd, dis_info, value, attrs, pc, length); +} + + +/* -- */ + + + + + diff -uprN binutils-2.16.90.0.3/depcomp binutils-2.16.91.0.1/depcomp --- binutils-2.16.90.0.3/depcomp 2004-12-20 11:16:48.000000000 -0800 +++ binutils-2.16.91.0.1/depcomp 2005-06-22 13:53:34.090451951 -0700 @@ -1,9 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2004-05-31.23 +scriptversion=2005-05-16.16 -# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005 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 @@ -17,8 +17,8 @@ scriptversion=2004-05-31.23 # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -50,11 +50,11 @@ Environment variables: Report bugs to . EOF - exit 0 + exit $? ;; -v | --v*) echo "depcomp $scriptversion" - exit 0 + exit $? ;; esac @@ -276,6 +276,29 @@ icc) rm -f "$tmpdepfile" ;; +ia64hp) + # The "hp" stanza above does not work with HP's ia64 compilers, + # which have integrated preprocessors. The correct option to use + # with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + tmpdepfile=`echo "$object" | sed -e 's/\.o$/.d/'` + "$@" +Maked + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + # The object file name is correct already. + cat "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${; s/^ //; s/ \\*$//; s/$/:/; p; }' "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. @@ -287,36 +310,43 @@ tru64) base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then - # Dependencies are output in .lo.d with libtool 1.4. - # With libtool 1.5 they are output both in $dir.libs/$base.o.d - # and in $dir.libs/$base.o.d and $dir$base.o.d. We process the - # latter, because the former will be cleaned when $dir.libs is - # erased. - tmpdepfile1="$dir.libs/$base.lo.d" - tmpdepfile2="$dir$base.o.d" - tmpdepfile3="$dir.libs/$base.d" + # With Tru64 cc, shared objects can also be used to make a + # static library. This mecanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else - tmpdepfile1="$dir$base.o.d" - tmpdepfile2="$dir$base.d" - tmpdepfile3="$dir$base.d" + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi - if test -f "$tmpdepfile1"; then - tmpdepfile="$tmpdepfile1" - elif test -f "$tmpdepfile2"; then - tmpdepfile="$tmpdepfile2" - else - tmpdepfile="$tmpdepfile3" - fi + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. @@ -460,7 +490,8 @@ cpp) done "$@" -E | - sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" diff -uprN binutils-2.16.90.0.3/etc/ChangeLog binutils-2.16.91.0.1/etc/ChangeLog --- binutils-2.16.90.0.3/etc/ChangeLog 2003-05-23 07:18:53.000000000 -0700 +++ binutils-2.16.91.0.1/etc/ChangeLog 2005-06-22 13:53:34.683353989 -0700 @@ -1,3 +1,7 @@ +2005-05-19 Zack Weinberg + + * Makefile.in: Have 'all' depend on 'info'. + 2003-05-16 Kelley Cook * configure.texi: Use "i[3-7]86" in example. @@ -63,7 +67,7 @@ 1998-12-03 Nick Clifton * targetdoc/fr30.texi: New document. - + 1998-10-01 Angela Marie Thomas (angela@cygnus.com) * comp-tools-fix, cross-tools-fix: Replace /usr/include @@ -128,7 +132,7 @@ Mon May 18 14:27:37 1998 Angela Marie T Thu May 14 14:43:10 1998 Nick Clifton * targetdoc/arm-interwork.texi: Document dlltool support of - interworking. + interworking. Thu May 7 16:49:38 1998 Jason Molenda (crash@bugshack.cygnus.com) @@ -137,7 +141,7 @@ Thu May 7 16:49:38 1998 Jason Molenda Wed Apr 1 17:11:44 1998 Nick Clifton - * targetdoc/arm-interwork.texi: Document ARM/thumb interworking. + * targetdoc/arm-interwork.texi: Document ARM/thumb interworking. Tue Mar 31 15:28:20 1998 Ian Lance Taylor @@ -147,7 +151,7 @@ Tue Mar 31 15:28:20 1998 Ian Lance Tayl Tue Mar 24 16:13:26 1998 Stu Grossman * configure: Regenerate with autoconf 2.12.1 to fix shell issues - for NT native builds. + for NT native builds. Mon Mar 9 16:41:04 1998 Doug Evans @@ -183,7 +187,7 @@ Tue Jun 17 15:50:23 1997 Angela Marie T Thu Jun 12 13:47:00 1997 Angela Marie Thomas (angela@cygnus.com) - * Install.in (show_exec_prefix_msg): fix quoting + * Install.in (show_exec_prefix_msg): fix quoting Wed Jun 4 15:31:43 1997 Jason Molenda (crash@godzilla.cygnus.co.jp) @@ -231,8 +235,8 @@ Thu Apr 10 23:23:33 1997 Jason Molenda Mon Apr 7 18:15:00 1997 Brendan Kehoe - * Fix the version string for OSF1 4.0 to recognize either - V4.* or X4.* + * Fix the version string for OSF1 4.0 to recognize either + V4.* or X4.* Mon Apr 7 15:34:47 1997 Ian Lance Taylor @@ -303,8 +307,8 @@ Mon Aug 28 17:25:49 1995 Jason Molenda Tue Aug 15 21:51:58 1995 Jason Molenda (crash@phydeaux.cygnus.com) - * Install.in (guess_system): Match OSF/1 v3.x as the same as - v2.x--v2.x binaries are upward compatible. + * Install.in (guess_system): Match OSF/1 v3.x as the same as + v2.x--v2.x binaries are upward compatible. Tue Aug 15 21:46:54 1995 Jason Molenda (crash@phydeaux.cygnus.com) @@ -319,8 +323,8 @@ Tue Aug 8 13:11:56 1995 Brendan Kehoe Thu Jun 8 00:42:56 1995 Angela Marie Thomas - * subst-strings: change du commands to $BINDIR/. & $SRCDIR/. just - in case they are symlinks. + * subst-strings: change du commands to $BINDIR/. & $SRCDIR/. just + in case they are symlinks. Tue Apr 18 14:23:10 1995 J.T. Conklin @@ -335,7 +339,7 @@ Tue Apr 18 14:23:10 1995 J.T. Conklin * Install.in (do_mkdir): New function. * Install.in: Added support for --with and --without options. - Changed so that tape commands are not run when extracting + Changed so that tape commands are not run when extracting from a file. (do_mt): Changed to take only one argument. @@ -343,7 +347,7 @@ Wed Mar 29 11:16:38 1995 Jason Molenda * Install.in: catch UNAME==alpha-dec-osf2.x and correct entry for alpha-dec-osf1.x - + Fri Jan 27 12:04:29 1995 J.T. Conklin * subst-strings (mips-sgi-irix5): New entry in table. @@ -388,8 +392,8 @@ Thu Apr 28 14:42:22 1994 David J. Macke Tue Apr 26 17:18:03 1994 Jason Molenda (crash@sendai.cygnus.com) - * Install.in: fixincludes output is actually put in fixincludes.log, - but echo'ed messages claim it is fixinc.log. This is the same + * Install.in: fixincludes output is actually put in fixincludes.log, + but echo'ed messages claim it is fixinc.log. This is the same messages as I logged in March 4 1994, but for some reason we found the change hadn't been done. I'll have to dig through the logs and find out what I really did do that day. :) @@ -449,21 +453,21 @@ Wed Mar 23 23:38:24 1994 Jason Molenda Wed Mar 23 13:42:48 1994 Jason Molenda (crash@sendai.cygnus.com) - * Install.in: set PATH to $PATH:/bin:/usr/bin so we can pick - up native tools even if the user doesn't have them in his - path. + * Install.in: set PATH to $PATH:/bin:/usr/bin so we can pick + up native tools even if the user doesn't have them in his + path. - * Install.in: ``hppa-1.1-hp-hpux'' -> ``hppa1.1-hp-hpux''. + * Install.in: ``hppa-1.1-hp-hpux'' -> ``hppa1.1-hp-hpux''. Tue Mar 15 22:09:20 1994 Jason Molenda (crash@sendai.cygnus.com) - - * Install.in: TAPE_REWIND and TAPE_FORWARD variables for Unixunaware, - added switch statement to detect if system is Unixunaware. + + * Install.in: TAPE_REWIND and TAPE_FORWARD variables for Unixunaware, + added switch statement to detect if system is Unixunaware. Fri Mar 4 12:10:30 1994 Jason Molenda (crash@sendai.cygnus.com) - * Install.in: fixincludes output is actually put in fixincludes.log, - but echo'ed messages claim it is fixinc.log. + * Install.in: fixincludes output is actually put in fixincludes.log, + but echo'ed messages claim it is fixinc.log. Wed Nov 3 02:58:02 1993 Jeffrey Osier (jeffrey@thepub.cygnus.com) @@ -494,9 +498,9 @@ Thu Jun 10 16:01:25 1993 Jeffrey Osier Wed Jun 9 19:23:59 1993 Jeffrey Osier (jeffrey@rtl.cygnus.com) - * install-texi.in: added conditionals (nearly complete) - cleaned up - added support for other releases (not done) + * install-texi.in: added conditionals (nearly complete) + cleaned up + added support for other releases (not done) Wed Jun 9 15:53:58 1993 Jim Kingdon (kingdon@cygnus.com) @@ -511,7 +515,7 @@ Fri Jun 4 17:09:56 1993 Jeffrey Osier Thu Jun 3 00:37:01 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - * Install.in: pull COPYING and COPYING.LIB off of the tape + * Install.in: pull COPYING and COPYING.LIB off of the tape Tue Jun 1 16:52:08 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) diff -uprN binutils-2.16.90.0.3/etc/Makefile.in binutils-2.16.91.0.1/etc/Makefile.in --- binutils-2.16.90.0.3/etc/Makefile.in 2003-01-21 10:21:32.000000000 -0800 +++ binutils-2.16.91.0.1/etc/Makefile.in 2005-06-22 13:53:34.684353823 -0700 @@ -51,9 +51,7 @@ TEXIDIR = $(srcdir)/../texinfo INFOFILES = standards.info configure.info DVIFILES = standards.dvi configure.dvi -all: - -# We want install to imply install-info as per GNU standards. +all: info install: install-info uninstall: diff -uprN binutils-2.16.90.0.3/gas/cgen.c binutils-2.16.91.0.1/gas/cgen.c --- binutils-2.16.90.0.3/gas/cgen.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/cgen.c 2005-06-22 13:53:34.705350354 -0700 @@ -225,7 +225,7 @@ gas_cgen_swap_fixups (i) At this point we do not use a bfd_reloc_code_real_type for operands residing in the insn, but instead just use the operand index. This lets us easily handle fixups for any - operand type. We pick a BFD reloc type in md_apply_fix3. */ + operand type. We pick a BFD reloc type in md_apply_fix. */ fixS * gas_cgen_record_fixup (frag, where, insn, length, operand, opinfo, symbol, offset) @@ -264,7 +264,7 @@ gas_cgen_record_fixup (frag, where, insn At this point we do not use a bfd_reloc_code_real_type for operands residing in the insn, but instead just use the operand index. This lets us easily handle fixups for any - operand type. We pick a BFD reloc type in md_apply_fix3. */ + operand type. We pick a BFD reloc type in md_apply_fix. */ fixS * gas_cgen_record_fixup_exp (frag, where, insn, length, operand, opinfo, exp) @@ -580,7 +580,7 @@ gas_cgen_finish_insn (insn, buf, length, should handle them all. */ void -gas_cgen_md_apply_fix3 (fixP, valP, seg) +gas_cgen_md_apply_fix (fixP, valP, seg) fixS * fixP; valueT * valP; segT seg ATTRIBUTE_UNUSED; diff -uprN binutils-2.16.90.0.3/gas/cgen.h binutils-2.16.91.0.1/gas/cgen.h --- binutils-2.16.90.0.3/gas/cgen.h 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/cgen.h 2005-06-22 13:53:34.706350189 -0700 @@ -80,8 +80,8 @@ extern fixS * gas_cgen_record_fixup_exp int, const CGEN_OPERAND *, int, expressionS *); -/* md_apply_fix3 handler */ -extern void gas_cgen_md_apply_fix3 (fixS *, valueT *, segT); +/* md_apply_fix handler */ +extern void gas_cgen_md_apply_fix (fixS *, valueT *, segT); /* tc_gen_reloc handler */ extern arelent *gas_cgen_tc_gen_reloc (asection *, fixS *); diff -uprN binutils-2.16.90.0.3/gas/ChangeLog binutils-2.16.91.0.1/gas/ChangeLog --- binutils-2.16.90.0.3/gas/ChangeLog 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/ChangeLog 2005-06-22 13:53:34.693352337 -0700 @@ -1,3 +1,356 @@ +2005-06-20 H.J. Lu + + PR 1013 + * config/tc-i386.c (md_assemble): Don't call optimize_disp on + movabs. + (optimize_disp): Optimize only if possible. Don't use 64bit + displacement on non-constants and do same on constants if + possible. + +2005-06-17 Jan Beulich + + * config/tc-i386.c (reloc): Also handle BFD_RELOC_64_PCREL. + (tc_i386_fix_adjustable): Include BFD_RELOC_X86_64_GOTOFF64, + BFD_RELOC_X86_64_DTPOFF64, and BFD_RELOC_X86_64_TPOFF64. + (output_disp): Do GOTPC conversion also for BFD_RELOC_X86_64_32S + and BFD_RELOC_32_PCREL. Use BFD_RELOC_X86_64_GOTPC32 instead of + aborting. + (output_imm): Do GOTPC conversion also for BFD_RELOC_X86_64_32S. + Use BFD_RELOC_X86_64_GOTPC32 instead of aborting. + (tc_gen_reloc): Do GOTPC conversion also for BFD_RELOC_32_PCREL. + Use BFD_RELOC_X86_64_GOTPC32 instead of aborting. Also handle + BFD_RELOC_X86_64_GOTOFF64, BFD_RELOC_X86_64_GOTPC32, + BFD_RELOC_X86_64_DTPOFF64, and BFD_RELOC_X86_64_TPOFF64. Also + convert 8-byte pc-relative relocations. + (lex_got): Use BFD_RELOC_X86_64_GOTOFF64 for 64-bit @gotoff. + (i386_validate_fix): Likewise. + (x86_cons): Also handle quad values in 64-bit mode. + (i386_displacement): Also handle BFD_RELOC_X86_64_GOTOFF64. + (md_apply_fix): Include BFD_RELOC_X86_64_DTPOFF64 and + BFD_RELOC_X86_64_TPOFF64 in the TLS check. Also convert BFD_RELOC_64 + to pc-relative variant. Also check for BFD_RELOC_64_PCREL. + +2005-06-13 Zack Weinberg + + * config/tc-arm.c (find_real_start): Check S_IS_LOCAL on + symbolP as well as for names with a leading dot. Use ACONCAT. + (md_apply_fix): For branch relocations, only replace value + with fixP->fx_offset (under #ifdef OBJ_ELF) when !fixP->fx_done. + (arm_force_relocation): Remove #ifdef OBJ_ELF case. + * config/tc-arm.h (LOCAL_LABEL): Remove unnecessary parentheses. + (LOCAL_LABEL_PREFIX): Don't define. + +2005-06-10 Alan Modra + + * config/tc-hppa.c (pa_block): Allocate just one byte for the + fill pattern. + +2005-06-08 James E Wilson + + PR 994 + * config/tc-ia64.c (slot_index): Revert last change. If first_frag + is NULL, then emit a warning, and return the current index. + +2005-06-08 Tomas Hurka + + PR 991 + * config/tc-m68k.c (m68k_ip): Test for insn compatiblity using a + temporary copy of the operands array so that changes can be safely + backed out if the insn does not match. + (m68k_compare_opcode): Shortcut the test when the parameters are + the same. Return 1 if the names match but the second opcode is + further on in the array than the first. + +2005-06-08 Nick Clifton + + PR 994 + * config/tc-ia64.c (slot_index): Check for a NULL first_frag. + +2005-06-08 Kazuhiro Inaoka + + * config/tc-m32r.c (use_parallel): Change default value from 1 to 0. + +2005-06-07 Aldy Hernandez + Michael Snyder + Stan Cox + + * configure.in: Add ms1 case. + + * configure: Regenerate. + + * configure.tgt: Add ms1 case. + +2005-06-07 Bob Wilson + + * config/tc-xtensa.h (resource_table): Change units to unsigned chars. + * config/tc-xtensa.c (new_resource_table): Likewise. + (resize_resource_table): Likewise. + (release_resources): Fix assertion for unsigned values. + +2005-06-07 Zack Weinberg + + * cgen.c, cgen.h, tc.h, write.c, config/obj-coff.c + * config/tc-a29k.c, config/tc-alpha.c, config/tc-alpha.h + * config/tc-arc.c, config/tc-arc.h, config/tc-arm.c + * config/tc-arm.h, config/tc-avr.c, config/tc-avr.h + * config/tc-cris.c, config/tc-crx.c, config/tc-d10v.c + * config/tc-d10v.h, config/tc-d30v.c, config/tc-d30v.h + * config/tc-dlx.c, config/tc-dlx.h, config/tc-fr30.h + * config/tc-frv.c, config/tc-frv.h, config/tc-h8300.c + * config/tc-h8500.c, config/tc-hppa.c, config/tc-hppa.h + * config/tc-i370.c, config/tc-i370.h, config/tc-i386.c + * config/tc-i386.h, config/tc-i860.c, config/tc-i860.h + * config/tc-i960.c, config/tc-i960.h, config/tc-ia64.c + * config/tc-ip2k.c, config/tc-ip2k.h, config/tc-iq2000.c + * config/tc-iq2000.h, config/tc-m32r.c, config/tc-m32r.h + * config/tc-m68hc11.c, config/tc-m68hc11.h, config/tc-m68k.c + * config/tc-m68k.h, config/tc-m88k.c, config/tc-maxq.c + * config/tc-mcore.c, config/tc-mcore.h, config/tc-mips.c + * config/tc-mips.h, config/tc-mmix.c, config/tc-mn10200.c + * config/tc-mn10300.c, config/tc-msp430.c, config/tc-ns32k.c + * config/tc-openrisc.h, config/tc-or32.c, config/tc-or32.h + * config/tc-pdp11.c, config/tc-pj.c, config/tc-pj.h + * config/tc-ppc.c, config/tc-ppc.h, config/tc-s390.c + * config/tc-s390.h, config/tc-sh64.c, config/tc-sh.c + * config/tc-sh.h, config/tc-sparc.c, config/tc-sparc.h + * config/tc-tahoe.c, config/tc-tic30.c, config/tc-tic4x.c + * config/tc-tic54x.c, config/tc-tic80.c, config/tc-v850.c + * config/tc-v850.h, config/tc-vax.c, config/tc-vax.h + * config/tc-w65.c, config/tc-xstormy16.c, config/tc-xstormy16.h + * config/tc-xtensa.c, config/tc-z8k.c: + Replace all instances of the string "_apply_fix3" with + "_apply_fix". + * po/POTFILES.in, po/gas.pot: Regenerate. + +2005-06-08 Alan Modra + + * Makefile.am: Run "make dep-am". + (POTFILES): Remove GAS_CFILES. + * Makefile.in: Regenerate. + +2005-06-07 David Ung + + * config/tc-mips.c (mips_cpu_info_table): Add cpu names m4k, 24k, + 24kc, 24kf and 24kfx under MIPS32 release 2. + +2005-06-04 Nick Clifton + + * config/tc-arm.c (CE, C3, CM, UE, UF): Redefine without reference + to their Thumb-enabled equivalents. + +2005-06-01 Maciej W. Rozycki + + * config/tc-mips.c (load_register): Add leading "0x" to the + output of sprintf_vma(). + (macro): Likewise. + +2005-06-01 Nick Clifton + + * config/tc-arm.c (TxCE, TxC3, TxCM, TUE, TUF): Remove redundant + test for the presence of thumb version of the parsing functions + since they must always exist and the test generates a compile time + warning message. + +2005-05-31 Richard Henderson + + * config/tc-alpha.c (O_lituse_jsrdirect): New. + (alpha_reloc_op): Add it. + (debug_exp): Handle it. + (DUMMY_RELOC_LITUSE_JSRDIRECT): New. + (emit_insn): Handle it. + * doc/c-alpha.texi (Alpha-Relocs): Document lituse_jsrdirect. + +2005-05-31 Christian Groessler + + * write.c (dump_section_relocs): Convert to ISO-C. + (write_relocs): Avoid signed/unsigned and fprintf argument + warnings in debug code. + +2005-05-26 Zack Weinberg + + * config/tc-arm.h (TC_FIX_TYPE): Change to int. + (TC_INIT_FIX_DATA): Initialize to 0, not NULL. + * config/tc-arm.c (fix_new_arm): Remove now-unnecessary cast. + (md_apply_fix3): Delete fix_is_thumb variable; refer to + fixP->tc_fix_data directly in the sole place it was used. + Explicitly truncate value, *valP, fixP->fx_addnumber, and + fixP->fx_offset to 32 bits, for consistent behavior between 32- + and 64-bit hosts. + +2005-05-27 Jan Beulich + + * config/tc-ia64.c (struct proc_pending): New. + (unwind): Replace proc_start with proc_pending. + (unwind_diagnostic): Check unwind.proc_pending.sym. + (dot_proc): Replace unwind.proc_start with unwind.proc_pending.sym. + Check if previous proc not closed. Record all entry points. + (dot_endp): Replace unwind.proc_start with unwind.proc_pending.sym. + Set symbol sizes for entry points recorded in dot_proc. Check + arguments for consistency with respective .proc's. + (md_assemble): Replace unwind.proc_start with + unwind.proc_pending.sym. + +2005-05-27 Jan Beulich + + * config/tc-ia64.c (emit_one_bundle): Restrict scope of ptr, end_ptr, + and last_ptr. Check all in-use slots for first one with non-NULL + unwind_record. Don't reload end_ptr before second update round. + +2005-05-26 James E Wilson + + * config/tc-ia64.c (extra_goodness): Update comment. + (md_begin): Add debugging code to print best_template table. + +2005-05-25 Jan Beulich + + * config/tc-ia64.c (md_begin): Don't try to match slot 2 of an MLX + template. + +2005-05-25 Jan Beulich + + * config/tc-ia64.c (ia64_gen_real_reloc_type): Also handle + BFD_RELOC_UNUSED when determining the width of the reloc. + +2005-05-25 Jan Beulich + + * config/tc-ia64.c (dot_endp): Clear out all three pointers in unwind + section entry. + +2005-05-25 Jan Beulich + + * config/tc-ia64.c (dot_radix): Rewrite. + +2005-05-25 Jan Beulich + + * config/tc-ia64.c (struct unw_rec_list): Remove next_slot_number + and next_slot_frag. + (alloc_record): Remove references to next_slot_number and + next_slot_frag. + (emit_one_bundle): Likewise. + +2005-05-22 Nick Clifton + + * config/tc-v850.c (md_apply_fix3): Pass the address of the + message buffer when invoking the insert function. + +2005-05-21 John David Anglin + + * config/tc-hppa.c (pa_ip): Promote architecture from PA 1.0 to 1.1 + only if an instruction match is found. + +2005-05-20 Bob Wilson + + * config/tc-xtensa.c (xg_assemble_vliw_tokens): Change subtraction + to addition in argument to xtensa_dwarf2_emit_insn. + +2005-05-19 Zack Weinberg + + * Makefile.am: Have 'all' depend on 'info'. + * Makefile.in: Regenerate. + +2005-05-19 Alan Modra + + * config/tc-ppc.c (ppc_force_relocation): Add BFD_RELOC_24_PLT_PCREL. + +2005-05-19 Anton Blanchard + + * config/tc-ppc.c (parse_cpu): Handle "-mpower5". + (md_show_usage): Document it. + (ppc_setup_opcodes): Insert POWER5 mnemonics. + * doc/c-ppc.texi (PowerPC-Opts): Document "-mpower5". + +2005-05-19 Jan Beulich + + * config/tc-ia64.c (dot_endp): Don't use global symbol for unwind + relocations in unwind section. + +2005-05-18 Nick Clifton + + * config/tc-v850.c (md_apply_fix3): Only use the insertion routine + if one exists. Ignore any error messages it may produce, just + allow it to perform the insertion. + +2005-05-17 Zack Weinberg + + * hash.c (hash_lookup): Add len parameter. All callers changed. + (hash_find_n): New interface. + * hash.h: Prototype hash_find_n. + * sb.c: Include as.h. + (scrub_from_sb, sb_to_scrub, scrub_position): New statics. + (sb_scrub_and_add_sb): New interface. + * sb.h: Prototype sb_scrub_and_add_sb. + * input-scrub.c (input_scrub_include_sb): Use sb_scrub_and_add_sb. + + * config/tc-arm.h (TC_FORCE_RELOCATION_LOCAL): Remove + reference to BFD_RELOC_ARM_GOT12 which is never generated. + * config/tc-arm.c: Rewrite, adding Thumb-2 support. + +2005-05-17 Daniel Jacobowitz + + * doc/Makefile.am (gasver.texi): Don't use $<. + * doc/Makefile.in: Regenerated. + +2005-05-17 Nick Clifton + + PR 876 + * symbols.c (resolve_symbol_value): Do not move symbols whose + value expression has not been resolved or finalized into the + absolute section as this will confuse other parts of the assembler + into thinking that their value is zero. + +2005-05-17 Jan Beulich + + * read.c (_find_end_of_line): New. + (find_end_of_line): New. + (HANDLE_CONDITIONAL_ASSEMBLY): Use it. + (read_a_source_file): Use it. + (s_globl): Use it. + (s_macro): Use it. + (get_line_sb): Use it. + (s_errwarn): Replace discard_rest_of_line by ignore_rest_of_line. + (s_comm_internal): Likewise. + (s_lsym): Likewise. + (s_macro): Likewise. + (s_ignore): Use ignore_rest_of_line. + * read.h (find_end_of_line): Prototype. + (discard_rest_of_line): Remove prototype. #define to + ignore_rest_of_line. + +2005-05-17 Nick Clifton + + * config/tc-v850,h (TC_FIX_TYPE): Define. + (TC_INIT_FIX_TYPE): Define. + * config/tc-v850.c (md_assemble): When creating a fix record the + operand in the tc_fix_data field. + (md_apply_fix3): When applying a resolved fix use the operand's + insertion procedure to store the value, if the operand has been + recorded. + +2005-05-15 Daniel Jacobowitz + + * Makefile.am (m68k-parse.c, itbl-parse.c): Update ylwrap + invocation. + * Makefile.in: Regenerated. + +2005-05-13 Sterling Augustine + Bob Wilson + + * config/tc-xtensa.c (xtensa_insnbuf_set_operand): Clarify error + message. + (xtensa_mark_zcl_first_insns): Fix incorrect nesting of conditional + for handling RELAX_CHECK_ALIGN_NEXT_OPCODE. + +2005-05-11 Alan Modra + + * config/tc-ppc.c (md_apply_fix3): Allow pcrel forms of BFD_RELOC_16, + BFD_RELOC_LO16, BFD_RELOC_HI16 and BFD_RELOC_HI16_S. + +2005-05-10 Michael Matz + + * frags.c (frag_grow): Don't be too greedy in allocating memory. + + * config/tc-hppa.c (pa_block): Check arguments to .block[z]. + 2005-05-10 Hans-Peter Nilsson PR binutils/886 @@ -23,8 +376,8 @@ 2005-05-09 Jan Beulich - * config/tc-i386.c (optimize_disp): Discard displacement entirely when zero and - not required by encoding constraints. + * config/tc-i386.c (optimize_disp): Discard displacement entirely + when zero and not required by encoding constraints. 2005-05-09 H.J. Lu @@ -515,7 +868,7 @@ so that the hash table size can be set before it is used. * hash.c: Use an unsigned long type for the size of the hash tables. - * hash.h (set_gas_hash_table_size): Update the prototype. + * hash.h (set_gas_hash_table_size): Update the prototype. 2005-04-14 Alan Modra @@ -888,7 +1241,7 @@ * config/tc-w65.c: Convert to ISO-C90 and fix formatting. * config/tc-w65.h: Convert to ISO-C90 and fix formatting. * config/tc-xstormy16.c: Convert to ISO-C90 and fix formatting. - * config/tc-xstormy16.h: Convert to ISO-C90 and fix formatting. + * config/tc-xstormy16.h: Convert to ISO-C90 and fix formatting. 2005-03-23 Jim Blandy diff -uprN binutils-2.16.90.0.3/gas/config/obj-coff.c binutils-2.16.91.0.1/gas/config/obj-coff.c --- binutils-2.16.90.0.3/gas/config/obj-coff.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/obj-coff.c 2005-06-22 13:53:34.770339616 -0700 @@ -3882,7 +3882,7 @@ fixup_segment (segment_info_type * segP, #endif } - md_apply_fix3 (fixP, (valueT *) & add_number, this_segment_type); + md_apply_fix (fixP, (valueT *) & add_number, this_segment_type); if (!fixP->fx_bit_fixP && ! fixP->fx_no_overflow) { diff -uprN binutils-2.16.90.0.3/gas/config/tc-a29k.c binutils-2.16.91.0.1/gas/config/tc-a29k.c --- binutils-2.16.90.0.3/gas/config/tc-a29k.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-a29k.c 2005-06-22 13:53:34.772339286 -0700 @@ -732,7 +732,7 @@ md_number_to_chars (char *buf, valueT va } void -md_apply_fix3 (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) { valueT val = *valP; char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; diff -uprN binutils-2.16.90.0.3/gas/config/tc-alpha.c binutils-2.16.91.0.1/gas/config/tc-alpha.c --- binutils-2.16.90.0.3/gas/config/tc-alpha.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-alpha.c 2005-06-22 13:53:34.777338460 -0700 @@ -109,28 +109,29 @@ struct alpha_macro #define O_cpregister O_md2 /* + a leading comma. */ /* The alpha_reloc_op table below depends on the ordering of these. */ -#define O_literal O_md3 /* !literal relocation. */ -#define O_lituse_addr O_md4 /* !lituse_addr relocation. */ -#define O_lituse_base O_md5 /* !lituse_base relocation. */ -#define O_lituse_bytoff O_md6 /* !lituse_bytoff relocation. */ -#define O_lituse_jsr O_md7 /* !lituse_jsr relocation. */ -#define O_lituse_tlsgd O_md8 /* !lituse_tlsgd relocation. */ -#define O_lituse_tlsldm O_md9 /* !lituse_tlsldm relocation. */ -#define O_gpdisp O_md10 /* !gpdisp relocation. */ -#define O_gprelhigh O_md11 /* !gprelhigh relocation. */ -#define O_gprellow O_md12 /* !gprellow relocation. */ -#define O_gprel O_md13 /* !gprel relocation. */ -#define O_samegp O_md14 /* !samegp relocation. */ -#define O_tlsgd O_md15 /* !tlsgd relocation. */ -#define O_tlsldm O_md16 /* !tlsldm relocation. */ -#define O_gotdtprel O_md17 /* !gotdtprel relocation. */ -#define O_dtprelhi O_md18 /* !dtprelhi relocation. */ -#define O_dtprello O_md19 /* !dtprello relocation. */ -#define O_dtprel O_md20 /* !dtprel relocation. */ -#define O_gottprel O_md21 /* !gottprel relocation. */ -#define O_tprelhi O_md22 /* !tprelhi relocation. */ -#define O_tprello O_md23 /* !tprello relocation. */ -#define O_tprel O_md24 /* !tprel relocation. */ +#define O_literal O_md3 /* !literal relocation. */ +#define O_lituse_addr O_md4 /* !lituse_addr relocation. */ +#define O_lituse_base O_md5 /* !lituse_base relocation. */ +#define O_lituse_bytoff O_md6 /* !lituse_bytoff relocation. */ +#define O_lituse_jsr O_md7 /* !lituse_jsr relocation. */ +#define O_lituse_tlsgd O_md8 /* !lituse_tlsgd relocation. */ +#define O_lituse_tlsldm O_md9 /* !lituse_tlsldm relocation. */ +#define O_lituse_jsrdirect O_md10 /* !lituse_jsrdirect relocation. */ +#define O_gpdisp O_md11 /* !gpdisp relocation. */ +#define O_gprelhigh O_md12 /* !gprelhigh relocation. */ +#define O_gprellow O_md13 /* !gprellow relocation. */ +#define O_gprel O_md14 /* !gprel relocation. */ +#define O_samegp O_md15 /* !samegp relocation. */ +#define O_tlsgd O_md16 /* !tlsgd relocation. */ +#define O_tlsldm O_md17 /* !tlsldm relocation. */ +#define O_gotdtprel O_md18 /* !gotdtprel relocation. */ +#define O_dtprelhi O_md19 /* !dtprelhi relocation. */ +#define O_dtprello O_md20 /* !dtprello relocation. */ +#define O_dtprel O_md21 /* !dtprel relocation. */ +#define O_gottprel O_md22 /* !gottprel relocation. */ +#define O_tprelhi O_md23 /* !tprelhi relocation. */ +#define O_tprello O_md24 /* !tprello relocation. */ +#define O_tprel O_md25 /* !tprel relocation. */ #define DUMMY_RELOC_LITUSE_ADDR (BFD_RELOC_UNUSED + 1) #define DUMMY_RELOC_LITUSE_BASE (BFD_RELOC_UNUSED + 2) @@ -138,6 +139,7 @@ struct alpha_macro #define DUMMY_RELOC_LITUSE_JSR (BFD_RELOC_UNUSED + 4) #define DUMMY_RELOC_LITUSE_TLSGD (BFD_RELOC_UNUSED + 5) #define DUMMY_RELOC_LITUSE_TLSLDM (BFD_RELOC_UNUSED + 6) +#define DUMMY_RELOC_LITUSE_JSRDIRECT (BFD_RELOC_UNUSED + 7) #define USER_RELOC_P(R) ((R) >= O_literal && (R) <= O_tprel) @@ -418,6 +420,7 @@ alpha_reloc_op[] = DEF (lituse_jsr, DUMMY_RELOC_LITUSE_JSR, 1, 1), DEF (lituse_tlsgd, DUMMY_RELOC_LITUSE_TLSGD, 1, 1), DEF (lituse_tlsldm, DUMMY_RELOC_LITUSE_TLSLDM, 1, 1), + DEF (lituse_jsrdirect, DUMMY_RELOC_LITUSE_JSRDIRECT, 1, 1), DEF (gpdisp, BFD_RELOC_ALPHA_GPDISP, 1, 1), DEF (gprelhigh, BFD_RELOC_ALPHA_GPREL_HI16, 0, 0), DEF (gprellow, BFD_RELOC_ALPHA_GPREL_LO16, 0, 0), @@ -770,6 +773,7 @@ debug_exp (expressionS tok[], int ntok) case O_lituse_jsr: name = "O_lituse_jsr"; break; case O_lituse_tlsgd: name = "O_lituse_tlsgd"; break; case O_lituse_tlsldm: name = "O_lituse_tlsldm"; break; + case O_lituse_jsrdirect: name = "O_lituse_jsrdirect"; break; case O_gpdisp: name = "O_gpdisp"; break; case O_gprelhigh: name = "O_gprelhigh"; break; case O_gprellow: name = "O_gprellow"; break; @@ -1720,6 +1724,9 @@ emit_insn (struct alpha_insn *insn) case DUMMY_RELOC_LITUSE_TLSLDM: fixP->fx_offset = LITUSE_ALPHA_TLSLDM; goto do_lituse; + case DUMMY_RELOC_LITUSE_JSRDIRECT: + fixP->fx_offset = LITUSE_ALPHA_JSRDIRECT; + goto do_lituse; do_lituse: fixP->fx_addsy = section_symbol (now_seg); fixP->fx_r_type = BFD_RELOC_ALPHA_LITUSE; @@ -5197,7 +5204,7 @@ md_pcrel_from (fixS *fixP) GPDISP. */ void -md_apply_fix3 (fixS *fixP, valueT * valP, segT seg) +md_apply_fix (fixS *fixP, valueT * valP, segT seg) { char * const fixpos = fixP->fx_frag->fr_literal + fixP->fx_where; valueT value = * valP; diff -uprN binutils-2.16.90.0.3/gas/config/tc-alpha.h binutils-2.16.91.0.1/gas/config/tc-alpha.h --- binutils-2.16.90.0.3/gas/config/tc-alpha.h 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-alpha.h 2005-06-22 13:53:34.783337469 -0700 @@ -60,7 +60,7 @@ extern valueT alpha_gp_value; #define tc_fix_adjustable(FIX) alpha_fix_adjustable (FIX) #define RELOC_REQUIRES_SYMBOL -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 #define md_convert_frag(b,s,f) as_fatal ("alpha convert_frag\n") diff -uprN binutils-2.16.90.0.3/gas/config/tc-arc.c binutils-2.16.91.0.1/gas/config/tc-arc.c --- binutils-2.16.90.0.3/gas/config/tc-arc.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-arc.c 2005-06-22 13:53:34.784337304 -0700 @@ -1269,7 +1269,7 @@ md_pcrel_from (fixS *fixP) that, we determine the correct reloc code and put it back in the fixup. */ void -md_apply_fix3 (fixS *fixP, valueT * valP, segT seg) +md_apply_fix (fixS *fixP, valueT * valP, segT seg) { valueT value = * valP; @@ -1884,7 +1884,7 @@ md_assemble (char *str) operands residing in the insn, but instead just use the operand index. This lets us easily handle fixups for any operand type, although that is admittedly not a very exciting - feature. We pick a BFD reloc type in md_apply_fix3. + feature. We pick a BFD reloc type in md_apply_fix. Limm values (4 byte immediate "constants") must be treated normally because they're not part of the actual insn word diff -uprN binutils-2.16.90.0.3/gas/config/tc-arc.h binutils-2.16.91.0.1/gas/config/tc-arc.h --- binutils-2.16.90.0.3/gas/config/tc-arc.h 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-arc.h 2005-06-22 13:53:34.788336643 -0700 @@ -65,7 +65,7 @@ extern void arc_cons_fix_new (struct fra #define DWARF2_LINE_MIN_INSN_LENGTH 4 -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 /* No shared lib support, so we don't need to ensure externally diff -uprN binutils-2.16.90.0.3/gas/config/tc-arm.c binutils-2.16.91.0.1/gas/config/tc-arm.c --- binutils-2.16.90.0.3/gas/config/tc-arm.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-arm.c 2005-06-22 13:53:34.826330365 -0700 @@ -17,7 +17,7 @@ GAS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License @@ -26,7 +26,7 @@ 02110-1301, USA. */ #include -#define NO_RELOC 0 +#define NO_RELOC 0 #include "as.h" #include "safe-ctype.h" @@ -56,31 +56,31 @@ static struct { - symbolS * proc_start; - symbolS * table_entry; - symbolS * personality_routine; - int personality_index; + symbolS * proc_start; + symbolS * table_entry; + symbolS * personality_routine; + int personality_index; /* The segment containing the function. */ - segT saved_seg; - subsegT saved_subseg; + segT saved_seg; + subsegT saved_subseg; /* Opcodes generated from this function. */ unsigned char * opcodes; - int opcode_count; - int opcode_alloc; + int opcode_count; + int opcode_alloc; /* The number of bytes pushed to the stack. */ - offsetT frame_size; + offsetT frame_size; /* We don't add stack adjustment opcodes immediately so that we can merge multiple adjustments. We can also omit the final adjustment when using a frame pointer. */ - offsetT pending_offset; + offsetT pending_offset; /* These two fields are set by both unwind_movsp and unwind_setfp. They - hold the reg+offset to use when restoring sp from a frame pointer. */ - offsetT fp_offset; - int fp_reg; + hold the reg+offset to use when restoring sp from a frame pointer. */ + offsetT fp_offset; + int fp_reg; /* Nonzero if an unwind_setfp directive has been seen. */ - unsigned fp_used:1; + unsigned fp_used:1; /* Nonzero if the last opcode restores sp from fp_reg. */ - unsigned sp_restored:1; + unsigned sp_restored:1; } unwind; /* Bit N indicates that an R_ARM_NONE relocation has been output for @@ -97,7 +97,7 @@ enum arm_float_abi ARM_FLOAT_ABI_SOFT }; -/* Types of processor to assemble for. */ +/* Types of processor to assemble for. */ #define ARM_1 ARM_ARCH_V1 #define ARM_2 ARM_ARCH_V2 #define ARM_3 ARM_ARCH_V2S @@ -107,16 +107,16 @@ enum arm_float_abi #define ARM_8 ARM_ARCH_V4 #define ARM_9 ARM_ARCH_V4T #define ARM_STRONG ARM_ARCH_V4 -#define ARM_CPU_MASK 0x0000000f /* XXX? */ +#define ARM_CPU_MASK 0x0000000f /* XXX? */ #ifndef CPU_DEFAULT #if defined __XSCALE__ #define CPU_DEFAULT (ARM_ARCH_XSCALE) #else #if defined __thumb__ -#define CPU_DEFAULT (ARM_ARCH_V5T) +#define CPU_DEFAULT (ARM_ARCH_V5T) #else -#define CPU_DEFAULT ARM_ANY +#define CPU_DEFAULT ARM_ANY #endif #endif #endif @@ -139,17 +139,16 @@ enum arm_float_abi # endif #endif /* ifndef FPU_DEFAULT */ -#define streq(a, b) (strcmp (a, b) == 0) -#define skip_whitespace(str) while (*(str) == ' ') ++(str) +#define streq(a, b) (strcmp (a, b) == 0) static unsigned long cpu_variant; /* Flags stored in private area of BFD structure. */ -static int uses_apcs_26 = FALSE; -static int atpcs = FALSE; +static int uses_apcs_26 = FALSE; +static int atpcs = FALSE; static int support_interwork = FALSE; static int uses_apcs_float = FALSE; -static int pic_code = FALSE; +static int pic_code = FALSE; /* Variables that we set while parsing command-line options. Once all options have been read we re-process these values to set the real @@ -171,37 +170,8 @@ static int meabi_flags = EF_ARM_EABI_UNK # endif #endif -/* This array holds the chars that always start a comment. If the - 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. */ -/* 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. */ -const char line_comment_chars[] = "#"; - -const char line_separator_chars[] = ";"; - -/* 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. */ -/* As in 0f12.456 */ -/* or 0d1.2345e12 */ - -const char FLT_CHARS[] = "rRsSfFdDxXeEpP"; - -/* Prefix characters that indicate the start of an immediate - value. */ -#define is_immediate_prefix(C) ((C) == '#' || (C) == '$') - #ifdef OBJ_ELF -/* Pre-defined "_GLOBAL_OFFSET_TABLE_" */ +/* Pre-defined "_GLOBAL_OFFSET_TABLE_" */ symbolS * GOT_symbol; #endif @@ -214,84 +184,63 @@ const int md_reloc_size = 8; instructions. */ static int thumb_mode = 0; -typedef struct arm_fix -{ - int thumb_mode; -} arm_fix_data; +/* If unified_syntax is true, we are processing the new unified + ARM/Thumb syntax. Important differences from the old ARM mode: + + - Immediate operands do not require a # prefix. + - Conditional affixes always appear at the end of the + instruction. (For backward compatibility, those instructions + that formerly had them in the middle, continue to accept them + there.) + - The IT instruction may appear, and if it does is validated + against subsequent conditional affixes. It does not generate + machine code. + + Important differences from the old Thumb mode: + + - Immediate operands do not require a # prefix. + - Most of the V6T2 instructions are only available in unified mode. + - The .N and .W suffixes are recognized and honored (it is an error + if they cannot be honored). + - All instructions set the flags if and only if they have an 's' affix. + - Conditional affixes may be used. They are validated against + preceding IT instructions. Unlike ARM mode, you cannot use a + conditional affix except in the scope of an IT instruction. */ + +static bfd_boolean unified_syntax = FALSE; struct arm_it { - const char * error; + const char * error; unsigned long instruction; - int size; + int size; + int size_req; + int cond; struct { bfd_reloc_code_real_type type; - expressionS exp; - int pc_rel; + expressionS exp; + int pc_rel; } reloc; -}; - -struct arm_it inst; - -enum asm_shift_index -{ - SHIFT_LSL = 0, - SHIFT_LSR, - SHIFT_ASR, - SHIFT_ROR, - SHIFT_RRX -}; - -struct asm_shift_properties -{ - enum asm_shift_index index; - unsigned long bit_field; - unsigned int allows_0 : 1; - unsigned int allows_32 : 1; -}; - -static const struct asm_shift_properties shift_properties [] = -{ - { SHIFT_LSL, 0, 1, 0}, - { SHIFT_LSR, 0x20, 0, 1}, - { SHIFT_ASR, 0x40, 0, 1}, - { SHIFT_ROR, 0x60, 0, 0}, - { SHIFT_RRX, 0x60, 0, 0} -}; - -struct asm_shift_name -{ - const char * name; - const struct asm_shift_properties * properties; -}; -static const struct asm_shift_name shift_names [] = -{ - { "asl", shift_properties + SHIFT_LSL }, - { "lsl", shift_properties + SHIFT_LSL }, - { "lsr", shift_properties + SHIFT_LSR }, - { "asr", shift_properties + SHIFT_ASR }, - { "ror", shift_properties + SHIFT_ROR }, - { "rrx", shift_properties + SHIFT_RRX }, - { "ASL", shift_properties + SHIFT_LSL }, - { "LSL", shift_properties + SHIFT_LSL }, - { "LSR", shift_properties + SHIFT_LSR }, - { "ASR", shift_properties + SHIFT_ASR }, - { "ROR", shift_properties + SHIFT_ROR }, - { "RRX", shift_properties + SHIFT_RRX } + struct + { + unsigned reg; + unsigned imm; + unsigned present : 1; /* operand present */ + unsigned isreg : 1; /* operand was a register */ + unsigned immisreg : 1; /* .imm field is a second register */ + unsigned hasreloc : 1; /* operand has relocation suffix */ + unsigned writeback : 1; /* operand has trailing ! */ + unsigned preind : 1; /* preindexed address */ + unsigned postind : 1; /* postindexed address */ + unsigned negative : 1; /* index register was negated */ + unsigned shifted : 1; /* shift applied to operation */ + unsigned shift_kind : 3; /* shift operation (enum shift_kind) */ + } operands[6]; }; -/* Any kind of shift is accepted. */ -#define NO_SHIFT_RESTRICT 1 -/* The shift operand must be an immediate value, not a register. */ -#define SHIFT_IMMEDIATE 0 -/* The shift must be LSL or ASR and the operand must be an immediate. */ -#define SHIFT_LSL_OR_ASR_IMMEDIATE 2 -/* The shift must be ASR and the operand must be an immediate. */ -#define SHIFT_ASR_IMMEDIATE 3 -/* The shift must be LSL and the operand must be an immediate. */ -#define SHIFT_LSL_IMMEDIATE 4 +static struct arm_it inst; #define NUM_FLOAT_VALS 8 @@ -300,7 +249,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]; @@ -308,246 +257,46 @@ LITTLENUM_TYPE fp_values[NUM_FLOAT_VALS] #define FAIL (-1) #define SUCCESS (0) -/* Whether a Co-processor load/store operation accepts write-back forms. */ -#define CP_WB_OK 1 -#define CP_NO_WB 0 - #define SUFF_S 1 #define SUFF_D 2 #define SUFF_E 3 #define SUFF_P 4 -#define CP_T_X 0x00008000 -#define CP_T_Y 0x00400000 -#define CP_T_Pre 0x01000000 -#define CP_T_UD 0x00800000 -#define CP_T_WB 0x00200000 +#define CP_T_X 0x00008000 +#define CP_T_Y 0x00400000 -#define CONDS_BIT 0x00100000 -#define LOAD_BIT 0x00100000 +#define CONDS_BIT 0x00100000 +#define LOAD_BIT 0x00100000 #define DOUBLE_LOAD_FLAG 0x00000001 struct asm_cond { - const char * template; + const char * template; unsigned long value; }; -#define COND_ALWAYS 0xe0000000 -#define COND_MASK 0xf0000000 - -static const struct asm_cond conds[] = -{ - {"eq", 0x00000000}, - {"ne", 0x10000000}, - {"cs", 0x20000000}, {"hs", 0x20000000}, - {"cc", 0x30000000}, {"ul", 0x30000000}, {"lo", 0x30000000}, - {"mi", 0x40000000}, - {"pl", 0x50000000}, - {"vs", 0x60000000}, - {"vc", 0x70000000}, - {"hi", 0x80000000}, - {"ls", 0x90000000}, - {"ge", 0xa0000000}, - {"lt", 0xb0000000}, - {"gt", 0xc0000000}, - {"le", 0xd0000000}, - {"al", 0xe0000000}, - {"nv", 0xf0000000} -}; +#define COND_ALWAYS 0xE struct asm_psr { const char *template; - bfd_boolean cpsr; unsigned long field; }; /* The bit that distinguishes CPSR and SPSR. */ #define SPSR_BIT (1 << 22) -/* How many bits to shift the PSR_xxx bits up by. */ -#define PSR_SHIFT 16 - -#define PSR_c (1 << 0) -#define PSR_x (1 << 1) -#define PSR_s (1 << 2) -#define PSR_f (1 << 3) - -static const struct asm_psr psrs[] = -{ - {"CPSR", TRUE, PSR_c | PSR_f}, - {"CPSR_all", TRUE, PSR_c | PSR_f}, - {"SPSR", FALSE, PSR_c | PSR_f}, - {"SPSR_all", FALSE, PSR_c | PSR_f}, - {"CPSR_flg", TRUE, PSR_f}, - {"CPSR_f", TRUE, PSR_f}, - {"SPSR_flg", FALSE, PSR_f}, - {"SPSR_f", FALSE, PSR_f}, - {"CPSR_c", TRUE, PSR_c}, - {"CPSR_ctl", TRUE, PSR_c}, - {"SPSR_c", FALSE, PSR_c}, - {"SPSR_ctl", FALSE, PSR_c}, - {"CPSR_x", TRUE, PSR_x}, - {"CPSR_s", TRUE, PSR_s}, - {"SPSR_x", FALSE, PSR_x}, - {"SPSR_s", FALSE, PSR_s}, - /* Combinations of flags. */ - {"CPSR_fs", TRUE, PSR_f | PSR_s}, - {"CPSR_fx", TRUE, PSR_f | PSR_x}, - {"CPSR_fc", TRUE, PSR_f | PSR_c}, - {"CPSR_sf", TRUE, PSR_s | PSR_f}, - {"CPSR_sx", TRUE, PSR_s | PSR_x}, - {"CPSR_sc", TRUE, PSR_s | PSR_c}, - {"CPSR_xf", TRUE, PSR_x | PSR_f}, - {"CPSR_xs", TRUE, PSR_x | PSR_s}, - {"CPSR_xc", TRUE, PSR_x | PSR_c}, - {"CPSR_cf", TRUE, PSR_c | PSR_f}, - {"CPSR_cs", TRUE, PSR_c | PSR_s}, - {"CPSR_cx", TRUE, PSR_c | PSR_x}, - {"CPSR_fsx", TRUE, PSR_f | PSR_s | PSR_x}, - {"CPSR_fsc", TRUE, PSR_f | PSR_s | PSR_c}, - {"CPSR_fxs", TRUE, PSR_f | PSR_x | PSR_s}, - {"CPSR_fxc", TRUE, PSR_f | PSR_x | PSR_c}, - {"CPSR_fcs", TRUE, PSR_f | PSR_c | PSR_s}, - {"CPSR_fcx", TRUE, PSR_f | PSR_c | PSR_x}, - {"CPSR_sfx", TRUE, PSR_s | PSR_f | PSR_x}, - {"CPSR_sfc", TRUE, PSR_s | PSR_f | PSR_c}, - {"CPSR_sxf", TRUE, PSR_s | PSR_x | PSR_f}, - {"CPSR_sxc", TRUE, PSR_s | PSR_x | PSR_c}, - {"CPSR_scf", TRUE, PSR_s | PSR_c | PSR_f}, - {"CPSR_scx", TRUE, PSR_s | PSR_c | PSR_x}, - {"CPSR_xfs", TRUE, PSR_x | PSR_f | PSR_s}, - {"CPSR_xfc", TRUE, PSR_x | PSR_f | PSR_c}, - {"CPSR_xsf", TRUE, PSR_x | PSR_s | PSR_f}, - {"CPSR_xsc", TRUE, PSR_x | PSR_s | PSR_c}, - {"CPSR_xcf", TRUE, PSR_x | PSR_c | PSR_f}, - {"CPSR_xcs", TRUE, PSR_x | PSR_c | PSR_s}, - {"CPSR_cfs", TRUE, PSR_c | PSR_f | PSR_s}, - {"CPSR_cfx", TRUE, PSR_c | PSR_f | PSR_x}, - {"CPSR_csf", TRUE, PSR_c | PSR_s | PSR_f}, - {"CPSR_csx", TRUE, PSR_c | PSR_s | PSR_x}, - {"CPSR_cxf", TRUE, PSR_c | PSR_x | PSR_f}, - {"CPSR_cxs", TRUE, PSR_c | PSR_x | PSR_s}, - {"CPSR_fsxc", TRUE, PSR_f | PSR_s | PSR_x | PSR_c}, - {"CPSR_fscx", TRUE, PSR_f | PSR_s | PSR_c | PSR_x}, - {"CPSR_fxsc", TRUE, PSR_f | PSR_x | PSR_s | PSR_c}, - {"CPSR_fxcs", TRUE, PSR_f | PSR_x | PSR_c | PSR_s}, - {"CPSR_fcsx", TRUE, PSR_f | PSR_c | PSR_s | PSR_x}, - {"CPSR_fcxs", TRUE, PSR_f | PSR_c | PSR_x | PSR_s}, - {"CPSR_sfxc", TRUE, PSR_s | PSR_f | PSR_x | PSR_c}, - {"CPSR_sfcx", TRUE, PSR_s | PSR_f | PSR_c | PSR_x}, - {"CPSR_sxfc", TRUE, PSR_s | PSR_x | PSR_f | PSR_c}, - {"CPSR_sxcf", TRUE, PSR_s | PSR_x | PSR_c | PSR_f}, - {"CPSR_scfx", TRUE, PSR_s | PSR_c | PSR_f | PSR_x}, - {"CPSR_scxf", TRUE, PSR_s | PSR_c | PSR_x | PSR_f}, - {"CPSR_xfsc", TRUE, PSR_x | PSR_f | PSR_s | PSR_c}, - {"CPSR_xfcs", TRUE, PSR_x | PSR_f | PSR_c | PSR_s}, - {"CPSR_xsfc", TRUE, PSR_x | PSR_s | PSR_f | PSR_c}, - {"CPSR_xscf", TRUE, PSR_x | PSR_s | PSR_c | PSR_f}, - {"CPSR_xcfs", TRUE, PSR_x | PSR_c | PSR_f | PSR_s}, - {"CPSR_xcsf", TRUE, PSR_x | PSR_c | PSR_s | PSR_f}, - {"CPSR_cfsx", TRUE, PSR_c | PSR_f | PSR_s | PSR_x}, - {"CPSR_cfxs", TRUE, PSR_c | PSR_f | PSR_x | PSR_s}, - {"CPSR_csfx", TRUE, PSR_c | PSR_s | PSR_f | PSR_x}, - {"CPSR_csxf", TRUE, PSR_c | PSR_s | PSR_x | PSR_f}, - {"CPSR_cxfs", TRUE, PSR_c | PSR_x | PSR_f | PSR_s}, - {"CPSR_cxsf", TRUE, PSR_c | PSR_x | PSR_s | PSR_f}, - {"SPSR_fs", FALSE, PSR_f | PSR_s}, - {"SPSR_fx", FALSE, PSR_f | PSR_x}, - {"SPSR_fc", FALSE, PSR_f | PSR_c}, - {"SPSR_sf", FALSE, PSR_s | PSR_f}, - {"SPSR_sx", FALSE, PSR_s | PSR_x}, - {"SPSR_sc", FALSE, PSR_s | PSR_c}, - {"SPSR_xf", FALSE, PSR_x | PSR_f}, - {"SPSR_xs", FALSE, PSR_x | PSR_s}, - {"SPSR_xc", FALSE, PSR_x | PSR_c}, - {"SPSR_cf", FALSE, PSR_c | PSR_f}, - {"SPSR_cs", FALSE, PSR_c | PSR_s}, - {"SPSR_cx", FALSE, PSR_c | PSR_x}, - {"SPSR_fsx", FALSE, PSR_f | PSR_s | PSR_x}, - {"SPSR_fsc", FALSE, PSR_f | PSR_s | PSR_c}, - {"SPSR_fxs", FALSE, PSR_f | PSR_x | PSR_s}, - {"SPSR_fxc", FALSE, PSR_f | PSR_x | PSR_c}, - {"SPSR_fcs", FALSE, PSR_f | PSR_c | PSR_s}, - {"SPSR_fcx", FALSE, PSR_f | PSR_c | PSR_x}, - {"SPSR_sfx", FALSE, PSR_s | PSR_f | PSR_x}, - {"SPSR_sfc", FALSE, PSR_s | PSR_f | PSR_c}, - {"SPSR_sxf", FALSE, PSR_s | PSR_x | PSR_f}, - {"SPSR_sxc", FALSE, PSR_s | PSR_x | PSR_c}, - {"SPSR_scf", FALSE, PSR_s | PSR_c | PSR_f}, - {"SPSR_scx", FALSE, PSR_s | PSR_c | PSR_x}, - {"SPSR_xfs", FALSE, PSR_x | PSR_f | PSR_s}, - {"SPSR_xfc", FALSE, PSR_x | PSR_f | PSR_c}, - {"SPSR_xsf", FALSE, PSR_x | PSR_s | PSR_f}, - {"SPSR_xsc", FALSE, PSR_x | PSR_s | PSR_c}, - {"SPSR_xcf", FALSE, PSR_x | PSR_c | PSR_f}, - {"SPSR_xcs", FALSE, PSR_x | PSR_c | PSR_s}, - {"SPSR_cfs", FALSE, PSR_c | PSR_f | PSR_s}, - {"SPSR_cfx", FALSE, PSR_c | PSR_f | PSR_x}, - {"SPSR_csf", FALSE, PSR_c | PSR_s | PSR_f}, - {"SPSR_csx", FALSE, PSR_c | PSR_s | PSR_x}, - {"SPSR_cxf", FALSE, PSR_c | PSR_x | PSR_f}, - {"SPSR_cxs", FALSE, PSR_c | PSR_x | PSR_s}, - {"SPSR_fsxc", FALSE, PSR_f | PSR_s | PSR_x | PSR_c}, - {"SPSR_fscx", FALSE, PSR_f | PSR_s | PSR_c | PSR_x}, - {"SPSR_fxsc", FALSE, PSR_f | PSR_x | PSR_s | PSR_c}, - {"SPSR_fxcs", FALSE, PSR_f | PSR_x | PSR_c | PSR_s}, - {"SPSR_fcsx", FALSE, PSR_f | PSR_c | PSR_s | PSR_x}, - {"SPSR_fcxs", FALSE, PSR_f | PSR_c | PSR_x | PSR_s}, - {"SPSR_sfxc", FALSE, PSR_s | PSR_f | PSR_x | PSR_c}, - {"SPSR_sfcx", FALSE, PSR_s | PSR_f | PSR_c | PSR_x}, - {"SPSR_sxfc", FALSE, PSR_s | PSR_x | PSR_f | PSR_c}, - {"SPSR_sxcf", FALSE, PSR_s | PSR_x | PSR_c | PSR_f}, - {"SPSR_scfx", FALSE, PSR_s | PSR_c | PSR_f | PSR_x}, - {"SPSR_scxf", FALSE, PSR_s | PSR_c | PSR_x | PSR_f}, - {"SPSR_xfsc", FALSE, PSR_x | PSR_f | PSR_s | PSR_c}, - {"SPSR_xfcs", FALSE, PSR_x | PSR_f | PSR_c | PSR_s}, - {"SPSR_xsfc", FALSE, PSR_x | PSR_s | PSR_f | PSR_c}, - {"SPSR_xscf", FALSE, PSR_x | PSR_s | PSR_c | PSR_f}, - {"SPSR_xcfs", FALSE, PSR_x | PSR_c | PSR_f | PSR_s}, - {"SPSR_xcsf", FALSE, PSR_x | PSR_c | PSR_s | PSR_f}, - {"SPSR_cfsx", FALSE, PSR_c | PSR_f | PSR_s | PSR_x}, - {"SPSR_cfxs", FALSE, PSR_c | PSR_f | PSR_x | PSR_s}, - {"SPSR_csfx", FALSE, PSR_c | PSR_s | PSR_f | PSR_x}, - {"SPSR_csxf", FALSE, PSR_c | PSR_s | PSR_x | PSR_f}, - {"SPSR_cxfs", FALSE, PSR_c | PSR_x | PSR_f | PSR_s}, - {"SPSR_cxsf", FALSE, PSR_c | PSR_x | PSR_s | PSR_f}, -}; - -enum wreg_type - { - IWMMXT_REG_WR = 0, - IWMMXT_REG_WC = 1, - IWMMXT_REG_WR_OR_WC = 2, - IWMMXT_REG_WCG - }; - -enum iwmmxt_insn_type -{ - check_rd, - check_wr, - check_wrwr, - check_wrwrwr, - check_wrwrwcg, - check_tbcst, - check_tmovmsk, - check_tmia, - check_tmcrr, - check_tmrrc, - check_tmcr, - check_tmrc, - check_tinsr, - check_textrc, - check_waligni, - check_textrm, - check_wshufh -}; +/* The individual PSR flag bits. */ +#define PSR_c (1 << 16) +#define PSR_x (1 << 17) +#define PSR_s (1 << 18) +#define PSR_f (1 << 19) -enum vfp_dp_reg_pos +struct reloc_entry { - VFP_REG_Dd, VFP_REG_Dm, VFP_REG_Dn + char *name; + bfd_reloc_code_real_type reloc; }; enum vfp_sp_reg_pos @@ -560,291 +309,101 @@ enum vfp_ldstm_type VFP_LDSTMIA, VFP_LDSTMDB, VFP_LDSTMIAX, VFP_LDSTMDBX }; -/* VFP system registers. */ -struct vfp_reg -{ - const char *name; - unsigned long regno; -}; - -static const struct vfp_reg vfp_regs[] = +/* ARM register categories. This includes coprocessor numbers and various + architecture extensions' registers. */ +enum arm_reg_type { - {"fpsid", 0x00000000}, - {"FPSID", 0x00000000}, - {"fpscr", 0x00010000}, - {"FPSCR", 0x00010000}, - {"fpexc", 0x00080000}, - {"FPEXC", 0x00080000} + REG_TYPE_RN, + REG_TYPE_CP, + REG_TYPE_CN, + REG_TYPE_FN, + REG_TYPE_VFS, + REG_TYPE_VFD, + REG_TYPE_VFC, + REG_TYPE_MVF, + REG_TYPE_MVD, + REG_TYPE_MVFX, + REG_TYPE_MVDX, + REG_TYPE_MVAX, + REG_TYPE_DSPSC, + REG_TYPE_MMXWR, + REG_TYPE_MMXWC, + REG_TYPE_MMXWCG, + REG_TYPE_XSCALE, }; /* Structure for a hash table entry for a register. */ struct reg_entry { - const char * name; - int number; - bfd_boolean builtin; + const char *name; + unsigned char number; + unsigned char type; + unsigned char builtin; +}; + +/* Diagnostics used when we don't get a register of the expected type. */ +const char *const reg_expected_msgs[] = +{ + N_("ARM register expected"), + N_("bad or missing co-processor number"), + N_("co-processor register expected"), + N_("FPA register expected"), + N_("VFP single precision register expected"), + N_("VFP double precision register expected"), + N_("VFP system register expected"), + N_("Maverick MVF register expected"), + N_("Maverick MVD register expected"), + N_("Maverick MVFX register expected"), + N_("Maverick MVDX register expected"), + N_("Maverick MVAX register expected"), + N_("Maverick DSPSC register expected"), + N_("iWMMXt data register expected"), + N_("iWMMXt control register expected"), + N_("iWMMXt scalar register expected"), + N_("XScale accumulator register expected"), }; /* Some well known registers that we refer to directly elsewhere. */ -#define REG_SP 13 -#define REG_LR 14 +#define REG_SP 13 +#define REG_LR 14 #define REG_PC 15 -#define wr_register(reg) ((reg ^ WR_PREFIX) >= 0 && (reg ^ WR_PREFIX) <= 15) -#define wc_register(reg) ((reg ^ WC_PREFIX) >= 0 && (reg ^ WC_PREFIX) <= 15) -#define wcg_register(reg) ((reg ^ WC_PREFIX) >= 8 && (reg ^ WC_PREFIX) <= 11) - -/* These are the standard names. Users can add aliases with .req. - and delete them with .unreq. */ - -/* Integer Register Numbers. */ -static const struct reg_entry rn_table[] = -{ - {"r0", 0, TRUE}, {"r1", 1, TRUE}, {"r2", 2, TRUE}, {"r3", 3, TRUE}, - {"r4", 4, TRUE}, {"r5", 5, TRUE}, {"r6", 6, TRUE}, {"r7", 7, TRUE}, - {"r8", 8, TRUE}, {"r9", 9, TRUE}, {"r10", 10, TRUE}, {"r11", 11, TRUE}, - {"r12", 12, TRUE}, {"r13", REG_SP, TRUE}, {"r14", REG_LR, TRUE}, {"r15", REG_PC, TRUE}, - /* ATPCS Synonyms. */ - {"a1", 0, TRUE}, {"a2", 1, TRUE}, {"a3", 2, TRUE}, {"a4", 3, TRUE}, - {"v1", 4, TRUE}, {"v2", 5, TRUE}, {"v3", 6, TRUE}, {"v4", 7, TRUE}, - {"v5", 8, TRUE}, {"v6", 9, TRUE}, {"v7", 10, TRUE}, {"v8", 11, TRUE}, - /* Well-known aliases. */ - {"wr", 7, TRUE}, {"sb", 9, TRUE}, {"sl", 10, TRUE}, {"fp", 11, TRUE}, - {"ip", 12, TRUE}, {"sp", REG_SP, TRUE}, {"lr", REG_LR, TRUE}, {"pc", REG_PC, TRUE}, - {NULL, 0, TRUE} -}; - -#define WR_PREFIX 0x200 -#define WC_PREFIX 0x400 - -static const struct reg_entry iwmmxt_table[] = -{ - /* Intel Wireless MMX technology register names. */ - { "wr0", 0x0 | WR_PREFIX, TRUE}, {"wr1", 0x1 | WR_PREFIX, TRUE}, - { "wr2", 0x2 | WR_PREFIX, TRUE}, {"wr3", 0x3 | WR_PREFIX, TRUE}, - { "wr4", 0x4 | WR_PREFIX, TRUE}, {"wr5", 0x5 | WR_PREFIX, TRUE}, - { "wr6", 0x6 | WR_PREFIX, TRUE}, {"wr7", 0x7 | WR_PREFIX, TRUE}, - { "wr8", 0x8 | WR_PREFIX, TRUE}, {"wr9", 0x9 | WR_PREFIX, TRUE}, - { "wr10", 0xa | WR_PREFIX, TRUE}, {"wr11", 0xb | WR_PREFIX, TRUE}, - { "wr12", 0xc | WR_PREFIX, TRUE}, {"wr13", 0xd | WR_PREFIX, TRUE}, - { "wr14", 0xe | WR_PREFIX, TRUE}, {"wr15", 0xf | WR_PREFIX, TRUE}, - { "wcid", 0x0 | WC_PREFIX, TRUE}, {"wcon", 0x1 | WC_PREFIX, TRUE}, - {"wcssf", 0x2 | WC_PREFIX, TRUE}, {"wcasf", 0x3 | WC_PREFIX, TRUE}, - {"wcgr0", 0x8 | WC_PREFIX, TRUE}, {"wcgr1", 0x9 | WC_PREFIX, TRUE}, - {"wcgr2", 0xa | WC_PREFIX, TRUE}, {"wcgr3", 0xb | WC_PREFIX, TRUE}, - - { "wR0", 0x0 | WR_PREFIX, TRUE}, {"wR1", 0x1 | WR_PREFIX, TRUE}, - { "wR2", 0x2 | WR_PREFIX, TRUE}, {"wR3", 0x3 | WR_PREFIX, TRUE}, - { "wR4", 0x4 | WR_PREFIX, TRUE}, {"wR5", 0x5 | WR_PREFIX, TRUE}, - { "wR6", 0x6 | WR_PREFIX, TRUE}, {"wR7", 0x7 | WR_PREFIX, TRUE}, - { "wR8", 0x8 | WR_PREFIX, TRUE}, {"wR9", 0x9 | WR_PREFIX, TRUE}, - { "wR10", 0xa | WR_PREFIX, TRUE}, {"wR11", 0xb | WR_PREFIX, TRUE}, - { "wR12", 0xc | WR_PREFIX, TRUE}, {"wR13", 0xd | WR_PREFIX, TRUE}, - { "wR14", 0xe | WR_PREFIX, TRUE}, {"wR15", 0xf | WR_PREFIX, TRUE}, - { "wCID", 0x0 | WC_PREFIX, TRUE}, {"wCon", 0x1 | WC_PREFIX, TRUE}, - {"wCSSF", 0x2 | WC_PREFIX, TRUE}, {"wCASF", 0x3 | WC_PREFIX, TRUE}, - {"wCGR0", 0x8 | WC_PREFIX, TRUE}, {"wCGR1", 0x9 | WC_PREFIX, TRUE}, - {"wCGR2", 0xa | WC_PREFIX, TRUE}, {"wCGR3", 0xb | WC_PREFIX, TRUE}, - {NULL, 0, TRUE} -}; - -/* Co-processor Numbers. */ -static const struct reg_entry cp_table[] = -{ - {"p0", 0, TRUE}, {"p1", 1, TRUE}, {"p2", 2, TRUE}, {"p3", 3, TRUE}, - {"p4", 4, TRUE}, {"p5", 5, TRUE}, {"p6", 6, TRUE}, {"p7", 7, TRUE}, - {"p8", 8, TRUE}, {"p9", 9, TRUE}, {"p10", 10, TRUE}, {"p11", 11, TRUE}, - {"p12", 12, TRUE}, {"p13", 13, TRUE}, {"p14", 14, TRUE}, {"p15", 15, TRUE}, - {NULL, 0, TRUE} -}; - -/* Co-processor Register Numbers. */ -static const struct reg_entry cn_table[] = -{ - {"c0", 0, TRUE}, {"c1", 1, TRUE}, {"c2", 2, TRUE}, {"c3", 3, TRUE}, - {"c4", 4, TRUE}, {"c5", 5, TRUE}, {"c6", 6, TRUE}, {"c7", 7, TRUE}, - {"c8", 8, TRUE}, {"c9", 9, TRUE}, {"c10", 10, TRUE}, {"c11", 11, TRUE}, - {"c12", 12, TRUE}, {"c13", 13, TRUE}, {"c14", 14, TRUE}, {"c15", 15, TRUE}, - /* Not really valid, but kept for back-wards compatibility. */ - {"cr0", 0, TRUE}, {"cr1", 1, TRUE}, {"cr2", 2, TRUE}, {"cr3", 3, TRUE}, - {"cr4", 4, TRUE}, {"cr5", 5, TRUE}, {"cr6", 6, TRUE}, {"cr7", 7, TRUE}, - {"cr8", 8, TRUE}, {"cr9", 9, TRUE}, {"cr10", 10, TRUE}, {"cr11", 11, TRUE}, - {"cr12", 12, TRUE}, {"cr13", 13, TRUE}, {"cr14", 14, TRUE}, {"cr15", 15, TRUE}, - {NULL, 0, TRUE} -}; - -/* FPA Registers. */ -static const struct reg_entry fn_table[] = -{ - {"f0", 0, TRUE}, {"f1", 1, TRUE}, {"f2", 2, TRUE}, {"f3", 3, TRUE}, - {"f4", 4, TRUE}, {"f5", 5, TRUE}, {"f6", 6, TRUE}, {"f7", 7, TRUE}, - {NULL, 0, TRUE} -}; - -/* VFP SP Registers. */ -static const struct reg_entry sn_table[] = -{ - {"s0", 0, TRUE}, {"s1", 1, TRUE}, {"s2", 2, TRUE}, {"s3", 3, TRUE}, - {"s4", 4, TRUE}, {"s5", 5, TRUE}, {"s6", 6, TRUE}, {"s7", 7, TRUE}, - {"s8", 8, TRUE}, {"s9", 9, TRUE}, {"s10", 10, TRUE}, {"s11", 11, TRUE}, - {"s12", 12, TRUE}, {"s13", 13, TRUE}, {"s14", 14, TRUE}, {"s15", 15, TRUE}, - {"s16", 16, TRUE}, {"s17", 17, TRUE}, {"s18", 18, TRUE}, {"s19", 19, TRUE}, - {"s20", 20, TRUE}, {"s21", 21, TRUE}, {"s22", 22, TRUE}, {"s23", 23, TRUE}, - {"s24", 24, TRUE}, {"s25", 25, TRUE}, {"s26", 26, TRUE}, {"s27", 27, TRUE}, - {"s28", 28, TRUE}, {"s29", 29, TRUE}, {"s30", 30, TRUE}, {"s31", 31, TRUE}, - {NULL, 0, TRUE} -}; - -/* VFP DP Registers. */ -static const struct reg_entry dn_table[] = -{ - {"d0", 0, TRUE}, {"d1", 1, TRUE}, {"d2", 2, TRUE}, {"d3", 3, TRUE}, - {"d4", 4, TRUE}, {"d5", 5, TRUE}, {"d6", 6, TRUE}, {"d7", 7, TRUE}, - {"d8", 8, TRUE}, {"d9", 9, TRUE}, {"d10", 10, TRUE}, {"d11", 11, TRUE}, - {"d12", 12, TRUE}, {"d13", 13, TRUE}, {"d14", 14, TRUE}, {"d15", 15, TRUE}, - {NULL, 0, TRUE} -}; - -/* Maverick DSP coprocessor registers. */ -static const struct reg_entry mav_mvf_table[] = -{ - {"mvf0", 0, TRUE}, {"mvf1", 1, TRUE}, {"mvf2", 2, TRUE}, {"mvf3", 3, TRUE}, - {"mvf4", 4, TRUE}, {"mvf5", 5, TRUE}, {"mvf6", 6, TRUE}, {"mvf7", 7, TRUE}, - {"mvf8", 8, TRUE}, {"mvf9", 9, TRUE}, {"mvf10", 10, TRUE}, {"mvf11", 11, TRUE}, - {"mvf12", 12, TRUE}, {"mvf13", 13, TRUE}, {"mvf14", 14, TRUE}, {"mvf15", 15, TRUE}, - {NULL, 0, TRUE} -}; - -static const struct reg_entry mav_mvd_table[] = -{ - {"mvd0", 0, TRUE}, {"mvd1", 1, TRUE}, {"mvd2", 2, TRUE}, {"mvd3", 3, TRUE}, - {"mvd4", 4, TRUE}, {"mvd5", 5, TRUE}, {"mvd6", 6, TRUE}, {"mvd7", 7, TRUE}, - {"mvd8", 8, TRUE}, {"mvd9", 9, TRUE}, {"mvd10", 10, TRUE}, {"mvd11", 11, TRUE}, - {"mvd12", 12, TRUE}, {"mvd13", 13, TRUE}, {"mvd14", 14, TRUE}, {"mvd15", 15, TRUE}, - {NULL, 0, TRUE} -}; - -static const struct reg_entry mav_mvfx_table[] = -{ - {"mvfx0", 0, TRUE}, {"mvfx1", 1, TRUE}, {"mvfx2", 2, TRUE}, {"mvfx3", 3, TRUE}, - {"mvfx4", 4, TRUE}, {"mvfx5", 5, TRUE}, {"mvfx6", 6, TRUE}, {"mvfx7", 7, TRUE}, - {"mvfx8", 8, TRUE}, {"mvfx9", 9, TRUE}, {"mvfx10", 10, TRUE}, {"mvfx11", 11, TRUE}, - {"mvfx12", 12, TRUE}, {"mvfx13", 13, TRUE}, {"mvfx14", 14, TRUE}, {"mvfx15", 15, TRUE}, - {NULL, 0, TRUE} -}; - -static const struct reg_entry mav_mvdx_table[] = -{ - {"mvdx0", 0, TRUE}, {"mvdx1", 1, TRUE}, {"mvdx2", 2, TRUE}, {"mvdx3", 3, TRUE}, - {"mvdx4", 4, TRUE}, {"mvdx5", 5, TRUE}, {"mvdx6", 6, TRUE}, {"mvdx7", 7, TRUE}, - {"mvdx8", 8, TRUE}, {"mvdx9", 9, TRUE}, {"mvdx10", 10, TRUE}, {"mvdx11", 11, TRUE}, - {"mvdx12", 12, TRUE}, {"mvdx13", 13, TRUE}, {"mvdx14", 14, TRUE}, {"mvdx15", 15, TRUE}, - {NULL, 0, TRUE} -}; - -static const struct reg_entry mav_mvax_table[] = -{ - {"mvax0", 0, TRUE}, {"mvax1", 1, TRUE}, {"mvax2", 2, TRUE}, {"mvax3", 3, TRUE}, - {NULL, 0, TRUE} -}; - -static const struct reg_entry mav_dspsc_table[] = -{ - {"dspsc", 0, TRUE}, - {NULL, 0, TRUE} -}; - -struct reg_map -{ - const struct reg_entry * names; - int max_regno; - struct hash_control * htab; - const char * expected; -}; - -struct reg_map all_reg_maps[] = -{ - {rn_table, 15, NULL, N_("ARM register expected")}, - {cp_table, 15, NULL, N_("bad or missing co-processor number")}, - {cn_table, 15, NULL, N_("co-processor register expected")}, - {fn_table, 7, NULL, N_("FPA register expected")}, - {sn_table, 31, NULL, N_("VFP single precision register expected")}, - {dn_table, 15, NULL, N_("VFP double precision register expected")}, - {mav_mvf_table, 15, NULL, N_("Maverick MVF register expected")}, - {mav_mvd_table, 15, NULL, N_("Maverick MVD register expected")}, - {mav_mvfx_table, 15, NULL, N_("Maverick MVFX register expected")}, - {mav_mvdx_table, 15, NULL, N_("Maverick MVDX register expected")}, - {mav_mvax_table, 3, NULL, N_("Maverick MVAX register expected")}, - {mav_dspsc_table, 0, NULL, N_("Maverick DSPSC register expected")}, - {iwmmxt_table, 23, NULL, N_("Intel Wireless MMX technology register expected")}, -}; - -/* Enumeration matching entries in table above. */ -enum arm_reg_type -{ - REG_TYPE_RN = 0, -#define REG_TYPE_FIRST REG_TYPE_RN - REG_TYPE_CP = 1, - REG_TYPE_CN = 2, - REG_TYPE_FN = 3, - REG_TYPE_SN = 4, - REG_TYPE_DN = 5, - REG_TYPE_MVF = 6, - REG_TYPE_MVD = 7, - REG_TYPE_MVFX = 8, - REG_TYPE_MVDX = 9, - REG_TYPE_MVAX = 10, - REG_TYPE_DSPSC = 11, - REG_TYPE_IWMMXT = 12, - - REG_TYPE_MAX = 13 -}; - /* ARM instructions take 4bytes in the object file, Thumb instructions take 2: */ -#define INSN_SIZE 4 - -/* "INSN X,Y" where X:bit12, Y:bit16. */ -#define MAV_MODE1 0x100c - -/* "INSN X,Y" where X:bit16, Y:bit12. */ -#define MAV_MODE2 0x0c10 - -/* "INSN X,Y" where X:bit12, Y:bit16. */ -#define MAV_MODE3 0x100c - -/* "INSN X,Y,Z" where X:16, Y:0, Z:12. */ -#define MAV_MODE4 0x0c0010 - -/* "INSN X,Y,Z" where X:12, Y:16, Z:0. */ -#define MAV_MODE5 0x00100c - -/* "INSN W,X,Y,Z" where W:5, X:12, Y:16, Z:0. */ -#define MAV_MODE6 0x00100c05 +#define INSN_SIZE 4 struct asm_opcode { /* Basic string to match. */ - const char * template; + const char *template; + + /* Parameters to instruction. */ + unsigned char operands[8]; + + /* Conditional tag - see opcode_lookup. */ + unsigned int tag : 4; /* Basic instruction code. */ - unsigned long value; + unsigned int avalue : 28; - /* Offset into the template where the condition code (if any) will be. - If zero, then the instruction is never conditional. */ - unsigned cond_offset; + /* Thumb-format instruction code. */ + unsigned int tvalue; /* Which architecture variant provides this instruction. */ - unsigned long variant; + unsigned long avariant; + unsigned long tvariant; - /* Function to call to parse args. */ - void (* parms) (char *); + /* Function to call to encode instruction in ARM format. */ + void (* aencode) (void); + + /* Function to call to encode instruction in Thumb format. */ + void (* tencode) (void); }; /* Defines for various bits that we will want to toggle. */ #define INST_IMMEDIATE 0x02000000 #define OFFSET_REG 0x02000000 -#define HWOFFSET_IMM 0x00400000 +#define HWOFFSET_IMM 0x00400000 #define SHIFT_BY_REG 0x00000010 #define PRE_INDEX 0x01000000 #define INDEX_UP 0x00800000 @@ -895,7 +454,8 @@ struct asm_opcode #define T_OPCODE_ASR_R 0x4100 #define T_OPCODE_LSL_R 0x4080 -#define T_OPCODE_LSR_R 0x40c0 +#define T_OPCODE_LSR_R 0x40c0 +#define T_OPCODE_ROR_R 0x41c0 #define T_OPCODE_ASR_I 0x1000 #define T_OPCODE_LSL_I 0x0000 #define T_OPCODE_LSR_I 0x0800 @@ -928,58 +488,22 @@ struct asm_opcode #define T_OPCODE_BRANCH 0xe7fe #define THUMB_SIZE 2 /* Size of thumb instruction. */ -#define THUMB_REG_LO 0x1 -#define THUMB_REG_HI 0x2 -#define THUMB_REG_ANY 0x3 - -#define THUMB_H1 0x0080 -#define THUMB_H2 0x0040 - -#define THUMB_ASR 0 -#define THUMB_LSL 1 -#define THUMB_LSR 2 - -#define THUMB_MOVE 0 -#define THUMB_COMPARE 1 -#define THUMB_CPY 2 - -#define THUMB_LOAD 0 -#define THUMB_STORE 1 - #define THUMB_PP_PC_LR 0x0100 +#define THUMB_LOAD_BIT 0x0800 -/* These three are used for immediate shifts, do not alter. */ -#define THUMB_WORD 2 -#define THUMB_HALFWORD 1 -#define THUMB_BYTE 0 - -struct thumb_opcode -{ - /* Basic string to match. */ - const char * template; - - /* Basic instruction code. */ - unsigned long value; - - int size; - - /* Which CPU variants this exists for. */ - unsigned long variant; - - /* Function to call to parse args. */ - void (* parms) (char *); -}; - -#define BAD_ARGS _("bad arguments to instruction") -#define BAD_PC _("r15 not allowed here") -#define BAD_COND _("instruction is not conditional") -#define ERR_NO_ACCUM _("acc0 expected") - -static struct hash_control * arm_ops_hsh = NULL; -static struct hash_control * arm_tops_hsh = NULL; -static struct hash_control * arm_cond_hsh = NULL; -static struct hash_control * arm_shift_hsh = NULL; -static struct hash_control * arm_psr_hsh = NULL; +#define BAD_ARGS _("bad arguments to instruction") +#define BAD_PC _("r15 not allowed here") +#define BAD_COND _("instruction cannot be conditional") +#define BAD_OVERLAP _("registers may not be the same") +#define BAD_HIREG _("lo register required") +#define BAD_THUMB32 _("instruction not supported in Thumb16 mode") + +static struct hash_control *arm_ops_hsh; +static struct hash_control *arm_cond_hsh; +static struct hash_control *arm_shift_hsh; +static struct hash_control *arm_psr_hsh; +static struct hash_control *arm_reg_hsh; +static struct hash_control *arm_reloc_hsh; /* Stuff needed to resolve the label ambiguity As: @@ -988,460 +512,769 @@ static struct hash_control * arm_psr_hsh may differ from: ... label: - + */ symbolS * last_label_seen; static int label_is_thumb_function_name = FALSE; -/* Literal Pool stuff. */ - -#define MAX_LITERAL_POOL_SIZE 1024 - /* Literal pool structure. Held on a per-section and per-sub-section basis. */ +#define MAX_LITERAL_POOL_SIZE 1024 typedef struct literal_pool { - expressionS literals [MAX_LITERAL_POOL_SIZE]; - unsigned int next_free_entry; - unsigned int id; - symbolS * symbol; - segT section; - subsegT sub_section; + expressionS literals [MAX_LITERAL_POOL_SIZE]; + unsigned int next_free_entry; + unsigned int id; + symbolS * symbol; + segT section; + subsegT sub_section; struct literal_pool * next; } literal_pool; /* Pointer to a linked list of literal pools. */ literal_pool * list_of_pools = NULL; + +/* Pure syntax. */ -static literal_pool * -find_literal_pool (void) -{ - literal_pool * pool; +/* This array holds the chars that always start a comment. If the + pre-processor is disabled, these aren't very useful. */ +const char comment_chars[] = "@"; - for (pool = list_of_pools; pool != NULL; pool = pool->next) - { - if (pool->section == now_seg - && pool->sub_section == now_subseg) - break; - } +/* 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. */ +/* 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. */ +const char line_comment_chars[] = "#"; - return pool; -} +const char line_separator_chars[] = ";"; -static literal_pool * -find_or_make_literal_pool (void) -{ - /* Next literal pool ID number. */ - static unsigned int latest_pool_num = 1; - literal_pool * pool; +/* Chars that can be used to separate mant + from exp in floating point numbers. */ +const char EXP_CHARS[] = "eE"; - pool = find_literal_pool (); +/* Chars that mean this number is a floating point constant. */ +/* As in 0f12.456 */ +/* or 0d1.2345e12 */ - if (pool == NULL) - { - /* Create a new pool. */ - pool = xmalloc (sizeof (* pool)); - if (! pool) - return NULL; +const char FLT_CHARS[] = "rRsSfFdDxXeEpP"; - pool->next_free_entry = 0; - pool->section = now_seg; - pool->sub_section = now_subseg; - pool->next = list_of_pools; - pool->symbol = NULL; +/* Prefix characters that indicate the start of an immediate + value. */ +#define is_immediate_prefix(C) ((C) == '#' || (C) == '$') - /* Add it to the list. */ - list_of_pools = pool; - } +/* Separator character handling. */ - /* New pools, and emptied pools, will have a NULL symbol. */ - if (pool->symbol == NULL) +#define skip_whitespace(str) do { if (*(str) == ' ') ++(str); } while (0) + +static inline int +skip_past_char (char ** str, char c) +{ + if (**str == c) { - pool->symbol = symbol_create (FAKE_LABEL_NAME, undefined_section, - (valueT) 0, &zero_address_frag); - pool->id = latest_pool_num ++; + (*str)++; + return SUCCESS; } - - /* Done. */ - return pool; + else + return FAIL; } +#define skip_past_comma(str) skip_past_char (str, ',') -/* Add the literal in the global 'inst' - structure to the relevent literal pool. */ +/* Arithmetic expressions (possibly involving symbols). */ + +/* Return TRUE if anything in the expression is a bignum. */ static int -add_to_lit_pool (void) +walk_no_bignums (symbolS * sp) { - literal_pool * pool; - unsigned int entry; - - pool = find_or_make_literal_pool (); + if (symbol_get_value_expression (sp)->X_op == O_big) + return 1; - /* Check if this literal value is already in the pool. */ - for (entry = 0; entry < pool->next_free_entry; entry ++) + if (symbol_get_value_expression (sp)->X_add_symbol) { - if ((pool->literals[entry].X_op == inst.reloc.exp.X_op) - && (inst.reloc.exp.X_op == O_constant) - && (pool->literals[entry].X_add_number - == inst.reloc.exp.X_add_number) - && (pool->literals[entry].X_unsigned - == inst.reloc.exp.X_unsigned)) - break; - - if ((pool->literals[entry].X_op == inst.reloc.exp.X_op) - && (inst.reloc.exp.X_op == O_symbol) - && (pool->literals[entry].X_add_number - == inst.reloc.exp.X_add_number) - && (pool->literals[entry].X_add_symbol - == inst.reloc.exp.X_add_symbol) - && (pool->literals[entry].X_op_symbol - == inst.reloc.exp.X_op_symbol)) - break; + return (walk_no_bignums (symbol_get_value_expression (sp)->X_add_symbol) + || (symbol_get_value_expression (sp)->X_op_symbol + && walk_no_bignums (symbol_get_value_expression (sp)->X_op_symbol))); } - /* Do we need to create a new entry? */ - if (entry == pool->next_free_entry) + return 0; +} + +static int in_my_get_expression = 0; + +/* Third argument to my_get_expression. */ +#define GE_NO_PREFIX 0 +#define GE_IMM_PREFIX 1 +#define GE_OPT_PREFIX 2 + +static int +my_get_expression (expressionS * ep, char ** str, int prefix_mode) +{ + char * save_in; + segT seg; + + /* In unified syntax, all prefixes are optional. */ + if (unified_syntax) + prefix_mode = GE_OPT_PREFIX; + + switch (prefix_mode) { - if (entry >= MAX_LITERAL_POOL_SIZE) + case GE_NO_PREFIX: break; + case GE_IMM_PREFIX: + if (!is_immediate_prefix (**str)) { - inst.error = _("literal pool overflow"); + inst.error = _("immediate expression requires a # prefix"); return FAIL; } - - pool->literals[entry] = inst.reloc.exp; - pool->next_free_entry += 1; + (*str)++; + break; + case GE_OPT_PREFIX: + if (is_immediate_prefix (**str)) + (*str)++; + break; + default: abort (); } - inst.reloc.exp.X_op = O_symbol; - inst.reloc.exp.X_add_number = ((int) entry) * 4 - 8; - inst.reloc.exp.X_add_symbol = pool->symbol; + memset (ep, 0, sizeof (expressionS)); - return SUCCESS; + save_in = input_line_pointer; + input_line_pointer = *str; + in_my_get_expression = 1; + seg = expression (ep); + in_my_get_expression = 0; + + if (ep->X_op == O_illegal) + { + /* We found a bad expression in md_operand(). */ + *str = input_line_pointer; + input_line_pointer = save_in; + if (inst.error == NULL) + inst.error = _("bad expression"); + return 1; + } + +#ifdef OBJ_AOUT + if (seg != absolute_section + && seg != text_section + && seg != data_section + && seg != bss_section + && seg != undefined_section) + { + inst.error = _("bad segment"); + *str = input_line_pointer; + input_line_pointer = save_in; + return 1; + } +#endif + + /* Get rid of any bignums now, so that we don't generate an error for which + we can't establish a line number later on. Big numbers are never valid + in instructions, which is where this routine is always called. */ + if (ep->X_op == O_big + || (ep->X_add_symbol + && (walk_no_bignums (ep->X_add_symbol) + || (ep->X_op_symbol + && walk_no_bignums (ep->X_op_symbol))))) + { + inst.error = _("invalid constant"); + *str = input_line_pointer; + input_line_pointer = save_in; + return 1; + } + + *str = input_line_pointer; + input_line_pointer = save_in; + return 0; } -/* Can't use symbol_new here, so have to create a symbol and then at - a later date assign it a value. Thats what these functions do. */ +/* Turn a string in input_line_pointer into a floating point constant + of type TYPE, and store the appropriate bytes in *LITP. The number + of LITTLENUMS emitted is stored in *SIZEP. An error message is + returned, or NULL on OK. -static void -symbol_locate (symbolS * symbolP, - const char * name, /* It is copied, the caller can modify. */ - segT segment, /* Segment identifier (SEG_). */ - valueT valu, /* Symbol value. */ - fragS * frag) /* Associated fragment. */ + Note that fp constants aren't represent in the normal way on the ARM. + In big endian mode, things are as expected. However, in little endian + mode fp constants are big-endian word-wise, and little-endian byte-wise + within the words. For example, (double) 1.1 in big endian mode is + the byte sequence 3f f1 99 99 99 99 99 9a, and in little endian mode is + the byte sequence 99 99 f1 3f 9a 99 99 99. + + ??? The format of 12 byte floats is uncertain according to gcc's arm.h. */ + +char * +md_atof (int type, char * litP, int * sizeP) { - unsigned int name_length; - char * preserved_copy_of_name; + int prec; + LITTLENUM_TYPE words[MAX_LITTLENUMS]; + char *t; + int i; - name_length = strlen (name) + 1; /* +1 for \0. */ - obstack_grow (¬es, name, name_length); - preserved_copy_of_name = obstack_finish (¬es); + switch (type) + { + case 'f': + case 'F': + case 's': + case 'S': + prec = 2; + break; -#ifdef tc_canonicalize_symbol_name - preserved_copy_of_name = - tc_canonicalize_symbol_name (preserved_copy_of_name); -#endif + case 'd': + case 'D': + case 'r': + case 'R': + prec = 4; + break; - S_SET_NAME (symbolP, preserved_copy_of_name); + case 'x': + case 'X': + prec = 6; + break; - S_SET_SEGMENT (symbolP, segment); - S_SET_VALUE (symbolP, valu); - symbol_clear_list_pointers (symbolP); + case 'p': + case 'P': + prec = 6; + break; - symbol_set_frag (symbolP, frag); + default: + *sizeP = 0; + return _("bad call to MD_ATOF()"); + } - /* Link to end of symbol chain. */ - { - extern int symbol_table_frozen; + t = atof_ieee (input_line_pointer, type, words); + if (t) + input_line_pointer = t; + *sizeP = prec * 2; - if (symbol_table_frozen) - abort (); - } + if (target_big_endian) + { + for (i = 0; i < prec; i++) + { + md_number_to_chars (litP, (valueT) words[i], 2); + litP += 2; + } + } + else + { + if (cpu_variant & FPU_ARCH_VFP) + for (i = prec - 1; i >= 0; i--) + { + md_number_to_chars (litP, (valueT) words[i], 2); + litP += 2; + } + else + /* For a 4 byte float the order of elements in `words' is 1 0. + For an 8 byte float the order is 1 0 3 2. */ + for (i = 0; i < prec; i += 2) + { + md_number_to_chars (litP, (valueT) words[i + 1], 2); + md_number_to_chars (litP + 2, (valueT) words[i], 2); + litP += 4; + } + } - symbol_append (symbolP, symbol_lastP, & symbol_rootP, & symbol_lastP); + return 0; +} - obj_symbol_new_hook (symbolP); +/* We handle all bad expressions here, so that we can report the faulty + instruction in the error message. */ +void +md_operand (expressionS * expr) +{ + if (in_my_get_expression) + expr->X_op = O_illegal; +} -#ifdef tc_symbol_new_hook - tc_symbol_new_hook (symbolP); -#endif +/* Immediate values. */ -#ifdef DEBUG_SYMS - verify_symbol_chain (symbol_rootP, symbol_lastP); -#endif /* DEBUG_SYMS */ +/* Generic immediate-value read function for use in directives. + Accepts anything that 'expression' can fold to a constant. + *val receives the number. */ +#ifdef OBJ_ELF +static int +immediate_for_directive (int *val) +{ + expressionS exp; + exp.X_op = O_illegal; + + if (is_immediate_prefix (*input_line_pointer)) + { + input_line_pointer++; + expression (&exp); + } + + if (exp.X_op != O_constant) + { + as_bad (_("expected #constant")); + ignore_rest_of_line (); + return FAIL; + } + *val = exp.X_add_number; + return SUCCESS; } +#endif -/* Check that an immediate is valid. - If so, convert it to the right format. */ +/* Register parsing. */ -static unsigned int -validate_immediate (unsigned int val) +/* Generic register parser. CCP points to what should be the + beginning of a register name. If it is indeed a valid register + name, advance CCP over it and return the reg_entry structure; + otherwise return NULL. Does not issue diagnostics. */ + +static struct reg_entry * +arm_reg_parse_multi (char **ccp) { - unsigned int a; - unsigned int i; + char *start = *ccp; + char *p; + struct reg_entry *reg; -#define rotate_left(v, n) (v << n | v >> (32 - n)) +#ifdef REGISTER_PREFIX + if (*start != REGISTER_PREFIX) + return FAIL; + start++; +#endif +#ifdef OPTIONAL_REGISTER_PREFIX + if (*start == OPTIONAL_REGISTER_PREFIX) + start++; +#endif - for (i = 0; i < 32; i += 2) - if ((a = rotate_left (val, i)) <= 0xff) - return a | (i << 7); /* 12-bit pack: [shift-cnt,const]. */ + p = start; + if (!ISALPHA (*p) || !is_name_beginner (*p)) + return NULL; - return FAIL; + do + p++; + while (ISALPHA (*p) || ISDIGIT (*p) || *p == '_'); + + reg = (struct reg_entry *) hash_find_n (arm_reg_hsh, start, p - start); + + if (!reg) + return NULL; + + *ccp = p; + return reg; } -/* Check to see if an immediate can be computed as two separate immediate - values, added together. We already know that this value cannot be - computed by just one ARM instruction. */ +/* As above, but the register must be of type TYPE, and the return + value is the register number or NULL. */ -static unsigned int -validate_immediate_twopart (unsigned int val, - unsigned int * highpart) +static int +arm_reg_parse (char **ccp, enum arm_reg_type type) { - unsigned int a; - unsigned int i; + char *start = *ccp; + struct reg_entry *reg = arm_reg_parse_multi (ccp); - for (i = 0; i < 32; i += 2) - if (((a = rotate_left (val, i)) & 0xff) != 0) - { - if (a & 0xff00) - { - if (a & ~ 0xffff) - continue; - * highpart = (a >> 8) | ((i + 24) << 7); - } - else if (a & 0xff0000) - { - if (a & 0xff000000) - continue; - * highpart = (a >> 16) | ((i + 16) << 7); - } - else - { - assert (a & 0xff000000); - * highpart = (a >> 24) | ((i + 8) << 7); - } + if (reg && reg->type == type) + return reg->number; - return (a & 0xff) | (i << 7); + /* Alternative syntaxes are accepted for a few register classes. */ + switch (type) + { + case REG_TYPE_MVF: + case REG_TYPE_MVD: + case REG_TYPE_MVFX: + case REG_TYPE_MVDX: + /* Generic coprocessor register names are allowed for these. */ + if (reg->type == REG_TYPE_CN) + return reg->number; + break; + + case REG_TYPE_CP: + /* For backward compatibility, a bare number is valid here. */ + { + unsigned long processor = strtoul (start, ccp, 10); + if (*ccp != start && processor <= 15) + return processor; } + case REG_TYPE_MMXWC: + /* WC includes WCG. ??? I'm not sure this is true for all + instructions that take WC registers. */ + if (reg->type == REG_TYPE_MMXWCG) + return reg->number; + break; + + default: + break; + } + + *ccp = start; return FAIL; } -static int -validate_offset_imm (unsigned int val, int hwse) +/* Parse an ARM register list. Returns the bitmask, or FAIL. */ +static long +parse_reg_list (char ** strp) { - if ((hwse && val > 255) || val > 4095) - return FAIL; - return val; -} + char * str = * strp; + long range = 0; + int another_range; - -#ifdef OBJ_ELF -/* This code is to handle mapping symbols as defined in the ARM ELF spec. - (See "Mapping symbols", section 4.5.5, ARM AAELF version 1.0). - Note that previously, $a and $t has type STT_FUNC (BSF_OBJECT flag), - and $d has type STT_OBJECT (BSF_OBJECT flag). Now all three are untyped. */ + /* We come back here if we get ranges concatenated by '+' or '|'. */ + do + { + another_range = 0; -static enum mstate mapstate = MAP_UNDEFINED; + if (*str == '{') + { + int in_range = 0; + int cur_reg = -1; -static void -mapping_state (enum mstate state) -{ - symbolS * symbolP; - const char * symname; - int type; + str++; + do + { + int reg; - if (mapstate == state) - /* The mapping symbol has already been emitted. - There is nothing else to do. */ - return; + if ((reg = arm_reg_parse (&str, REG_TYPE_RN)) == FAIL) + { + inst.error = _(reg_expected_msgs[REG_TYPE_RN]); + return FAIL; + } - mapstate = state; + if (in_range) + { + int i; - switch (state) - { - case MAP_DATA: - symname = "$d"; - type = BSF_NO_FLAGS; - break; - case MAP_ARM: - symname = "$a"; - type = BSF_NO_FLAGS; - break; - case MAP_THUMB: - symname = "$t"; - type = BSF_NO_FLAGS; - break; - case MAP_UNDEFINED: - return; - default: - abort (); - } + if (reg <= cur_reg) + { + inst.error = _("bad range in register list"); + return FAIL; + } - seg_info (now_seg)->tc_segment_info_data.mapstate = state; + for (i = cur_reg + 1; i < reg; i++) + { + if (range & (1 << i)) + as_tsktsk + (_("Warning: duplicated register (r%d) in register list"), + i); + else + range |= 1 << i; + } + in_range = 0; + } - symbolP = symbol_new (symname, now_seg, (valueT) frag_now_fix (), frag_now); - symbol_table_insert (symbolP); - symbol_get_bfdsym (symbolP)->flags |= type | BSF_LOCAL; + if (range & (1 << reg)) + as_tsktsk (_("Warning: duplicated register (r%d) in register list"), + reg); + else if (reg <= cur_reg) + as_tsktsk (_("Warning: register range not in ascending order")); - switch (state) - { - case MAP_ARM: - THUMB_SET_FUNC (symbolP, 0); - ARM_SET_THUMB (symbolP, 0); - ARM_SET_INTERWORK (symbolP, support_interwork); - break; + range |= 1 << reg; + cur_reg = reg; + } + while (skip_past_comma (&str) != FAIL + || (in_range = 1, *str++ == '-')); + str--; - case MAP_THUMB: - THUMB_SET_FUNC (symbolP, 1); - ARM_SET_THUMB (symbolP, 1); - ARM_SET_INTERWORK (symbolP, support_interwork); - break; + if (*str++ != '}') + { + inst.error = _("missing `}'"); + return FAIL; + } + } + else + { + expressionS expr; - case MAP_DATA: - default: - return; - } -} + if (my_get_expression (&expr, &str, GE_NO_PREFIX)) + return FAIL; -/* When we change sections we need to issue a new mapping symbol. */ + if (expr.X_op == O_constant) + { + if (expr.X_add_number + != (expr.X_add_number & 0x0000ffff)) + { + inst.error = _("invalid register mask"); + return FAIL; + } -void -arm_elf_change_section (void) -{ - flagword flags; - segment_info_type *seginfo; + if ((range & expr.X_add_number) != 0) + { + int regno = range & expr.X_add_number; - /* Link an unlinked unwind index table section to the .text section. */ - if (elf_section_type (now_seg) == SHT_ARM_EXIDX - && elf_linked_to_section (now_seg) == NULL) - elf_linked_to_section (now_seg) = text_section; + regno &= -regno; + regno = (1 << regno) - 1; + as_tsktsk + (_("Warning: duplicated register (r%d) in register list"), + regno); + } - if (!SEG_NORMAL (now_seg)) - return; + range |= expr.X_add_number; + } + else + { + if (inst.reloc.type != 0) + { + inst.error = _("expression too complex"); + return FAIL; + } - flags = bfd_get_section_flags (stdoutput, now_seg); + memcpy (&inst.reloc.exp, &expr, sizeof (expressionS)); + inst.reloc.type = BFD_RELOC_ARM_MULTI; + inst.reloc.pc_rel = 0; + } + } - /* We can ignore sections that only contain debug info. */ - if ((flags & SEC_ALLOC) == 0) - return; + if (*str == '|' || *str == '+') + { + str++; + another_range = 1; + } + } + while (another_range); - seginfo = seg_info (now_seg); - mapstate = seginfo->tc_segment_info_data.mapstate; - marked_pr_dependency = seginfo->tc_segment_info_data.marked_pr_dependency; + *strp = str; + return range; } -int -arm_elf_section_type (const char * str, size_t len) -{ - if (len == 5 && strncmp (str, "exidx", 5) == 0) - return SHT_ARM_EXIDX; - - return -1; -} -#else -#define mapping_state(a) -#endif /* OBJ_ELF */ - -/* arm_reg_parse () := if it looks like a register, return its token and - advance the pointer. */ +/* Parse a VFP register list. If the string is invalid return FAIL. + Otherwise return the number of registers, and set PBASE to the first + register. Double precision registers are matched if DP is nonzero. */ static int -arm_reg_parse (char ** ccp, struct hash_control * htab) +parse_vfp_reg_list (char **str, int *pbase, int dp) { - char * start = * ccp; - char c; - char * p; - struct reg_entry * reg; + int base_reg; + int new_base; + int regtype; + int max_regs; + int count = 0; + int warned = 0; + unsigned long mask = 0; + int i; -#ifdef REGISTER_PREFIX - if (*start != REGISTER_PREFIX) - return FAIL; - p = start + 1; -#else - p = start; -#ifdef OPTIONAL_REGISTER_PREFIX - if (*p == OPTIONAL_REGISTER_PREFIX) - p++, start++; -#endif -#endif - if (!ISALPHA (*p) || !is_name_beginner (*p)) + if (**str != '{') return FAIL; - c = *p++; - while (ISALPHA (c) || ISDIGIT (c) || c == '_') - c = *p++; - - *--p = 0; - reg = (struct reg_entry *) hash_find (htab, start); - *p = c; + (*str)++; - if (reg) + if (dp) + { + regtype = REG_TYPE_VFD; + max_regs = 16; + } + else { - *ccp = p; - return reg->number; + regtype = REG_TYPE_VFS; + max_regs = 32; } - return FAIL; -} - -/* Search for the following register name in each of the possible reg name - tables. Return the classification if found, or REG_TYPE_MAX if not - present. */ - -static enum arm_reg_type -arm_reg_parse_any (char *cp) -{ - int i; - - for (i = (int) REG_TYPE_FIRST; i < (int) REG_TYPE_MAX; i++) - if (arm_reg_parse (&cp, all_reg_maps[i].htab) != FAIL) - return (enum arm_reg_type) i; - - return REG_TYPE_MAX; -} + base_reg = max_regs; -static void -opcode_select (int width) -{ - switch (width) + do { - case 16: - if (! thumb_mode) + new_base = arm_reg_parse (str, regtype); + if (new_base == FAIL) { - if (! (cpu_variant & ARM_EXT_V4T)) - as_bad (_("selected processor does not support THUMB opcodes")); - - thumb_mode = 1; - /* No need to force the alignment, since we will have been - coming from ARM mode, which is word-aligned. */ - record_alignment (now_seg, 1); + inst.error = gettext (reg_expected_msgs[regtype]); + return FAIL; } - mapping_state (MAP_THUMB); - break; - case 32: - if (thumb_mode) + if (new_base < base_reg) + base_reg = new_base; + + if (mask & (1 << new_base)) { - if ((cpu_variant & ARM_ALL) == ARM_EXT_V4T) - as_bad (_("selected processor does not support ARM opcodes")); + inst.error = _("invalid register list"); + return FAIL; + } - thumb_mode = 0; + if ((mask >> new_base) != 0 && ! warned) + { + as_tsktsk (_("register list not in ascending order")); + warned = 1; + } - if (!need_pass_2) - frag_align (2, 0, 0); + mask |= 1 << new_base; + count++; - record_alignment (now_seg, 1); + if (**str == '-') /* We have the start of a range expression */ + { + int high_range; + + (*str)++; + + if ((high_range = arm_reg_parse (str, regtype)) == FAIL) + { + inst.error = gettext (reg_expected_msgs[regtype]); + return FAIL; + } + + if (high_range <= new_base) + { + inst.error = _("register range not in ascending order"); + return FAIL; + } + + for (new_base++; new_base <= high_range; new_base++) + { + if (mask & (1 << new_base)) + { + inst.error = _("invalid register list"); + return FAIL; + } + + mask |= 1 << new_base; + count++; + } } - mapping_state (MAP_ARM); - break; + } + while (skip_past_comma (str) != FAIL); - default: - as_bad (_("invalid instruction size selected (%d)"), width); + (*str)++; + + /* Sanity check -- should have raised a parse error above. */ + if (count == 0 || count > max_regs) + abort (); + + *pbase = base_reg; + + /* Final test -- the registers must be consecutive. */ + mask >>= base_reg; + for (i = 0; i < count; i++) + { + if ((mask & (1u << i)) == 0) + { + inst.error = _("non-contiguous register range"); + return FAIL; + } + } + + return count; +} + +/* Parse an explicit relocation suffix on an expression. This is + either nothing, or a word in parentheses. Note that if !OBJ_ELF, + arm_reloc_hsh contains no entries, so this function can only + succeed if there is no () after the word. Returns -1 on error, + BFD_RELOC_UNUSED if there wasn't any suffix. */ +static int +parse_reloc (char **str) +{ + struct reloc_entry *r; + char *p, *q; + + if (**str != '(') + return BFD_RELOC_UNUSED; + + p = *str + 1; + q = p; + + while (*q && *q != ')' && *q != ',') + q++; + if (*q != ')') + return -1; + + if ((r = hash_find_n (arm_reloc_hsh, p, q - p)) == NULL) + return -1; + + *str = q + 1; + return r->reloc; +} + +/* Directives: register aliases. */ + +static void +insert_reg_alias (char *str, int number, int type) +{ + struct reg_entry *new; + const char *name; + + if ((new = hash_find (arm_reg_hsh, str)) != 0) + { + if (new->builtin) + as_warn (_("ignoring attempt to redefine built-in register '%s'"), str); + + /* Only warn about a redefinition if it's not defined as the + same register. */ + else if (new->number != number || new->type != type) + as_warn (_("ignoring redefinition of register alias '%s'"), str); + + return; + } + + name = xstrdup (str); + new = xmalloc (sizeof (struct reg_entry)); + + new->name = name; + new->number = number; + new->type = type; + new->builtin = FALSE; + + if (hash_insert (arm_reg_hsh, name, (PTR) new)) + abort (); +} + +/* Look for the .req directive. This is of the form: + + new_register_name .req existing_register_name + + If we find one, or if it looks sufficiently like one that we want to + handle any error here, return non-zero. Otherwise return zero. */ + +static int +create_register_alias (char * newname, char *p) +{ + struct reg_entry *old; + char *oldname, *nbuf; + size_t nlen; + + /* The input scrubber ensures that whitespace after the mnemonic is + collapsed to single spaces. */ + oldname = p; + if (strncmp (oldname, " .req ", 6) != 0) + return 0; + + oldname += 6; + if (*oldname == '\0') + return 0; + + old = hash_find (arm_reg_hsh, oldname); + if (!old) + { + as_warn (_("unknown register '%s' -- .req ignored"), oldname); + return 1; } + + /* If TC_CASE_SENSITIVE is defined, then newname already points to + the desired alias name, and p points to its end. If not, then + the desired alias name is in the global original_case_string. */ +#ifdef TC_CASE_SENSITIVE + nlen = p - newname; +#else + newname = original_case_string; + nlen = strlen (newname); +#endif + + nbuf = alloca (nlen + 1); + memcpy (nbuf, newname, nlen); + nbuf[nlen] = '\0'; + + /* Create aliases under the new name as stated; an all-lowercase + version of the new name; and an all-uppercase version of the new + name. */ + insert_reg_alias (nbuf, old->number, old->type); + + for (p = nbuf; *p; p++) + *p = TOUPPER (*p); + + if (strncmp (nbuf, newname, nlen)) + insert_reg_alias (nbuf, old->number, old->type); + + for (p = nbuf; *p; p++) + *p = TOLOWER (*p); + + if (strncmp (nbuf, newname, nlen)) + insert_reg_alias (nbuf, old->number, old->type); + + return 1; } +/* Should never be called, as .req goes between the alias and the + register name, not at the beginning of the line. */ static void s_req (int a ATTRIBUTE_UNUSED) { @@ -1452,7 +1285,7 @@ s_req (int a ATTRIBUTE_UNUSED) by .req. For example: my_alias .req r11 - .unreq my_alias */ + .unreq my_alias */ static void s_unreq (int a ATTRIBUTE_UNUSED) @@ -1460,7 +1293,6 @@ s_unreq (int a ATTRIBUTE_UNUSED) char * name; char saved_char; - skip_whitespace (input_line_pointer); name = input_line_pointer; while (*input_line_pointer != 0 @@ -1471,154 +1303,207 @@ s_unreq (int a ATTRIBUTE_UNUSED) saved_char = *input_line_pointer; *input_line_pointer = 0; - if (*name) + if (!*name) + as_bad (_("invalid syntax for .unreq directive")); + else { - enum arm_reg_type req_type = arm_reg_parse_any (name); + struct reg_entry *reg = hash_find (arm_reg_hsh, name); - if (req_type != REG_TYPE_MAX) + if (!reg) + as_bad (_("unknown register alias '%s'"), name); + else if (reg->builtin) + as_warn (_("ignoring attempt to undefine built-in register '%s'"), + name); + else { - char *temp_name = name; - int req_no = arm_reg_parse (&temp_name, all_reg_maps[req_type].htab); - - if (req_no != FAIL) - { - struct reg_entry *req_entry; - - /* Check to see if this alias is a builtin one. */ - req_entry = hash_delete (all_reg_maps[req_type].htab, name); - - if (!req_entry) - as_bad (_("unreq: missing hash entry for \"%s\""), name); - else if (req_entry->builtin) - /* FIXME: We are deleting a built in register alias which - points to a const data structure, so we only need to - free up the memory used by the key in the hash table. - Unfortunately we have not recorded this value, so this - is a memory leak. */ - /* FIXME: Should we issue a warning message ? */ - ; - else - { - /* Deleting a user defined alias. We need to free the - key and the value, but fortunately the key is the same - as the value->name field. */ - free ((char *) req_entry->name); - free (req_entry); - } - } - else - as_bad (_(".unreq: unrecognized symbol \"%s\""), name); + hash_delete (arm_reg_hsh, name); + free ((char *) reg->name); + free (reg); } - else - as_bad (_(".unreq: unrecognized symbol \"%s\""), name); } - else - as_bad (_("invalid syntax for .unreq directive")); *input_line_pointer = saved_char; demand_empty_rest_of_line (); } -static void -s_bss (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. */ - subseg_set (bss_section, 0); - demand_empty_rest_of_line (); - mapping_state (MAP_DATA); -} - -static void -s_even (int ignore ATTRIBUTE_UNUSED) -{ - /* Never make frag if expect extra pass. */ - if (!need_pass_2) - frag_align (1, 0, 0); +/* Directives: Instruction set selection. */ - record_alignment (now_seg, 1); +#ifdef OBJ_ELF +/* This code is to handle mapping symbols as defined in the ARM ELF spec. + (See "Mapping symbols", section 4.5.5, ARM AAELF version 1.0). + Note that previously, $a and $t has type STT_FUNC (BSF_OBJECT flag), + and $d has type STT_OBJECT (BSF_OBJECT flag). Now all three are untyped. */ - demand_empty_rest_of_line (); -} +static enum mstate mapstate = MAP_UNDEFINED; static void -s_ltorg (int ignored ATTRIBUTE_UNUSED) +mapping_state (enum mstate state) { - unsigned int entry; - literal_pool * pool; - char sym_name[20]; + symbolS * symbolP; + const char * symname; + int type; - pool = find_literal_pool (); - if (pool == NULL - || pool->symbol == NULL - || pool->next_free_entry == 0) + if (mapstate == state) + /* The mapping symbol has already been emitted. + There is nothing else to do. */ return; - mapping_state (MAP_DATA); + mapstate = state; - /* Align pool as you have word accesses. - Only make a frag if we have to. */ - if (!need_pass_2) - frag_align (2, 0, 0); + switch (state) + { + case MAP_DATA: + symname = "$d"; + type = BSF_NO_FLAGS; + break; + case MAP_ARM: + symname = "$a"; + type = BSF_NO_FLAGS; + break; + case MAP_THUMB: + symname = "$t"; + type = BSF_NO_FLAGS; + break; + case MAP_UNDEFINED: + return; + default: + abort (); + } - record_alignment (now_seg, 2); + seg_info (now_seg)->tc_segment_info_data.mapstate = state; - sprintf (sym_name, "$$lit_\002%x", pool->id); + symbolP = symbol_new (symname, now_seg, (valueT) frag_now_fix (), frag_now); + symbol_table_insert (symbolP); + symbol_get_bfdsym (symbolP)->flags |= type | BSF_LOCAL; - symbol_locate (pool->symbol, sym_name, now_seg, - (valueT) frag_now_fix (), frag_now); - symbol_table_insert (pool->symbol); + switch (state) + { + case MAP_ARM: + THUMB_SET_FUNC (symbolP, 0); + ARM_SET_THUMB (symbolP, 0); + ARM_SET_INTERWORK (symbolP, support_interwork); + break; - ARM_SET_THUMB (pool->symbol, thumb_mode); + case MAP_THUMB: + THUMB_SET_FUNC (symbolP, 1); + ARM_SET_THUMB (symbolP, 1); + ARM_SET_INTERWORK (symbolP, support_interwork); + break; -#if defined OBJ_COFF || defined OBJ_ELF - ARM_SET_INTERWORK (pool->symbol, support_interwork); + case MAP_DATA: + default: + return; + } +} +#else +#define mapping_state(x) /* nothing */ #endif - for (entry = 0; entry < pool->next_free_entry; entry ++) - /* First output the expression in the instruction to the pool. */ - emit_expr (&(pool->literals[entry]), 4); /* .word */ +/* Find the real, Thumb encoded start of a Thumb function. */ - /* Mark the pool as empty. */ - pool->next_free_entry = 0; - pool->symbol = NULL; -} +static symbolS * +find_real_start (symbolS * symbolP) +{ + char * real_start; + const char * name = S_GET_NAME (symbolP); + symbolS * new_target; -/* Same as s_align_ptwo but align 0 => align 2. */ + /* This definition must agree with the one in gcc/config/arm/thumb.c. */ +#define STUB_NAME ".real_start_of" -static void -s_align (int unused ATTRIBUTE_UNUSED) -{ - int temp; - long temp_fill; - long max_alignment = 15; + if (name == NULL) + abort (); - temp = get_absolute_expression (); - if (temp > max_alignment) - as_bad (_("alignment too large: %d assumed"), temp = max_alignment); - else if (temp < 0) + /* The compiler may generate BL instructions to local labels because + it needs to perform a branch to a far away location. These labels + do not have a corresponding ".real_start_of" label. We check + both for S_IS_LOCAL and for a leading dot, to give a way to bypass + the ".real_start_of" convention for nonlocal branches. */ + if (S_IS_LOCAL (symbolP) || name[0] == '.') + return symbolP; + + real_start = ACONCAT ((STUB_NAME, name, NULL)); + new_target = symbol_find (real_start); + + if (new_target == NULL) { - as_bad (_("alignment negative. 0 assumed.")); - temp = 0; + as_warn ("Failed to find real start of function: %s\n", name); + new_target = symbolP; } - if (*input_line_pointer == ',') + return new_target; +} + +static void +opcode_select (int width) +{ + switch (width) { - input_line_pointer++; - temp_fill = get_absolute_expression (); + case 16: + if (! thumb_mode) + { + if (! (cpu_variant & ARM_EXT_V4T)) + as_bad (_("selected processor does not support THUMB opcodes")); + + thumb_mode = 1; + /* No need to force the alignment, since we will have been + coming from ARM mode, which is word-aligned. */ + record_alignment (now_seg, 1); + } + mapping_state (MAP_THUMB); + break; + + case 32: + if (thumb_mode) + { + if ((cpu_variant & ARM_ALL) == ARM_EXT_V4T) + as_bad (_("selected processor does not support ARM opcodes")); + + thumb_mode = 0; + + if (!need_pass_2) + frag_align (2, 0, 0); + + record_alignment (now_seg, 1); + } + mapping_state (MAP_ARM); + break; + + default: + as_bad (_("invalid instruction size selected (%d)"), width); } - else - temp_fill = 0; +} - if (!temp) - temp = 2; +static void +s_arm (int ignore ATTRIBUTE_UNUSED) +{ + opcode_select (32); + demand_empty_rest_of_line (); +} - /* Only make a frag if we HAVE to. */ - if (temp && !need_pass_2) - frag_align (temp, (int) temp_fill, 0); +static void +s_thumb (int ignore ATTRIBUTE_UNUSED) +{ + opcode_select (16); demand_empty_rest_of_line (); +} - record_alignment (now_seg, temp); +static void +s_code (int unused ATTRIBUTE_UNUSED) +{ + int temp; + + temp = get_absolute_expression (); + switch (temp) + { + case 16: + case 32: + opcode_select (temp); + break; + + default: + as_bad (_("invalid operand to .code directive (%d) (expecting 16 or 32)"), temp); + } } static void @@ -1628,11 +1513,10 @@ s_force_thumb (int ignore ATTRIBUTE_UNUS the target processor does not support thumb instructions. This is used by gcc/config/arm/lib1funcs.asm for example to compile interworking support functions even if the - target processor should not support interworking. */ + target processor should not support interworking. */ if (! thumb_mode) { thumb_mode = 2; - record_alignment (now_seg, 1); } @@ -1642,14 +1526,11 @@ s_force_thumb (int ignore ATTRIBUTE_UNUS static void s_thumb_func (int ignore ATTRIBUTE_UNUSED) { - if (! thumb_mode) - opcode_select (16); + s_thumb (0); /* The following label is the name/address of the start of a Thumb function. - We need to know this for the interworking support. */ + We need to know this for the interworking support. */ label_is_thumb_function_name = TRUE; - - demand_empty_rest_of_line (); } /* Perform a .set directive, but also mark the alias as @@ -1662,20 +1543,18 @@ s_thumb_set (int equiv) We cannot just call that code as we need to get at the symbol that is created. */ char * name; - char delim; + char delim; char * end_name; symbolS * symbolP; /* Especial apologies for the random logic: This just grew, and could be parsed much more simply! Dean - in haste. */ - name = input_line_pointer; - delim = get_symbol_end (); + name = input_line_pointer; + delim = get_symbol_end (); end_name = input_line_pointer; *end_name = delim; - SKIP_WHITESPACE (); - if (*input_line_pointer != ',') { *end_name = 0; @@ -1700,7 +1579,7 @@ s_thumb_set (int equiv) #ifndef NO_LISTING /* When doing symbol listings, play games with dummy fragments living outside the normal fragment chain to record the file and line info - for this symbol. */ + for this symbol. */ if (listing & LISTING_SYMBOLS) { extern struct list_info_struct * listing_tail; @@ -1735,7 +1614,7 @@ s_thumb_set (int equiv) demand_empty_rest_of_line (); - /* XXX Now we come to the Thumb specific bit of code. */ + /* XXX Now we come to the Thumb specific bit of code. */ THUMB_SET_FUNC (symbolP, 1); ARM_SET_THUMB (symbolP, 1); @@ -1744,3825 +1623,3923 @@ s_thumb_set (int equiv) #endif } -static void -s_arm (int ignore ATTRIBUTE_UNUSED) -{ - opcode_select (32); - demand_empty_rest_of_line (); -} +/* Directives: Mode selection. */ +/* .syntax [unified|divided] - choose the new unified syntax + (same for Arm and Thumb encoding, modulo slight differences in what + can be represented) or the old divergent syntax for each mode. */ static void -s_thumb (int ignore ATTRIBUTE_UNUSED) +s_syntax (int unused ATTRIBUTE_UNUSED) { - opcode_select (16); + char *name, delim; + + name = input_line_pointer; + delim = get_symbol_end (); + + if (!strcasecmp (name, "unified")) + unified_syntax = TRUE; + else if (!strcasecmp (name, "divided")) + unified_syntax = FALSE; + else + { + as_bad (_("unrecognized syntax mode \"%s\""), name); + return; + } + *input_line_pointer = delim; demand_empty_rest_of_line (); } +/* Directives: sectioning and alignment. */ + +/* Same as s_align_ptwo but align 0 => align 2. */ + static void -s_code (int unused ATTRIBUTE_UNUSED) +s_align (int unused ATTRIBUTE_UNUSED) { int temp; + long temp_fill; + long max_alignment = 15; temp = get_absolute_expression (); - switch (temp) + if (temp > max_alignment) + as_bad (_("alignment too large: %d assumed"), temp = max_alignment); + else if (temp < 0) { - case 16: - case 32: - opcode_select (temp); - break; + as_bad (_("alignment negative. 0 assumed.")); + temp = 0; + } - default: - as_bad (_("invalid operand to .code directive (%d) (expecting 16 or 32)"), temp); + if (*input_line_pointer == ',') + { + input_line_pointer++; + temp_fill = get_absolute_expression (); } + else + temp_fill = 0; + + if (!temp) + temp = 2; + + /* Only make a frag if we HAVE to. */ + if (temp && !need_pass_2) + frag_align (temp, (int) temp_fill, 0); + demand_empty_rest_of_line (); + + record_alignment (now_seg, temp); } static void -end_of_line (char * str) +s_bss (int ignore ATTRIBUTE_UNUSED) { - skip_whitespace (str); - - if (*str != '\0' && !inst.error) - inst.error = _("garbage following instruction"); + /* We don't support putting frags in the BSS segment, we fake it by + marking in_bss, then looking at s_skip for clues. */ + subseg_set (bss_section, 0); + demand_empty_rest_of_line (); + mapping_state (MAP_DATA); } -static int -skip_past_comma (char ** str) +static void +s_even (int ignore ATTRIBUTE_UNUSED) { - char * p = * str, c; - int comma = 0; - - while ((c = *p) == ' ' || c == ',') - { - p++; - if (c == ',' && comma++) - return FAIL; - } + /* Never make frag if expect extra pass. */ + if (!need_pass_2) + frag_align (1, 0, 0); - if (c == '\0') - return FAIL; + record_alignment (now_seg, 1); - *str = p; - return comma ? SUCCESS : FAIL; + demand_empty_rest_of_line (); } -/* Return TRUE if anything in the expression is a bignum. */ +/* Directives: Literal pools. */ -static int -walk_no_bignums (symbolS * sp) +static literal_pool * +find_literal_pool (void) { - if (symbol_get_value_expression (sp)->X_op == O_big) - return 1; + literal_pool * pool; - if (symbol_get_value_expression (sp)->X_add_symbol) + for (pool = list_of_pools; pool != NULL; pool = pool->next) { - return (walk_no_bignums (symbol_get_value_expression (sp)->X_add_symbol) - || (symbol_get_value_expression (sp)->X_op_symbol - && walk_no_bignums (symbol_get_value_expression (sp)->X_op_symbol))); + if (pool->section == now_seg + && pool->sub_section == now_subseg) + break; } - return 0; + return pool; } -static int in_my_get_expression = 0; - -static int -my_get_expression (expressionS * ep, char ** str) +static literal_pool * +find_or_make_literal_pool (void) { - char * save_in; - segT seg; + /* Next literal pool ID number. */ + static unsigned int latest_pool_num = 1; + literal_pool * pool; - save_in = input_line_pointer; - input_line_pointer = *str; - in_my_get_expression = 1; - seg = expression (ep); - in_my_get_expression = 0; + pool = find_literal_pool (); - if (ep->X_op == O_illegal) + if (pool == NULL) { - /* We found a bad expression in md_operand(). */ - *str = input_line_pointer; - input_line_pointer = save_in; - return 1; - } + /* Create a new pool. */ + pool = xmalloc (sizeof (* pool)); + if (! pool) + return NULL; -#ifdef OBJ_AOUT - if (seg != absolute_section - && seg != text_section - && seg != data_section - && seg != bss_section - && seg != undefined_section) - { - inst.error = _("bad_segment"); - *str = input_line_pointer; - input_line_pointer = save_in; - return 1; + pool->next_free_entry = 0; + pool->section = now_seg; + pool->sub_section = now_subseg; + pool->next = list_of_pools; + pool->symbol = NULL; + + /* Add it to the list. */ + list_of_pools = pool; } -#endif - /* Get rid of any bignums now, so that we don't generate an error for which - we can't establish a line number later on. Big numbers are never valid - in instructions, which is where this routine is always called. */ - if (ep->X_op == O_big - || (ep->X_add_symbol - && (walk_no_bignums (ep->X_add_symbol) - || (ep->X_op_symbol - && walk_no_bignums (ep->X_op_symbol))))) + /* New pools, and emptied pools, will have a NULL symbol. */ + if (pool->symbol == NULL) { - inst.error = _("invalid constant"); - *str = input_line_pointer; - input_line_pointer = save_in; - return 1; + pool->symbol = symbol_create (FAKE_LABEL_NAME, undefined_section, + (valueT) 0, &zero_address_frag); + pool->id = latest_pool_num ++; } - *str = input_line_pointer; - input_line_pointer = save_in; - return 0; + /* Done. */ + return pool; } -/* A standard register must be given at this point. - SHIFT is the place to put it in inst.instruction. - Restores input start point on error. - Returns the reg#, or FAIL. */ +/* Add the literal in the global 'inst' + structure to the relevent literal pool. */ static int -reg_required_here (char ** str, int shift) +add_to_lit_pool (void) { - static char buff [128]; /* XXX */ - int reg; - char * start = * str; - - if ((reg = arm_reg_parse (str, all_reg_maps[REG_TYPE_RN].htab)) != FAIL) - { - if (shift >= 0) - inst.instruction |= reg << shift; - return reg; - } + literal_pool * pool; + unsigned int entry; - /* Restore the start point, we may have got a reg of the wrong class. */ - *str = start; + pool = find_or_make_literal_pool (); - /* In the few cases where we might be able to accept something else - this error can be overridden. */ - sprintf (buff, _("register expected, not '%.100s'"), start); - inst.error = buff; + /* Check if this literal value is already in the pool. */ + for (entry = 0; entry < pool->next_free_entry; entry ++) + { + if ((pool->literals[entry].X_op == inst.reloc.exp.X_op) + && (inst.reloc.exp.X_op == O_constant) + && (pool->literals[entry].X_add_number + == inst.reloc.exp.X_add_number) + && (pool->literals[entry].X_unsigned + == inst.reloc.exp.X_unsigned)) + break; - return FAIL; -} - -/* A Intel Wireless MMX technology 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. */ - -static int -wreg_required_here (char ** str, - int shift, - enum wreg_type reg_type) -{ - static char buff [128]; - int reg; - char * start = *str; - - if ((reg = arm_reg_parse (str, all_reg_maps[REG_TYPE_IWMMXT].htab)) != FAIL) - { - if (wr_register (reg) - && (reg_type == IWMMXT_REG_WR || reg_type == IWMMXT_REG_WR_OR_WC)) - { - if (shift >= 0) - inst.instruction |= (reg ^ WR_PREFIX) << shift; - return reg; - } - else if (wc_register (reg) - && (reg_type == IWMMXT_REG_WC || reg_type == IWMMXT_REG_WR_OR_WC)) - { - if (shift >= 0) - inst.instruction |= (reg ^ WC_PREFIX) << shift; - return reg; - } - else if ((wcg_register (reg) && reg_type == IWMMXT_REG_WCG)) - { - if (shift >= 0) - inst.instruction |= ((reg ^ WC_PREFIX) - 8) << shift; - return reg; - } - } - - /* Restore the start point, we may have got a reg of the wrong class. */ - *str = start; - - /* In the few cases where we might be able to accept - something else this error can be overridden. */ - sprintf (buff, _("Intel Wireless MMX technology register expected, not '%.100s'"), start); - inst.error = buff; - - return FAIL; -} - -static const struct asm_psr * -arm_psr_parse (char ** ccp) -{ - char * start = * ccp; - char c; - char * p; - const struct asm_psr * psr; - - p = start; - - /* Skip to the end of the next word in the input stream. */ - do - { - c = *p++; + if ((pool->literals[entry].X_op == inst.reloc.exp.X_op) + && (inst.reloc.exp.X_op == O_symbol) + && (pool->literals[entry].X_add_number + == inst.reloc.exp.X_add_number) + && (pool->literals[entry].X_add_symbol + == inst.reloc.exp.X_add_symbol) + && (pool->literals[entry].X_op_symbol + == inst.reloc.exp.X_op_symbol)) + break; } - while (ISALPHA (c) || c == '_'); - - /* Terminate the word. */ - *--p = 0; - - /* CPSR's and SPSR's can now be lowercase. This is just a convenience - feature for ease of use and backwards compatibility. */ - if (!strncmp (start, "cpsr", 4)) - strncpy (start, "CPSR", 4); - else if (!strncmp (start, "spsr", 4)) - strncpy (start, "SPSR", 4); - /* Now locate the word in the psr hash table. */ - psr = (const struct asm_psr *) hash_find (arm_psr_hsh, start); + /* Do we need to create a new entry? */ + if (entry == pool->next_free_entry) + { + if (entry >= MAX_LITERAL_POOL_SIZE) + { + inst.error = _("literal pool overflow"); + return FAIL; + } - /* Restore the input stream. */ - *p = c; + pool->literals[entry] = inst.reloc.exp; + pool->next_free_entry += 1; + } - /* If we found a valid match, advance the - stream pointer past the end of the word. */ - *ccp = p; + inst.reloc.exp.X_op = O_symbol; + inst.reloc.exp.X_add_number = ((int) entry) * 4; + inst.reloc.exp.X_add_symbol = pool->symbol; - return psr; + return SUCCESS; } -/* Parse the input looking for a PSR flag. */ +/* Can't use symbol_new here, so have to create a symbol and then at + a later date assign it a value. Thats what these functions do. */ -static int -psr_required_here (char ** str) +static void +symbol_locate (symbolS * symbolP, + const char * name, /* It is copied, the caller can modify. */ + segT segment, /* Segment identifier (SEG_). */ + valueT valu, /* Symbol value. */ + fragS * frag) /* Associated fragment. */ { - char * start = * str; - const struct asm_psr * psr; + unsigned int name_length; + char * preserved_copy_of_name; - psr = arm_psr_parse (str); + name_length = strlen (name) + 1; /* +1 for \0. */ + obstack_grow (¬es, name, name_length); + preserved_copy_of_name = obstack_finish (¬es); - if (psr) - { - /* If this is the SPSR that is being modified, set the R bit. */ - if (! psr->cpsr) - inst.instruction |= SPSR_BIT; +#ifdef tc_canonicalize_symbol_name + preserved_copy_of_name = + tc_canonicalize_symbol_name (preserved_copy_of_name); +#endif - /* Set the psr flags in the MSR instruction. */ - inst.instruction |= psr->field << PSR_SHIFT; + S_SET_NAME (symbolP, preserved_copy_of_name); - return SUCCESS; - } + S_SET_SEGMENT (symbolP, segment); + S_SET_VALUE (symbolP, valu); + symbol_clear_list_pointers (symbolP); - /* In the few cases where we might be able to accept - something else this error can be overridden. */ - inst.error = _("flag for {c}psr instruction expected"); + symbol_set_frag (symbolP, frag); - /* Restore the start point. */ - *str = start; - return FAIL; -} + /* Link to end of symbol chain. */ + { + extern int symbol_table_frozen; -static int -co_proc_number (char ** str) -{ - int processor, pchar; - char *start; + if (symbol_table_frozen) + abort (); + } - skip_whitespace (*str); - start = *str; + symbol_append (symbolP, symbol_lastP, & symbol_rootP, & symbol_lastP); - /* The data sheet seems to imply that just a number on its own is valid - here, but the RISC iX assembler seems to accept a prefix 'p'. We will - accept either. */ - if ((processor = arm_reg_parse (str, all_reg_maps[REG_TYPE_CP].htab)) - == FAIL) - { - *str = start; + obj_symbol_new_hook (symbolP); - pchar = *(*str)++; - if (pchar >= '0' && pchar <= '9') - { - processor = pchar - '0'; - if (**str >= '0' && **str <= '9') - { - processor = processor * 10 + *(*str)++ - '0'; - if (processor > 15) - { - inst.error = _("illegal co-processor number"); - return FAIL; - } - } - } - else - { - inst.error = all_reg_maps[REG_TYPE_CP].expected; - return FAIL; - } - } +#ifdef tc_symbol_new_hook + tc_symbol_new_hook (symbolP); +#endif - inst.instruction |= processor << 8; - return SUCCESS; +#ifdef DEBUG_SYMS + verify_symbol_chain (symbol_rootP, symbol_lastP); +#endif /* DEBUG_SYMS */ } -static int -cp_opc_expr (char ** str, int where, int length) -{ - expressionS expr; - skip_whitespace (* str); +static void +s_ltorg (int ignored ATTRIBUTE_UNUSED) +{ + unsigned int entry; + literal_pool * pool; + char sym_name[20]; - memset (&expr, '\0', sizeof (expr)); + pool = find_literal_pool (); + if (pool == NULL + || pool->symbol == NULL + || pool->next_free_entry == 0) + return; - if (my_get_expression (&expr, str)) - return FAIL; - if (expr.X_op != O_constant) - { - inst.error = _("bad or missing expression"); - return FAIL; - } + mapping_state (MAP_DATA); - if ((expr.X_add_number & ((1 << length) - 1)) != expr.X_add_number) - { - inst.error = _("immediate co-processor expression too large"); - return FAIL; - } + /* Align pool as you have word accesses. + Only make a frag if we have to. */ + if (!need_pass_2) + frag_align (2, 0, 0); - inst.instruction |= expr.X_add_number << where; - return SUCCESS; -} + record_alignment (now_seg, 2); -static int -cp_reg_required_here (char ** str, int where) -{ - int reg; - char * start = *str; + sprintf (sym_name, "$$lit_\002%x", pool->id); - if ((reg = arm_reg_parse (str, all_reg_maps[REG_TYPE_CN].htab)) != FAIL) - { - inst.instruction |= reg << where; - return reg; - } + symbol_locate (pool->symbol, sym_name, now_seg, + (valueT) frag_now_fix (), frag_now); + symbol_table_insert (pool->symbol); - /* In the few cases where we might be able to accept something else - this error can be overridden. */ - inst.error = all_reg_maps[REG_TYPE_CN].expected; + ARM_SET_THUMB (pool->symbol, thumb_mode); - /* Restore the start point. */ - *str = start; - return FAIL; -} +#if defined OBJ_COFF || defined OBJ_ELF + ARM_SET_INTERWORK (pool->symbol, support_interwork); +#endif -static int -fp_reg_required_here (char ** str, int where) -{ - int reg; - char * start = * str; + for (entry = 0; entry < pool->next_free_entry; entry ++) + /* First output the expression in the instruction to the pool. */ + emit_expr (&(pool->literals[entry]), 4); /* .word */ - if ((reg = arm_reg_parse (str, all_reg_maps[REG_TYPE_FN].htab)) != FAIL) - { - inst.instruction |= reg << where; - return reg; - } + /* Mark the pool as empty. */ + pool->next_free_entry = 0; + pool->symbol = NULL; +} - /* In the few cases where we might be able to accept something else - this error can be overridden. */ - inst.error = all_reg_maps[REG_TYPE_FN].expected; +#ifdef OBJ_ELF +/* Forward declarations for functions below, in the MD interface + section. */ +static void fix_new_arm (fragS *, int, short, expressionS *, int, int); +static valueT create_unwind_entry (int); +static void start_unwind_section (const segT, int); +static void add_unwind_opcode (valueT, int); +static void flush_pending_unwind (void); - /* Restore the start point. */ - *str = start; - return FAIL; -} +/* Directives: Data. */ -static int -cp_address_offset (char ** str) +static void +s_arm_elf_cons (int nbytes) { - int offset; + expressionS exp; - skip_whitespace (* str); +#ifdef md_flush_pending_output + md_flush_pending_output (); +#endif - if (! is_immediate_prefix (**str)) + if (is_it_end_of_statement ()) { - inst.error = _("immediate expression expected"); - return FAIL; + demand_empty_rest_of_line (); + return; } - (*str)++; - - if (my_get_expression (& inst.reloc.exp, str)) - return FAIL; +#ifdef md_cons_align + md_cons_align (nbytes); +#endif - if (inst.reloc.exp.X_op == O_constant) + mapping_state (MAP_DATA); + do { - offset = inst.reloc.exp.X_add_number; - - if (offset & 3) - { - inst.error = _("co-processor address must be word aligned"); - return FAIL; - } + int reloc; + char *base = input_line_pointer; - if (offset > 1023 || offset < -1023) - { - inst.error = _("offset too large"); - return FAIL; - } + expression (& exp); - if (offset >= 0) - inst.instruction |= INDEX_UP; + if (exp.X_op != O_symbol) + emit_expr (&exp, (unsigned int) nbytes); else - offset = -offset; + { + char *before_reloc = input_line_pointer; + reloc = parse_reloc (&input_line_pointer); + if (reloc == -1) + { + as_bad (_("unrecognized relocation suffix")); + ignore_rest_of_line (); + return; + } + else if (reloc == BFD_RELOC_UNUSED) + emit_expr (&exp, (unsigned int) nbytes); + else + { + reloc_howto_type *howto = bfd_reloc_type_lookup (stdoutput, reloc); + int size = bfd_get_reloc_size (howto); - inst.instruction |= offset >> 2; + if (size > nbytes) + as_bad ("%s relocations do not fit in %d bytes", + howto->name, nbytes); + else + { + /* We've parsed an expression stopping at O_symbol. + But there may be more expression left now that we + have parsed the relocation marker. Parse it again. + XXX Surely there is a cleaner way to do this. */ + char *p = input_line_pointer; + int offset; + char *save_buf = alloca (input_line_pointer - base); + memcpy (save_buf, base, input_line_pointer - base); + memmove (base + (input_line_pointer - before_reloc), + base, before_reloc - base); + + input_line_pointer = base + (input_line_pointer-before_reloc); + expression (&exp); + memcpy (base, save_buf, p - base); + + offset = nbytes - size; + p = frag_more ((int) nbytes); + fix_new_exp (frag_now, p - frag_now->fr_literal + offset, + size, &exp, 0, reloc); + } + } + } } - else - inst.reloc.type = BFD_RELOC_ARM_CP_OFF_IMM; + while (*input_line_pointer++ == ','); - return SUCCESS; + /* Put terminator back into stream. */ + input_line_pointer --; + demand_empty_rest_of_line (); } -static int -cp_address_required_here (char ** str, int wb_ok) -{ - char * p = * str; - int pre_inc = 0; - int write_back = 0; - - if (*p == '[') - { - int reg; - p++; - skip_whitespace (p); - - if ((reg = reg_required_here (& p, 16)) == FAIL) - return FAIL; +/* Parse a .rel31 directive. */ - skip_whitespace (p); +static void +s_arm_rel31 (int ignored ATTRIBUTE_UNUSED) +{ + expressionS exp; + char *p; + valueT highbit; - if (*p == ']') - { - p++; + highbit = 0; + if (*input_line_pointer == '1') + highbit = 0x80000000; + else if (*input_line_pointer != '0') + as_bad (_("expected 0 or 1")); - skip_whitespace (p); + input_line_pointer++; + if (*input_line_pointer != ',') + as_bad (_("missing comma")); + input_line_pointer++; - if (*p == '\0') - { - /* As an extension to the official ARM syntax we allow: - [Rn] - as a short hand for: - [Rn,#0] */ - inst.instruction |= PRE_INDEX | INDEX_UP; - *str = p; - return SUCCESS; - } +#ifdef md_flush_pending_output + md_flush_pending_output (); +#endif - if (skip_past_comma (& p) == FAIL) - { - inst.error = _("comma expected after closing square bracket"); - return FAIL; - } +#ifdef md_cons_align + md_cons_align (4); +#endif - skip_whitespace (p); + mapping_state (MAP_DATA); - if (*p == '#') - { - if (wb_ok) - { - /* [Rn], #expr */ - write_back = WRITE_BACK; + expression (&exp); - if (reg == REG_PC) - { - inst.error = _("pc may not be used in post-increment"); - return FAIL; - } + p = frag_more (4); + md_number_to_chars (p, highbit, 4); + fix_new_arm (frag_now, p - frag_now->fr_literal, 4, &exp, 1, + BFD_RELOC_ARM_PREL31); - if (cp_address_offset (& p) == FAIL) - return FAIL; - } - else - pre_inc = PRE_INDEX | INDEX_UP; - } - else if (*p == '{') - { - int option; + demand_empty_rest_of_line (); +} - /* [Rn], {} */ - p++; +/* Directives: AEABI stack-unwind tables. */ - skip_whitespace (p); +/* Parse an unwind_fnstart directive. Simply records the current location. */ - if (my_get_expression (& inst.reloc.exp, & p)) - return FAIL; - - if (inst.reloc.exp.X_op == O_constant) - { - option = inst.reloc.exp.X_add_number; - - if (option > 255 || option < 0) - { - inst.error = _("'option' field too large"); - return FAIL; - } - - skip_whitespace (p); +static void +s_arm_unwind_fnstart (int ignored ATTRIBUTE_UNUSED) +{ + demand_empty_rest_of_line (); + /* Mark the start of the function. */ + unwind.proc_start = expr_build_dot (); - if (*p != '}') - { - inst.error = _("'}' expected at end of 'option' field"); - return FAIL; - } - else - { - p++; - inst.instruction |= option; - inst.instruction |= INDEX_UP; - } - } - else - { - inst.error = _("non-constant expressions for 'option' field not supported"); - return FAIL; - } - } - else - { - inst.error = _("# or { expected after comma"); - return FAIL; - } - } - else - { - /* '['Rn, #expr']'[!] */ + /* Reset the rest of the unwind info. */ + unwind.opcode_count = 0; + unwind.table_entry = NULL; + unwind.personality_routine = NULL; + unwind.personality_index = -1; + unwind.frame_size = 0; + unwind.fp_offset = 0; + unwind.fp_reg = 13; + unwind.fp_used = 0; + unwind.sp_restored = 0; +} - if (skip_past_comma (& p) == FAIL) - { - inst.error = _("pre-indexed expression expected"); - return FAIL; - } - pre_inc = PRE_INDEX; +/* Parse a handlerdata directive. Creates the exception handling table entry + for the function. */ - if (cp_address_offset (& p) == FAIL) - return FAIL; +static void +s_arm_unwind_handlerdata (int ignored ATTRIBUTE_UNUSED) +{ + demand_empty_rest_of_line (); + if (unwind.table_entry) + as_bad (_("dupicate .handlerdata directive")); - skip_whitespace (p); + create_unwind_entry (1); +} - if (*p++ != ']') - { - inst.error = _("missing ]"); - return FAIL; - } +/* Parse an unwind_fnend directive. Generates the index table entry. */ - skip_whitespace (p); +static void +s_arm_unwind_fnend (int ignored ATTRIBUTE_UNUSED) +{ + long where; + char *ptr; + valueT val; - if (wb_ok && *p == '!') - { - if (reg == REG_PC) - { - inst.error = _("pc may not be used with write-back"); - return FAIL; - } + demand_empty_rest_of_line (); - p++; - write_back = WRITE_BACK; - } - } - } + /* Add eh table entry. */ + if (unwind.table_entry == NULL) + val = create_unwind_entry (0); else - { - if (my_get_expression (&inst.reloc.exp, &p)) - return FAIL; - - inst.reloc.type = BFD_RELOC_ARM_CP_OFF_IMM; - inst.reloc.exp.X_add_number -= 8; /* PC rel adjust. */ - inst.reloc.pc_rel = 1; - inst.instruction |= (REG_PC << 16); - pre_inc = PRE_INDEX; - } + val = 0; - inst.instruction |= write_back | pre_inc; - *str = p; - return SUCCESS; -} + /* Add index table entry. This is two words. */ + start_unwind_section (unwind.saved_seg, 1); + frag_align (2, 0, 0); + record_alignment (now_seg, 2); -static int -cp_byte_address_offset (char ** str) -{ - int offset; + ptr = frag_more (8); + where = frag_now_fix () - 8; - skip_whitespace (* str); + /* Self relative offset of the function start. */ + fix_new (frag_now, where, 4, unwind.proc_start, 0, 1, + BFD_RELOC_ARM_PREL31); - if (! is_immediate_prefix (**str)) + /* Indicate dependency on EHABI-defined personality routines to the + linker, if it hasn't been done already. */ + if (unwind.personality_index >= 0 && unwind.personality_index < 3 + && !(marked_pr_dependency & (1 << unwind.personality_index))) { - inst.error = _("immediate expression expected"); - return FAIL; + static const char *const name[] = { + "__aeabi_unwind_cpp_pr0", + "__aeabi_unwind_cpp_pr1", + "__aeabi_unwind_cpp_pr2" + }; + symbolS *pr = symbol_find_or_make (name[unwind.personality_index]); + fix_new (frag_now, where, 0, pr, 0, 1, BFD_RELOC_NONE); + marked_pr_dependency |= 1 << unwind.personality_index; + seg_info (now_seg)->tc_segment_info_data.marked_pr_dependency + = marked_pr_dependency; } - (*str)++; - - if (my_get_expression (& inst.reloc.exp, str)) - return FAIL; + if (val) + /* Inline exception table entry. */ + md_number_to_chars (ptr + 4, val, 4); + else + /* Self relative offset of the table entry. */ + fix_new (frag_now, where + 4, 4, unwind.table_entry, 0, 1, + BFD_RELOC_ARM_PREL31); - if (inst.reloc.exp.X_op == O_constant) - { - offset = inst.reloc.exp.X_add_number; + /* Restore the original section. */ + subseg_set (unwind.saved_seg, unwind.saved_subseg); +} - if (offset > 255 || offset < -255) - { - inst.error = _("offset too large"); - return FAIL; - } - if (offset >= 0) - inst.instruction |= INDEX_UP; - else - offset = -offset; +/* Parse an unwind_cantunwind directive. */ - inst.instruction |= offset; - } - else - inst.reloc.type = BFD_RELOC_ARM_CP_OFF_IMM_S2; +static void +s_arm_unwind_cantunwind (int ignored ATTRIBUTE_UNUSED) +{ + demand_empty_rest_of_line (); + if (unwind.personality_routine || unwind.personality_index != -1) + as_bad (_("personality routine specified for cantunwind frame")); - return SUCCESS; + unwind.personality_index = -2; } -static int -cp_byte_address_required_here (char ** str) -{ - char * p = * str; - int pre_inc = 0; - int write_back = 0; - if (*p == '[') - { - int reg; +/* Parse a personalityindex directive. */ - p++; - skip_whitespace (p); +static void +s_arm_unwind_personalityindex (int ignored ATTRIBUTE_UNUSED) +{ + expressionS exp; - if ((reg = reg_required_here (& p, 16)) == FAIL) - return FAIL; + if (unwind.personality_routine || unwind.personality_index != -1) + as_bad (_("duplicate .personalityindex directive")); - skip_whitespace (p); + expression (&exp); - if (*p == ']') - { - p++; - - if (skip_past_comma (& p) == SUCCESS) - { - /* [Rn], #expr */ - write_back = WRITE_BACK; - - if (reg == REG_PC) - { - inst.error = _("pc may not be used in post-increment"); - return FAIL; - } - - if (cp_byte_address_offset (& p) == FAIL) - return FAIL; - } - else - pre_inc = PRE_INDEX | INDEX_UP; - } - else - { - /* '['Rn, #expr']'[!] */ - - if (skip_past_comma (& p) == FAIL) - { - inst.error = _("pre-indexed expression expected"); - return FAIL; - } - - pre_inc = PRE_INDEX; - - if (cp_byte_address_offset (& p) == FAIL) - return FAIL; - - skip_whitespace (p); - - if (*p++ != ']') - { - inst.error = _("missing ]"); - return FAIL; - } - - skip_whitespace (p); - - if (*p == '!') - { - if (reg == REG_PC) - { - inst.error = _("pc may not be used with write-back"); - return FAIL; - } - - p++; - write_back = WRITE_BACK; - } - } - } - else + if (exp.X_op != O_constant + || exp.X_add_number < 0 || exp.X_add_number > 15) { - if (my_get_expression (&inst.reloc.exp, &p)) - return FAIL; - - inst.reloc.type = BFD_RELOC_ARM_CP_OFF_IMM_S2; - inst.reloc.exp.X_add_number -= 8; /* PC rel adjust. */ - inst.reloc.pc_rel = 1; - inst.instruction |= (REG_PC << 16); - pre_inc = PRE_INDEX; + as_bad (_("bad personality routine number")); + ignore_rest_of_line (); + return; } - inst.instruction |= write_back | pre_inc; - *str = p; - return SUCCESS; + unwind.personality_index = exp.X_add_number; + + demand_empty_rest_of_line (); } -static void -do_nop (char * str) -{ - skip_whitespace (str); - if (*str == '{') - { - str++; - if (my_get_expression (&inst.reloc.exp, &str)) - inst.reloc.exp.X_op = O_illegal; - else - { - skip_whitespace (str); - if (*str == '}') - str++; - else - inst.reloc.exp.X_op = O_illegal; - } +/* Parse a personality directive. */ - if (inst.reloc.exp.X_op != O_constant - || inst.reloc.exp.X_add_number > 255 - || inst.reloc.exp.X_add_number < 0) - { - inst.error = _("Invalid NOP hint"); - return; - } +static void +s_arm_unwind_personality (int ignored ATTRIBUTE_UNUSED) +{ + char *name, *p, c; - /* Arcitectural NOP hints are CPSR sets with no bits selected. */ - inst.instruction &= 0xf0000000; - inst.instruction |= 0x0320f000 + inst.reloc.exp.X_add_number; - } + if (unwind.personality_routine || unwind.personality_index != -1) + as_bad (_("duplicate .personality directive")); - end_of_line (str); + name = input_line_pointer; + c = get_symbol_end (); + p = input_line_pointer; + unwind.personality_routine = symbol_find_or_make (name); + *p = c; + demand_empty_rest_of_line (); } -static void -do_empty (char * str) -{ - /* Do nothing really. */ - end_of_line (str); -} + +/* Parse a directive saving core registers. */ static void -do_mrs (char * str) +s_arm_unwind_save_core (void) { - int skip = 0; - - /* Only one syntax. */ - skip_whitespace (str); + valueT op; + long range; + int n; - if (reg_required_here (&str, 12) == FAIL) + range = parse_reg_list (&input_line_pointer); + if (range == FAIL) { - inst.error = BAD_ARGS; + as_bad (_("expected register list")); + ignore_rest_of_line (); return; } - if (skip_past_comma (&str) == FAIL) + demand_empty_rest_of_line (); + + /* Turn .unwind_movsp ip followed by .unwind_save {..., ip, ...} + into .unwind_save {..., sp...}. We aren't bothered about the value of + ip because it is clobbered by calls. */ + if (unwind.sp_restored && unwind.fp_reg == 12 + && (range & 0x3000) == 0x1000) { - inst.error = _("comma expected after register name"); - return; + unwind.opcode_count--; + unwind.sp_restored = 0; + range = (range | 0x2000) & ~0x1000; + unwind.pending_offset = 0; } - skip_whitespace (str); - - if ( streq (str, "CPSR") - || streq (str, "SPSR") - /* Lower case versions for backwards compatibility. */ - || streq (str, "cpsr") - || streq (str, "spsr")) - skip = 4; - - /* This is for backwards compatibility with older toolchains. */ - else if ( streq (str, "cpsr_all") - || streq (str, "spsr_all")) - skip = 8; - else + /* See if we can use the short opcodes. These pop a block of upto 8 + registers starting with r4, plus maybe r14. */ + for (n = 0; n < 8; n++) { - inst.error = _("CPSR or SPSR expected"); - return; + /* Break at the first non-saved register. */ + if ((range & (1 << (n + 4))) == 0) + break; } - - if (* str == 's' || * str == 'S') - inst.instruction |= SPSR_BIT; - str += skip; - - end_of_line (str); -} - -/* Two possible forms: - "{C|S}PSR_, Rm", - "{C|S}PSR_f, #expression". */ - -static void -do_msr (char * str) -{ - skip_whitespace (str); - - if (psr_required_here (& str) == FAIL) - return; - - if (skip_past_comma (& str) == FAIL) + /* See if there are any other bits set. */ + if (n == 0 || (range & (0xfff0 << n) & 0xbff0) != 0) { - inst.error = _("comma missing after psr flags"); - return; + /* Use the long form. */ + op = 0x8000 | ((range >> 4) & 0xfff); + add_unwind_opcode (op, 2); } - - skip_whitespace (str); - - if (reg_required_here (& str, 0) != FAIL) + else { - inst.error = NULL; - end_of_line (str); - return; + /* Use the short form. */ + if (range & 0x4000) + op = 0xa8; /* Pop r14. */ + else + op = 0xa0; /* Do not pop r14. */ + op |= (n - 1); + add_unwind_opcode (op, 1); } - if (! is_immediate_prefix (* str)) + /* Pop r0-r3. */ + if (range & 0xf) { - inst.error = - _("only a register or immediate value can follow a psr flag"); - return; + op = 0xb100 | (range & 0xf); + add_unwind_opcode (op, 2); } - str ++; - inst.error = NULL; - - if (my_get_expression (& inst.reloc.exp, & str)) + /* Record the number of bytes pushed. */ + for (n = 0; n < 16; n++) { - inst.error = - _("only a register or immediate value can follow a psr flag"); - return; + if (range & (1 << n)) + unwind.frame_size += 4; } +} - inst.instruction |= INST_IMMEDIATE; - if (inst.reloc.exp.X_add_symbol) - { - inst.reloc.type = BFD_RELOC_ARM_IMMEDIATE; - inst.reloc.pc_rel = 0; - } - else - { - unsigned value = validate_immediate (inst.reloc.exp.X_add_number); - - if (value == (unsigned) FAIL) - { - inst.error = _("invalid constant"); - return; - } - - inst.instruction |= value; - } - - inst.error = NULL; - end_of_line (str); -} - -/* Long Multiply Parser - UMULL RdLo, RdHi, Rm, Rs - SMULL RdLo, RdHi, Rm, Rs - UMLAL RdLo, RdHi, Rm, Rs - SMLAL RdLo, RdHi, Rm, Rs. */ +/* Parse a directive saving FPA registers. */ static void -do_mull (char * str) +s_arm_unwind_save_fpa (int reg) { - int rdlo, rdhi, rm, rs; + expressionS exp; + int num_regs; + valueT op; - /* Only one format "rdlo, rdhi, rm, rs". */ - skip_whitespace (str); + /* Get Number of registers to transfer. */ + if (skip_past_comma (&input_line_pointer) != FAIL) + expression (&exp); + else + exp.X_op = O_illegal; - if ((rdlo = reg_required_here (&str, 12)) == FAIL) + if (exp.X_op != O_constant) { - inst.error = BAD_ARGS; + as_bad (_("expected , ")); + ignore_rest_of_line (); return; } - if (skip_past_comma (&str) == FAIL - || (rdhi = reg_required_here (&str, 16)) == FAIL) - { - inst.error = BAD_ARGS; - return; - } + num_regs = exp.X_add_number; - if (skip_past_comma (&str) == FAIL - || (rm = reg_required_here (&str, 0)) == FAIL) + if (num_regs < 1 || num_regs > 4) { - inst.error = BAD_ARGS; + as_bad (_("number of registers must be in the range [1:4]")); + ignore_rest_of_line (); return; } - /* rdhi, rdlo and rm must all be different. */ - if (rdlo == rdhi || rdlo == rm || rdhi == rm) - as_tsktsk (_("rdhi, rdlo and rm must all be different")); + demand_empty_rest_of_line (); - if (skip_past_comma (&str) == FAIL - || (rs = reg_required_here (&str, 8)) == FAIL) + if (reg == 4) { - inst.error = BAD_ARGS; - return; + /* Short form. */ + op = 0xb4 | (num_regs - 1); + add_unwind_opcode (op, 1); } - - if (rdhi == REG_PC || rdhi == REG_PC || rdhi == REG_PC || rdhi == REG_PC) + else { - inst.error = BAD_PC; - return; + /* Long form. */ + op = 0xc800 | (reg << 4) | (num_regs - 1); + add_unwind_opcode (op, 2); } - - end_of_line (str); + unwind.frame_size += num_regs * 12; } -static void -do_mul (char * str) -{ - int rd, rm; - /* Only one format "rd, rm, rs". */ - skip_whitespace (str); +/* Parse a directive saving VFP registers. */ - if ((rd = reg_required_here (&str, 16)) == FAIL) - { - inst.error = BAD_ARGS; - return; - } +static void +s_arm_unwind_save_vfp (void) +{ + int count; + int reg; + valueT op; - if (rd == REG_PC) + count = parse_vfp_reg_list (&input_line_pointer, ®, 1); + if (count == FAIL) { - inst.error = BAD_PC; + as_bad (_("expected register list")); + ignore_rest_of_line (); return; } - if (skip_past_comma (&str) == FAIL - || (rm = reg_required_here (&str, 0)) == FAIL) - { - inst.error = BAD_ARGS; - return; - } + demand_empty_rest_of_line (); - if (rm == REG_PC) + if (reg == 8) { - inst.error = BAD_PC; - return; + /* Short form. */ + op = 0xb8 | (count - 1); + add_unwind_opcode (op, 1); } - - if (rm == rd) - as_tsktsk (_("rd and rm should be different in mul")); - - if (skip_past_comma (&str) == FAIL - || (rm = reg_required_here (&str, 8)) == FAIL) + else { - inst.error = BAD_ARGS; - return; + /* Long form. */ + op = 0xb300 | (reg << 4) | (count - 1); + add_unwind_opcode (op, 2); } + unwind.frame_size += count * 8 + 4; +} - if (rm == REG_PC) - { - inst.error = BAD_PC; - return; - } - end_of_line (str); -} +/* Parse a directive saving iWMMXt data registers. */ static void -do_mlas (char * str, bfd_boolean is_mls) +s_arm_unwind_save_mmxwr (void) { - int rd, rm; + int reg; + int hi_reg; + int i; + unsigned mask = 0; + valueT op; - /* Only one format "rd, rm, rs, rn". */ - skip_whitespace (str); + if (*input_line_pointer == '{') + input_line_pointer++; - if ((rd = reg_required_here (&str, 16)) == FAIL) + do { - inst.error = BAD_ARGS; - return; - } + reg = arm_reg_parse (&input_line_pointer, REG_TYPE_MMXWR); - if (rd == REG_PC) - { - inst.error = BAD_PC; - return; - } + if (reg == FAIL) + { + as_bad (_(reg_expected_msgs[REG_TYPE_MMXWR])); + goto error; + } - if (skip_past_comma (&str) == FAIL - || (rm = reg_required_here (&str, 0)) == FAIL) - { - inst.error = BAD_ARGS; - return; - } + if (mask >> reg) + as_tsktsk (_("register list not in ascending order")); + mask |= 1 << reg; - if (rm == REG_PC) - { - inst.error = BAD_PC; - return; + if (*input_line_pointer == '-') + { + input_line_pointer++; + hi_reg = arm_reg_parse (&input_line_pointer, REG_TYPE_MMXWR); + if (hi_reg == FAIL) + { + as_bad (_(reg_expected_msgs[REG_TYPE_MMXWR])); + goto error; + } + else if (reg >= hi_reg) + { + as_bad (_("bad register range")); + goto error; + } + for (; reg < hi_reg; reg++) + mask |= 1 << reg; + } } + while (skip_past_comma (&input_line_pointer) != FAIL); - /* This restriction does not apply to mls (nor to mla in v6, but - that's hard to detect at present). */ - if (rm == rd && !is_mls) - as_tsktsk (_("rd and rm should be different in mla")); + if (*input_line_pointer == '}') + input_line_pointer++; + + demand_empty_rest_of_line (); - if (skip_past_comma (&str) == FAIL - || (rd = reg_required_here (&str, 8)) == FAIL - || skip_past_comma (&str) == FAIL - || (rm = reg_required_here (&str, 12)) == FAIL) + /* Generate any deferred opcodes becuuse we're going to be looking at + the list. */ + flush_pending_unwind (); + + for (i = 0; i < 16; i++) { - inst.error = BAD_ARGS; - return; + if (mask & (1 << i)) + unwind.frame_size += 8; } - if (rd == REG_PC || rm == REG_PC) + /* Attempt to combine with a previous opcode. We do this because gcc + likes to output separate unwind directives for a single block of + registers. */ + if (unwind.opcode_count > 0) { - inst.error = BAD_PC; - return; + i = unwind.opcodes[unwind.opcode_count - 1]; + if ((i & 0xf8) == 0xc0) + { + i &= 7; + /* Only merge if the blocks are contiguous. */ + if (i < 6) + { + if ((mask & 0xfe00) == (1 << 9)) + { + mask |= ((1 << (i + 11)) - 1) & 0xfc00; + unwind.opcode_count--; + } + } + else if (i == 6 && unwind.opcode_count >= 2) + { + i = unwind.opcodes[unwind.opcode_count - 2]; + reg = i >> 4; + i &= 0xf; + + op = 0xffff << (reg - 1); + if (reg > 0 + || ((mask & op) == (1u << (reg - 1)))) + { + op = (1 << (reg + i + 1)) - 1; + op &= ~((1 << reg) - 1); + mask |= op; + unwind.opcode_count -= 2; + } + } + } } - end_of_line (str); -} + hi_reg = 15; + /* We want to generate opcodes in the order the registers have been + saved, ie. descending order. */ + for (reg = 15; reg >= -1; reg--) + { + /* Save registers in blocks. */ + if (reg < 0 + || !(mask & (1 << reg))) + { + /* We found an unsaved reg. Generate opcodes to save the + preceeding block. */ + if (reg != hi_reg) + { + if (reg == 9) + { + /* Short form. */ + op = 0xc0 | (hi_reg - 10); + add_unwind_opcode (op, 1); + } + else + { + /* Long form. */ + op = 0xc600 | ((reg + 1) << 4) | ((hi_reg - reg) - 1); + add_unwind_opcode (op, 2); + } + } + hi_reg = reg - 1; + } + } -static void -do_mla (char *str) -{ - do_mlas (str, FALSE); + return; +error: + ignore_rest_of_line (); } static void -do_mls (char *str) +s_arm_unwind_save_mmxwcg (void) { - do_mlas (str, TRUE); -} - -/* Expects *str -> the characters "acc0", possibly with leading blanks. - Advances *str to the next non-alphanumeric. - Returns 0, or else FAIL (in which case sets inst.error). - - (In a future XScale, there may be accumulators other than zero. - At that time this routine and its callers can be upgraded to suit.) */ - -static int -accum0_required_here (char ** str) -{ - static char buff [128]; /* Note the address is taken. Hence, static. */ - char * p = * str; - char c; - int result = 0; /* The accum number. */ - - skip_whitespace (p); - - *str = p; /* Advance caller's string pointer too. */ - c = *p++; - while (ISALNUM (c)) - c = *p++; + int reg; + int hi_reg; + unsigned mask = 0; + valueT op; - *--p = 0; /* Aap nul into input buffer at non-alnum. */ + if (*input_line_pointer == '{') + input_line_pointer++; - if (! ( streq (*str, "acc0") || streq (*str, "ACC0"))) + do { - sprintf (buff, _("acc0 expected, not '%.100s'"), *str); - inst.error = buff; - result = FAIL; - } - - *p = c; /* Unzap. */ - *str = p; /* Caller's string pointer to after match. */ - return result; -} + reg = arm_reg_parse (&input_line_pointer, REG_TYPE_MMXWCG); -static int -ldst_extend_v4 (char ** str) -{ - int add = INDEX_UP; + if (reg == FAIL) + { + as_bad (_(reg_expected_msgs[REG_TYPE_MMXWCG])); + goto error; + } - switch (**str) - { - case '#': - case '$': - (*str)++; - if (my_get_expression (& inst.reloc.exp, str)) - return FAIL; + reg -= 8; + if (mask >> reg) + as_tsktsk (_("register list not in ascending order")); + mask |= 1 << reg; - if (inst.reloc.exp.X_op == O_constant) + if (*input_line_pointer == '-') { - int value = inst.reloc.exp.X_add_number; - - if (value < -255 || value > 255) + input_line_pointer++; + hi_reg = arm_reg_parse (&input_line_pointer, REG_TYPE_MMXWCG); + if (hi_reg == FAIL) { - inst.error = _("address offset too large"); - return FAIL; + as_bad (_(reg_expected_msgs[REG_TYPE_MMXWCG])); + goto error; } - - if (value < 0) + else if (reg >= hi_reg) { - value = -value; - add = 0; + as_bad (_("bad register range")); + goto error; } - - /* Halfword and signextension instructions have the - immediate value split across bits 11..8 and bits 3..0. */ - inst.instruction |= (add | HWOFFSET_IMM - | ((value >> 4) << 8) | (value & 0xF)); - } - else - { - inst.instruction |= HWOFFSET_IMM; - inst.reloc.type = BFD_RELOC_ARM_OFFSET_IMM8; - inst.reloc.pc_rel = 0; + for (; reg < hi_reg; reg++) + mask |= 1 << reg; } - return SUCCESS; + } + while (skip_past_comma (&input_line_pointer) != FAIL); - case '-': - add = 0; - /* Fall through. */ + if (*input_line_pointer == '}') + input_line_pointer++; - case '+': - (*str)++; - /* Fall through. */ + demand_empty_rest_of_line (); - default: - if (reg_required_here (str, 0) == FAIL) - return FAIL; + /* Generate any deferred opcodes becuuse we're going to be looking at + the list. */ + flush_pending_unwind (); - inst.instruction |= add; - return SUCCESS; + for (reg = 0; reg < 16; reg++) + { + if (mask & (1 << reg)) + unwind.frame_size += 4; } + op = 0xc700 | mask; + add_unwind_opcode (op, 2); + return; +error: + ignore_rest_of_line (); } -/* Expects **str -> after a comma. May be leading blanks. - Advances *str, recognizing a load mode, and setting inst.instruction. - Returns rn, or else FAIL (in which case may set inst.error - and not advance str) - Note: doesn't know Rd, so no err checks that require such knowledge. */ +/* Parse an unwind_save directive. */ -static int -ld_mode_required_here (char ** string) +static void +s_arm_unwind_save (int ignored ATTRIBUTE_UNUSED) { - char * str = * string; - int rn; - int pre_inc = 0; + char *peek; + struct reg_entry *reg; + bfd_boolean had_brace = FALSE; - skip_whitespace (str); + /* Figure out what sort of save we have. */ + peek = input_line_pointer; - if (* str == '[') + if (*peek == '{') { - str++; - - skip_whitespace (str); + had_brace = TRUE; + peek++; + } - if ((rn = reg_required_here (& str, 16)) == FAIL) - return FAIL; + reg = arm_reg_parse_multi (&peek); - skip_whitespace (str); + if (!reg) + { + as_bad (_("register expected")); + ignore_rest_of_line (); + return; + } - if (* str == ']') + switch (reg->type) + { + case REG_TYPE_FN: + if (had_brace) { - str ++; + as_bad (_("FPA .unwind_save does not take a register list")); + ignore_rest_of_line (); + return; + } + s_arm_unwind_save_fpa (reg->number); + return; - if (skip_past_comma (& str) == SUCCESS) - { - /* [Rn],... (post inc) */ - if (ldst_extend_v4 (&str) == FAIL) - return FAIL; - } - else /* [Rn] */ - { - skip_whitespace (str); + case REG_TYPE_RN: s_arm_unwind_save_core (); return; + case REG_TYPE_VFD: s_arm_unwind_save_vfp (); return; + case REG_TYPE_MMXWR: s_arm_unwind_save_mmxwr (); return; + case REG_TYPE_MMXWCG: s_arm_unwind_save_mmxwcg (); return; - if (* str == '!') - { - str ++; - inst.instruction |= WRITE_BACK; - } - - inst.instruction |= INDEX_UP | HWOFFSET_IMM; - pre_inc = 1; - } - } - else /* [Rn,...] */ - { - if (skip_past_comma (& str) == FAIL) - { - inst.error = _("pre-indexed expression expected"); - return FAIL; - } - - pre_inc = 1; - - if (ldst_extend_v4 (&str) == FAIL) - return FAIL; - - skip_whitespace (str); - - if (* str ++ != ']') - { - inst.error = _("missing ]"); - return FAIL; - } - - skip_whitespace (str); - - if (* str == '!') - { - str ++; - inst.instruction |= WRITE_BACK; - } - } - } - else if (* str == '=') /* ldr's "r,=label" syntax */ - /* We should never reach here, because = is - caught gas/read.c read_a_source_file() as a .set operation. */ - return FAIL; - else /* PC +- 8 bit immediate offset. */ - { - if (my_get_expression (& inst.reloc.exp, & str)) - return FAIL; - - inst.instruction |= HWOFFSET_IMM; /* The I bit. */ - inst.reloc.type = BFD_RELOC_ARM_OFFSET_IMM8; - inst.reloc.exp.X_add_number -= 8; /* PC rel adjust. */ - inst.reloc.pc_rel = 1; - inst.instruction |= (REG_PC << 16); - - rn = REG_PC; - pre_inc = 1; + default: + as_bad (_(".unwind_save does not support this kind of register")); + ignore_rest_of_line (); } - - inst.instruction |= (pre_inc ? PRE_INDEX : 0); - * string = str; - - return rn; } -/* ARM V5E (El Segundo) signed-multiply-accumulate (argument parse) - SMLAxy{cond} Rd,Rm,Rs,Rn - SMLAWy{cond} Rd,Rm,Rs,Rn - Error if any register is R15. */ - -static void -do_smla (char * str) -{ - int rd, rm, rs, rn; - - skip_whitespace (str); - - if ((rd = reg_required_here (& str, 16)) == FAIL - || skip_past_comma (& str) == FAIL - || (rm = reg_required_here (& str, 0)) == FAIL - || skip_past_comma (& str) == FAIL - || (rs = reg_required_here (& str, 8)) == FAIL - || skip_past_comma (& str) == FAIL - || (rn = reg_required_here (& str, 12)) == FAIL) - inst.error = BAD_ARGS; - else if (rd == REG_PC || rm == REG_PC || rs == REG_PC || rn == REG_PC) - inst.error = BAD_PC; - - else - end_of_line (str); -} - -/* ARM V5E (El Segundo) signed-multiply-accumulate-long (argument parse) - SMLALxy{cond} Rdlo,Rdhi,Rm,Rs - Error if any register is R15. - Warning if Rdlo == Rdhi. */ +/* Parse an unwind_movsp directive. */ static void -do_smlal (char * str) +s_arm_unwind_movsp (int ignored ATTRIBUTE_UNUSED) { - int rdlo, rdhi, rm, rs; - - skip_whitespace (str); + int reg; + valueT op; - if ((rdlo = reg_required_here (& str, 12)) == FAIL - || skip_past_comma (& str) == FAIL - || (rdhi = reg_required_here (& str, 16)) == FAIL - || skip_past_comma (& str) == FAIL - || (rm = reg_required_here (& str, 0)) == FAIL - || skip_past_comma (& str) == FAIL - || (rs = reg_required_here (& str, 8)) == FAIL) + reg = arm_reg_parse (&input_line_pointer, REG_TYPE_RN); + if (reg == FAIL) { - inst.error = BAD_ARGS; + as_bad (_(reg_expected_msgs[REG_TYPE_RN])); + ignore_rest_of_line (); return; } + demand_empty_rest_of_line (); - if (rdlo == REG_PC || rdhi == REG_PC || rm == REG_PC || rs == REG_PC) + if (reg == REG_SP || reg == REG_PC) { - inst.error = BAD_PC; + as_bad (_("SP and PC not permitted in .unwind_movsp directive")); return; } - if (rdlo == rdhi) - as_tsktsk (_("rdhi and rdlo must be different")); - - end_of_line (str); -} - -/* ARM V5E (El Segundo) signed-multiply (argument parse) - SMULxy{cond} Rd,Rm,Rs - Error if any register is R15. */ - -static void -do_smul (char * str) -{ - int rd, rm, rs; - - skip_whitespace (str); - - if ((rd = reg_required_here (& str, 16)) == FAIL - || skip_past_comma (& str) == FAIL - || (rm = reg_required_here (& str, 0)) == FAIL - || skip_past_comma (& str) == FAIL - || (rs = reg_required_here (& str, 8)) == FAIL) - inst.error = BAD_ARGS; + if (unwind.fp_reg != REG_SP) + as_bad (_("unexpected .unwind_movsp directive")); - else if (rd == REG_PC || rm == REG_PC || rs == REG_PC) - inst.error = BAD_PC; + /* Generate opcode to restore the value. */ + op = 0x90 | reg; + add_unwind_opcode (op, 1); - else - end_of_line (str); + /* Record the information for later. */ + unwind.fp_reg = reg; + unwind.fp_offset = unwind.frame_size; + unwind.sp_restored = 1; } -/* ARM V5E (El Segundo) saturating-add/subtract (argument parse) - Q[D]{ADD,SUB}{cond} Rd,Rm,Rn - Error if any register is R15. */ +/* Parse an unwind_pad directive. */ static void -do_qadd (char * str) +s_arm_unwind_pad (int ignored ATTRIBUTE_UNUSED) { - int rd, rm, rn; + int offset; - skip_whitespace (str); + if (immediate_for_directive (&offset) == FAIL) + return; - if ((rd = reg_required_here (& str, 12)) == FAIL - || skip_past_comma (& str) == FAIL - || (rm = reg_required_here (& str, 0)) == FAIL - || skip_past_comma (& str) == FAIL - || (rn = reg_required_here (& str, 16)) == FAIL) - inst.error = BAD_ARGS; + if (offset & 3) + { + as_bad (_("stack increment must be multiple of 4")); + ignore_rest_of_line (); + return; + } - else if (rd == REG_PC || rm == REG_PC || rn == REG_PC) - inst.error = BAD_PC; + /* Don't generate any opcodes, just record the details for later. */ + unwind.frame_size += offset; + unwind.pending_offset += offset; - else - end_of_line (str); + demand_empty_rest_of_line (); } -/* ARM V5E (el Segundo) - MCRRcc , , , , . - MRRCcc , , , , . - - These are equivalent to the XScale instructions MAR and MRA, - respectively, when coproc == 0, opcode == 0, and CRm == 0. - - Result unpredicatable if Rd or Rn is R15. */ +/* Parse an unwind_setfp directive. */ static void -do_co_reg2c (char * str) +s_arm_unwind_setfp (int ignored ATTRIBUTE_UNUSED) { - int rd, rn; - - skip_whitespace (str); - - if (co_proc_number (& str) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + int sp_reg; + int fp_reg; + int offset; - if (skip_past_comma (& str) == FAIL - || cp_opc_expr (& str, 4, 4) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + fp_reg = arm_reg_parse (&input_line_pointer, REG_TYPE_RN); + if (skip_past_comma (&input_line_pointer) == FAIL) + sp_reg = FAIL; + else + sp_reg = arm_reg_parse (&input_line_pointer, REG_TYPE_RN); - if (skip_past_comma (& str) == FAIL - || (rd = reg_required_here (& str, 12)) == FAIL) + if (fp_reg == FAIL || sp_reg == FAIL) { - if (!inst.error) - inst.error = BAD_ARGS; + as_bad (_("expected , ")); + ignore_rest_of_line (); return; } - if (skip_past_comma (& str) == FAIL - || (rn = reg_required_here (& str, 16)) == FAIL) + /* Optional constant. */ + if (skip_past_comma (&input_line_pointer) != FAIL) { - if (!inst.error) - inst.error = BAD_ARGS; - return; + if (immediate_for_directive (&offset) == FAIL) + return; } + else + offset = 0; - /* Unpredictable result if rd or rn is R15. */ - if (rd == REG_PC || rn == REG_PC) - as_tsktsk - (_("Warning: instruction unpredictable when using r15")); + demand_empty_rest_of_line (); - if (skip_past_comma (& str) == FAIL - || cp_reg_required_here (& str, 0) == FAIL) + if (sp_reg != 13 && sp_reg != unwind.fp_reg) { - if (!inst.error) - inst.error = BAD_ARGS; + as_bad (_("register must be either sp or set by a previous" + "unwind_movsp directive")); return; } - end_of_line (str); -} - -/* ARM V5 count-leading-zeroes instruction (argument parse) - CLZ{} , - Condition defaults to COND_ALWAYS. - Error if Rd or Rm are R15. */ - -static void -do_clz (char * str) -{ - int rd, rm; - - skip_whitespace (str); - - if (((rd = reg_required_here (& str, 12)) == FAIL) - || (skip_past_comma (& str) == FAIL) - || ((rm = reg_required_here (& str, 0)) == FAIL)) - inst.error = BAD_ARGS; - - else if (rd == REG_PC || rm == REG_PC ) - inst.error = BAD_PC; - + /* Don't generate any opcodes, just record the information for later. */ + unwind.fp_reg = fp_reg; + unwind.fp_used = 1; + if (sp_reg == 13) + unwind.fp_offset = unwind.frame_size - offset; else - end_of_line (str); + unwind.fp_offset -= offset; } -/* ARM V5 (argument parse) - LDC2{L} , , - STC2{L} , , - Instruction is not conditional, and has 0xf in the condition field. - Otherwise, it's the same as LDC/STC. */ +/* Parse an unwind_raw directive. */ static void -do_lstc2 (char * str) +s_arm_unwind_raw (int ignored ATTRIBUTE_UNUSED) { - skip_whitespace (str); + expressionS exp; + /* This is an arbitary limit. */ + unsigned char op[16]; + int count; - if (co_proc_number (& str) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - } - else if (skip_past_comma (& str) == FAIL - || cp_reg_required_here (& str, 12) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - } - else if (skip_past_comma (& str) == FAIL - || cp_address_required_here (&str, CP_WB_OK) == FAIL) + expression (&exp); + if (exp.X_op == O_constant + && skip_past_comma (&input_line_pointer) != FAIL) { - if (! inst.error) - inst.error = BAD_ARGS; + unwind.frame_size += exp.X_add_number; + expression (&exp); } else - end_of_line (str); -} - -/* ARM V5 (argument parse) - CDP2 , , , , , - Instruction is not conditional, and has 0xf in the condition field. - Otherwise, it's the same as CDP. */ - -static void -do_cdp2 (char * str) -{ - skip_whitespace (str); - - if (co_proc_number (& str) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } - - if (skip_past_comma (& str) == FAIL - || cp_opc_expr (& str, 20,4) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } - - if (skip_past_comma (& str) == FAIL - || cp_reg_required_here (& str, 12) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + exp.X_op = O_illegal; - if (skip_past_comma (& str) == FAIL - || cp_reg_required_here (& str, 16) == FAIL) + if (exp.X_op != O_constant) { - if (!inst.error) - inst.error = BAD_ARGS; + as_bad (_("expected , ")); + ignore_rest_of_line (); return; } - if (skip_past_comma (& str) == FAIL - || cp_reg_required_here (& str, 0) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + count = 0; - if (skip_past_comma (& str) == SUCCESS) + /* Parse the opcode. */ + for (;;) { - if (cp_opc_expr (& str, 5, 3) == FAIL) + if (count >= 16) + { + as_bad (_("unwind opcode too long")); + ignore_rest_of_line (); + } + if (exp.X_op != O_constant || exp.X_add_number & ~0xff) { - if (!inst.error) - inst.error = BAD_ARGS; + as_bad (_("invalid unwind opcode")); + ignore_rest_of_line (); return; } + op[count++] = exp.X_add_number; + + /* Parse the next byte. */ + if (skip_past_comma (&input_line_pointer) == FAIL) + break; + + expression (&exp); } - end_of_line (str); + /* Add the opcode bytes in reverse order. */ + while (count--) + add_unwind_opcode (op[count], 1); + + demand_empty_rest_of_line (); } +#endif /* OBJ_ELF */ -/* ARM V5 (argument parse) - MCR2 , , , , , - MRC2 , , , , , - Instruction is not conditional, and has 0xf in the condition field. - Otherwise, it's the same as MCR/MRC. */ +/* 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. */ -static void -do_co_reg2 (char * str) +const pseudo_typeS md_pseudo_table[] = { - skip_whitespace (str); + /* Never called because '.req' does not start a line. */ + { "req", s_req, 0 }, + { "unreq", s_unreq, 0 }, + { "bss", s_bss, 0 }, + { "align", s_align, 0 }, + { "arm", s_arm, 0 }, + { "thumb", s_thumb, 0 }, + { "code", s_code, 0 }, + { "force_thumb", s_force_thumb, 0 }, + { "thumb_func", s_thumb_func, 0 }, + { "thumb_set", s_thumb_set, 0 }, + { "even", s_even, 0 }, + { "ltorg", s_ltorg, 0 }, + { "pool", s_ltorg, 0 }, + { "syntax", s_syntax, 0 }, +#ifdef OBJ_ELF + { "word", s_arm_elf_cons, 4 }, + { "long", s_arm_elf_cons, 4 }, + { "rel31", s_arm_rel31, 0 }, + { "fnstart", s_arm_unwind_fnstart, 0 }, + { "fnend", s_arm_unwind_fnend, 0 }, + { "cantunwind", s_arm_unwind_cantunwind, 0 }, + { "personality", s_arm_unwind_personality, 0 }, + { "personalityindex", s_arm_unwind_personalityindex, 0 }, + { "handlerdata", s_arm_unwind_handlerdata, 0 }, + { "save", s_arm_unwind_save, 0 }, + { "movsp", s_arm_unwind_movsp, 0 }, + { "pad", s_arm_unwind_pad, 0 }, + { "setfp", s_arm_unwind_setfp, 0 }, + { "unwind_raw", s_arm_unwind_raw, 0 }, +#else + { "word", cons, 4}, +#endif + { "extend", float_cons, 'x' }, + { "ldouble", float_cons, 'x' }, + { "packed", float_cons, 'p' }, + { 0, 0, 0 } +}; + +/* Parser functions used exclusively in instruction operands. */ - if (co_proc_number (& str) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } +/* Generic immediate-value read function for use in insn parsing. + STR points to the beginning of the immediate (the leading #); + VAL receives the value; if the value is outside [MIN, MAX] + issue an error. PREFIX_OPT is true if the immediate prefix is + optional. */ - if (skip_past_comma (& str) == FAIL - || cp_opc_expr (& str, 21, 3) == FAIL) +static int +parse_immediate (char **str, int *val, int min, int max, + bfd_boolean prefix_opt) +{ + expressionS exp; + my_get_expression (&exp, str, prefix_opt ? GE_OPT_PREFIX : GE_IMM_PREFIX); + if (exp.X_op != O_constant) { - if (!inst.error) - inst.error = BAD_ARGS; - return; + inst.error = _("constant expression required"); + return FAIL; } - if (skip_past_comma (& str) == FAIL - || reg_required_here (& str, 12) == FAIL) + if (exp.X_add_number < min || exp.X_add_number > max) { - if (!inst.error) - inst.error = BAD_ARGS; - return; + inst.error = _("immediate value out of range"); + return FAIL; } - if (skip_past_comma (& str) == FAIL - || cp_reg_required_here (& str, 16) == FAIL) + *val = exp.X_add_number; + return SUCCESS; +} + +/* Returns the pseudo-register number of an FPA immediate constant, + or FAIL if there isn't a valid constant here. */ + +static int +parse_fpa_immediate (char ** str) +{ + LITTLENUM_TYPE words[MAX_LITTLENUMS]; + char * save_in; + expressionS exp; + int i; + int j; + + /* First try and match exact strings, this is to guarantee + that some formats will work even for cross assembly. */ + + for (i = 0; fp_const[i]; i++) { - if (!inst.error) - inst.error = BAD_ARGS; - return; + if (strncmp (*str, fp_const[i], strlen (fp_const[i])) == 0) + { + char *start = *str; + + *str += strlen (fp_const[i]); + if (is_end_of_line[(unsigned char) **str]) + return i + 8; + *str = start; + } } - if (skip_past_comma (& str) == FAIL - || cp_reg_required_here (& str, 0) == FAIL) + /* Just because we didn't get a match doesn't mean that the constant + isn't valid, just that it is in a format that we don't + automatically recognize. Try parsing it with the standard + expression routines. */ + + memset (words, 0, MAX_LITTLENUMS * sizeof (LITTLENUM_TYPE)); + + /* Look for a raw floating point number. */ + if ((save_in = atof_ieee (*str, 'x', words)) != NULL + && is_end_of_line[(unsigned char) *save_in]) { - if (!inst.error) - inst.error = BAD_ARGS; - return; + for (i = 0; i < NUM_FLOAT_VALS; i++) + { + for (j = 0; j < MAX_LITTLENUMS; j++) + { + if (words[j] != fp_values[i][j]) + break; + } + + if (j == MAX_LITTLENUMS) + { + *str = save_in; + return i + 8; + } + } } - if (skip_past_comma (& str) == SUCCESS) + /* Try and parse a more complex expression, this will probably fail + unless the code uses a floating point prefix (eg "0f"). */ + save_in = input_line_pointer; + input_line_pointer = *str; + if (expression (&exp) == absolute_section + && exp.X_op == O_big + && exp.X_add_number < 0) { - if (cp_opc_expr (& str, 5, 3) == FAIL) + /* FIXME: 5 = X_PRECISION, should be #define'd where we can use it. + Ditto for 15. */ + if (gen_to_words (words, 5, (long) 15) == 0) { - if (!inst.error) - inst.error = BAD_ARGS; - return; + for (i = 0; i < NUM_FLOAT_VALS; i++) + { + for (j = 0; j < MAX_LITTLENUMS; j++) + { + if (words[j] != fp_values[i][j]) + break; + } + + if (j == MAX_LITTLENUMS) + { + *str = input_line_pointer; + input_line_pointer = save_in; + return i + 8; + } + } } } - end_of_line (str); + *str = input_line_pointer; + input_line_pointer = save_in; + inst.error = _("invalid FPA immediate expression"); + return FAIL; } -static void -do_bx (char * str) +/* Shift operands. */ +enum shift_kind { - int reg; + SHIFT_LSL, SHIFT_LSR, SHIFT_ASR, SHIFT_ROR, SHIFT_RRX +}; - skip_whitespace (str); +struct asm_shift_name +{ + const char *name; + enum shift_kind kind; +}; - if ((reg = reg_required_here (&str, 0)) == FAIL) - { - inst.error = BAD_ARGS; - return; - } +/* Third argument to parse_shift. */ +enum parse_shift_mode +{ + NO_SHIFT_RESTRICT, /* Any kind of shift is accepted. */ + SHIFT_IMMEDIATE, /* Shift operand must be an immediate. */ + SHIFT_LSL_OR_ASR_IMMEDIATE, /* Shift must be LSL or ASR immediate. */ + SHIFT_ASR_IMMEDIATE, /* Shift must be ASR immediate. */ + SHIFT_LSL_IMMEDIATE, /* Shift must be LSL immediate. */ +}; - /* Note - it is not illegal to do a "bx pc". Useless, but not illegal. */ - if (reg == REG_PC) - as_tsktsk (_("use of r15 in bx in ARM mode is not really useful")); +/* Parse a specifier on an ARM data processing instruction. + This has three forms: - end_of_line (str); -} + (LSL|LSR|ASL|ASR|ROR) Rs + (LSL|LSR|ASL|ASR|ROR) #imm + RRX -/* ARM v5TEJ. Jump to Jazelle code. */ + Note that ASL is assimilated to LSL in the instruction encoding, and + RRX to ROR #0 (which cannot be written as such). */ -static void -do_bxj (char * str) +static int +parse_shift (char **str, int i, enum parse_shift_mode mode) { + const struct asm_shift_name *shift_name; + enum shift_kind shift; + char *s = *str; + char *p = s; int reg; - skip_whitespace (str); + for (p = *str; ISALPHA (*p); p++) + ; - if ((reg = reg_required_here (&str, 0)) == FAIL) + if (p == *str) { - inst.error = BAD_ARGS; - return; + inst.error = _("shift expression expected"); + return FAIL; } - /* Note - it is not illegal to do a "bxj pc". Useless, but not illegal. */ - if (reg == REG_PC) - as_tsktsk (_("use of r15 in bxj is not really useful")); - - end_of_line (str); -} + shift_name = hash_find_n (arm_shift_hsh, *str, p - *str); -/* ARM V6 umaal (argument parse). */ + if (shift_name == NULL) + { + inst.error = _("shift expression expected"); + return FAIL; + } -static void -do_umaal (char * str) -{ - int rdlo, rdhi, rm, rs; + shift = shift_name->kind; - skip_whitespace (str); - if ((rdlo = reg_required_here (& str, 12)) == FAIL - || skip_past_comma (& str) == FAIL - || (rdhi = reg_required_here (& str, 16)) == FAIL - || skip_past_comma (& str) == FAIL - || (rm = reg_required_here (& str, 0)) == FAIL - || skip_past_comma (& str) == FAIL - || (rs = reg_required_here (& str, 8)) == FAIL) + switch (mode) { - inst.error = BAD_ARGS; - return; + case NO_SHIFT_RESTRICT: + case SHIFT_IMMEDIATE: break; + + case SHIFT_LSL_OR_ASR_IMMEDIATE: + if (shift != SHIFT_LSL && shift != SHIFT_ASR) + { + inst.error = _("'LSL' or 'ASR' required"); + return FAIL; + } + break; + + case SHIFT_LSL_IMMEDIATE: + if (shift != SHIFT_LSL) + { + inst.error = _("'LSL' required"); + return FAIL; + } + break; + + case SHIFT_ASR_IMMEDIATE: + if (shift != SHIFT_ASR) + { + inst.error = _("'ASR' required"); + return FAIL; + } + break; + + default: abort (); } - if (rdlo == REG_PC || rdhi == REG_PC || rm == REG_PC || rs == REG_PC) + if (shift != SHIFT_RRX) { - inst.error = BAD_PC; - return; - } + /* Whitespace can appear here if the next thing is a bare digit. */ + skip_whitespace (p); - end_of_line (str); + if (mode == NO_SHIFT_RESTRICT + && (reg = arm_reg_parse (&p, REG_TYPE_RN)) != FAIL) + { + inst.operands[i].imm = reg; + inst.operands[i].immisreg = 1; + } + else if (my_get_expression (&inst.reloc.exp, &p, GE_IMM_PREFIX)) + return FAIL; + } + inst.operands[i].shift_kind = shift; + inst.operands[i].shifted = 1; + *str = p; + return SUCCESS; } -/* ARM V6 strex (argument parse). */ +/* Parse a for an ARM data processing instruction: -static void -do_strex (char * str) + # + #, + + , + + where is defined by parse_shift above, and is a + multiple of 2 between 0 and 30. Validation of immediate operands + is deferred to md_apply_fix. */ + +static int +parse_shifter_operand (char **str, int i) { - int rd, rm, rn; + int value; + expressionS expr; - /* Parse Rd, Rm,. */ - skip_whitespace (str); - if ((rd = reg_required_here (& str, 12)) == FAIL - || skip_past_comma (& str) == FAIL - || (rm = reg_required_here (& str, 0)) == FAIL - || skip_past_comma (& str) == FAIL) + if ((value = arm_reg_parse (str, REG_TYPE_RN)) != FAIL) { - inst.error = BAD_ARGS; - return; - } - if (rd == REG_PC || rm == REG_PC) - { - inst.error = BAD_PC; - return; - } - if (rd == rm) - { - inst.error = _("Rd equal to Rm or Rn yields unpredictable results"); - return; - } + inst.operands[i].reg = value; + inst.operands[i].isreg = 1; - /* Skip past '['. */ - if ((strlen (str) >= 1) - && strncmp (str, "[", 1) == 0) - str += 1; + /* parse_shift will override this if appropriate */ + inst.reloc.exp.X_op = O_constant; + inst.reloc.exp.X_add_number = 0; - skip_whitespace (str); + if (skip_past_comma (str) == FAIL) + return SUCCESS; - /* Parse Rn. */ - if ((rn = reg_required_here (& str, 16)) == FAIL) - { - inst.error = BAD_ARGS; - return; - } - else if (rn == REG_PC) - { - inst.error = BAD_PC; - return; + /* Shift operation on register. */ + return parse_shift (str, i, NO_SHIFT_RESTRICT); } - if (rd == rn) + + if (my_get_expression (&inst.reloc.exp, str, GE_IMM_PREFIX)) + return FAIL; + + if (skip_past_comma (str) == SUCCESS) { - inst.error = _("Rd equal to Rm or Rn yields unpredictable results"); - return; - } - skip_whitespace (str); + /* #x, y -- ie explicit rotation by Y. */ + if (my_get_expression (&expr, str, GE_NO_PREFIX)) + return FAIL; - /* Skip past ']'. */ - if ((strlen (str) >= 1) - && strncmp (str, "]", 1) == 0) - str += 1; + if (expr.X_op != O_constant || inst.reloc.exp.X_op != O_constant) + { + inst.error = _("constant expression expected"); + return FAIL; + } + + value = expr.X_add_number; + if (value < 0 || value > 30 || value % 2 != 0) + { + inst.error = _("invalid rotation"); + return FAIL; + } + if (inst.reloc.exp.X_add_number < 0 || inst.reloc.exp.X_add_number > 255) + { + inst.error = _("invalid constant"); + return FAIL; + } - end_of_line (str); + /* Convert to decoded value. md_apply_fix will put it back. */ + inst.reloc.exp.X_add_number + = (((inst.reloc.exp.X_add_number << (32 - value)) + | (inst.reloc.exp.X_add_number >> value)) & 0xffffffff); + } + + inst.reloc.type = BFD_RELOC_ARM_IMMEDIATE; + inst.reloc.pc_rel = 0; + return SUCCESS; } -/* KIND indicates what kind of shifts are accepted. */ +/* Parse all forms of an ARM address expression. Information is written + to inst.operands[i] and/or inst.reloc. -static int -decode_shift (char ** str, int kind) -{ - const struct asm_shift_name * shift; - char * p; - char c; + Preindexed addressing (.preind=1): - skip_whitespace (* str); + [Rn, #offset] .reg=Rn .reloc.exp=offset + [Rn, +/-Rm] .reg=Rn .imm=Rm .immisreg=1 .negative=0/1 + [Rn, +/-Rm, shift] .reg=Rn .imm=Rm .immisreg=1 .negative=0/1 + .shift_kind=shift .reloc.exp=shift_imm - for (p = * str; ISALPHA (* p); p ++) - ; + These three may have a trailing ! which causes .writeback to be set also. - if (p == * str) - { - inst.error = _("shift expression expected"); - return FAIL; - } + Postindexed addressing (.postind=1, .writeback=1): - c = * p; - * p = '\0'; - shift = (const struct asm_shift_name *) hash_find (arm_shift_hsh, * str); - * p = c; + [Rn], #offset .reg=Rn .reloc.exp=offset + [Rn], +/-Rm .reg=Rn .imm=Rm .immisreg=1 .negative=0/1 + [Rn], +/-Rm, shift .reg=Rn .imm=Rm .immisreg=1 .negative=0/1 + .shift_kind=shift .reloc.exp=shift_imm - if (shift == NULL) - { - inst.error = _("shift expression expected"); - return FAIL; - } + Unindexed addressing (.preind=0, .postind=0): - assert (shift->properties->index == shift_properties[shift->properties->index].index); + [Rn], {option} .reg=Rn .imm=option .immisreg=0 - if (kind == SHIFT_LSL_OR_ASR_IMMEDIATE - && shift->properties->index != SHIFT_LSL - && shift->properties->index != SHIFT_ASR) - { - inst.error = _("'LSL' or 'ASR' required"); - return FAIL; - } - else if (kind == SHIFT_LSL_IMMEDIATE - && shift->properties->index != SHIFT_LSL) + Other: + + [Rn]{!} shorthand for [Rn,#0]{!} + =immediate .isreg=0 .reloc.exp=immediate + label .reg=PC .reloc.pc_rel=1 .reloc.exp=label + + It is the caller's responsibility to check for addressing modes not + supported by the instruction, and to set inst.reloc.type. */ + +static int +parse_address (char **str, int i) +{ + char *p = *str; + int reg; + + if (skip_past_char (&p, '[') == FAIL) { - inst.error = _("'LSL' required"); - return FAIL; + if (skip_past_char (&p, '=') == FAIL) + { + /* bare address - translate to PC-relative offset */ + inst.reloc.pc_rel = 1; + inst.operands[i].reg = REG_PC; + inst.operands[i].isreg = 1; + inst.operands[i].preind = 1; + } + /* else a load-constant pseudo op, no special treatment needed here */ + + if (my_get_expression (&inst.reloc.exp, &p, GE_NO_PREFIX)) + return FAIL; + + *str = p; + return SUCCESS; } - else if (kind == SHIFT_ASR_IMMEDIATE - && shift->properties->index != SHIFT_ASR) + + if ((reg = arm_reg_parse (&p, REG_TYPE_RN)) == FAIL) { - inst.error = _("'ASR' required"); + inst.error = _(reg_expected_msgs[REG_TYPE_RN]); return FAIL; } + inst.operands[i].reg = reg; + inst.operands[i].isreg = 1; - if (shift->properties->index == SHIFT_RRX) + if (skip_past_comma (&p) == SUCCESS) { - * str = p; - inst.instruction |= shift->properties->bit_field; - return SUCCESS; - } + inst.operands[i].preind = 1; - skip_whitespace (p); + if (*p == '+') p++; + else if (*p == '-') p++, inst.operands[i].negative = 1; - if (kind == NO_SHIFT_RESTRICT && reg_required_here (& p, 8) != FAIL) - { - inst.instruction |= shift->properties->bit_field | SHIFT_BY_REG; - * str = p; - return SUCCESS; + if ((reg = arm_reg_parse (&p, REG_TYPE_RN)) != FAIL) + { + inst.operands[i].imm = reg; + inst.operands[i].immisreg = 1; + + if (skip_past_comma (&p) == SUCCESS) + if (parse_shift (&p, i, SHIFT_IMMEDIATE) == FAIL) + return FAIL; + } + else + { + if (inst.operands[i].negative) + { + inst.operands[i].negative = 0; + p--; + } + if (my_get_expression (&inst.reloc.exp, &p, GE_IMM_PREFIX)) + return FAIL; + } } - else if (! is_immediate_prefix (* p)) + + if (skip_past_char (&p, ']') == FAIL) { - inst.error = (NO_SHIFT_RESTRICT - ? _("shift requires register or #expression") - : _("shift requires #expression")); - * str = p; + inst.error = _("']' expected"); return FAIL; } - inst.error = NULL; - p ++; - - if (my_get_expression (& inst.reloc.exp, & p)) - return FAIL; + if (skip_past_char (&p, '!') == SUCCESS) + inst.operands[i].writeback = 1; - /* Validate some simple #expressions. */ - if (inst.reloc.exp.X_op == O_constant) + else if (skip_past_comma (&p) == SUCCESS) { - unsigned num = inst.reloc.exp.X_add_number; + if (skip_past_char (&p, '{') == SUCCESS) + { + /* [Rn], {expr} - unindexed, with option */ + if (parse_immediate (&p, &inst.operands[i].imm, + 0, 255, TRUE) == FAIL) + return FAIL; - /* Reject operations greater than 32. */ - if (num > 32 - /* Reject a shift of 0 unless the mode allows it. */ - || (num == 0 && shift->properties->allows_0 == 0) - /* Reject a shift of 32 unless the mode allows it. */ - || (num == 32 && shift->properties->allows_32 == 0) - ) - { - /* As a special case we allow a shift of zero for - modes that do not support it to be recoded as an - logical shift left of zero (ie nothing). We warn - about this though. */ - if (num == 0) - { - as_warn (_("shift of 0 ignored.")); - shift = & shift_names[0]; - assert (shift->properties->index == SHIFT_LSL); + if (skip_past_char (&p, '}') == FAIL) + { + inst.error = _("'}' expected at end of 'option' field"); + return FAIL; } - else + if (inst.operands[i].preind) { - inst.error = _("invalid immediate shift"); + inst.error = _("cannot combine index with option"); return FAIL; } + *str = p; + return SUCCESS; } + else + { + inst.operands[i].postind = 1; + inst.operands[i].writeback = 1; - /* Shifts of 32 are encoded as 0, for those shifts that - support it. */ - if (num == 32) - num = 0; + if (inst.operands[i].preind) + { + inst.error = _("cannot combine pre- and post-indexing"); + return FAIL; + } - inst.instruction |= (num << 7) | shift->properties->bit_field; - } - else - { - inst.reloc.type = BFD_RELOC_ARM_SHIFT_IMM; - inst.reloc.pc_rel = 0; - inst.instruction |= shift->properties->bit_field; + if (*p == '+') p++; + else if (*p == '-') p++, inst.operands[i].negative = 1; + + if ((reg = arm_reg_parse (&p, REG_TYPE_RN)) != FAIL) + { + inst.operands[i].imm = reg; + inst.operands[i].immisreg = 1; + + if (skip_past_comma (&p) == SUCCESS) + if (parse_shift (&p, i, SHIFT_IMMEDIATE) == FAIL) + return FAIL; + } + else + { + if (inst.operands[i].negative) + { + inst.operands[i].negative = 0; + p--; + } + if (my_get_expression (&inst.reloc.exp, &p, GE_IMM_PREFIX)) + return FAIL; + } + } } - * str = p; + /* If at this point neither .preind nor .postind is set, we have a + bare [Rn]{!}, which is shorthand for [Rn,#0]{!}. */ + if (inst.operands[i].preind == 0 && inst.operands[i].postind == 0) + { + inst.operands[i].preind = 1; + inst.reloc.exp.X_op = O_constant; + inst.reloc.exp.X_add_number = 0; + } + *str = p; return SUCCESS; } -static void -do_sat (char ** str, int bias) +/* Miscellaneous. */ + +/* Parse a PSR flag operand. The value returned is FAIL on syntax error, + or a bitmask suitable to be or-ed into the ARM msr instruction. */ +static int +parse_psr (char **str) { - int rd, rm; - expressionS expr; + char *p; + unsigned long psr_field; - skip_whitespace (*str); + /* CPSR's and SPSR's can now be lowercase. This is just a convenience + feature for ease of use and backwards compatibility. */ + p = *str; + if (*p == 's' || *p == 'S') + psr_field = SPSR_BIT; + else if (*p == 'c' || *p == 'C') + psr_field = 0; + else + goto error; + + p++; + if (strncasecmp (p, "PSR", 3) != 0) + goto error; + p += 3; + + if (*p == '_') + { + /* A suffix follows. */ + const struct asm_psr *psr; + char *start; - /* Parse , field. */ - if ((rd = reg_required_here (str, 12)) == FAIL - || skip_past_comma (str) == FAIL) - { - inst.error = BAD_ARGS; - return; - } - if (rd == REG_PC) - { - inst.error = BAD_PC; - return; - } + p++; + start = p; - /* Parse #, field. */ - if (is_immediate_prefix (**str)) - (*str)++; - else - { - inst.error = _("immediate expression expected"); - return; - } - if (my_get_expression (&expr, str)) - { - inst.error = _("bad expression"); - return; - } - if (expr.X_op != O_constant) - { - inst.error = _("constant expression expected"); - return; - } - if (expr.X_add_number + bias < 0 - || expr.X_add_number + bias > 31) - { - inst.error = _("immediate value out of range"); - return; - } - inst.instruction |= (expr.X_add_number + bias) << 16; - if (skip_past_comma (str) == FAIL) - { - inst.error = BAD_ARGS; - return; - } + do + p++; + while (ISALNUM (*p) || *p == '_'); - /* Parse field. */ - if ((rm = reg_required_here (str, 0)) == FAIL) - { - inst.error = BAD_ARGS; - return; + psr = hash_find_n (arm_psr_hsh, start, p - start); + if (!psr) + goto error; + + psr_field |= psr->field; } - if (rm == REG_PC) + else { - inst.error = BAD_PC; - return; + if (ISALNUM (*p)) + goto error; /* Garbage after "[CS]PSR". */ + + psr_field |= (PSR_c | PSR_f); } + *str = p; + return psr_field; - if (skip_past_comma (str) == SUCCESS) - decode_shift (str, SHIFT_LSL_OR_ASR_IMMEDIATE); + error: + inst.error = _("flag for {c}psr instruction expected"); + return FAIL; } -/* ARM V6 ssat (argument parse). */ +/* Parse the flags argument to CPSI[ED]. Returns FAIL on error, or a + value suitable for splatting into the AIF field of the instruction. */ -static void -do_ssat (char * str) +static int +parse_cps_flags (char **str) { - do_sat (&str, /*bias=*/-1); - end_of_line (str); -} - -/* ARM V6 usat (argument parse). */ + int val = 0; + int saw_a_flag = 0; + char *s = *str; -static void -do_usat (char * str) -{ - do_sat (&str, /*bias=*/0); - end_of_line (str); -} + for (;;) + switch (*s++) + { + case '\0': case ',': + goto done; -static void -do_sat16 (char ** str, int bias) -{ - int rd, rm; - expressionS expr; + case 'a': case 'A': saw_a_flag = 1; val |= 0x4; break; + case 'i': case 'I': saw_a_flag = 1; val |= 0x2; break; + case 'f': case 'F': saw_a_flag = 1; val |= 0x1; break; - skip_whitespace (*str); + default: + inst.error = _("unrecognized CPS flag"); + return FAIL; + } - /* Parse the field. */ - if ((rd = reg_required_here (str, 12)) == FAIL - || skip_past_comma (str) == FAIL) - { - inst.error = BAD_ARGS; - return; - } - if (rd == REG_PC) + done: + if (saw_a_flag == 0) { - inst.error = BAD_PC; - return; + inst.error = _("missing CPS flags"); + return FAIL; } - /* Parse #, field. */ - if (is_immediate_prefix (**str)) - (*str)++; + *str = s - 1; + return val; +} + +/* Parse an endian specifier ("BE" or "LE", case insensitive); + returns 0 for big-endian, 1 for little-endian, FAIL for an error. */ + +static int +parse_endian_specifier (char **str) +{ + int little_endian; + char *s = *str; + + if (strncasecmp (s, "BE", 2)) + little_endian = 0; + else if (strncasecmp (s, "LE", 2)) + little_endian = 1; else { - inst.error = _("immediate expression expected"); - return; - } - if (my_get_expression (&expr, str)) - { - inst.error = _("bad expression"); - return; - } - if (expr.X_op != O_constant) - { - inst.error = _("constant expression expected"); - return; - } - if (expr.X_add_number + bias < 0 - || expr.X_add_number + bias > 15) - { - inst.error = _("immediate value out of range"); - return; - } - inst.instruction |= (expr.X_add_number + bias) << 16; - if (skip_past_comma (str) == FAIL) - { - inst.error = BAD_ARGS; - return; + inst.error = _("valid endian specifiers are be or le"); + return FAIL; } - /* Parse field. */ - if ((rm = reg_required_here (str, 0)) == FAIL) - { - inst.error = BAD_ARGS; - return; - } - if (rm == REG_PC) + if (ISALNUM (s[2]) || s[2] == '_') { - inst.error = BAD_PC; - return; + inst.error = _("valid endian specifiers are be or le"); + return FAIL; } -} - -/* ARM V6 ssat16 (argument parse). */ -static void -do_ssat16 (char * str) -{ - do_sat16 (&str, /*bias=*/-1); - end_of_line (str); + *str = s + 2; + return little_endian; } -static void -do_usat16 (char * str) -{ - do_sat16 (&str, /*bias=*/0); - end_of_line (str); -} +/* Parse a rotation specifier: ROR #0, #8, #16, #24. *val receives a + value suitable for poking into the rotate field of an sxt or sxta + instruction, or FAIL on error. */ -static void -do_cps_mode (char ** str) +static int +parse_ror (char **str) { - expressionS expr; - - skip_whitespace (*str); - - if (! is_immediate_prefix (**str)) - { - inst.error = _("immediate expression expected"); - return; - } + int rot; + char *s = *str; - (*str)++; /* Strip off the immediate signifier. */ - if (my_get_expression (&expr, str)) + if (strncasecmp (s, "ROR", 3) == 0) + s += 3; + else { - inst.error = _("bad expression"); - return; + inst.error = _("missing rotation field after comma"); + return FAIL; } - if (expr.X_op != O_constant) - { - inst.error = _("constant expression expected"); - return; - } + if (parse_immediate (&s, &rot, 0, 24, FALSE) == FAIL) + return FAIL; - /* The mode is a 5 bit field. Valid values are 0-31. */ - if (((unsigned) expr.X_add_number) > 31 - || (inst.reloc.exp.X_add_number) < 0) + switch (rot) { - inst.error = _("invalid constant"); - return; - } - - inst.instruction |= expr.X_add_number; -} + case 0: *str = s; return 0x0; + case 8: *str = s; return 0x1; + case 16: *str = s; return 0x2; + case 24: *str = s; return 0x3; -/* ARM V6 srs (argument parse). */ - -static void -do_srs (char * str) -{ - char *exclam; - skip_whitespace (str); - exclam = strchr (str, '!'); - if (exclam) - *exclam = '\0'; - do_cps_mode (&str); - if (exclam) - *exclam = '!'; - if (*str == '!') - { - inst.instruction |= WRITE_BACK; - str++; + default: + inst.error = _("rotation can only be 0, 8, 16, or 24"); + return FAIL; } - end_of_line (str); } -/* ARM V6 SMMUL (argument parse). */ - -static void -do_smmul (char * str) +/* Parse a conditional code (from conds[] below). The value returned is in the + range 0 .. 14, or FAIL. */ +static int +parse_cond (char **str) { - int rd, rm, rs; + char *p, *q; + const struct asm_cond *c; - skip_whitespace (str); - if ((rd = reg_required_here (&str, 16)) == FAIL - || skip_past_comma (&str) == FAIL - || (rm = reg_required_here (&str, 0)) == FAIL - || skip_past_comma (&str) == FAIL - || (rs = reg_required_here (&str, 8)) == FAIL) - { - inst.error = BAD_ARGS; - return; - } + p = q = *str; + while (ISALPHA (*q)) + q++; - if ( rd == REG_PC - || rm == REG_PC - || rs == REG_PC) + c = hash_find_n (arm_cond_hsh, p, q - p); + if (!c) { - inst.error = BAD_PC; - return; + inst.error = _("condition required"); + return FAIL; } - end_of_line (str); + *str = q; + return c->value; } -/* ARM V6 SMLALD (argument parse). */ - -static void -do_smlald (char * str) +/* Matcher codes for parse_operands. */ +enum operand_parse_code { - int rdlo, rdhi, rm, rs; + OP_stop, /* end of line */ - skip_whitespace (str); - if ((rdlo = reg_required_here (&str, 12)) == FAIL - || skip_past_comma (&str) == FAIL - || (rdhi = reg_required_here (&str, 16)) == FAIL - || skip_past_comma (&str) == FAIL - || (rm = reg_required_here (&str, 0)) == FAIL - || skip_past_comma (&str) == FAIL - || (rs = reg_required_here (&str, 8)) == FAIL) - { - inst.error = BAD_ARGS; - return; - } + OP_RR, /* ARM register */ + OP_RRnpc, /* ARM register, not r15 */ + OP_RRnpcb, /* ARM register, not r15, in square brackets */ + OP_RRw, /* ARM register, not r15, optional trailing ! */ + OP_RCP, /* Coprocessor number */ + OP_RCN, /* Coprocessor register */ + OP_RF, /* FPA register */ + OP_RVS, /* VFP single precision register */ + OP_RVD, /* VFP double precision register */ + OP_RVC, /* VFP control register */ + OP_RMF, /* Maverick F register */ + OP_RMD, /* Maverick D register */ + OP_RMFX, /* Maverick FX register */ + OP_RMDX, /* Maverick DX register */ + OP_RMAX, /* Maverick AX register */ + OP_RMDS, /* Maverick DSPSC register */ + OP_RIWR, /* iWMMXt wR register */ + OP_RIWC, /* iWMMXt wC register */ + OP_RIWG, /* iWMMXt wCG register */ + OP_RXA, /* XScale accumulator register */ + + OP_REGLST, /* ARM register list */ + OP_VRSLST, /* VFP single-precision register list */ + OP_VRDLST, /* VFP double-precision register list */ + + OP_I7, /* immediate value 0 .. 7 */ + OP_I15, /* 0 .. 15 */ + OP_I16, /* 1 .. 16 */ + OP_I31, /* 0 .. 31 */ + OP_I31w, /* 0 .. 31, optional trailing ! */ + OP_I32, /* 1 .. 32 */ + OP_I63s, /* -64 .. 63 */ + OP_I255, /* 0 .. 255 */ + OP_Iffff, /* 0 .. 65535 */ + + OP_I4b, /* immediate, prefix optional, 1 .. 4 */ + OP_I7b, /* 0 .. 7 */ + OP_I15b, /* 0 .. 15 */ + OP_I31b, /* 0 .. 31 */ + + OP_SH, /* shifter operand */ + OP_ADDR, /* Memory address expression (any mode) */ + OP_EXP, /* arbitrary expression */ + OP_EXPi, /* same, with optional immediate prefix */ + OP_EXPr, /* same, with optional relocation suffix */ + + OP_CPSF, /* CPS flags */ + OP_ENDI, /* Endianness specifier */ + OP_PSR, /* CPSR/SPSR mask for msr */ + OP_COND, /* conditional code */ + + OP_RRnpc_I0, /* ARM register or literal 0 */ + OP_RR_EXr, /* ARM register or expression with opt. reloc suff. */ + OP_RR_EXi, /* ARM register or expression with imm prefix */ + OP_RF_IF, /* FPA register or immediate */ + OP_RIWR_RIWC, /* iWMMXt R or C reg */ + + /* Optional operands. */ + OP_oI7b, /* immediate, prefix optional, 0 .. 7 */ + OP_oI31b, /* 0 .. 31 */ + OP_oIffffb, /* 0 .. 65535 */ + OP_oI255c, /* curly-brace enclosed, 0 .. 255 */ + + OP_oRR, /* ARM register */ + OP_oRRnpc, /* ARM register, not the PC */ + OP_oSHll, /* LSL immediate */ + OP_oSHar, /* ASR immediate */ + OP_oSHllar, /* LSL or ASR immediate */ + OP_oROR, /* ROR 0/8/16/24 */ + + OP_FIRST_OPTIONAL = OP_oI7b +}; + +/* Generic instruction operand parser. This does no encoding and no + semantic validation; it merely squirrels values away in the inst + structure. Returns SUCCESS or FAIL depending on whether the + specified grammar matched. */ +static int +parse_operands (char *str, const char *pattern) +{ + unsigned const char *upat = pattern; + char *backtrack_pos = 0; + const char *backtrack_error = 0; + int i, val, backtrack_index = 0; + +#define po_char_or_fail(chr) do { \ + if (skip_past_char (&str, chr) == FAIL) \ + goto bad_args; \ +} while (0) + +#define po_reg_or_fail(regtype) do { \ + val = arm_reg_parse (&str, regtype); \ + if (val == FAIL) \ + { \ + inst.error = _(reg_expected_msgs[regtype]); \ + goto failure; \ + } \ + inst.operands[i].reg = val; \ + inst.operands[i].isreg = 1; \ +} while (0) + +#define po_reg_or_goto(regtype, label) do { \ + val = arm_reg_parse (&str, regtype); \ + if (val == FAIL) \ + goto label; \ + \ + inst.operands[i].reg = val; \ + inst.operands[i].isreg = 1; \ +} while (0) + +#define po_imm_or_fail(min, max, popt) do { \ + if (parse_immediate (&str, &val, min, max, popt) == FAIL) \ + goto failure; \ + inst.operands[i].imm = val; \ +} while (0) + +#define po_misc_or_fail(expr) do { \ + if (expr) \ + goto failure; \ +} while (0) + + skip_whitespace (str); + + for (i = 0; upat[i] != OP_stop; i++) + { + if (upat[i] >= OP_FIRST_OPTIONAL) + { + /* Remember where we are in case we need to backtrack. */ + assert (!backtrack_pos); + backtrack_pos = str; + backtrack_error = inst.error; + backtrack_index = i; + } + + if (i > 0) + po_char_or_fail (','); + + switch (upat[i]) + { + /* Registers */ + case OP_oRRnpc: + case OP_RRnpc: + case OP_oRR: + case OP_RR: po_reg_or_fail (REG_TYPE_RN); break; + case OP_RCP: po_reg_or_fail (REG_TYPE_CP); break; + case OP_RCN: po_reg_or_fail (REG_TYPE_CN); break; + case OP_RF: po_reg_or_fail (REG_TYPE_FN); break; + case OP_RVS: po_reg_or_fail (REG_TYPE_VFS); break; + case OP_RVD: po_reg_or_fail (REG_TYPE_VFD); break; + case OP_RVC: po_reg_or_fail (REG_TYPE_VFC); break; + case OP_RMF: po_reg_or_fail (REG_TYPE_MVF); break; + case OP_RMD: po_reg_or_fail (REG_TYPE_MVD); break; + case OP_RMFX: po_reg_or_fail (REG_TYPE_MVFX); break; + case OP_RMDX: po_reg_or_fail (REG_TYPE_MVDX); break; + case OP_RMAX: po_reg_or_fail (REG_TYPE_MVAX); break; + case OP_RMDS: po_reg_or_fail (REG_TYPE_DSPSC); break; + case OP_RIWR: po_reg_or_fail (REG_TYPE_MMXWR); break; + case OP_RIWC: po_reg_or_fail (REG_TYPE_MMXWC); break; + case OP_RIWG: po_reg_or_fail (REG_TYPE_MMXWCG); break; + case OP_RXA: po_reg_or_fail (REG_TYPE_XSCALE); break; + + case OP_RRnpcb: + po_char_or_fail ('['); + po_reg_or_fail (REG_TYPE_RN); + po_char_or_fail (']'); + break; - if ( rdlo == REG_PC - || rdhi == REG_PC - || rm == REG_PC - || rs == REG_PC) - { - inst.error = BAD_PC; - return; - } + case OP_RRw: + po_reg_or_fail (REG_TYPE_RN); + if (skip_past_char (&str, '!') == SUCCESS) + inst.operands[i].writeback = 1; + break; - end_of_line (str); -} + /* Immediates */ + case OP_I7: po_imm_or_fail ( 0, 7, FALSE); break; + case OP_I15: po_imm_or_fail ( 0, 15, FALSE); break; + case OP_I16: po_imm_or_fail ( 1, 16, FALSE); break; + case OP_I31: po_imm_or_fail ( 0, 31, FALSE); break; + case OP_I32: po_imm_or_fail ( 1, 32, FALSE); break; + case OP_I63s: po_imm_or_fail (-64, 63, FALSE); break; + case OP_I255: po_imm_or_fail ( 0, 255, FALSE); break; + case OP_Iffff: po_imm_or_fail ( 0, 0xffff, FALSE); break; + + case OP_I4b: po_imm_or_fail ( 1, 4, TRUE); break; + case OP_oI7b: + case OP_I7b: po_imm_or_fail ( 0, 7, TRUE); break; + case OP_I15b: po_imm_or_fail ( 0, 15, TRUE); break; + case OP_oI31b: + case OP_I31b: po_imm_or_fail ( 0, 31, TRUE); break; + case OP_oIffffb: po_imm_or_fail ( 0, 0xffff, TRUE); break; + + /* Immediate variants */ + case OP_oI255c: + po_char_or_fail ('{'); + po_imm_or_fail (0, 255, TRUE); + po_char_or_fail ('}'); + break; -/* ARM V6 SMLAD (argument parse). Signed multiply accumulate dual. - smlad{x}{} Rd, Rm, Rs, Rn */ + case OP_I31w: + /* The expression parser chokes on a trailing !, so we have + to find it first and zap it. */ + { + char *s = str; + while (*s && *s != ',') + s++; + if (s[-1] == '!') + { + s[-1] = '\0'; + inst.operands[i].writeback = 1; + } + po_imm_or_fail (0, 31, TRUE); + if (str == s - 1) + str = s; + } + break; -static void -do_smlad (char * str) -{ - int rd, rm, rs, rn; + /* Expressions */ + case OP_EXPi: EXPi: + po_misc_or_fail (my_get_expression (&inst.reloc.exp, &str, + GE_OPT_PREFIX)); + break; - skip_whitespace (str); - if ((rd = reg_required_here (&str, 16)) == FAIL - || skip_past_comma (&str) == FAIL - || (rm = reg_required_here (&str, 0)) == FAIL - || skip_past_comma (&str) == FAIL - || (rs = reg_required_here (&str, 8)) == FAIL - || skip_past_comma (&str) == FAIL - || (rn = reg_required_here (&str, 12)) == FAIL) - { - inst.error = BAD_ARGS; - return; - } + case OP_EXP: + po_misc_or_fail (my_get_expression (&inst.reloc.exp, &str, + GE_NO_PREFIX)); + break; - if ( rd == REG_PC - || rn == REG_PC - || rs == REG_PC - || rm == REG_PC) - { - inst.error = BAD_PC; - return; - } + case OP_EXPr: EXPr: + po_misc_or_fail (my_get_expression (&inst.reloc.exp, &str, + GE_NO_PREFIX)); + if (inst.reloc.exp.X_op == O_symbol) + { + val = parse_reloc (&str); + if (val == -1) + { + inst.error = _("unrecognized relocation suffix"); + goto failure; + } + else if (val != BFD_RELOC_UNUSED) + { + inst.operands[i].imm = val; + inst.operands[i].hasreloc = 1; + } + } + break; - end_of_line (str); -} + /* Register or expression */ + case OP_RR_EXr: po_reg_or_goto (REG_TYPE_RN, EXPr); break; + case OP_RR_EXi: po_reg_or_goto (REG_TYPE_RN, EXPi); break; + + /* Register or immediate */ + case OP_RRnpc_I0: po_reg_or_goto (REG_TYPE_RN, I0); break; + I0: po_imm_or_fail (0, 0, FALSE); break; + + case OP_RF_IF: po_reg_or_goto (REG_TYPE_FN, IF); break; + IF: + if (!is_immediate_prefix (*str)) + goto bad_args; + str++; + val = parse_fpa_immediate (&str); + if (val == FAIL) + goto failure; + /* FPA immediates are encoded as registers 8-15. + parse_fpa_immediate has already applied the offset. */ + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + break; + + /* Two kinds of register */ + case OP_RIWR_RIWC: + { + struct reg_entry *rege = arm_reg_parse_multi (&str); + if (rege->type != REG_TYPE_MMXWR + && rege->type != REG_TYPE_MMXWC + && rege->type != REG_TYPE_MMXWCG) + { + inst.error = _("iWMMXt data or control register expected"); + goto failure; + } + inst.operands[i].reg = rege->number; + inst.operands[i].isreg = (rege->type == REG_TYPE_MMXWR); + } + break; -/* Returns true if the endian-specifier indicates big-endianness. */ + /* Misc */ + case OP_CPSF: val = parse_cps_flags (&str); break; + case OP_ENDI: val = parse_endian_specifier (&str); break; + case OP_oROR: val = parse_ror (&str); break; + case OP_PSR: val = parse_psr (&str); break; + case OP_COND: val = parse_cond (&str); break; + + /* Register lists */ + case OP_REGLST: + val = parse_reg_list (&str); + if (*str == '^') + { + inst.operands[1].writeback = 1; + str++; + } + break; -static int -do_endian_specifier (char * str) -{ - int big_endian = 0; + case OP_VRSLST: + val = parse_vfp_reg_list (&str, &inst.operands[i].reg, 0); + break; - skip_whitespace (str); - if (strlen (str) < 2) - inst.error = _("missing endian specifier"); - else if (strncasecmp (str, "BE", 2) == 0) - { - str += 2; - big_endian = 1; - } - else if (strncasecmp (str, "LE", 2) == 0) - str += 2; - else - inst.error = _("valid endian specifiers are be or le"); + case OP_VRDLST: + val = parse_vfp_reg_list (&str, &inst.operands[i].reg, 1); + break; - end_of_line (str); + /* Addressing modes */ + case OP_ADDR: + po_misc_or_fail (parse_address (&str, i)); + break; - return big_endian; -} + case OP_SH: + po_misc_or_fail (parse_shifter_operand (&str, i)); + break; -/* ARM V6 SETEND (argument parse). Sets the E bit in the CPSR while - preserving the other bits. + case OP_oSHll: + po_misc_or_fail (parse_shift (&str, i, SHIFT_LSL_IMMEDIATE)); + break; - setend , where is either - BE or LE. */ + case OP_oSHar: + po_misc_or_fail (parse_shift (&str, i, SHIFT_ASR_IMMEDIATE)); + break; -static void -do_setend (char * str) -{ - if (do_endian_specifier (str)) - inst.instruction |= 0x200; -} + case OP_oSHllar: + po_misc_or_fail (parse_shift (&str, i, SHIFT_LSL_OR_ASR_IMMEDIATE)); + break; -/* ARM V6 SXTH. + default: + as_fatal ("unhandled operand code %d", upat[i]); + } - SXTH {} , {, } - Condition defaults to COND_ALWAYS. - Error if any register uses R15. */ + /* Various value-based sanity checks and shared operations. We + do not signal immediate failures for the register constraints; + this allows a syntax error to take precedence. */ + switch (upat[i]) + { + case OP_oRRnpc: + case OP_RRnpc: + case OP_RRnpcb: + case OP_RRw: + case OP_RRnpc_I0: + if (inst.operands[i].isreg && inst.operands[i].reg == REG_PC) + inst.error = BAD_PC; + break; -static void -do_sxth (char * str) -{ - int rd, rm; - expressionS expr; - int rotation_clear_mask = 0xfffff3ff; - int rotation_eight_mask = 0x00000400; - int rotation_sixteen_mask = 0x00000800; - int rotation_twenty_four_mask = 0x00000c00; + case OP_CPSF: + case OP_ENDI: + case OP_oROR: + case OP_PSR: + case OP_COND: + case OP_REGLST: + case OP_VRSLST: + case OP_VRDLST: + if (val == FAIL) + goto failure; + inst.operands[i].imm = val; + break; - skip_whitespace (str); - if ((rd = reg_required_here (&str, 12)) == FAIL - || skip_past_comma (&str) == FAIL - || (rm = reg_required_here (&str, 0)) == FAIL) - { + default: + break; + } + + /* If we get here, this operand was successfully parsed. */ + inst.operands[i].present = 1; + continue; + + bad_args: inst.error = BAD_ARGS; - return; - } - else if (rd == REG_PC || rm == REG_PC) - { - inst.error = BAD_PC; - return; - } + failure: + if (!backtrack_pos) + return FAIL; - /* Zero out the rotation field. */ - inst.instruction &= rotation_clear_mask; + /* Do not backtrack over a trailing optional argument that + absorbed some text. We will only fail again, with the + 'garbage following instruction' error message, which is + probably less helpful than the current one. */ + if (backtrack_index == i && backtrack_pos != str + && upat[i+1] == OP_stop) + return FAIL; - /* Check for lack of optional rotation field. */ - if (skip_past_comma (&str) == FAIL) - { - end_of_line (str); - return; + /* Try again, skipping the optional argument at backtrack_pos. */ + str = backtrack_pos; + inst.error = backtrack_error; + inst.operands[backtrack_index].present = 0; + i = backtrack_index; + backtrack_pos = 0; } - /* Move past 'ROR'. */ - skip_whitespace (str); - if (strncasecmp (str, "ROR", 3) == 0) - str += 3; - else - { - inst.error = _("missing rotation field after comma"); - return; - } + /* Check that we have parsed all the arguments. */ + if (*str != '\0' && !inst.error) + inst.error = _("garbage following instruction"); - /* Get the immediate constant. */ - skip_whitespace (str); - if (is_immediate_prefix (* str)) - str++; - else - { - inst.error = _("immediate expression expected"); - return; - } + return inst.error ? FAIL : SUCCESS; +} - if (my_get_expression (&expr, &str)) - { - inst.error = _("bad expression"); - return; - } +#undef po_char_or_fail +#undef po_reg_or_fail +#undef po_reg_or_goto +#undef po_imm_or_fail + +/* Shorthand macro for instruction encoding functions issuing errors. */ +#define constraint(expr, err) do { \ + if (expr) \ + { \ + inst.error = err; \ + return; \ + } \ +} while (0) + +/* Functions for operand encoding. ARM, then Thumb. */ + +#define rotate_left(v, n) (v << n | v >> (32 - n)) + +/* If VAL can be encoded in the immediate field of an ARM instruction, + return the encoded form. Otherwise, return FAIL. */ + +static unsigned int +encode_arm_immediate (unsigned int val) +{ + unsigned int a, i; - if (expr.X_op != O_constant) + for (i = 0; i < 32; i += 2) + if ((a = rotate_left (val, i)) <= 0xff) + return a | (i << 7); /* 12-bit pack: [shift-cnt,const]. */ + + return FAIL; +} + +/* If VAL can be encoded in the immediate field of a Thumb32 instruction, + return the encoded form. Otherwise, return FAIL. */ +static unsigned int +encode_thumb32_immediate (unsigned int val) +{ + unsigned int a, i; + + if (val <= 255) + return val; + + for (i = 0; i < 32; i++) { - inst.error = _("constant expression expected"); - return; + a = rotate_left (val, i); + if (a >= 128 && a <= 255) + return (a & 0x7f) | (i << 7); } - switch (expr.X_add_number) + a = val & 0xff; + if (val == ((a << 16) | a)) + return 0x100 | a; + if (val == ((a << 24) | (a << 16) | (a << 8) | a)) + return 0x300 | a; + + a = val & 0xff00; + if (val == ((a << 16) | a)) + return 0x200 | (a >> 8); + + return FAIL; +} +/* Encode a VFP SP register number into inst.instruction. */ + +static void +encode_arm_vfp_sp_reg (int reg, enum vfp_sp_reg_pos pos) +{ + switch (pos) { - case 0: - /* Rotation field has already been zeroed. */ - break; - case 8: - inst.instruction |= rotation_eight_mask; + case VFP_REG_Sd: + inst.instruction |= ((reg >> 1) << 12) | ((reg & 1) << 22); break; - case 16: - inst.instruction |= rotation_sixteen_mask; + case VFP_REG_Sn: + inst.instruction |= ((reg >> 1) << 16) | ((reg & 1) << 7); break; - case 24: - inst.instruction |= rotation_twenty_four_mask; + case VFP_REG_Sm: + inst.instruction |= ((reg >> 1) << 0) | ((reg & 1) << 5); break; default: - inst.error = _("rotation can be 8, 16, 24 or 0 when field is ommited"); - break; + abort (); } - - end_of_line (str); } -/* ARM V6 SXTAH extracts a 16-bit value from a register, sign - extends it to 32-bits, and adds the result to a value in another - register. You can specify a rotation by 0, 8, 16, or 24 bits - before extracting the 16-bit value. - SXTAH{} , , {, } - Condition defaults to COND_ALWAYS. - Error if any register uses R15. */ - +/* Encode a in an ARM-format instruction. The immediate, + if any, is handled by md_apply_fix. */ static void -do_sxtah (char * str) +encode_arm_shift (int i) { - int rd, rn, rm; - expressionS expr; - int rotation_clear_mask = 0xfffff3ff; - int rotation_eight_mask = 0x00000400; - int rotation_sixteen_mask = 0x00000800; - int rotation_twenty_four_mask = 0x00000c00; - - skip_whitespace (str); - if ((rd = reg_required_here (&str, 12)) == FAIL - || skip_past_comma (&str) == FAIL - || (rn = reg_required_here (&str, 16)) == FAIL - || skip_past_comma (&str) == FAIL - || (rm = reg_required_here (&str, 0)) == FAIL) + if (inst.operands[i].shift_kind == SHIFT_RRX) + inst.instruction |= SHIFT_ROR << 5; + else { - inst.error = BAD_ARGS; - return; + inst.instruction |= inst.operands[i].shift_kind << 5; + if (inst.operands[i].immisreg) + { + inst.instruction |= SHIFT_BY_REG; + inst.instruction |= inst.operands[i].imm << 8; + } + else + inst.reloc.type = BFD_RELOC_ARM_SHIFT_IMM; } +} - else if (rd == REG_PC || rn == REG_PC || rm == REG_PC) +static void +encode_arm_shifter_operand (int i) +{ + if (inst.operands[i].isreg) { - inst.error = BAD_PC; - return; + inst.instruction |= inst.operands[i].reg; + encode_arm_shift (i); } + else + inst.instruction |= INST_IMMEDIATE; +} - /* Zero out the rotation field. */ - inst.instruction &= rotation_clear_mask; +/* Subroutine of encode_arm_addr_mode_2 and encode_arm_addr_mode_3. */ +static void +encode_arm_addr_mode_common (int i, bfd_boolean is_t) +{ + assert (inst.operands[i].isreg); + inst.instruction |= inst.operands[i].reg << 16; - /* Check for lack of optional rotation field. */ - if (skip_past_comma (&str) == FAIL) + if (inst.operands[i].preind) { - end_of_line (str); - return; - } + if (is_t) + { + inst.error = _("instruction does not accept preindexed addressing"); + return; + } + inst.instruction |= PRE_INDEX; + if (inst.operands[i].writeback) + inst.instruction |= WRITE_BACK; - /* Move past 'ROR'. */ - skip_whitespace (str); - if (strncasecmp (str, "ROR", 3) == 0) - str += 3; - else - { - inst.error = _("missing rotation field after comma"); - return; } - - /* Get the immediate constant. */ - skip_whitespace (str); - if (is_immediate_prefix (* str)) - str++; - else + else if (inst.operands[i].postind) { - inst.error = _("immediate expression expected"); - return; + assert (inst.operands[i].writeback); + if (is_t) + inst.instruction |= WRITE_BACK; } - - if (my_get_expression (&expr, &str)) + else /* unindexed - only for coprocessor */ { - inst.error = _("bad expression"); + inst.error = _("instruction does not accept unindexed addressing"); return; } - if (expr.X_op != O_constant) + if (((inst.instruction & WRITE_BACK) || !(inst.instruction & PRE_INDEX)) + && (((inst.instruction & 0x000f0000) >> 16) + == ((inst.instruction & 0x0000f000) >> 12))) + as_warn ((inst.instruction & LOAD_BIT) + ? _("destination register same as write-back base") + : _("source register same as write-back base")); +} + +/* inst.operands[i] was set up by parse_address. Encode it into an + ARM-format mode 2 load or store instruction. If is_t is true, + reject forms that cannot be used with a T instruction (i.e. not + post-indexed). */ +static void +encode_arm_addr_mode_2 (int i, bfd_boolean is_t) +{ + encode_arm_addr_mode_common (i, is_t); + + if (inst.operands[i].immisreg) { - inst.error = _("constant expression expected"); - return; + inst.instruction |= INST_IMMEDIATE; /* yes, this is backwards */ + inst.instruction |= inst.operands[i].imm; + if (!inst.operands[i].negative) + inst.instruction |= INDEX_UP; + if (inst.operands[i].shifted) + { + if (inst.operands[i].shift_kind == SHIFT_RRX) + inst.instruction |= SHIFT_ROR << 5; + else + { + inst.instruction |= inst.operands[i].shift_kind << 5; + inst.reloc.type = BFD_RELOC_ARM_SHIFT_IMM; + } + } } - - switch (expr.X_add_number) + else /* immediate offset in inst.reloc */ { - case 0: - /* Rotation field has already been zeroed. */ - break; - - case 8: - inst.instruction |= rotation_eight_mask; - break; - - case 16: - inst.instruction |= rotation_sixteen_mask; - break; - - case 24: - inst.instruction |= rotation_twenty_four_mask; - break; - - default: - inst.error = _("rotation can be 8, 16, 24 or 0 when field is ommited"); - break; + if (inst.reloc.type == BFD_RELOC_UNUSED) + inst.reloc.type = BFD_RELOC_ARM_OFFSET_IMM; + if (inst.reloc.pc_rel) + inst.reloc.exp.X_add_number -= 8; /* pipeline offset */ } - - end_of_line (str); } - -/* ARM V6 RFE (Return from Exception) loads the PC and CPSR from the - word at the specified address and the following word - respectively. - Unconditionally executed. - Error if Rn is R15. */ - +/* inst.operands[i] was set up by parse_address. Encode it into an + ARM-format mode 3 load or store instruction. Reject forms that + cannot be used with such instructions. If is_t is true, reject + forms that cannot be used with a T instruction (i.e. not + post-indexed). */ static void -do_rfe (char * str) +encode_arm_addr_mode_3 (int i, bfd_boolean is_t) { - int rn; - - skip_whitespace (str); - - if ((rn = reg_required_here (&str, 16)) == FAIL) - return; - - if (rn == REG_PC) + if (inst.operands[i].immisreg && inst.operands[i].shifted) { - inst.error = BAD_PC; + inst.error = _("instruction does not accept scaled register index"); return; } - skip_whitespace (str); + encode_arm_addr_mode_common (i, is_t); - if (*str == '!') + if (inst.operands[i].immisreg) { - inst.instruction |= WRITE_BACK; - str++; + inst.instruction |= inst.operands[i].imm; + if (!inst.operands[i].negative) + inst.instruction |= INDEX_UP; + } + else /* immediate offset in inst.reloc */ + { + inst.instruction |= HWOFFSET_IMM; + if (inst.reloc.type == BFD_RELOC_UNUSED) + inst.reloc.type = BFD_RELOC_ARM_OFFSET_IMM8; + if (inst.reloc.pc_rel) + inst.reloc.exp.X_add_number -= 8; /* pipeline offset */ } - end_of_line (str); } -/* ARM V6 REV (Byte Reverse Word) reverses the byte order in a 32-bit - register (argument parse). - REV{} Rd, Rm. - Condition defaults to COND_ALWAYS. - Error if Rd or Rm are R15. */ +/* inst.operands[i] was set up by parse_address. Encode it into an + ARM-format instruction. Reject all forms which cannot be encoded + into a coprocessor load/store instruction. If wb_ok is false, + reject use of writeback; if unind_ok is false, reject use of + unindexed addressing. If reloc_override is not 0, use it instead + of BFD_ARM_CP_OFF_IMM. */ -static void -do_rev (char * str) +static int +encode_arm_cp_address (int i, int wb_ok, int unind_ok, int reloc_override) { - int rd, rm; + inst.instruction |= inst.operands[i].reg << 16; - skip_whitespace (str); + assert (!(inst.operands[i].preind && inst.operands[i].postind)); + + if (!inst.operands[i].preind && !inst.operands[i].postind) /* unindexed */ + { + assert (!inst.operands[i].writeback); + if (!unind_ok) + { + inst.error = _("instruction does not support unindexed addressing"); + return FAIL; + } + inst.instruction |= inst.operands[i].imm; + inst.instruction |= INDEX_UP; + return SUCCESS; + } - if ((rd = reg_required_here (&str, 12)) == FAIL - || skip_past_comma (&str) == FAIL - || (rm = reg_required_here (&str, 0)) == FAIL) - inst.error = BAD_ARGS; + if (inst.operands[i].preind) + inst.instruction |= PRE_INDEX; - else if (rd == REG_PC || rm == REG_PC) - inst.error = BAD_PC; + if (inst.operands[i].writeback) + { + if (inst.operands[i].reg == REG_PC) + { + inst.error = _("pc may not be used with write-back"); + return FAIL; + } + if (!wb_ok) + { + inst.error = _("instruction does not support writeback"); + return FAIL; + } + inst.instruction |= WRITE_BACK; + } + if (reloc_override) + inst.reloc.type = reloc_override; else - end_of_line (str); + inst.reloc.type = BFD_RELOC_ARM_CP_OFF_IMM; + if (inst.reloc.pc_rel) + inst.reloc.exp.X_add_number -= 8; + return SUCCESS; } -/* ARM V6 Perform Two Sixteen Bit Integer Additions. (argument parse). - QADD16{} , , - Condition defaults to COND_ALWAYS. - Error if Rd, Rn or Rm are R15. */ - -static void -do_qadd16 (char * str) -{ - int rd, rm, rn; - - skip_whitespace (str); - - if ((rd = reg_required_here (&str, 12)) == FAIL - || skip_past_comma (&str) == FAIL - || (rn = reg_required_here (&str, 16)) == FAIL - || skip_past_comma (&str) == FAIL - || (rm = reg_required_here (&str, 0)) == FAIL) - inst.error = BAD_ARGS; - - else if (rd == REG_PC || rm == REG_PC || rn == REG_PC) - inst.error = BAD_PC; +/* inst.reloc.exp describes an "=expr" load pseudo-operation. + Determine whether it can be performed with a move instruction; if + it can, convert inst.instruction to that move instruction and + return 1; if it can't, convert inst.instruction to a literal-pool + load and return 0. If this is not a valid thing to do in the + current context, set inst.error and return 1. - else - end_of_line (str); -} + inst.operands[i] describes the destination register. */ -static void -do_pkh_core (char * str, int shift) +static int +move_or_literal_pool (int i, bfd_boolean thumb_p, bfd_boolean mode_3) { - int rd, rn, rm; - - skip_whitespace (str); - if (((rd = reg_required_here (&str, 12)) == FAIL) - || (skip_past_comma (&str) == FAIL) - || ((rn = reg_required_here (&str, 16)) == FAIL) - || (skip_past_comma (&str) == FAIL) - || ((rm = reg_required_here (&str, 0)) == FAIL)) + if ((inst.instruction & (thumb_p ? THUMB_LOAD_BIT : LOAD_BIT)) == 0) { - inst.error = BAD_ARGS; - return; + inst.error = _("invalid pseudo operation"); + return 1; } - - else if (rd == REG_PC || rn == REG_PC || rm == REG_PC) + if (inst.reloc.exp.X_op != O_constant && inst.reloc.exp.X_op != O_symbol) { - inst.error = BAD_PC; - return; + inst.error = _("constant expression expected"); + return 1; } - - /* Check for optional shift immediate constant. */ - if (skip_past_comma (&str) == FAIL) + if (inst.reloc.exp.X_op == O_constant) { - if (shift == SHIFT_ASR_IMMEDIATE) + if (thumb_p) { - /* If the shift specifier is ommited, turn the instruction - into pkhbt rd, rm, rn. First, switch the instruction - code, and clear the rn and rm fields. */ - inst.instruction &= 0xfff0f010; - /* Now, re-encode the registers. */ - inst.instruction |= (rm << 16) | rn; + if ((inst.reloc.exp.X_add_number & ~0xFF) == 0) + { + /* This can be done with a mov(1) instruction. */ + inst.instruction = T_OPCODE_MOV_I8 | (inst.operands[i].reg << 8); + inst.instruction |= inst.reloc.exp.X_add_number; + return 1; + } + } + else + { + int value = encode_arm_immediate (inst.reloc.exp.X_add_number); + if (value != FAIL) + { + /* This can be done with a mov instruction. */ + inst.instruction &= LITERAL_MASK; + inst.instruction |= INST_IMMEDIATE | (OPCODE_MOV << DATA_OP_SHIFT); + inst.instruction |= value & 0xfff; + return 1; + } + + value = encode_arm_immediate (~inst.reloc.exp.X_add_number); + if (value != FAIL) + { + /* This can be done with a mvn instruction. */ + inst.instruction &= LITERAL_MASK; + inst.instruction |= INST_IMMEDIATE | (OPCODE_MVN << DATA_OP_SHIFT); + inst.instruction |= value & 0xfff; + return 1; + } } - return; } - decode_shift (&str, shift); + if (add_to_lit_pool () == FAIL) + { + inst.error = _("literal pool insertion failed"); + return 1; + } + inst.operands[1].reg = REG_PC; + inst.operands[1].isreg = 1; + inst.operands[1].preind = 1; + inst.reloc.pc_rel = 1; + inst.reloc.type = (thumb_p + ? BFD_RELOC_ARM_THUMB_OFFSET + : (mode_3 + ? BFD_RELOC_ARM_HWLITERAL + : BFD_RELOC_ARM_LITERAL)); + return 0; } -/* ARM V6 Pack Halfword Bottom Top instruction (argument parse). - PKHBT {} , , {, LSL #} - Condition defaults to COND_ALWAYS. - Error if Rd, Rn or Rm are R15. */ +/* Functions for instruction encoding, sorted by subarchitecture. + First some generics; their names are taken from the conventional + bit positions for register arguments in ARM format instructions. */ static void -do_pkhbt (char * str) +do_noargs (void) { - do_pkh_core (str, SHIFT_LSL_IMMEDIATE); } -/* ARM V6 PKHTB (Argument Parse). */ - static void -do_pkhtb (char * str) +do_rd (void) { - do_pkh_core (str, SHIFT_ASR_IMMEDIATE); + inst.instruction |= inst.operands[0].reg << 12; } -/* ARM V6 Load Register Exclusive instruction (argument parse). - LDREX{,B,D,H}{} ] - Condition defaults to COND_ALWAYS. - Error if Rd or Rn are R15. - See ARMARMv6 A4.1.27: LDREX. */ - static void -do_ldrex (char * str) +do_rd_rm (void) { - int rd, rn; - - skip_whitespace (str); - - /* Parse Rd. */ - if (((rd = reg_required_here (&str, 12)) == FAIL) - || (skip_past_comma (&str) == FAIL)) - { - inst.error = BAD_ARGS; - return; - } - else if (rd == REG_PC) - { - inst.error = BAD_PC; - return; - } - skip_whitespace (str); - - /* Skip past '['. */ - if ((strlen (str) >= 1) - &&strncmp (str, "[", 1) == 0) - str += 1; - skip_whitespace (str); + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg; +} - /* Parse Rn. */ - if ((rn = reg_required_here (&str, 16)) == FAIL) - { - inst.error = BAD_ARGS; - return; - } - else if (rn == REG_PC) - { - inst.error = BAD_PC; - return; - } - skip_whitespace (str); +static void +do_rd_rn (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; +} - /* Skip past ']'. */ - if ((strlen (str) >= 1) - && strncmp (str, "]", 1) == 0) - str += 1; +static void +do_rn_rd (void) +{ + inst.instruction |= inst.operands[0].reg << 16; + inst.instruction |= inst.operands[1].reg << 12; +} - end_of_line (str); +static void +do_rd_rm_rn (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg; + inst.instruction |= inst.operands[2].reg << 16; } -/* ARM V6 change processor state instruction (argument parse) - CPS, CPSIE, CSPID . */ +static void +do_rd_rn_rm (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[2].reg; +} static void -do_cps (char * str) +do_rm_rd_rn (void) { - do_cps_mode (&str); - end_of_line (str); + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[1].reg << 12; + inst.instruction |= inst.operands[2].reg << 16; } static void -do_cps_flags (char ** str, int thumb_p) +do_imm0 (void) { - struct cps_flag - { - char character; - unsigned long arm_value; - unsigned long thumb_value; - }; - static struct cps_flag flag_table[] = - { - {'a', 0x100, 0x4 }, - {'i', 0x080, 0x2 }, - {'f', 0x040, 0x1 } - }; + inst.instruction |= inst.operands[0].imm; +} - int saw_a_flag = 0; +static void +do_rd_cpaddr (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + encode_arm_cp_address (1, TRUE, TRUE, 0); +} - skip_whitespace (*str); +/* ARM instructions, in alphabetical order by function name (except + that wrapper functions appear immediately after the function they + wrap). */ - /* Get the a, f and i flags. */ - while (**str && **str != ',') - { - struct cps_flag *p; - struct cps_flag *q = flag_table + sizeof (flag_table)/sizeof (*p); +/* 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". */ - for (p = flag_table; p < q; ++p) - if (strncasecmp (*str, &p->character, 1) == 0) - { - inst.instruction |= (thumb_p ? p->thumb_value : p->arm_value); - saw_a_flag = 1; - break; - } - if (p == q) - { - inst.error = _("unrecognized flag"); - return; - } - (*str)++; - } +static void +do_adr (void) +{ + inst.instruction |= (inst.operands[0].reg << 12); /* Rd */ - if (!saw_a_flag) - inst.error = _("no 'a', 'i', or 'f' flags for 'cps'"); + /* Frag hacking will turn this into a sub instruction if the offset turns + out to be negative. */ + inst.reloc.type = BFD_RELOC_ARM_IMMEDIATE; +#ifndef TE_WINCE + inst.reloc.exp.X_add_number -= 8; /* PC relative adjust. */ +#endif + inst.reloc.pc_rel = 1; } +/* This is a pseudo-op of the form "adrl rd, label" to be converted + into a relative address of the form: + add rd, pc, #low(label-.-8)" + add rd, rd, #high(label-.-8)" */ + static void -do_cpsi (char * str) +do_adrl (void) { - do_cps_flags (&str, /*thumb_p=*/0); + inst.instruction |= (inst.operands[0].reg << 12); /* Rd */ - if (skip_past_comma (&str) == SUCCESS) - { - skip_whitespace (str); - do_cps_mode (&str); - } - end_of_line (str); + /* Frag hacking will turn this into a sub instruction if the offset turns + out to be negative. */ + inst.reloc.type = BFD_RELOC_ARM_ADRL_IMMEDIATE; +#ifndef TE_WINCE + inst.reloc.exp.X_add_number -= 8; /* PC relative adjust */ +#endif + inst.reloc.pc_rel = 1; + inst.size = INSN_SIZE * 2; } -/* ARM V6T2 bitfield manipulation instructions. */ - -static int -five_bit_unsigned_immediate (char **str) +static void +do_arit (void) { - expressionS expr; + if (!inst.operands[1].present) + inst.operands[1].reg = inst.operands[0].reg; + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; + encode_arm_shifter_operand (2); +} - skip_whitespace (*str); - if (!is_immediate_prefix (**str)) - { - inst.error = _("immediate expression expected"); - return -1; - } - (*str)++; - if (my_get_expression (&expr, str)) - { - inst.error = _("bad expression"); - return -1; - } - if (expr.X_op != O_constant) - { - inst.error = _("constant expression expected"); - return -1; - } - if (expr.X_add_number < 0 || expr.X_add_number > 32) - { - inst.error = _("immediate value out of range"); - return -1; - } - - return expr.X_add_number; +static void +do_bfc (void) +{ + unsigned int msb = inst.operands[1].imm + inst.operands[2].imm; + constraint (msb > 32, _("bit-field extends past end of register")); + /* The instruction encoding stores the LSB and MSB, + not the LSB and width. */ + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].imm << 7; + inst.instruction |= (msb - 1) << 16; } static void -bfci_lsb_and_width (char *str) +do_bfi (void) { - int lsb, width; + unsigned int msb; - if ((lsb = five_bit_unsigned_immediate (&str)) == -1) - return; + /* #0 in second position is alternative syntax for bfc, which is + the same instruction but with REG_PC in the Rm field. */ + if (!inst.operands[1].isreg) + inst.operands[1].reg = REG_PC; - if (skip_past_comma (&str) == FAIL) - { - inst.error = BAD_ARGS; - return; - } - if ((width = five_bit_unsigned_immediate (&str)) == -1) - return; + msb = inst.operands[2].imm + inst.operands[3].imm; + constraint (msb > 32, _("bit-field extends past end of register")); + /* The instruction encoding stores the LSB and MSB, + not the LSB and width. */ + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg; + inst.instruction |= inst.operands[2].imm << 7; + inst.instruction |= (msb - 1) << 16; +} - end_of_line (str); +static void +do_bfx (void) +{ + constraint (inst.operands[2].imm + inst.operands[3].imm > 32, + _("bit-field extends past end of register")); + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg; + inst.instruction |= inst.operands[2].imm << 7; + inst.instruction |= (inst.operands[3].imm - 1) << 16; +} - if (width == 0 || lsb == 32) - { - inst.error = _("immediate value out of range"); - return; - } - else if (width + lsb > 32) - { - inst.error = _("bit-field extends past end of register"); - return; - } +/* ARM V5 breakpoint instruction (argument parse) + BKPT <16 bit unsigned immediate> + Instruction is not conditional. + The bit pattern given in insns[] has the COND_ALWAYS condition, + and it is an error if the caller tried to override that. */ + +static void +do_bkpt (void) +{ + /* Top 12 of 16 bits to bits 19:8. */ + inst.instruction |= (inst.operands[0].imm & 0xfff0) << 4; - /* Convert to LSB/MSB and write to register. */ - inst.instruction |= lsb << 7; - inst.instruction |= (width + lsb - 1) << 16; + /* Bottom 4 of 16 bits to bits 3:0. */ + inst.instruction |= inst.operands[0].imm & 0xf; } static void -do_bfc (char *str) +encode_branch (int default_reloc) { - int rd; - - /* Rd. */ - skip_whitespace (str); - if (((rd = reg_required_here (&str, 12)) == FAIL) - || (skip_past_comma (&str) == FAIL)) + if (inst.operands[0].hasreloc) { - inst.error = BAD_ARGS; - return; + constraint (inst.operands[0].imm != BFD_RELOC_ARM_PLT32, + _("the only suffix valid here is '(plt)'")); + inst.reloc.type = BFD_RELOC_ARM_PLT32; + inst.reloc.pc_rel = 0; } - else if (rd == REG_PC) + else { - inst.error = BAD_PC; - return; + inst.reloc.type = default_reloc; + inst.reloc.pc_rel = 1; } - - bfci_lsb_and_width (str); } static void -do_bfi (char *str) +do_branch (void) { - int rd, rm; + encode_branch (BFD_RELOC_ARM_PCREL_BRANCH); +} - /* Rd. */ - skip_whitespace (str); - if (((rd = reg_required_here (&str, 12)) == FAIL) - || (skip_past_comma (&str) == FAIL)) - { - inst.error = BAD_ARGS; - return; - } - else if (rd == REG_PC) - { - inst.error = BAD_PC; - return; - } +/* ARM V5 branch-link-exchange instruction (argument parse) + BLX ie BLX(1) + BLX{} ie BLX(2) + Unfortunately, there are two different opcodes for this mnemonic. + So, the insns[].value is not used, and the code here zaps values + into inst.instruction. + Also, the can be 25 bits, hence has its own reloc. */ - /* Rm. Accept #0 in this position as an alternative syntax for bfc. */ - skip_whitespace (str); - if (is_immediate_prefix (*str)) +static void +do_blx (void) +{ + if (inst.operands[0].isreg) { - expressionS expr; - str++; - if (my_get_expression (&expr, &str)) - { - inst.error = _("bad expression"); - return; - } - if (expr.X_op != O_constant) - { - inst.error = _("constant expression expected"); - return; - } - if (expr.X_add_number != 0) - { - inst.error = _("immediate value out of range"); - return; - } - inst.instruction |= 0x0000000f; /* Rm = PC -> bfc, not bfi. */ + /* Arg is a register; the opcode provided by insns[] is correct. + It is not illegal to do "blx pc", just useless. */ + if (inst.operands[0].reg == REG_PC) + as_tsktsk (_("use of r15 in blx in ARM mode is not really useful")); + + inst.instruction |= inst.operands[0].reg; } else { - if ((rm = reg_required_here (&str, 0)) == FAIL) - { - inst.error = BAD_ARGS; - return; - } - else if (rm == REG_PC) - { - inst.error = BAD_PC; - return; - } - } - if (skip_past_comma (&str) == FAIL) - { - inst.error = BAD_ARGS; - return; + /* Arg is an address; this instruction cannot be executed + conditionally, and the opcode must be adjusted. */ + constraint (inst.cond != COND_ALWAYS, BAD_COND); + inst.instruction = 0xfafffffe; + encode_branch (BFD_RELOC_ARM_PCREL_BLX); } - - bfci_lsb_and_width (str); } static void -do_bfx (char *str) +do_bx (void) { - int lsb, width; - - /* Rd. */ - skip_whitespace (str); - if (reg_required_here (&str, 12) == FAIL - || skip_past_comma (&str) == FAIL) - { - inst.error = BAD_ARGS; - return; - } + if (inst.operands[0].reg == REG_PC) + as_tsktsk (_("use of r15 in bx in ARM mode is not really useful")); - /* Rm. */ - skip_whitespace (str); - if (reg_required_here (&str, 0) == FAIL - || skip_past_comma (&str) == FAIL) - { - inst.error = BAD_ARGS; - return; - } + inst.instruction |= inst.operands[0].reg; +} - if ((lsb = five_bit_unsigned_immediate (&str)) == -1) - return; - if (skip_past_comma (&str) == FAIL) - { - inst.error = BAD_ARGS; - return; - } - if ((width = five_bit_unsigned_immediate (&str)) == -1) - return; +/* ARM v5TEJ. Jump to Jazelle code. */ - end_of_line (str); +static void +do_bxj (void) +{ + if (inst.operands[0].reg == REG_PC) + as_tsktsk (_("use of r15 in bxj is not really useful")); - if (width == 0 || lsb == 32) - { - inst.error = _("immediate value out of range"); - return; - } - else if (width + lsb > 32) - { - inst.error = _("bit-field extends past end of register"); - return; - } + inst.instruction |= inst.operands[0].reg; +} - inst.instruction |= lsb << 7; - inst.instruction |= (width - 1) << 16; +/* Co-processor data operation: + CDP{cond} , , , , {, } + CDP2 , , , , {, } */ +static void +do_cdp (void) +{ + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].imm << 20; + inst.instruction |= inst.operands[2].reg << 12; + inst.instruction |= inst.operands[3].reg << 16; + inst.instruction |= inst.operands[4].reg; + inst.instruction |= inst.operands[5].imm << 5; } static void -do_rbit (char *str) +do_cmp (void) { - /* Rd. */ - skip_whitespace (str); - if (reg_required_here (&str, 12) == FAIL - || skip_past_comma (&str) == FAIL) - { - inst.error = BAD_ARGS; - return; - } + inst.instruction |= inst.operands[0].reg << 16; + encode_arm_shifter_operand (1); +} - /* Rm. */ - skip_whitespace (str); - if (reg_required_here (&str, 0) == FAIL) - { - inst.error = BAD_ARGS; - return; - } +/* Transfer between coprocessor and ARM registers. + MRC{cond} , , , , {, } + MRC2 + MCR{cond} + MCR2 - end_of_line (str); -} + No special properties. */ -/* ARM V6T2 16-bit immediate register load: MOV[WT]{cond} Rd, #. */ static void -do_mov16 (char *str) +do_co_reg (void) { - int rd; - expressionS expr; + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].imm << 21; + inst.instruction |= inst.operands[2].reg << 12; + inst.instruction |= inst.operands[3].reg << 16; + inst.instruction |= inst.operands[4].reg; + inst.instruction |= inst.operands[5].imm << 5; +} - /* Rd. */ - skip_whitespace (str); - if (((rd = reg_required_here (&str, 12)) == FAIL) - || (skip_past_comma (&str) == FAIL)) - { - inst.error = BAD_ARGS; - return; - } - else if (rd == REG_PC) - { - inst.error = BAD_PC; - return; - } +/* Transfer between coprocessor register and pair of ARM registers. + MCRR{cond} , , , , . + MCRR2 + MRRC{cond} + MRRC2 - /* Imm16. */ - skip_whitespace (str); - if (!is_immediate_prefix (*str)) - { - inst.error = _("immediate expression expected"); - return; - } - str++; - if (my_get_expression (&expr, &str)) - { - inst.error = _("bad expression"); - return; - } - if (expr.X_op != O_constant) - { - inst.error = _("constant expression expected"); - return; - } - if (expr.X_add_number < 0 || expr.X_add_number > 65535) - { - inst.error = _("immediate value out of range"); - return; - } + Two XScale instructions are special cases of these: - end_of_line (str); + MAR{cond} acc0, , == MCRR{cond} p0, #0, , , c0 + MRA{cond} acc0, , == MRRC{cond} p0, #0, , , c0 - /* The value is in two pieces: 0:11, 16:19. */ - inst.instruction |= (expr.X_add_number & 0x00000fff); - inst.instruction |= (expr.X_add_number & 0x0000f000) << 4; + Result unpredicatable if Rd or Rn is R15. */ + +static void +do_co_reg2c (void) +{ + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].imm << 4; + inst.instruction |= inst.operands[2].reg << 12; + inst.instruction |= inst.operands[3].reg << 16; + inst.instruction |= inst.operands[4].reg; } - -/* THUMB V5 breakpoint instruction (argument parse) - BKPT . */ +static void +do_cpsi (void) +{ + inst.instruction |= inst.operands[0].imm << 6; + inst.instruction |= inst.operands[1].imm; +} static void -do_t_bkpt (char * str) +do_it (void) { - expressionS expr; - unsigned long number; + /* There is no IT instruction in ARM mode. We + process it but do not generate code for it. */ + inst.size = 0; +} - skip_whitespace (str); +static void +do_ldmstm (void) +{ + int base_reg = inst.operands[0].reg; + int range = inst.operands[1].imm; - /* Allow optional leading '#'. */ - if (is_immediate_prefix (*str)) - str ++; - - memset (& expr, '\0', sizeof (expr)); - if (my_get_expression (& expr, & str) - || (expr.X_op != O_constant - /* As a convenience we allow 'bkpt' without an operand. */ - && expr.X_op != O_absent)) - { - inst.error = _("bad expression"); - return; - } + inst.instruction |= base_reg << 16; + inst.instruction |= range; - number = expr.X_add_number; + if (inst.operands[1].writeback) + inst.instruction |= LDM_TYPE_2_OR_3; - /* Check it fits an 8 bit unsigned. */ - if (number != (number & 0xff)) + if (inst.operands[0].writeback) { - inst.error = _("immediate value out of range"); - return; + inst.instruction |= WRITE_BACK; + /* Check for unpredictable uses of writeback. */ + if (inst.instruction & LOAD_BIT) + { + /* Not allowed in LDM type 2. */ + if ((inst.instruction & LDM_TYPE_2_OR_3) + && ((range & (1 << REG_PC)) == 0)) + as_warn (_("writeback of base register is UNPREDICTABLE")); + /* Only allowed if base reg not in list for other types. */ + else if (range & (1 << base_reg)) + as_warn (_("writeback of base register when in register list is UNPREDICTABLE")); + } + else /* STM. */ + { + /* Not allowed for type 2. */ + if (inst.instruction & LDM_TYPE_2_OR_3) + as_warn (_("writeback of base register is UNPREDICTABLE")); + /* Only allowed if base reg not in list, or first in list. */ + else if ((range & (1 << base_reg)) + && (range & ((1 << base_reg) - 1))) + as_warn (_("if writeback register is in list, it must be the lowest reg in the list")); + } } +} - inst.instruction |= number; +/* ARMv5TE load-consecutive (argument parse) + Mode is like LDRH. - end_of_line (str); -} + LDRccD R, mode + STRccD R, mode. */ -#ifdef OBJ_ELF -static bfd_reloc_code_real_type -arm_parse_reloc (void) +static void +do_ldrd (void) { - char id [16]; - char * ip; - unsigned int i; - static struct - { - char * str; - int len; - bfd_reloc_code_real_type reloc; - } - reloc_map[] = - { -#define MAP(str,reloc) { str, sizeof (str) - 1, reloc } - MAP ("(got)", BFD_RELOC_ARM_GOT32), - MAP ("(gotoff)", BFD_RELOC_ARM_GOTOFF), - /* ScottB: Jan 30, 1998 - Added support for parsing "var(PLT)" - branch instructions generated by GCC for PLT relocs. */ - MAP ("(plt)", BFD_RELOC_ARM_PLT32), - MAP ("(target1)", BFD_RELOC_ARM_TARGET1), - MAP ("(sbrel)", BFD_RELOC_ARM_SBREL32), - MAP ("(target2)", BFD_RELOC_ARM_TARGET2), - MAP ("(tlsgd)", BFD_RELOC_ARM_TLS_GD32), - MAP ("(tlsldm)", BFD_RELOC_ARM_TLS_LDM32), - MAP ("(tlsldo)", BFD_RELOC_ARM_TLS_LDO32), - MAP ("(gottpoff)", BFD_RELOC_ARM_TLS_IE32), - MAP ("(tpoff)", BFD_RELOC_ARM_TLS_LE32), - { NULL, 0, BFD_RELOC_UNUSED } -#undef MAP - }; + constraint (inst.operands[0].reg % 2 != 0, + _("first destination register must be even")); + constraint (inst.operands[1].present + && inst.operands[1].reg != inst.operands[0].reg + 1, + _("can only load two consecutive registers")); + constraint (inst.operands[0].reg == REG_LR, _("r14 not allowed here")); + constraint (!inst.operands[2].isreg, _("'[' expected")); - for (i = 0, ip = input_line_pointer; - i < sizeof (id) && (ISALNUM (*ip) || ISPUNCT (*ip)); - i++, ip++) - id[i] = TOLOWER (*ip); + if (!inst.operands[1].present) + inst.operands[1].reg = inst.operands[0].reg + 1; + + if (inst.instruction & LOAD_BIT) + { + /* encode_arm_addr_mode_3 will diagnose overlap between the base + register and the first register written; we have to diagnose + overlap between the base and the second register written here. */ - for (i = 0; reloc_map[i].str; i++) - if (strncmp (id, reloc_map[i].str, reloc_map[i].len) == 0) - break; + if (inst.operands[2].reg == inst.operands[1].reg + && (inst.operands[2].writeback || inst.operands[2].postind)) + as_warn (_("base register written back, and overlaps " + "second destination register")); - input_line_pointer += reloc_map[i].len; + /* For an index-register load, the index register must not overlap the + destination (even if not write-back). */ + else if (inst.operands[2].immisreg + && (inst.operands[2].imm == inst.operands[0].reg + || inst.operands[2].imm == inst.operands[1].reg)) + as_warn (_("index register overlaps destination register")); + } - return reloc_map[i].reloc; + inst.instruction |= inst.operands[0].reg << 12; + encode_arm_addr_mode_3 (2, /*is_t=*/FALSE); } -#endif - -/* ARM V5 branch-link-exchange (argument parse) for BLX(1) only. - Expects inst.instruction is set for BLX(1). - Note: this is cloned from do_branch, and the reloc changed to be a - new one that can cope with setting one extra bit (the H bit). */ static void -do_branch25 (char * str) +do_ldrex (void) { - if (my_get_expression (& inst.reloc.exp, & str)) - return; + constraint (!inst.operands[1].isreg || !inst.operands[1].preind + || inst.operands[1].postind || inst.operands[1].writeback + || inst.operands[1].immisreg || inst.operands[1].shifted + || inst.operands[1].negative, + _("instruction does not accept this addressing mode")); -#ifdef OBJ_ELF - { - char * save_in; + constraint (inst.operands[1].reg == REG_PC, BAD_PC); - /* ScottB: February 5, 1998 */ - /* Check to see of PLT32 reloc required for the instruction. */ + constraint (inst.reloc.exp.X_op != O_constant + || inst.reloc.exp.X_add_number != 0, + _("offset must be zero in ARM encoding")); - /* arm_parse_reloc() works on input_line_pointer. - We actually want to parse the operands to the branch instruction - passed in 'str'. Save the input pointer and restore it later. */ - save_in = input_line_pointer; - input_line_pointer = str; - - if (inst.reloc.exp.X_op == O_symbol - && *str == '(' - && arm_parse_reloc () == BFD_RELOC_ARM_PLT32) - { - inst.reloc.type = BFD_RELOC_ARM_PLT32; - inst.reloc.pc_rel = 0; - /* Modify str to point to after parsed operands, otherwise - end_of_line() will complain about the (PLT) left in str. */ - str = input_line_pointer; - } - else - { - inst.reloc.type = BFD_RELOC_ARM_PCREL_BLX; - inst.reloc.pc_rel = 1; - } + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; + inst.reloc.type = BFD_RELOC_UNUSED; +} - input_line_pointer = save_in; - } -#else - inst.reloc.type = BFD_RELOC_ARM_PCREL_BLX; - inst.reloc.pc_rel = 1; -#endif /* OBJ_ELF */ +static void +do_ldrexd (void) +{ + constraint (inst.operands[0].reg % 2 != 0, + _("even register required")); + constraint (inst.operands[1].present + && inst.operands[1].reg != inst.operands[0].reg + 1, + _("can only load two consecutive registers")); + /* If op 1 were present and equal to PC, this function wouldn't + have been called in the first place. */ + constraint (inst.operands[0].reg == REG_LR, _("r14 not allowed here")); - end_of_line (str); + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[2].reg << 16; } -/* ARM V5 branch-link-exchange instruction (argument parse) - BLX ie BLX(1) - BLX{} ie BLX(2) - Unfortunately, there are two different opcodes for this mnemonic. - So, the insns[].value is not used, and the code here zaps values - into inst.instruction. - Also, the can be 25 bits, hence has its own reloc. */ +static void +do_ldst (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + if (!inst.operands[1].isreg) + if (move_or_literal_pool (0, /*thumb_p=*/FALSE, /*mode_3=*/FALSE)) + return; + encode_arm_addr_mode_2 (1, /*is_t=*/FALSE); +} static void -do_blx (char * str) +do_ldstt (void) { - char * mystr = str; - int rm; + /* ldrt/strt always use post-indexed addressing. Turn [Rn] into [Rn]! and + reject [Rn,...]. */ + if (inst.operands[1].preind) + { + constraint (inst.reloc.exp.X_op != O_constant || + inst.reloc.exp.X_add_number != 0, + _("this instruction requires a post-indexed address")); - skip_whitespace (mystr); - rm = reg_required_here (& mystr, 0); + inst.operands[1].preind = 0; + inst.operands[1].postind = 1; + inst.operands[1].writeback = 1; + } + inst.instruction |= inst.operands[0].reg << 12; + encode_arm_addr_mode_2 (1, /*is_t=*/TRUE); +} + +/* Halfword and signed-byte load/store operations. */ - /* The above may set inst.error. Ignore his opinion. */ - inst.error = 0; +static void +do_ldstv4 (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + if (!inst.operands[1].isreg) + if (move_or_literal_pool (0, /*thumb_p=*/FALSE, /*mode_3=*/TRUE)) + return; + encode_arm_addr_mode_3 (1, /*is_t=*/FALSE); +} - if (rm != FAIL) +static void +do_ldsttv4 (void) +{ + /* ldrt/strt always use post-indexed addressing. Turn [Rn] into [Rn]! and + reject [Rn,...]. */ + if (inst.operands[1].preind) { - /* Arg is a register. - Use the condition code our caller put in inst.instruction. - Pass ourselves off as a BX with a funny opcode. */ - inst.instruction |= 0x012fff30; - do_bx (str); + constraint (inst.reloc.exp.X_op != O_constant || + inst.reloc.exp.X_add_number != 0, + _("this instruction requires a post-indexed address")); + + inst.operands[1].preind = 0; + inst.operands[1].postind = 1; + inst.operands[1].writeback = 1; } - else - { - /* This must be is BLX , no condition allowed. */ - if (inst.instruction != COND_ALWAYS) - { - inst.error = BAD_COND; - return; - } + inst.instruction |= inst.operands[0].reg << 12; + encode_arm_addr_mode_3 (1, /*is_t=*/TRUE); +} - inst.instruction = 0xfafffffe; +/* Co-processor register load/store. + Format: {cond}[L] CP#,CRd,
*/ +static void +do_lstc (void) +{ + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg << 12; + encode_arm_cp_address (2, TRUE, TRUE, 0); +} + +static void +do_mlas (void) +{ + /* This restriction does not apply to mls (nor to mla in v6, but + that's hard to detect at present). */ + if (inst.operands[0].reg == inst.operands[1].reg + && !(inst.instruction & 0x00400000)) + as_tsktsk (_("rd and rm should be different in mla")); + + inst.instruction |= inst.operands[0].reg << 16; + inst.instruction |= inst.operands[1].reg; + inst.instruction |= inst.operands[2].reg << 8; + inst.instruction |= inst.operands[3].reg << 12; - /* Process like a B/BL, but with a different reloc. - Note that B/BL expecte fffffe, not 0, offset in the opcode table. */ - do_branch25 (str); - } } -/* ARM V5 Thumb BLX (argument parse) - BLX which is BLX(1) - BLX which is BLX(2) - Unfortunately, there are two different opcodes for this mnemonic. - So, the tinsns[].value is not used, and the code here zaps values - into inst.instruction. */ +static void +do_mov (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + encode_arm_shifter_operand (1); +} +/* ARM V6T2 16-bit immediate register load: MOV[WT]{cond} Rd, #. */ static void -do_t_blx (char * str) +do_mov16 (void) { - char * mystr = str; - int rm; + inst.instruction |= inst.operands[0].reg << 12; + /* The value is in two pieces: 0:11, 16:19. */ + inst.instruction |= (inst.operands[1].imm & 0x00000fff); + inst.instruction |= (inst.operands[1].imm & 0x0000f000) << 4; +} - skip_whitespace (mystr); - inst.instruction = 0x4780; +static void +do_mrs (void) +{ + /* mrs only accepts CPSR/SPSR/CPSR_all/SPSR_all. */ + constraint ((inst.operands[1].imm & (PSR_c|PSR_x|PSR_s|PSR_f)) + != (PSR_c|PSR_f), + _("'CPSR' or 'SPSR' expected")); + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= (inst.operands[1].imm & SPSR_BIT); +} - /* Note that this call is to the ARM register recognizer. BLX(2) - uses the ARM register space, not the Thumb one, so a call to - thumb_reg() would be wrong. */ - rm = reg_required_here (& mystr, 3); - inst.error = 0; +/* Two possible forms: + "{C|S}PSR_, Rm", + "{C|S}PSR_f, #expression". */ - if (rm != FAIL) - { - /* It's BLX(2). The .instruction was zapped with rm & is final. */ - inst.size = 2; - } +static void +do_msr (void) +{ + inst.instruction |= inst.operands[0].imm; + if (inst.operands[1].isreg) + inst.instruction |= inst.operands[1].reg; else { - /* No ARM register. This must be BLX(1). Change the .instruction. */ - inst.instruction = 0xf7ffeffe; - inst.size = 4; - - if (my_get_expression (& inst.reloc.exp, & mystr)) - return; - - inst.reloc.type = BFD_RELOC_THUMB_PCREL_BLX; - inst.reloc.pc_rel = 1; + inst.instruction |= INST_IMMEDIATE; + inst.reloc.type = BFD_RELOC_ARM_IMMEDIATE; + inst.reloc.pc_rel = 0; } +} - end_of_line (mystr); +static void +do_mul (void) +{ + if (!inst.operands[2].present) + inst.operands[2].reg = inst.operands[0].reg; + inst.instruction |= inst.operands[0].reg << 16; + inst.instruction |= inst.operands[1].reg; + inst.instruction |= inst.operands[2].reg << 8; + + if (inst.operands[0].reg == inst.operands[1].reg) + as_tsktsk (_("rd and rm should be different in mul")); } -/* ARM V5 breakpoint instruction (argument parse) - BKPT <16 bit unsigned immediate> - Instruction is not conditional. - The bit pattern given in insns[] has the COND_ALWAYS condition, - and it is an error if the caller tried to override that. */ +/* Long Multiply Parser + UMULL RdLo, RdHi, Rm, Rs + SMULL RdLo, RdHi, Rm, Rs + UMLAL RdLo, RdHi, Rm, Rs + SMLAL RdLo, RdHi, Rm, Rs. */ static void -do_bkpt (char * str) +do_mull (void) { - expressionS expr; - unsigned long number; + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[2].reg; + inst.instruction |= inst.operands[3].reg << 8; - skip_whitespace (str); + /* rdhi, rdlo and rm must all be different. */ + if (inst.operands[0].reg == inst.operands[1].reg + || inst.operands[0].reg == inst.operands[2].reg + || inst.operands[1].reg == inst.operands[2].reg) + as_tsktsk (_("rdhi, rdlo and rm must all be different")); +} - /* Allow optional leading '#'. */ - if (is_immediate_prefix (* str)) - str++; - - memset (& expr, '\0', sizeof (expr)); - - if (my_get_expression (& expr, & str) - || (expr.X_op != O_constant - /* As a convenience we allow 'bkpt' without an operand. */ - && expr.X_op != O_absent)) +static void +do_nop (void) +{ + if (inst.operands[0].present) { - inst.error = _("bad expression"); - return; + /* Architectural NOP hints are CPSR sets with no bits selected. */ + inst.instruction &= 0xf0000000; + inst.instruction |= 0x0320f000 + inst.operands[0].imm; } +} + +/* ARM V6 Pack Halfword Bottom Top instruction (argument parse). + PKHBT {} , , {, LSL #} + Condition defaults to COND_ALWAYS. + Error if Rd, Rn or Rm are R15. */ + +static void +do_pkhbt (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[2].reg; + if (inst.operands[3].present) + encode_arm_shift (3); +} - number = expr.X_add_number; +/* ARM V6 PKHTB (Argument Parse). */ - /* Check it fits a 16 bit unsigned. */ - if (number != (number & 0xffff)) +static void +do_pkhtb (void) +{ + if (!inst.operands[3].present) { - inst.error = _("immediate value out of range"); - return; + /* If the shift specifier is omitted, turn the instruction + into pkhbt rd, rm, rn. */ + inst.instruction &= 0xfff00010; + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg; + inst.instruction |= inst.operands[2].reg << 16; + } + else + { + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[2].reg; + encode_arm_shift (3); } +} - /* Top 12 of 16 bits to bits 19:8. */ - inst.instruction |= (number & 0xfff0) << 4; +/* ARMv5TE: Preload-Cache - /* Bottom 4 of 16 bits to bits 3:0. */ - inst.instruction |= number & 0xf; + PLD + + Syntactically, like LDR with B=1, W=0, L=1. */ + +static void +do_pld (void) +{ + constraint (!inst.operands[0].isreg, + _("'[' expected after PLD mnemonic")); + constraint (inst.operands[0].postind, + _("post-indexed expression used in preload instruction")); + constraint (inst.operands[0].writeback, + _("writeback used in preload instruction")); + constraint (!inst.operands[0].preind, + _("unindexed addressing used in preload instruction")); + inst.instruction |= inst.operands[0].reg; + encode_arm_addr_mode_2 (0, /*is_t=*/FALSE); +} - end_of_line (str); +static void +do_push_pop (void) +{ + inst.operands[1] = inst.operands[0]; + memset (&inst.operands[0], 0, sizeof inst.operands[0]); + inst.operands[0].isreg = 1; + inst.operands[0].writeback = 1; + inst.operands[0].reg = REG_SP; + do_ldmstm (); } -/* THUMB CPS instruction (argument parse). */ +/* ARM V6 RFE (Return from Exception) loads the PC and CPSR from the + word at the specified address and the following word + respectively. + Unconditionally executed. + Error if Rn is R15. */ static void -do_t_cps (char * str) +do_rfe (void) { - do_cps_flags (&str, /*thumb_p=*/1); - end_of_line (str); + inst.instruction |= inst.operands[0].reg << 16; + if (inst.operands[0].writeback) + inst.instruction |= WRITE_BACK; } -/* Parse and validate that a register is of the right form, this saves - repeated checking of this information in many similar cases. - Unlike the 32-bit case we do not insert the register into the opcode - here, since the position is often unknown until the full instruction - has been parsed. */ +/* ARM V6 ssat (argument parse). */ -static int -thumb_reg (char ** strp, int hi_lo) +static void +do_ssat (void) { - int reg; - - if ((reg = reg_required_here (strp, -1)) == FAIL) - return FAIL; + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= (inst.operands[1].imm - 1) << 16; + inst.instruction |= inst.operands[2].reg; - switch (hi_lo) - { - case THUMB_REG_LO: - if (reg > 7) - { - inst.error = _("lo register required"); - return FAIL; - } - break; + if (inst.operands[3].present) + encode_arm_shift (3); +} - case THUMB_REG_HI: - if (reg < 8) - { - inst.error = _("hi register required"); - return FAIL; - } - break; +/* ARM V6 usat (argument parse). */ - default: - break; - } +static void +do_usat (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].imm << 16; + inst.instruction |= inst.operands[2].reg; - return reg; + if (inst.operands[3].present) + encode_arm_shift (3); } +/* ARM V6 ssat16 (argument parse). */ + static void -thumb_mov_compare (char * str, int move) +do_ssat16 (void) { - int Rd, Rs = FAIL; - - skip_whitespace (str); + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= ((inst.operands[1].imm - 1) << 16); + inst.instruction |= inst.operands[2].reg; +} - if ((Rd = thumb_reg (&str, THUMB_REG_ANY)) == FAIL - || skip_past_comma (&str) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } +static void +do_usat16 (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].imm << 16; + inst.instruction |= inst.operands[2].reg; +} - if (move != THUMB_CPY && is_immediate_prefix (*str)) - { - str++; - if (my_get_expression (&inst.reloc.exp, &str)) - return; - } - else if ((Rs = thumb_reg (&str, THUMB_REG_ANY)) == FAIL) - return; +/* ARM V6 SETEND (argument parse). Sets the E bit in the CPSR while + preserving the other bits. - if (Rs != FAIL) - { - if (move != THUMB_CPY && Rs < 8 && Rd < 8) - { - if (move == THUMB_MOVE) - /* A move of two lowregs is encoded as ADD Rd, Rs, #0 - since a MOV instruction produces unpredictable results. */ - inst.instruction = T_OPCODE_ADD_I3; - else - inst.instruction = T_OPCODE_CMP_LR; - inst.instruction |= Rd | (Rs << 3); - } - else - { - if (move == THUMB_MOVE) - inst.instruction = T_OPCODE_MOV_HR; - else if (move != THUMB_CPY) - inst.instruction = T_OPCODE_CMP_HR; + setend , where is either + BE or LE. */ - if (Rd > 7) - inst.instruction |= THUMB_H1; +static void +do_setend (void) +{ + if (inst.operands[0].imm) + inst.instruction |= 0x200; +} - if (Rs > 7) - inst.instruction |= THUMB_H2; +static void +do_shift (void) +{ + unsigned int Rm = (inst.operands[1].present + ? inst.operands[1].reg + : inst.operands[0].reg); - inst.instruction |= (Rd & 7) | ((Rs & 7) << 3); - } + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= Rm; + if (inst.operands[2].isreg) /* Rd, {Rm,} Rs */ + { + constraint (inst.operands[0].reg != Rm, + _("source1 and dest must be same register")); + inst.instruction |= inst.operands[2].reg << 8; + inst.instruction |= SHIFT_BY_REG; } else - { - if (Rd > 7) - { - inst.error = _("only lo regs allowed with immediate"); - return; - } + inst.reloc.type = BFD_RELOC_ARM_SHIFT_IMM; +} - if (move == THUMB_MOVE) - inst.instruction = T_OPCODE_MOV_I8; - else - inst.instruction = T_OPCODE_CMP_I8; +static void +do_smi (void) +{ + inst.reloc.type = BFD_RELOC_ARM_SMI; + inst.reloc.pc_rel = 0; +} - inst.instruction |= Rd << 8; +static void +do_swi (void) +{ + inst.reloc.type = BFD_RELOC_ARM_SWI; + inst.reloc.pc_rel = 0; +} - if (inst.reloc.exp.X_op != O_constant) - inst.reloc.type = BFD_RELOC_ARM_THUMB_IMM; - else - { - unsigned value = inst.reloc.exp.X_add_number; +/* ARM V5E (El Segundo) signed-multiply-accumulate (argument parse) + SMLAxy{cond} Rd,Rm,Rs,Rn + SMLAWy{cond} Rd,Rm,Rs,Rn + Error if any register is R15. */ - if (value > 255) - { - inst.error = _("invalid immediate"); - return; - } +static void +do_smla (void) +{ + inst.instruction |= inst.operands[0].reg << 16; + inst.instruction |= inst.operands[1].reg; + inst.instruction |= inst.operands[2].reg << 8; + inst.instruction |= inst.operands[3].reg << 12; +} - inst.instruction |= value; - } - } +/* ARM V5E (El Segundo) signed-multiply-accumulate-long (argument parse) + SMLALxy{cond} Rdlo,Rdhi,Rm,Rs + Error if any register is R15. + Warning if Rdlo == Rdhi. */ - end_of_line (str); +static void +do_smlal (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[2].reg; + inst.instruction |= inst.operands[3].reg << 8; + + if (inst.operands[0].reg == inst.operands[1].reg) + as_tsktsk (_("rdhi and rdlo must be different")); } -/* THUMB CPY instruction (argument parse). */ +/* ARM V5E (El Segundo) signed-multiply (argument parse) + SMULxy{cond} Rd,Rm,Rs + Error if any register is R15. */ static void -do_t_cpy (char * str) +do_smul (void) { - thumb_mov_compare (str, THUMB_CPY); + inst.instruction |= inst.operands[0].reg << 16; + inst.instruction |= inst.operands[1].reg; + inst.instruction |= inst.operands[2].reg << 8; } -/* THUMB SETEND instruction (argument parse). */ +/* ARM V6 srs (argument parse). */ static void -do_t_setend (char * str) +do_srs (void) { - if (do_endian_specifier (str)) - inst.instruction |= 0x8; + inst.instruction |= inst.operands[0].imm; + if (inst.operands[0].writeback) + inst.instruction |= WRITE_BACK; } -/* Parse INSN_TYPE insn STR having a possible IMMEDIATE_SIZE immediate. */ +/* ARM V6 strex (argument parse). */ -static unsigned long -check_iwmmxt_insn (char * str, - enum iwmmxt_insn_type insn_type, - int immediate_size) +static void +do_strex (void) { - int reg = 0; - const char * inst_error; - expressionS expr; - unsigned long number; + constraint (!inst.operands[2].isreg || !inst.operands[2].preind + || inst.operands[2].postind || inst.operands[2].writeback + || inst.operands[2].immisreg || inst.operands[2].shifted + || inst.operands[2].negative, + _("instruction does not accept this addressing mode")); + + constraint (inst.operands[2].reg == REG_PC, BAD_PC); + + constraint (inst.operands[0].reg == inst.operands[1].reg + || inst.operands[0].reg == inst.operands[2].reg, BAD_OVERLAP); + + constraint (inst.reloc.exp.X_op != O_constant + || inst.reloc.exp.X_add_number != 0, + _("offset must be zero in ARM encoding")); + + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg; + inst.instruction |= inst.operands[2].reg << 16; + inst.reloc.type = BFD_RELOC_UNUSED; +} - inst_error = inst.error; - if (!inst.error) - inst.error = BAD_ARGS; - skip_whitespace (str); +static void +do_strexd (void) +{ + constraint (inst.operands[1].reg % 2 != 0, + _("even register required")); + constraint (inst.operands[2].present + && inst.operands[2].reg != inst.operands[1].reg + 1, + _("can only store two consecutive registers")); + /* If op 2 were present and equal to PC, this function wouldn't + have been called in the first place. */ + constraint (inst.operands[1].reg == REG_LR, _("r14 not allowed here")); + + constraint (inst.operands[0].reg == inst.operands[1].reg + || inst.operands[0].reg == inst.operands[1].reg + 1 + || inst.operands[0].reg == inst.operands[3].reg, + BAD_OVERLAP); + + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg; + inst.instruction |= inst.operands[3].reg << 16; +} - switch (insn_type) - { - case check_rd: - if ((reg = reg_required_here (&str, 12)) == FAIL) - return FAIL; - break; - - case check_wr: - if ((wreg_required_here (&str, 0, IWMMXT_REG_WR)) == FAIL) - return FAIL; - break; - - case check_wrwr: - if ((wreg_required_here (&str, 12, IWMMXT_REG_WR) == FAIL - || skip_past_comma (&str) == FAIL - || wreg_required_here (&str, 16, IWMMXT_REG_WR) == FAIL)) - return FAIL; - break; - - case check_wrwrwr: - if ((wreg_required_here (&str, 12, IWMMXT_REG_WR) == FAIL - || skip_past_comma (&str) == FAIL - || wreg_required_here (&str, 16, IWMMXT_REG_WR) == FAIL - || skip_past_comma (&str) == FAIL - || wreg_required_here (&str, 0, IWMMXT_REG_WR) == FAIL)) - return FAIL; - break; - - case check_wrwrwcg: - if ((wreg_required_here (&str, 12, IWMMXT_REG_WR) == FAIL - || skip_past_comma (&str) == FAIL - || wreg_required_here (&str, 16, IWMMXT_REG_WR) == FAIL - || skip_past_comma (&str) == FAIL - || wreg_required_here (&str, 0, IWMMXT_REG_WCG) == FAIL)) - return FAIL; - break; - - case check_tbcst: - if ((wreg_required_here (&str, 16, IWMMXT_REG_WR) == FAIL - || skip_past_comma (&str) == FAIL - || reg_required_here (&str, 12) == FAIL)) - return FAIL; - break; +/* ARM V6 SXTAH extracts a 16-bit value from a register, sign + extends it to 32-bits, and adds the result to a value in another + register. You can specify a rotation by 0, 8, 16, or 24 bits + before extracting the 16-bit value. + SXTAH{} , , {, } + Condition defaults to COND_ALWAYS. + Error if any register uses R15. */ - case check_tmovmsk: - if ((reg_required_here (&str, 12) == FAIL - || skip_past_comma (&str) == FAIL - || wreg_required_here (&str, 16, IWMMXT_REG_WR) == FAIL)) - return FAIL; - break; +static void +do_sxtah (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[2].reg; + inst.instruction |= inst.operands[3].imm << 10; +} - case check_tmia: - if ((wreg_required_here (&str, 5, IWMMXT_REG_WR) == FAIL - || skip_past_comma (&str) == FAIL - || reg_required_here (&str, 0) == FAIL - || skip_past_comma (&str) == FAIL - || reg_required_here (&str, 12) == FAIL)) - return FAIL; - break; +/* ARM V6 SXTH. - case check_tmcrr: - if ((wreg_required_here (&str, 0, IWMMXT_REG_WR) == FAIL - || skip_past_comma (&str) == FAIL - || reg_required_here (&str, 12) == FAIL - || skip_past_comma (&str) == FAIL - || reg_required_here (&str, 16) == FAIL)) - return FAIL; - break; + SXTH {} , {, } + Condition defaults to COND_ALWAYS. + Error if any register uses R15. */ - case check_tmrrc: - if ((reg_required_here (&str, 12) == FAIL - || skip_past_comma (&str) == FAIL - || reg_required_here (&str, 16) == FAIL - || skip_past_comma (&str) == FAIL - || wreg_required_here (&str, 0, IWMMXT_REG_WR) == FAIL)) - return FAIL; - break; +static void +do_sxth (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg; + inst.instruction |= inst.operands[2].imm << 10; +} + +/* VFP instructions. In a logical order: SP variant first, monad + before dyad, arithmetic then move then load/store. */ - case check_tmcr: - if ((wreg_required_here (&str, 16, IWMMXT_REG_WC) == FAIL - || skip_past_comma (&str) == FAIL - || reg_required_here (&str, 12) == FAIL)) - return FAIL; - break; +static void +do_vfp_sp_monadic (void) +{ + encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sd); + encode_arm_vfp_sp_reg (inst.operands[1].reg, VFP_REG_Sm); +} - case check_tmrc: - if ((reg_required_here (&str, 12) == FAIL - || skip_past_comma (&str) == FAIL - || wreg_required_here (&str, 16, IWMMXT_REG_WC) == FAIL)) - return FAIL; - break; +static void +do_vfp_sp_dyadic (void) +{ + encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sd); + encode_arm_vfp_sp_reg (inst.operands[1].reg, VFP_REG_Sn); + encode_arm_vfp_sp_reg (inst.operands[2].reg, VFP_REG_Sm); +} - case check_tinsr: - if ((wreg_required_here (&str, 16, IWMMXT_REG_WR) == FAIL - || skip_past_comma (&str) == FAIL - || reg_required_here (&str, 12) == FAIL - || skip_past_comma (&str) == FAIL)) - return FAIL; - break; +static void +do_vfp_sp_compare_z (void) +{ + encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sd); +} - case check_textrc: - if ((reg_required_here (&str, 12) == FAIL - || skip_past_comma (&str) == FAIL)) - return FAIL; - break; +static void +do_vfp_dp_sp_cvt (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + encode_arm_vfp_sp_reg (inst.operands[1].reg, VFP_REG_Sm); +} - case check_waligni: - if ((wreg_required_here (&str, 12, IWMMXT_REG_WR) == FAIL - || skip_past_comma (&str) == FAIL - || wreg_required_here (&str, 16, IWMMXT_REG_WR) == FAIL - || skip_past_comma (&str) == FAIL - || wreg_required_here (&str, 0, IWMMXT_REG_WR) == FAIL - || skip_past_comma (&str) == FAIL)) - return FAIL; - break; +static void +do_vfp_sp_dp_cvt (void) +{ + encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sd); + inst.instruction |= inst.operands[1].reg; +} - case check_textrm: - if ((reg_required_here (&str, 12) == FAIL - || skip_past_comma (&str) == FAIL - || wreg_required_here (&str, 16, IWMMXT_REG_WR) == FAIL - || skip_past_comma (&str) == FAIL)) - return FAIL; - break; +static void +do_vfp_reg_from_sp (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + encode_arm_vfp_sp_reg (inst.operands[1].reg, VFP_REG_Sn); +} - case check_wshufh: - if ((wreg_required_here (&str, 12, IWMMXT_REG_WR) == FAIL - || skip_past_comma (&str) == FAIL - || wreg_required_here (&str, 16, IWMMXT_REG_WR) == FAIL - || skip_past_comma (&str) == FAIL)) - return FAIL; - break; - } +static void +do_vfp_reg2_from_sp2 (void) +{ + constraint (inst.operands[2].imm != 2, + _("only two consecutive VFP SP registers allowed here")); + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; + encode_arm_vfp_sp_reg (inst.operands[2].reg, VFP_REG_Sm); +} - if (immediate_size == 0) - { - end_of_line (str); - inst.error = inst_error; - return reg; - } - else - { - skip_whitespace (str); +static void +do_vfp_sp_from_reg (void) +{ + encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sn); + inst.instruction |= inst.operands[1].reg << 12; +} - /* Allow optional leading '#'. */ - if (is_immediate_prefix (* str)) - str++; +static void +do_vfp_sp2_from_reg2 (void) +{ + constraint (inst.operands[0].imm != 2, + _("only two consecutive VFP SP registers allowed here")); + encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sm); + inst.instruction |= inst.operands[1].reg << 12; + inst.instruction |= inst.operands[2].reg << 16; +} - memset (& expr, '\0', sizeof (expr)); +static void +do_vfp_sp_ldst (void) +{ + encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sd); + encode_arm_cp_address (1, FALSE, TRUE, 0); +} - if (my_get_expression (& expr, & str) || (expr.X_op != O_constant)) - { - inst.error = _("bad or missing expression"); - return FAIL; - } +static void +do_vfp_dp_ldst (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + encode_arm_cp_address (1, FALSE, TRUE, 0); +} - number = expr.X_add_number; - if (number != (number & immediate_size)) - { - inst.error = _("immediate value out of range"); - return FAIL; - } - end_of_line (str); - inst.error = inst_error; - return number; - } +static void +vfp_sp_ldstm (enum vfp_ldstm_type ldstm_type) +{ + if (inst.operands[0].writeback) + inst.instruction |= WRITE_BACK; + else + constraint (ldstm_type != VFP_LDSTMIA, + _("this addressing mode requires base-register writeback")); + inst.instruction |= inst.operands[0].reg << 16; + encode_arm_vfp_sp_reg (inst.operands[1].reg, VFP_REG_Sd); + inst.instruction |= inst.operands[1].imm; } static void -do_iwmmxt_byte_addr (char * str) +vfp_dp_ldstm (enum vfp_ldstm_type ldstm_type) { - int op = (inst.instruction & 0x300) >> 8; - int reg; + int count; - inst.instruction &= ~0x300; - inst.instruction |= (op & 1) << 22 | (op & 2) << 7; + if (inst.operands[0].writeback) + inst.instruction |= WRITE_BACK; + else + constraint (ldstm_type != VFP_LDSTMIA && ldstm_type != VFP_LDSTMIAX, + _("this addressing mode requires base-register writeback")); - skip_whitespace (str); + inst.instruction |= inst.operands[0].reg << 16; + inst.instruction |= inst.operands[1].reg << 12; - if ((reg = wreg_required_here (&str, 12, IWMMXT_REG_WR_OR_WC)) == FAIL - || skip_past_comma (& str) == FAIL - || cp_byte_address_required_here (&str) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - } - else - end_of_line (str); + count = inst.operands[1].imm << 1; + if (ldstm_type == VFP_LDSTMIAX || ldstm_type == VFP_LDSTMDBX) + count += 1; - if (wc_register (reg)) - { - as_bad (_("non-word size not supported with control register")); - inst.instruction |= 0xf0000100; - inst.instruction &= ~0x00400000; - } + inst.instruction |= count; } static void -do_iwmmxt_tandc (char * str) +do_vfp_sp_ldstmia (void) { - int reg; - - reg = check_iwmmxt_insn (str, check_rd, 0); - - if (reg != REG_PC && !inst.error) - inst.error = _("only r15 allowed here"); + vfp_sp_ldstm (VFP_LDSTMIA); } static void -do_iwmmxt_tbcst (char * str) +do_vfp_sp_ldstmdb (void) { - check_iwmmxt_insn (str, check_tbcst, 0); + vfp_sp_ldstm (VFP_LDSTMDB); } static void -do_iwmmxt_textrc (char * str) +do_vfp_dp_ldstmia (void) { - unsigned long number; - - if ((number = check_iwmmxt_insn (str, check_textrc, 7)) == (unsigned long) FAIL) - return; - - inst.instruction |= number & 0x7; + vfp_dp_ldstm (VFP_LDSTMIA); } static void -do_iwmmxt_textrm (char * str) +do_vfp_dp_ldstmdb (void) { - unsigned long number; - - if ((number = check_iwmmxt_insn (str, check_textrm, 7)) == (unsigned long) FAIL) - return; - - inst.instruction |= number & 0x7; + vfp_dp_ldstm (VFP_LDSTMDB); } static void -do_iwmmxt_tinsr (char * str) +do_vfp_xp_ldstmia (void) { - unsigned long number; - - if ((number = check_iwmmxt_insn (str, check_tinsr, 7)) == (unsigned long) FAIL) - return; - - inst.instruction |= number & 0x7; + vfp_dp_ldstm (VFP_LDSTMIAX); } static void -do_iwmmxt_tmcr (char * str) +do_vfp_xp_ldstmdb (void) { - check_iwmmxt_insn (str, check_tmcr, 0); + vfp_dp_ldstm (VFP_LDSTMDBX); } + +/* FPA instructions. Also in a logical order. */ static void -do_iwmmxt_tmcrr (char * str) +do_fpa_cmp (void) { - check_iwmmxt_insn (str, check_tmcrr, 0); + inst.instruction |= inst.operands[0].reg << 16; + inst.instruction |= inst.operands[1].reg; } static void -do_iwmmxt_tmia (char * str) +do_fpa_ldmstm (void) { - check_iwmmxt_insn (str, check_tmia, 0); + inst.instruction |= inst.operands[0].reg << 12; + switch (inst.operands[1].imm) + { + case 1: inst.instruction |= CP_T_X; break; + case 2: inst.instruction |= CP_T_Y; break; + case 3: inst.instruction |= CP_T_Y | CP_T_X; break; + case 4: break; + default: abort (); + } + + if (inst.instruction & (PRE_INDEX | INDEX_UP)) + { + /* The instruction specified "ea" or "fd", so we can only accept + [Rn]{!}. The instruction does not really support stacking or + unstacking, so we have to emulate these by setting appropriate + bits and offsets. */ + constraint (inst.reloc.exp.X_op != O_constant + || inst.reloc.exp.X_add_number != 0, + _("this instruction does not support indexing")); + + if ((inst.instruction & PRE_INDEX) || inst.operands[2].writeback) + inst.reloc.exp.X_add_number = 12 * inst.operands[1].imm; + + if (!(inst.instruction & INDEX_UP)) + inst.reloc.exp.X_add_number = -inst.reloc.exp.X_add_number; + + if (!(inst.instruction & PRE_INDEX) && inst.operands[2].writeback) + { + inst.operands[2].preind = 0; + inst.operands[2].postind = 1; + } + } + + encode_arm_cp_address (2, TRUE, TRUE, 0); } + +/* iWMMXt instructions: strictly in alphabetical order. */ static void -do_iwmmxt_tmovmsk (char * str) +do_iwmmxt_tandorc (void) { - check_iwmmxt_insn (str, check_tmovmsk, 0); + constraint (inst.operands[0].reg != REG_PC, _("only r15 allowed here")); } static void -do_iwmmxt_tmrc (char * str) +do_iwmmxt_textrc (void) { - check_iwmmxt_insn (str, check_tmrc, 0); + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].imm; } static void -do_iwmmxt_tmrrc (char * str) +do_iwmmxt_textrm (void) { - check_iwmmxt_insn (str, check_tmrrc, 0); + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[2].imm; } static void -do_iwmmxt_torc (char * str) +do_iwmmxt_tinsr (void) { - check_iwmmxt_insn (str, check_rd, 0); + inst.instruction |= inst.operands[0].reg << 16; + inst.instruction |= inst.operands[1].reg << 12; + inst.instruction |= inst.operands[2].imm; } static void -do_iwmmxt_waligni (char * str) +do_iwmmxt_tmia (void) { - unsigned long number; - - if ((number = check_iwmmxt_insn (str, check_waligni, 7)) == (unsigned long) FAIL) - return; - - inst.instruction |= ((number & 0x7) << 20); + inst.instruction |= inst.operands[0].reg << 5; + inst.instruction |= inst.operands[1].reg; + inst.instruction |= inst.operands[2].reg << 12; } static void -do_iwmmxt_wmov (char * str) +do_iwmmxt_waligni (void) { - if (check_iwmmxt_insn (str, check_wrwr, 0) == (unsigned long) FAIL) - return; - - inst.instruction |= ((inst.instruction >> 16) & 0xf); + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[2].reg; + inst.instruction |= inst.operands[3].imm << 20; } static void -do_iwmmxt_word_addr (char * str) +do_iwmmxt_wmov (void) { - int op = (inst.instruction & 0x300) >> 8; - int reg; - - inst.instruction &= ~0x300; - inst.instruction |= (op & 1) << 22 | (op & 2) << 7; + /* WMOV rD, rN is an alias for WOR rD, rN, rN. */ + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[1].reg; +} - skip_whitespace (str); +static void +do_iwmmxt_wldstbh (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + inst.reloc.exp.X_add_number *= 4; + encode_arm_cp_address (1, TRUE, FALSE, BFD_RELOC_ARM_CP_OFF_IMM_S2); +} - if ((reg = wreg_required_here (&str, 12, IWMMXT_REG_WR_OR_WC)) == FAIL - || skip_past_comma (& str) == FAIL - || cp_address_required_here (& str, CP_WB_OK) == FAIL) +static void +do_iwmmxt_wldstw (void) +{ + /* RIWR_RIWC clears .isreg for a control register. */ + if (!inst.operands[0].isreg) { - if (! inst.error) - inst.error = BAD_ARGS; + constraint (inst.cond != COND_ALWAYS, BAD_COND); + inst.instruction |= 0xf0000000; } - else - end_of_line (str); - if (wc_register (reg)) - { - if ((inst.instruction & COND_MASK) != COND_ALWAYS) - as_bad (_("conditional execution not supported with control register")); - if (op != 2) - as_bad (_("non-word size not supported with control register")); - inst.instruction |= 0xf0000100; - inst.instruction &= ~0x00400000; - } + inst.instruction |= inst.operands[0].reg << 12; + encode_arm_cp_address (1, TRUE, TRUE, 0); } static void -do_iwmmxt_wrwr (char * str) +do_iwmmxt_wldstd (void) { - check_iwmmxt_insn (str, check_wrwr, 0); + inst.instruction |= inst.operands[0].reg << 12; + encode_arm_cp_address (1, TRUE, FALSE, BFD_RELOC_ARM_CP_OFF_IMM_S2); } static void -do_iwmmxt_wrwrwcg (char * str) +do_iwmmxt_wshufh (void) { - check_iwmmxt_insn (str, check_wrwrwcg, 0); + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= ((inst.operands[2].imm & 0xf0) << 16); + inst.instruction |= (inst.operands[2].imm & 0x0f); } static void -do_iwmmxt_wrwrwr (char * str) +do_iwmmxt_wzero (void) { - check_iwmmxt_insn (str, check_wrwrwr, 0); + /* WZERO reg is an alias for WANDN reg, reg, reg. */ + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[0].reg << 16; } + +/* Cirrus Maverick instructions. Simple 2-, 3-, and 4-register + operations first, then control, shift, and load/store. */ + +/* Insns like "foo X,Y,Z". */ static void -do_iwmmxt_wshufh (char * str) +do_mav_triple (void) { - unsigned long number; + inst.instruction |= inst.operands[0].reg << 16; + inst.instruction |= inst.operands[1].reg; + inst.instruction |= inst.operands[2].reg << 12; +} - if ((number = check_iwmmxt_insn (str, check_wshufh, 0xff)) == (unsigned long) FAIL) - return; +/* Insns like "foo W,X,Y,Z". + where W=MVAX[0:3] and X,Y,Z=MVFX[0:15]. */ + +static void +do_mav_quad (void) +{ + inst.instruction |= inst.operands[0].reg << 5; + inst.instruction |= inst.operands[1].reg << 12; + inst.instruction |= inst.operands[2].reg << 16; + inst.instruction |= inst.operands[3].reg; +} - inst.instruction |= ((number & 0xf0) << 16) | (number & 0xf); +/* cfmvsc32 DSPSC,MVDX[15:0]. */ +static void +do_mav_dspsc (void) +{ + inst.instruction |= inst.operands[1].reg << 12; } +/* Maverick shift immediate instructions. + cfsh32 MVFX[15:0],MVFX[15:0],Shift[6:0]. + cfsh64 MVDX[15:0],MVDX[15:0],Shift[6:0]. */ + static void -do_iwmmxt_wzero (char * str) +do_mav_shift (void) { - if (check_iwmmxt_insn (str, check_wr, 0) == (unsigned long) FAIL) - return; + int imm = inst.operands[2].imm; + + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; + + /* Bits 0-3 of the insn should have bits 0-3 of the immediate. + Bits 5-7 of the insn should have bits 4-6 of the immediate. + Bit 4 should be 0. */ + imm = (imm & 0xf) | ((imm & 0x70) << 1); - inst.instruction |= ((inst.instruction & 0xf) << 12) | ((inst.instruction & 0xf) << 16); + inst.instruction |= imm; } + +/* XScale instructions. Also sorted arithmetic before move. */ /* Xscale multiply-accumulate (argument parse) MIAcc acc0,Rm,Rs @@ -5570,28 +5547,10 @@ do_iwmmxt_wzero (char * str) MIAxycc acc0,Rm,Rs. */ static void -do_xsc_mia (char * str) +do_xsc_mia (void) { - int rs; - int rm; - - if (accum0_required_here (& str) == FAIL) - inst.error = ERR_NO_ACCUM; - - else if (skip_past_comma (& str) == FAIL - || (rm = reg_required_here (& str, 0)) == FAIL) - inst.error = BAD_ARGS; - - else if (skip_past_comma (& str) == FAIL - || (rs = reg_required_here (& str, 12)) == FAIL) - inst.error = BAD_ARGS; - - /* inst.instruction has now been zapped with both rm and rs. */ - else if (rm == REG_PC || rs == REG_PC) - inst.error = BAD_PC; /* Undefined result if rm or rs is R15. */ - - else - end_of_line (str); + inst.instruction |= inst.operands[1].reg; + inst.instruction |= inst.operands[2].reg << 12; } /* Xscale move-accumulator-register (argument parse) @@ -5599,27 +5558,10 @@ do_xsc_mia (char * str) MARcc acc0,RdLo,RdHi. */ static void -do_xsc_mar (char * str) +do_xsc_mar (void) { - int rdlo, rdhi; - - if (accum0_required_here (& str) == FAIL) - inst.error = ERR_NO_ACCUM; - - else if (skip_past_comma (& str) == FAIL - || (rdlo = reg_required_here (& str, 12)) == FAIL) - inst.error = BAD_ARGS; - - else if (skip_past_comma (& str) == FAIL - || (rdhi = reg_required_here (& str, 16)) == FAIL) - inst.error = BAD_ARGS; - - /* inst.instruction has now been zapped with both rdlo and rdhi. */ - else if (rdlo == REG_PC || rdhi == REG_PC) - inst.error = BAD_PC; /* Undefined result if rdlo or rdhi is R15. */ - - else - end_of_line (str); + inst.instruction |= inst.operands[1].reg << 12; + inst.instruction |= inst.operands[2].reg << 16; } /* Xscale move-register-accumulator (argument parse) @@ -5627,9632 +5569,6910 @@ do_xsc_mar (char * str) MRAcc RdLo,RdHi,acc0. */ static void -do_xsc_mra (char * str) +do_xsc_mra (void) { - int rdlo; - int rdhi; - - skip_whitespace (str); - - if ((rdlo = reg_required_here (& str, 12)) == FAIL) - inst.error = BAD_ARGS; - - else if (skip_past_comma (& str) == FAIL - || (rdhi = reg_required_here (& str, 16)) == FAIL) - inst.error = BAD_ARGS; - - else if (skip_past_comma (& str) == FAIL - || accum0_required_here (& str) == FAIL) - inst.error = ERR_NO_ACCUM; - - /* inst.instruction has now been zapped with both rdlo and rdhi. */ - else if (rdlo == rdhi) - inst.error = BAD_ARGS; /* Undefined result if 2 writes to same reg. */ - - else if (rdlo == REG_PC || rdhi == REG_PC) - inst.error = BAD_PC; /* Undefined result if rdlo or rdhi is R15. */ - else - end_of_line (str); + constraint (inst.operands[0].reg == inst.operands[1].reg, BAD_OVERLAP); + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; } + +/* Encoding functions relevant only to Thumb. */ -static int -ldst_extend (char ** str) +/* inst.operands[i] is a shifted-register operand; encode + it into inst.instruction in the format used by Thumb32. */ + +static void +encode_thumb32_shifted_operand (int i) { - int add = INDEX_UP; + unsigned int value = inst.reloc.exp.X_add_number; + unsigned int shift = inst.operands[i].shift_kind; - switch (**str) + inst.instruction |= inst.operands[i].reg; + if (shift == SHIFT_RRX) + inst.instruction |= SHIFT_ROR << 4; + else { - case '#': - case '$': - (*str)++; - if (my_get_expression (& inst.reloc.exp, str)) - return FAIL; - - if (inst.reloc.exp.X_op == O_constant) - { - int value = inst.reloc.exp.X_add_number; - - if (value < -4095 || value > 4095) - { - inst.error = _("address offset too large"); - return FAIL; - } - - if (value < 0) - { - value = -value; - add = 0; - } - - inst.instruction |= add | value; - } - else - { - inst.reloc.type = BFD_RELOC_ARM_OFFSET_IMM; - inst.reloc.pc_rel = 0; - } - return SUCCESS; + constraint (inst.reloc.exp.X_op != O_constant, + _("expression too complex")); - case '-': - add = 0; - /* Fall through. */ - - case '+': - (*str)++; - /* Fall through. */ - - default: - if (reg_required_here (str, 0) == FAIL) - return FAIL; + constraint (value > 32 + || (value == 32 && (shift == SHIFT_LSL + || shift == SHIFT_ROR)), + _("shift expression is too large")); - inst.instruction |= add | OFFSET_REG; - if (skip_past_comma (str) == SUCCESS) - return decode_shift (str, SHIFT_IMMEDIATE); + if (value == 0) + shift = SHIFT_LSL; + else if (value == 32) + value = 0; - return SUCCESS; + inst.instruction |= shift << 4; + inst.instruction |= (value & 0x1c) << 10; + inst.instruction |= (value & 0x03) << 6; } } -/* ARMv5TE: Preload-Cache - - PLD - Syntactically, like LDR with B=1, W=0, L=1. */ +/* inst.operands[i] was set up by parse_address. Encode it into a + Thumb32 format load or store instruction. Reject forms that cannot + be used with such instructions. If is_t is true, reject forms that + cannot be used with a T instruction; if is_d is true, reject forms + that cannot be used with a D instruction. */ static void -do_pld (char * str) +encode_thumb32_addr_mode (int i, bfd_boolean is_t, bfd_boolean is_d) { - int rd; + bfd_boolean is_pc = (inst.operands[i].reg == REG_PC); - skip_whitespace (str); + constraint (!inst.operands[i].isreg, + _("Thumb does not support the ldr =N pseudo-operation")); - if (* str != '[') + inst.instruction |= inst.operands[i].reg << 16; + if (inst.operands[i].immisreg) { - inst.error = _("'[' expected after PLD mnemonic"); - return; + constraint (is_pc, _("cannot use register index with PC-relative addressing")); + constraint (is_t || is_d, _("cannot use register index with this instruction")); + constraint (inst.operands[i].negative, + _("Thumb does not support negative register indexing")); + constraint (inst.operands[i].postind, + _("Thumb does not support register post-indexing")); + constraint (inst.operands[i].writeback, + _("Thumb does not support register indexing with writeback")); + constraint (inst.operands[i].shifted && inst.operands[i].shift_kind != SHIFT_LSL, + _("Thumb supports only LSL in shifted register indexing")); + + inst.instruction |= inst.operands[1].imm; + if (inst.operands[i].shifted) + { + constraint (inst.reloc.exp.X_op != O_constant, + _("expression too complex")); + constraint (inst.reloc.exp.X_add_number < 0 || inst.reloc.exp.X_add_number > 3, + _("shift out of range")); + inst.instruction |= inst.reloc.exp.X_op << 4; + } + inst.reloc.type = BFD_RELOC_UNUSED; } + else if (inst.operands[i].preind) + { + constraint (is_pc && inst.operands[i].writeback, + _("cannot use writeback with PC-relative addressing")); + constraint (is_t && inst.operands[1].writeback, + _("cannot use writeback with this instruction")); + + if (is_d) + { + inst.instruction |= 0x01000000; + if (inst.operands[i].writeback) + inst.instruction |= 0x00200000; + } + else + { + inst.instruction |= 0x00000c00; + if (inst.operands[i].writeback) + inst.instruction |= 0x00000100; + } + inst.reloc.type = BFD_RELOC_ARM_T32_OFFSET_IMM; + inst.reloc.pc_rel = is_pc; + } + else if (inst.operands[i].postind) + { + assert (inst.operands[i].writeback); + constraint (is_pc, _("cannot use post-indexing with PC-relative addressing")); + constraint (is_t, _("cannot use post-indexing with this instruction")); + + if (is_d) + inst.instruction |= 0x00200000; + else + inst.instruction |= 0x00000900; + inst.reloc.type = BFD_RELOC_ARM_T32_OFFSET_IMM; + } + else /* unindexed - only for coprocessor */ + inst.error = _("instruction does not accept unindexed addressing"); +} + +/* Table of Thumb instructions which exist in both 16- and 32-bit + encodings (the latter only in post-V6T2 cores). The index is the + value used in the insns table below. When there is more than one + possible 16-bit encoding for the instruction, this table always + holds variant (1). */ +#define T16_32_TAB \ + X(adc, 4140, eb400000), \ + X(adcs, 4140, eb500000), \ + X(add, 1c00, eb000000), \ + X(adds, 1c00, eb100000), \ + X(and, 4000, ea000000), \ + X(ands, 4000, ea100000), \ + X(asr, 1000, fa40f000), \ + X(asrs, 1000, fa50f000), \ + X(bic, 4380, ea200000), \ + X(bics, 4380, ea300000), \ + X(cmn, 42c0, eb100f00), \ + X(cmp, 2800, ebb00f00), \ + X(cpsie, b660, f3af8400), \ + X(cpsid, b670, f3af8600), \ + X(cpy, 4600, ea4f0000), \ + X(eor, 4040, ea800000), \ + X(eors, 4040, ea900000), \ + X(ldmia, c800, e8900000), \ + X(ldr, 6800, f8500000), \ + X(ldrb, 7800, f8100000), \ + X(ldrh, 8800, f8300000), \ + X(ldrsb, 5600, f9100000), \ + X(ldrsh, 5e00, f9300000), \ + X(lsl, 0000, fa00f000), \ + X(lsls, 0000, fa10f000), \ + X(lsr, 0800, fa20f000), \ + X(lsrs, 0800, fa30f000), \ + X(mov, 2000, ea4f0000), \ + X(movs, 2000, ea5f0000), \ + X(mul, 4340, fb00f000), \ + X(muls, 4340, ffffffff), /* no 32b muls */ \ + X(mvn, 43c0, ea6f0000), \ + X(mvns, 43c0, ea7f0000), \ + X(neg, 4240, f1c00000), /* rsb #0 */ \ + X(negs, 4240, f1d00000), /* rsbs #0 */ \ + X(orr, 4300, ea400000), \ + X(orrs, 4300, ea500000), \ + X(pop, bc00, e8ad0000), /* ldmia sp!,... */ \ + X(push, b400, e8bd0000), /* stmia sp!,... */ \ + X(rev, ba00, fa90f080), \ + X(rev16, ba40, fa90f090), \ + X(revsh, bac0, fa90f0b0), \ + X(ror, 41c0, fa60f000), \ + X(rors, 41c0, fa70f000), \ + X(sbc, 4180, eb600000), \ + X(sbcs, 4180, eb700000), \ + X(stmia, c000, e8800000), \ + X(str, 6000, f8400000), \ + X(strb, 7000, f8000000), \ + X(strh, 8000, f8200000), \ + X(sub, 1e00, eba00000), \ + X(subs, 1e00, ebb00000), \ + X(sxtb, b240, fa4ff080), \ + X(sxth, b200, fa0ff080), \ + X(tst, 4200, ea100f00), \ + X(uxtb, b2c0, fa5ff080), \ + X(uxth, b280, fa1ff080), \ + X(nop, bf00, f3af8000), \ + X(yield, bf10, f3af8001), \ + X(wfe, bf20, f3af8002), \ + X(wfi, bf30, f3af8003), \ + X(sev, bf40, f3af9004), /* typo, 8004? */ + +/* To catch errors in encoding functions, the codes are all offset by + 0xF800, putting them in one of the 32-bit prefix ranges, ergo undefined + as 16-bit instructions. */ +#define X(a,b,c) T_MNEM_##a +enum t16_32_codes { T16_32_OFFSET = 0xF7FF, T16_32_TAB }; +#undef X + +#define X(a,b,c) 0x##b +static const unsigned short thumb_op16[] = { T16_32_TAB }; +#define THUMB_OP16(n) (thumb_op16[(n) - (T16_32_OFFSET + 1)]) +#undef X + +#define X(a,b,c) 0x##c +static const unsigned int thumb_op32[] = { T16_32_TAB }; +#define THUMB_OP32(n) (thumb_op32[(n) - (T16_32_OFFSET + 1)]) +#define THUMB_SETS_FLAGS(n) (THUMB_OP32 (n) & 0x00100000) +#undef X +#undef T16_32_TAB - ++str; - skip_whitespace (str); +/* Thumb instruction encoders, in alphabetical order. */ - if ((rd = reg_required_here (& str, 16)) == FAIL) - return; +/* Parse an add or subtract instruction. We get here with inst.instruction + equalling any of THUMB_OPCODE_add, adds, sub, or subs. */ - skip_whitespace (str); +static void +do_t_add_sub (void) +{ + int Rd, Rs, Rn; - if (*str == ']') - { - /* [Rn], ... ? */ - ++str; - skip_whitespace (str); + Rd = inst.operands[0].reg; + Rs = (inst.operands[1].present + ? inst.operands[1].reg /* Rd, Rs, foo */ + : inst.operands[0].reg); /* Rd, foo -> Rd, Rd, foo */ - /* Post-indexed addressing is not allowed with PLD. */ - if (skip_past_comma (&str) == SUCCESS) - { - inst.error - = _("post-indexed expression used in preload instruction"); - return; - } - else if (*str == '!') /* [Rn]! */ - { - inst.error = _("writeback used in preload instruction"); - ++str; - } - else /* [Rn] */ - inst.instruction |= INDEX_UP | PRE_INDEX; - } - else /* [Rn, ...] */ + if (unified_syntax) { - if (skip_past_comma (& str) == FAIL) + if (!inst.operands[2].isreg) { - inst.error = _("pre-indexed expression expected"); - return; + /* For an immediate, we always generate a 32-bit opcode; + section relaxation will shrink it later if possible. */ + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction = (inst.instruction & 0xe1ffffff) | 0x10000000; + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg << 16; + inst.reloc.type = BFD_RELOC_ARM_T32_IMMEDIATE; } + else + { + Rn = inst.operands[2].reg; + /* See if we can do this with a 16-bit instruction. */ + if (!inst.operands[2].shifted && inst.size_req != 4) + { + if (Rd <= 7 && Rn <= 7 && Rn <= 7 + && (inst.instruction == T_MNEM_adds + || inst.instruction == T_MNEM_subs)) + { + inst.instruction = (inst.instruction == T_MNEM_adds + ? T_OPCODE_ADD_R3 + : T_OPCODE_SUB_R3); + inst.instruction |= Rd | (Rs << 3) | (Rn << 6); + return; + } - if (ldst_extend (&str) == FAIL) - return; - - skip_whitespace (str); + if (inst.instruction == T_MNEM_add) + { + if (Rd == Rs) + { + inst.instruction = T_OPCODE_ADD_HI; + inst.instruction |= (Rd & 8) << 4; + inst.instruction |= (Rd & 7); + inst.instruction |= Rn << 3; + return; + } + /* ... because addition is commutative! */ + else if (Rd == Rn) + { + inst.instruction = T_OPCODE_ADD_HI; + inst.instruction |= (Rd & 8) << 4; + inst.instruction |= (Rd & 7); + inst.instruction |= Rs << 3; + return; + } + } + } + /* If we get here, it can't be done in 16 bits. */ + constraint (inst.operands[2].shifted && inst.operands[2].immisreg, + _("shift must be constant")); + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction |= Rd << 8; + inst.instruction |= Rs << 16; + encode_thumb32_shifted_operand (2); + } + } + else + { + constraint (inst.instruction == T_MNEM_adds + || inst.instruction == T_MNEM_subs, + BAD_THUMB32); - if (* str != ']') + if (!inst.operands[2].isreg) /* Rd, Rs, #imm */ { - inst.error = _("missing ]"); + constraint ((Rd > 7 && (Rd != REG_SP || Rs != REG_SP)) + || (Rs > 7 && Rs != REG_SP && Rs != REG_PC), + BAD_HIREG); + + inst.instruction = (inst.instruction == T_MNEM_add + ? 0x0000 : 0x8000); + inst.instruction |= (Rd << 4) | Rs; + inst.reloc.type = BFD_RELOC_ARM_THUMB_ADD; return; } - ++ str; - skip_whitespace (str); + Rn = inst.operands[2].reg; + constraint (inst.operands[2].shifted, _("unshifted register required")); - if (* str == '!') /* [Rn]! */ + /* We now have Rd, Rs, and Rn set to registers. */ + if (Rd > 7 || Rs > 7 || Rn > 7) { - inst.error = _("writeback used in preload instruction"); - ++ str; + /* Can't do this for SUB. */ + constraint (inst.instruction == T_MNEM_sub, BAD_HIREG); + inst.instruction = T_OPCODE_ADD_HI; + inst.instruction |= (Rd & 8) << 4; + inst.instruction |= (Rd & 7); + if (Rs == Rd) + inst.instruction |= Rn << 3; + else if (Rn == Rd) + inst.instruction |= Rs << 3; + else + constraint (1, _("dest must overlap one source register")); + } + else + { + inst.instruction = (inst.instruction == T_MNEM_add + ? T_OPCODE_ADD_R3 : T_OPCODE_SUB_R3); + inst.instruction |= Rd | (Rs << 3) | (Rn << 6); } - - inst.instruction |= PRE_INDEX; } - - end_of_line (str); } -/* ARMv5TE load-consecutive (argument parse) - Mode is like LDRH. - - LDRccD R, mode - STRccD R, mode. */ - static void -do_ldrd (char * str) +do_t_adr (void) { - int rd; - int rn; + inst.reloc.type = BFD_RELOC_ARM_THUMB_ADD; + inst.reloc.exp.X_add_number -= 4; /* PC relative adjust. */ + inst.reloc.pc_rel = 1; - skip_whitespace (str); + inst.instruction |= inst.operands[0].reg << 4; +} - if ((rd = reg_required_here (& str, 12)) == FAIL) - { - inst.error = BAD_ARGS; - return; - } +/* Arithmetic instructions for which there is just one 16-bit + instruction encoding, and it allows only two low registers. + For maximal compatibility with ARM syntax, we allow three register + operands even when Thumb-32 instructions are not available, as long + as the first two are identical. For instance, both "sbc r0,r1" and + "sbc r0,r0,r1" are allowed. */ +static void +do_t_arit3 (void) +{ + int Rd, Rs, Rn; - if (skip_past_comma (& str) == FAIL - || (rn = ld_mode_required_here (& str)) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + Rd = inst.operands[0].reg; + Rs = (inst.operands[1].present + ? inst.operands[1].reg /* Rd, Rs, foo */ + : inst.operands[0].reg); /* Rd, foo -> Rd, Rd, foo */ + Rn = inst.operands[2].reg; + + if (unified_syntax) + { + if (!inst.operands[2].isreg) + { + /* For an immediate, we always generate a 32-bit opcode; + section relaxation will shrink it later if possible. */ + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction = (inst.instruction & 0xe1ffffff) | 0x10000000; + inst.instruction |= Rd << 8; + inst.instruction |= Rs << 16; + inst.reloc.type = BFD_RELOC_ARM_T32_IMMEDIATE; + } + else + { + /* See if we can do this with a 16-bit instruction. */ + if (THUMB_SETS_FLAGS (inst.instruction) + && !inst.operands[2].shifted + && inst.size_req != 4 + && Rd == Rs) + { + inst.instruction = THUMB_OP16 (inst.instruction); + inst.instruction |= Rd; + inst.instruction |= Rn << 3; + return; + } - /* inst.instruction has now been zapped with Rd and the addressing mode. */ - if (rd & 1) /* Unpredictable result if Rd is odd. */ - { - inst.error = _("destination register must be even"); - return; + /* If we get here, it can't be done in 16 bits. */ + constraint (inst.operands[2].shifted + && inst.operands[2].immisreg, + _("shift must be constant")); + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction |= Rd << 8; + inst.instruction |= Rs << 16; + encode_thumb32_shifted_operand (2); + } } - - if (rd == REG_LR) + else { - inst.error = _("r14 not allowed here"); - return; - } + /* On its face this is a lie - the instruction does set the + flags. However, the only supported mnemonic in this mode + says it doesn't. */ + constraint (THUMB_SETS_FLAGS (inst.instruction), BAD_THUMB32); - if (((rd == rn) || (rd + 1 == rn)) - && ((inst.instruction & WRITE_BACK) - || (!(inst.instruction & PRE_INDEX)))) - as_warn (_("pre/post-indexing used when modified address register is destination")); - - /* For an index-register load, the index register must not overlap the - destination (even if not write-back). */ - if ((inst.instruction & V4_STR_BIT) == 0 - && (inst.instruction & HWOFFSET_IMM) == 0) - { - int rm = inst.instruction & 0x0000000f; + constraint (!inst.operands[2].isreg || inst.operands[2].shifted, + _("unshifted register required")); + constraint (Rd > 7 || Rs > 7 || Rn > 7, BAD_HIREG); + constraint (Rd != Rs, + _("dest and source1 must be the same register")); - if (rm == rd || (rm == rd + 1)) - as_warn (_("ldrd destination registers must not overlap index register")); + inst.instruction = THUMB_OP16 (inst.instruction); + inst.instruction |= Rd; + inst.instruction |= Rn << 3; } - - end_of_line (str); } -/* Returns the index into fp_values of a floating point number, - or -1 if not in the table. */ - -static int -my_get_float_expression (char ** str) +/* Similarly, but for instructions where the arithmetic operation is + commutative, so we can allow either of them to be different from + the destination operand in a 16-bit instruction. For instance, all + three of "adc r0,r1", "adc r0,r0,r1", and "adc r0,r1,r0" are + accepted. */ +static void +do_t_arit3c (void) { - LITTLENUM_TYPE words[MAX_LITTLENUMS]; - char * save_in; - expressionS exp; - int i; - int j; + int Rd, Rs, Rn; - memset (words, 0, MAX_LITTLENUMS * sizeof (LITTLENUM_TYPE)); + Rd = inst.operands[0].reg; + Rs = (inst.operands[1].present + ? inst.operands[1].reg /* Rd, Rs, foo */ + : inst.operands[0].reg); /* Rd, foo -> Rd, Rd, foo */ + Rn = inst.operands[2].reg; - /* Look for a raw floating point number. */ - if ((save_in = atof_ieee (*str, 'x', words)) != NULL - && is_end_of_line[(unsigned char) *save_in]) + if (unified_syntax) { - for (i = 0; i < NUM_FLOAT_VALS; i++) + if (!inst.operands[2].isreg) { - for (j = 0; j < MAX_LITTLENUMS; j++) - { - if (words[j] != fp_values[i][j]) - break; - } - - if (j == MAX_LITTLENUMS) - { - *str = save_in; - return i; - } + /* For an immediate, we always generate a 32-bit opcode; + section relaxation will shrink it later if possible. */ + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction = (inst.instruction & 0xe1ffffff) | 0x10000000; + inst.instruction |= Rd << 8; + inst.instruction |= Rs << 16; + inst.reloc.type = BFD_RELOC_ARM_T32_IMMEDIATE; } - } - - /* Try and parse a more complex expression, this will probably fail - unless the code uses a floating point prefix (eg "0f"). */ - save_in = input_line_pointer; - input_line_pointer = *str; - if (expression (&exp) == absolute_section - && exp.X_op == O_big - && exp.X_add_number < 0) - { - /* FIXME: 5 = X_PRECISION, should be #define'd where we can use it. - Ditto for 15. */ - if (gen_to_words (words, 5, (long) 15) == 0) + else { - for (i = 0; i < NUM_FLOAT_VALS; i++) + /* See if we can do this with a 16-bit instruction. */ + if (THUMB_SETS_FLAGS (inst.instruction) + && !inst.operands[2].shifted + && inst.size_req != 4) { - for (j = 0; j < MAX_LITTLENUMS; j++) + if (Rd == Rs) { - if (words[j] != fp_values[i][j]) - break; + inst.instruction = THUMB_OP16 (inst.instruction); + inst.instruction |= Rd; + inst.instruction |= Rn << 3; + return; } - - if (j == MAX_LITTLENUMS) + if (Rd == Rn) { - *str = input_line_pointer; - input_line_pointer = save_in; - return i; + inst.instruction = THUMB_OP16 (inst.instruction); + inst.instruction |= Rd; + inst.instruction |= Rs << 3; + return; } } + + /* If we get here, it can't be done in 16 bits. */ + constraint (inst.operands[2].shifted + && inst.operands[2].immisreg, + _("shift must be constant")); + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction |= Rd << 8; + inst.instruction |= Rs << 16; + encode_thumb32_shifted_operand (2); } } + else + { + /* On its face this is a lie - the instruction does set the + flags. However, the only supported mnemonic in this mode + says it doesn't. */ + constraint (THUMB_SETS_FLAGS (inst.instruction), BAD_THUMB32); - *str = input_line_pointer; - input_line_pointer = save_in; - return -1; -} + constraint (!inst.operands[2].isreg || inst.operands[2].shifted, + _("unshifted register required")); + constraint (Rd > 7 || Rs > 7 || Rn > 7, BAD_HIREG); -/* We handle all bad expressions here, so that we can report the faulty - instruction in the error message. */ -void -md_operand (expressionS * expr) -{ - if (in_my_get_expression) - { - expr->X_op = O_illegal; - if (inst.error == NULL) - inst.error = _("bad expression"); + inst.instruction = THUMB_OP16 (inst.instruction); + inst.instruction |= Rd; + + if (Rd == Rs) + inst.instruction |= Rn << 3; + else if (Rd == Rn) + inst.instruction |= Rs << 3; + else + constraint (1, _("dest must overlap one source register")); } } -/* Do those data_ops which can take a negative immediate constant - by altering the instruction. A bit of a hack really. - MOV <-> MVN - AND <-> BIC - ADC <-> SBC - by inverting the second operand, and - ADD <-> SUB - CMP <-> CMN - by negating the second operand. */ +static void +do_t_bfc (void) +{ + unsigned int msb = inst.operands[1].imm + inst.operands[2].imm; + constraint (msb > 32, _("bit-field extends past end of register")); + /* The instruction encoding stores the LSB and MSB, + not the LSB and width. */ + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= (inst.operands[1].imm & 0x1c) << 10; + inst.instruction |= (inst.operands[1].imm & 0x03) << 6; + inst.instruction |= msb - 1; +} -static int -negate_data_op (unsigned long * instruction, - unsigned long value) +static void +do_t_bfi (void) { - int op, new_inst; - unsigned long negated, inverted; + unsigned int msb; - negated = validate_immediate (-value); - inverted = validate_immediate (~value); + /* #0 in second position is alternative syntax for bfc, which is + the same instruction but with REG_PC in the Rm field. */ + if (!inst.operands[1].isreg) + inst.operands[1].reg = REG_PC; - op = (*instruction >> DATA_OP_SHIFT) & 0xf; - switch (op) - { - /* First negates. */ - case OPCODE_SUB: /* ADD <-> SUB */ - new_inst = OPCODE_ADD; - value = negated; - break; + msb = inst.operands[2].imm + inst.operands[3].imm; + constraint (msb > 32, _("bit-field extends past end of register")); + /* The instruction encoding stores the LSB and MSB, + not the LSB and width. */ + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= (inst.operands[2].imm & 0x1c) << 10; + inst.instruction |= (inst.operands[2].imm & 0x03) << 6; + inst.instruction |= msb - 1; +} - case OPCODE_ADD: - new_inst = OPCODE_SUB; - value = negated; - break; +static void +do_t_bfx (void) +{ + constraint (inst.operands[2].imm + inst.operands[3].imm > 32, + _("bit-field extends past end of register")); + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= (inst.operands[2].imm & 0x1c) << 10; + inst.instruction |= (inst.operands[2].imm & 0x03) << 6; + inst.instruction |= inst.operands[3].imm - 1; +} - case OPCODE_CMP: /* CMP <-> CMN */ - new_inst = OPCODE_CMN; - value = negated; - break; +/* ARM V5 Thumb BLX (argument parse) + BLX which is BLX(1) + BLX which is BLX(2) + Unfortunately, there are two different opcodes for this mnemonic. + So, the insns[].value is not used, and the code here zaps values + into inst.instruction. - case OPCODE_CMN: - new_inst = OPCODE_CMP; - value = negated; - break; + ??? How to take advantage of the additional two bits of displacement + available in Thumb32 mode? Need new relocation? */ - /* Now Inverted ops. */ - case OPCODE_MOV: /* MOV <-> MVN */ - new_inst = OPCODE_MVN; - value = inverted; - break; +static void +do_t_blx (void) +{ + if (inst.operands[0].isreg) + /* We have a register, so this is BLX(2). */ + inst.instruction |= inst.operands[0].reg << 3; + else + { + /* No register. This must be BLX(1). */ + inst.instruction = 0xf7ffeffe; + inst.reloc.type = BFD_RELOC_THUMB_PCREL_BLX; + inst.reloc.pc_rel = 1; + } +} - case OPCODE_MVN: - new_inst = OPCODE_MOV; - value = inverted; - break; +static void +do_t_branch (void) +{ + if (unified_syntax && inst.size_req != 2) + { + if (inst.cond == COND_ALWAYS) + { + inst.instruction = 0xf7ffbffe; + inst.reloc.type = BFD_RELOC_THUMB_PCREL_BRANCH25; + } + else + { + assert (inst.cond != 0xF); + inst.instruction = (inst.cond << 22) | 0xf43faffe; + inst.reloc.type = BFD_RELOC_THUMB_PCREL_BRANCH20; + } + } + else + { + if (inst.cond == COND_ALWAYS) + inst.reloc.type = BFD_RELOC_THUMB_PCREL_BRANCH12; + else + { + inst.instruction = 0xd0fe | (inst.cond << 8); + inst.reloc.type = BFD_RELOC_THUMB_PCREL_BRANCH9; + } + } - case OPCODE_AND: /* AND <-> BIC */ - new_inst = OPCODE_BIC; - value = inverted; - break; + inst.reloc.pc_rel = 1; +} - case OPCODE_BIC: - new_inst = OPCODE_AND; - value = inverted; - break; +static void +do_t_bkpt (void) +{ + if (inst.operands[0].present) + { + constraint (inst.operands[0].imm > 255, + _("immediate value out of range")); + inst.instruction |= inst.operands[0].imm; + } +} - case OPCODE_ADC: /* ADC <-> SBC */ - new_inst = OPCODE_SBC; - value = inverted; - break; +static void +do_t_branch23 (void) +{ + inst.reloc.type = BFD_RELOC_THUMB_PCREL_BRANCH23; + inst.reloc.pc_rel = 1; - case OPCODE_SBC: - new_inst = OPCODE_ADC; - value = inverted; - break; + /* If the destination of the branch is a defined symbol which does not have + the THUMB_FUNC attribute, then we must be calling a function which has + the (interfacearm) attribute. We look for the Thumb entry point to that + function and change the branch to refer to that function instead. */ + if ( inst.reloc.exp.X_op == O_symbol + && inst.reloc.exp.X_add_symbol != NULL + && S_IS_DEFINED (inst.reloc.exp.X_add_symbol) + && ! THUMB_IS_FUNC (inst.reloc.exp.X_add_symbol)) + inst.reloc.exp.X_add_symbol = + find_real_start (inst.reloc.exp.X_add_symbol); +} - /* We cannot do anything. */ - default: - return FAIL; - } +static void +do_t_bx (void) +{ + inst.instruction |= inst.operands[0].reg << 3; + /* ??? FIXME: Should add a hacky reloc here if reg is REG_PC. The reloc + should cause the alignment to be checked once it is known. This is + because BX PC only works if the instruction is word aligned. */ +} - if (value == (unsigned) FAIL) - return FAIL; +static void +do_t_bxj (void) +{ + if (inst.operands[0].reg == REG_PC) + as_tsktsk (_("use of r15 in bxj is not really useful")); - *instruction &= OPCODE_MASK; - *instruction |= new_inst << DATA_OP_SHIFT; - return value; + inst.instruction |= inst.operands[0].reg << 16; } -static int -data_op2 (char ** str) +static void +do_t_clz (void) { - int value; - expressionS expr; - - skip_whitespace (* str); + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[1].reg; +} - if (reg_required_here (str, 0) != FAIL) +static void +do_t_cpsi (void) +{ + if (unified_syntax + && (inst.operands[1].present || inst.size_req == 4)) { - if (skip_past_comma (str) == SUCCESS) - /* Shift operation on register. */ - return decode_shift (str, NO_SHIFT_RESTRICT); - - return SUCCESS; + unsigned int imod = (inst.instruction & 0x0030) >> 4; + inst.instruction = 0xf3af8000; + inst.instruction |= imod << 9; + inst.instruction |= inst.operands[0].imm << 5; + if (inst.operands[1].present) + inst.instruction |= 0x100 | inst.operands[1].imm; } else { - /* Immediate expression. */ - if (is_immediate_prefix (**str)) - { - (*str)++; - inst.error = NULL; + constraint (inst.operands[1].present, + _("Thumb does not support the 2-argument " + "form of this instruction")); + inst.instruction |= inst.operands[0].imm; + } +} - if (my_get_expression (&inst.reloc.exp, str)) - return FAIL; - - if (inst.reloc.exp.X_add_symbol) - { - inst.reloc.type = BFD_RELOC_ARM_IMMEDIATE; - inst.reloc.pc_rel = 0; - } - else - { - if (skip_past_comma (str) == SUCCESS) - { - /* #x, y -- ie explicit rotation by Y. */ - if (my_get_expression (&expr, str)) - return FAIL; - - if (expr.X_op != O_constant) - { - inst.error = _("constant expression expected"); - return FAIL; - } +/* THUMB CPY instruction (argument parse). */ - /* Rotate must be a multiple of 2. */ - if (((unsigned) expr.X_add_number) > 30 - || (expr.X_add_number & 1) != 0 - || ((unsigned) inst.reloc.exp.X_add_number) > 255) - { - inst.error = _("invalid constant"); - return FAIL; - } - inst.instruction |= INST_IMMEDIATE; - inst.instruction |= inst.reloc.exp.X_add_number; - inst.instruction |= expr.X_add_number << 7; - return SUCCESS; - } +static void +do_t_cpy (void) +{ + if (inst.size_req == 4) + { + inst.instruction = THUMB_OP32 (T_MNEM_mov); + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg; + } + else + { + inst.instruction |= (inst.operands[0].reg & 0x8) << 4; + inst.instruction |= (inst.operands[0].reg & 0x7); + inst.instruction |= inst.operands[1].reg << 3; + } +} - /* Implicit rotation, select a suitable one. */ - value = validate_immediate (inst.reloc.exp.X_add_number); +static void +do_t_czb (void) +{ + constraint (inst.operands[0].reg > 7, BAD_HIREG); + inst.instruction |= inst.operands[0].reg; + inst.reloc.pc_rel = 1; + inst.reloc.type = BFD_RELOC_THUMB_PCREL_BRANCH7; +} - if (value == FAIL) - { - /* Can't be done. Perhaps the code reads something like - "add Rd, Rn, #-n", where "sub Rd, Rn, #n" would be OK. */ - if ((value = negate_data_op (&inst.instruction, - inst.reloc.exp.X_add_number)) - == FAIL) - { - inst.error = _("invalid constant"); - return FAIL; - } - } +static void +do_t_hint (void) +{ + if (unified_syntax && inst.size_req == 4) + inst.instruction = THUMB_OP32 (inst.instruction); + else + inst.instruction = THUMB_OP16 (inst.instruction); +} - inst.instruction |= value; - } +static void +do_t_it (void) +{ + unsigned int cond = inst.operands[0].imm; + if ((cond & 0x1) == 0x0) + { + unsigned int mask = inst.instruction & 0x000f; + inst.instruction &= 0xfff0; - inst.instruction |= INST_IMMEDIATE; - return SUCCESS; - } + if ((mask & 0x7) == 0) + /* no conversion needed */; + else if ((mask & 0x3) == 0) + mask = (~(mask & 0x8) & 0x8) | 0x4; + else if ((mask & 1) == 0) + mask = (~(mask & 0xC) & 0xC) | 0x2; + else + mask = (~(mask & 0xE) & 0xE) | 0x1; - (*str)++; - inst.error = _("register or shift expression expected"); - return FAIL; + inst.instruction |= (mask & 0xF); } + + inst.instruction |= cond << 4; } -static int -fp_op2 (char ** str) +static void +do_t_ldmstm (void) { - skip_whitespace (* str); + /* This really doesn't seem worth it. */ + constraint (inst.reloc.type != BFD_RELOC_UNUSED, + _("expression too complex")); + constraint (inst.operands[1].writeback, + _("Thumb load/store multiple does not support {reglist}^")); - if (fp_reg_required_here (str, 0) != FAIL) - return SUCCESS; - else + if (unified_syntax) { - /* Immediate expression. */ - if (*((*str)++) == '#') + /* See if we can use a 16-bit instruction. */ + if (inst.instruction < 0xffff /* not ldmdb/stmdb */ + && inst.size_req != 4 + && inst.operands[0].reg <= 7 + && !(inst.operands[1].imm & ~0xff) + && (inst.instruction == T_MNEM_stmia + ? inst.operands[0].writeback + : (inst.operands[0].writeback + == !(inst.operands[1].imm & (1 << inst.operands[0].reg))))) { - int i; - - inst.error = NULL; + if (inst.instruction == T_MNEM_stmia + && (inst.operands[1].imm & (1 << inst.operands[0].reg)) + && (inst.operands[1].imm & ((1 << inst.operands[0].reg) - 1))) + as_warn (_("value stored for r%d is UNPREDICTABLE"), + inst.operands[0].reg); - skip_whitespace (* str); - - /* First try and match exact strings, this is to guarantee - that some formats will work even for cross assembly. */ - - for (i = 0; fp_const[i]; i++) + inst.instruction = THUMB_OP16 (inst.instruction); + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].imm; + } + else + { + if (inst.operands[1].imm & (1 << 13)) + as_warn (_("SP should not be in register list")); + if (inst.instruction == T_MNEM_stmia) { - if (strncmp (*str, fp_const[i], strlen (fp_const[i])) == 0) - { - char *start = *str; - - *str += strlen (fp_const[i]); - if (is_end_of_line[(unsigned char) **str]) - { - inst.instruction |= i + 8; - return SUCCESS; - } - *str = start; - } + if (inst.operands[1].imm & (1 << 15)) + as_warn (_("PC should not be in register list")); + if (inst.operands[1].imm & (1 << inst.operands[0].reg)) + as_warn (_("value stored for r%d is UNPREDICTABLE"), + inst.operands[0].reg); } - - /* Just because we didn't get a match doesn't mean that the - constant isn't valid, just that it is in a format that we - don't automatically recognize. Try parsing it with - the standard expression routines. */ - if ((i = my_get_float_expression (str)) >= 0) + else { - inst.instruction |= i + 8; - return SUCCESS; + if (inst.operands[1].imm & (1 << 14) + && inst.operands[1].imm & (1 << 15)) + as_warn (_("LR and PC should not both be in register list")); + if ((inst.operands[1].imm & (1 << inst.operands[0].reg)) + && inst.operands[0].writeback) + as_warn (_("base register should not be in register list " + "when written back")); } - - inst.error = _("invalid floating point immediate expression"); - return FAIL; + if (inst.instruction < 0xffff) + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction |= inst.operands[0].reg << 16; + inst.instruction |= inst.operands[1].imm; + if (inst.operands[0].writeback) + inst.instruction |= WRITE_BACK; } - inst.error = - _("floating point register or immediate expression expected"); - return FAIL; + } + else + { + constraint (inst.operands[0].reg > 7 + || (inst.operands[1].imm & ~0xff), BAD_HIREG); + if (inst.instruction == T_MNEM_stmia) + { + if (!inst.operands[0].writeback) + as_warn (_("this instruction will write back the base register")); + if ((inst.operands[1].imm & (1 << inst.operands[0].reg)) + && (inst.operands[1].imm & ((1 << inst.operands[0].reg) - 1))) + as_warn (_("value stored for r%d is UNPREDICTABLE"), + inst.operands[0].reg); + } + else + { + if (!inst.operands[0].writeback + && !(inst.operands[1].imm & (1 << inst.operands[0].reg))) + as_warn (_("this instruction will write back the base register")); + else if (inst.operands[0].writeback + && (inst.operands[1].imm & (1 << inst.operands[0].reg))) + as_warn (_("this instruction will not write back the base register")); + } + + inst.instruction = THUMB_OP16 (inst.instruction); + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].imm; } } static void -do_arit (char * str) +do_t_ldrex (void) { - skip_whitespace (str); - - if (reg_required_here (&str, 12) == FAIL - || skip_past_comma (&str) == FAIL - || reg_required_here (&str, 16) == FAIL - || skip_past_comma (&str) == FAIL - || data_op2 (&str) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + constraint (!inst.operands[1].isreg || !inst.operands[1].preind + || inst.operands[1].postind || inst.operands[1].writeback + || inst.operands[1].immisreg || inst.operands[1].shifted + || inst.operands[1].negative, + _("instruction does not accept this addressing mode")); - end_of_line (str); + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; + inst.reloc.type = BFD_RELOC_ARM_T32_OFFSET_U8; } static void -do_adr (char * str) +do_t_ldrexd (void) { - /* 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". */ - skip_whitespace (str); - - if (reg_required_here (&str, 12) == FAIL - || skip_past_comma (&str) == FAIL - || my_get_expression (&inst.reloc.exp, &str)) + if (!inst.operands[1].present) { - if (!inst.error) - inst.error = BAD_ARGS; - return; + constraint (inst.operands[0].reg == REG_LR, + _("r14 not allowed as first register " + "when second register is omitted")); + inst.operands[1].reg = inst.operands[0].reg + 1; } + constraint (inst.operands[0].reg == inst.operands[1].reg, + BAD_OVERLAP); - /* Frag hacking will turn this into a sub instruction if the offset turns - out to be negative. */ - inst.reloc.type = BFD_RELOC_ARM_IMMEDIATE; -#ifndef TE_WINCE - inst.reloc.exp.X_add_number -= 8; /* PC relative adjust. */ -#endif - inst.reloc.pc_rel = 1; - - end_of_line (str); + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 8; + inst.instruction |= inst.operands[2].reg << 16; } static void -do_adrl (char * str) +do_t_ldst (void) { - /* This is a pseudo-op of the form "adrl rd, label" to be converted - into a relative address of the form: - add rd, pc, #low(label-.-8)" - add rd, rd, #high(label-.-8)" */ - - skip_whitespace (str); - - if (reg_required_here (&str, 12) == FAIL - || skip_past_comma (&str) == FAIL - || my_get_expression (&inst.reloc.exp, &str)) + if (unified_syntax) { - if (!inst.error) - inst.error = BAD_ARGS; + /* Generation of 16-bit instructions for anything other than + Rd, [Rn, Ri] is deferred to section relaxation time. */ + if (inst.operands[1].isreg && inst.operands[1].immisreg + && !inst.operands[1].shifted && !inst.operands[1].postind + && !inst.operands[1].negative && inst.operands[0].reg <= 7 + && inst.operands[1].reg <= 7 && inst.operands[1].imm <= 7 + && inst.instruction <= 0xffff) + { + inst.instruction = THUMB_OP16 (inst.instruction); + goto op16; + } + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction |= inst.operands[0].reg << 12; + encode_thumb32_addr_mode (1, /*is_t=*/FALSE, /*is_d=*/FALSE); return; } - end_of_line (str); - /* Frag hacking will turn this into a sub instruction if the offset turns - out to be negative. */ - inst.reloc.type = BFD_RELOC_ARM_ADRL_IMMEDIATE; -#ifndef TE_WINCE - inst.reloc.exp.X_add_number -= 8; /* PC relative adjust */ -#endif - inst.reloc.pc_rel = 1; - inst.size = INSN_SIZE * 2; -} + constraint (inst.operands[0].reg > 7, BAD_HIREG); -static void -do_cmp (char * str) -{ - skip_whitespace (str); + if (inst.instruction == T_MNEM_ldrsh || inst.instruction == T_MNEM_ldrsb) + { + /* Only [Rn,Rm] is acceptable. */ + constraint (inst.operands[1].reg > 7 || inst.operands[1].imm > 7, BAD_HIREG); + constraint (!inst.operands[1].isreg || !inst.operands[1].immisreg + || inst.operands[1].postind || inst.operands[1].shifted + || inst.operands[1].negative, + _("Thumb does not support this addressing mode")); + inst.instruction = THUMB_OP16 (inst.instruction); + goto op16; + } + + inst.instruction = THUMB_OP16 (inst.instruction); + if (!inst.operands[1].isreg) + if (move_or_literal_pool (0, /*thumb_p=*/TRUE, /*mode_3=*/FALSE)) + return; - if (reg_required_here (&str, 16) == FAIL) + constraint (!inst.operands[1].preind + || inst.operands[1].shifted + || inst.operands[1].writeback, + _("Thumb does not support this addressing mode")); + if (inst.operands[1].reg == REG_PC || inst.operands[1].reg == REG_SP) { - if (!inst.error) - inst.error = BAD_ARGS; + constraint (inst.instruction & 0x0600, + _("byte or halfword not valid for base register")); + constraint (inst.operands[1].reg == REG_PC + && !(inst.instruction & THUMB_LOAD_BIT), + _("r15 based store not allowed")); + constraint (inst.operands[1].immisreg, + _("invalid base register for register offset")); + + if (inst.operands[1].reg == REG_PC) + inst.instruction = T_OPCODE_LDR_PC; + else if (inst.instruction & THUMB_LOAD_BIT) + inst.instruction = T_OPCODE_LDR_SP; + else + inst.instruction = T_OPCODE_STR_SP; + + inst.instruction |= inst.operands[0].reg << 8; + inst.reloc.type = BFD_RELOC_ARM_THUMB_OFFSET; return; } - if (skip_past_comma (&str) == FAIL - || data_op2 (&str) == FAIL) + constraint (inst.operands[1].reg > 7, BAD_HIREG); + if (!inst.operands[1].immisreg) { - if (!inst.error) - inst.error = BAD_ARGS; + /* Immediate offset. */ + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[1].reg << 3; + inst.reloc.type = BFD_RELOC_ARM_THUMB_OFFSET; return; } - end_of_line (str); -} - -static void -do_mov (char * str) -{ - skip_whitespace (str); + /* Register offset. */ + constraint (inst.operands[1].imm > 7, BAD_HIREG); + constraint (inst.operands[1].negative, + _("Thumb does not support this addressing mode")); - if (reg_required_here (&str, 12) == FAIL) + op16: + switch (inst.instruction) { - if (!inst.error) - inst.error = BAD_ARGS; - return; + case T_OPCODE_STR_IW: inst.instruction = T_OPCODE_STR_RW; break; + case T_OPCODE_STR_IH: inst.instruction = T_OPCODE_STR_RH; break; + case T_OPCODE_STR_IB: inst.instruction = T_OPCODE_STR_RB; break; + case T_OPCODE_LDR_IW: inst.instruction = T_OPCODE_LDR_RW; break; + case T_OPCODE_LDR_IH: inst.instruction = T_OPCODE_LDR_RH; break; + case T_OPCODE_LDR_IB: inst.instruction = T_OPCODE_LDR_RB; break; + case 0x5600 /* ldrsb */: + case 0x5e00 /* ldrsh */: break; + default: abort (); } - if (skip_past_comma (&str) == FAIL - || data_op2 (&str) == FAIL) + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[1].reg << 3; + inst.instruction |= inst.operands[1].imm << 6; +} + +static void +do_t_ldstd (void) +{ + if (!inst.operands[1].present) { - if (!inst.error) - inst.error = BAD_ARGS; - return; + inst.operands[1].reg = inst.operands[0].reg + 1; + constraint (inst.operands[0].reg == REG_LR, + _("r14 not allowed here")); } + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 8; + encode_thumb32_addr_mode (2, /*is_t=*/FALSE, /*is_d=*/TRUE); + +} - end_of_line (str); +static void +do_t_ldstt (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + encode_thumb32_addr_mode (1, /*is_t=*/TRUE, /*is_d=*/FALSE); } static void -do_ldst (char * str) +do_t_mla (void) { - int pre_inc = 0; - int conflict_reg; - int value; + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[2].reg; + inst.instruction |= inst.operands[3].reg << 12; +} - skip_whitespace (str); +static void +do_t_mlal (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 8; + inst.instruction |= inst.operands[2].reg << 16; + inst.instruction |= inst.operands[3].reg; +} - if ((conflict_reg = reg_required_here (&str, 12)) == FAIL) +static void +do_t_mov_cmp (void) +{ + if (unified_syntax) { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + int r0off = (inst.instruction == T_MNEM_mov + || inst.instruction == T_MNEM_movs) ? 8 : 16; + if (!inst.operands[1].isreg) + { + /* For an immediate, we always generate a 32-bit opcode; + section relaxation will shrink it later if possible. */ + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction = (inst.instruction & 0xe1ffffff) | 0x10000000; + inst.instruction |= inst.operands[0].reg << r0off; + inst.reloc.type = BFD_RELOC_ARM_T32_IMMEDIATE; + } + else if (inst.size_req == 4 + || inst.operands[1].shifted + || (inst.instruction == T_MNEM_movs + && (inst.operands[0].reg > 7 || inst.operands[1].reg > 7))) + { + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction |= inst.operands[0].reg << r0off; + encode_thumb32_shifted_operand (1); + } + else + switch (inst.instruction) + { + case T_MNEM_mov: + inst.instruction = T_OPCODE_MOV_HR; + inst.instruction |= (inst.operands[0].reg & 0x8) << 4; + inst.instruction |= (inst.operands[0].reg & 0x7); + inst.instruction |= inst.operands[1].reg << 3; + break; - if (skip_past_comma (&str) == FAIL) - { - inst.error = _("address expected"); + case T_MNEM_movs: + /* We know we have low registers at this point. + Generate ADD Rd, Rs, #0. */ + inst.instruction = T_OPCODE_ADD_I3; + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[1].reg << 3; + break; + + case T_MNEM_cmp: + if (inst.operands[0].reg <= 7 && inst.operands[1].reg <= 7) + { + inst.instruction = T_OPCODE_CMP_LR; + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[1].reg << 3; + } + else + { + inst.instruction = T_OPCODE_CMP_HR; + inst.instruction |= (inst.operands[0].reg & 0x8) << 4; + inst.instruction |= (inst.operands[0].reg & 0x7); + inst.instruction |= inst.operands[1].reg << 3; + } + break; + } return; } - if (*str == '[') + inst.instruction = THUMB_OP16 (inst.instruction); + if (inst.operands[1].isreg) { - int reg; - - str++; - - skip_whitespace (str); - - if ((reg = reg_required_here (&str, 16)) == FAIL) - return; - - /* Conflicts can occur on stores as well as loads. */ - conflict_reg = (conflict_reg == reg); - - skip_whitespace (str); - - if (*str == ']') + if (inst.operands[0].reg < 8 && inst.operands[1].reg < 8) { - str ++; - - if (skip_past_comma (&str) == SUCCESS) - { - /* [Rn],... (post inc) */ - if (ldst_extend (&str) == FAIL) - return; - if (conflict_reg) - as_warn (_("%s register same as write-back base"), - ((inst.instruction & LOAD_BIT) - ? _("destination") : _("source"))); - } + /* A move of two lowregs is encoded as ADD Rd, Rs, #0 + since a MOV instruction produces unpredictable results. */ + if (inst.instruction == T_OPCODE_MOV_I8) + inst.instruction = T_OPCODE_ADD_I3; else - { - /* [Rn] */ - skip_whitespace (str); - - if (*str == '!') - { - if (conflict_reg) - as_warn (_("%s register same as write-back base"), - ((inst.instruction & LOAD_BIT) - ? _("destination") : _("source"))); - str++; - inst.instruction |= WRITE_BACK; - } + inst.instruction = T_OPCODE_CMP_LR; - inst.instruction |= INDEX_UP; - pre_inc = 1; - } + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[1].reg << 3; } else { - /* [Rn,...] */ - if (skip_past_comma (&str) == FAIL) - { - inst.error = _("pre-indexed expression expected"); - return; - } - - pre_inc = 1; - if (ldst_extend (&str) == FAIL) - return; - - skip_whitespace (str); - - if (*str++ != ']') - { - inst.error = _("missing ]"); - return; - } - - skip_whitespace (str); - - if (*str == '!') - { - if (conflict_reg) - as_warn (_("%s register same as write-back base"), - ((inst.instruction & LOAD_BIT) - ? _("destination") : _("source"))); - str++; - inst.instruction |= WRITE_BACK; - } + if (inst.instruction == T_OPCODE_MOV_I8) + inst.instruction = T_OPCODE_MOV_HR; + else + inst.instruction = T_OPCODE_CMP_HR; + do_t_cpy (); } } - else if (*str == '=') + else { - if ((inst.instruction & LOAD_BIT) == 0) - { - inst.error = _("invalid pseudo operation"); - return; - } - - /* Parse an "ldr Rd, =expr" instruction; this is another pseudo op. */ - str++; - - skip_whitespace (str); + constraint (inst.operands[0].reg > 7, + _("only lo regs allowed with immediate")); + inst.instruction |= inst.operands[0].reg << 8; + inst.reloc.type = BFD_RELOC_ARM_THUMB_IMM; + } +} - if (my_get_expression (&inst.reloc.exp, &str)) - return; +static void +do_t_mov16 (void) +{ + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= (inst.operands[1].imm & 0xf000) << 4; + inst.instruction |= (inst.operands[1].imm & 0x0800) << 15; + inst.instruction |= (inst.operands[1].imm & 0x0700) << 4; + inst.instruction |= (inst.operands[1].imm & 0x00ff); +} - if (inst.reloc.exp.X_op != O_constant - && inst.reloc.exp.X_op != O_symbol) +static void +do_t_mvn_tst (void) +{ + if (unified_syntax) + { + int r0off = (inst.instruction == T_MNEM_mvn + || inst.instruction == T_MNEM_mvns) ? 8 : 16; + if (!inst.operands[1].isreg) { - inst.error = _("constant expression expected"); - return; + /* For an immediate, we always generate a 32-bit opcode; + section relaxation will shrink it later if possible. */ + if (inst.instruction < 0xffff) + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction = (inst.instruction & 0xe1ffffff) | 0x10000000; + inst.instruction |= inst.operands[0].reg << r0off; + inst.reloc.type = BFD_RELOC_ARM_T32_IMMEDIATE; } - - if (inst.reloc.exp.X_op == O_constant) + else { - value = validate_immediate (inst.reloc.exp.X_add_number); - - if (value != FAIL) + /* See if we can do this with a 16-bit instruction. */ + if (inst.instruction < 0xffff + && THUMB_SETS_FLAGS (inst.instruction) + && !inst.operands[1].shifted + && inst.operands[0].reg <= 7 + && inst.operands[1].reg <= 7 + && inst.size_req != 4) { - /* This can be done with a mov instruction. */ - inst.instruction &= LITERAL_MASK; - inst.instruction |= (INST_IMMEDIATE - | (OPCODE_MOV << DATA_OP_SHIFT)); - inst.instruction |= value & 0xfff; - end_of_line (str); - return; + inst.instruction = THUMB_OP16 (inst.instruction); + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[1].reg << 3; } - - value = validate_immediate (~inst.reloc.exp.X_add_number); - - if (value != FAIL) + else { - /* This can be done with a mvn instruction. */ - inst.instruction &= LITERAL_MASK; - inst.instruction |= (INST_IMMEDIATE - | (OPCODE_MVN << DATA_OP_SHIFT)); - inst.instruction |= value & 0xfff; - end_of_line (str); - return; + constraint (inst.operands[1].shifted + && inst.operands[1].immisreg, + _("shift must be constant")); + if (inst.instruction < 0xffff) + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction |= inst.operands[0].reg << r0off; + encode_thumb32_shifted_operand (1); } } - - /* Insert into literal pool. */ - if (add_to_lit_pool () == FAIL) - { - if (!inst.error) - inst.error = _("literal pool insertion failed"); - return; - } - - /* Change the instruction exp to point to the pool. */ - inst.reloc.type = BFD_RELOC_ARM_LITERAL; - inst.reloc.pc_rel = 1; - inst.instruction |= (REG_PC << 16); - pre_inc = 1; } else { - if (my_get_expression (&inst.reloc.exp, &str)) - return; + constraint (inst.instruction > 0xffff + || inst.instruction == T_MNEM_mvns, BAD_THUMB32); + constraint (!inst.operands[1].isreg || inst.operands[1].shifted, + _("unshifted register required")); + constraint (inst.operands[0].reg > 7 || inst.operands[1].reg > 7, + BAD_HIREG); - inst.reloc.type = BFD_RELOC_ARM_OFFSET_IMM; -#ifndef TE_WINCE - /* PC rel adjust. */ - inst.reloc.exp.X_add_number -= 8; -#endif - inst.reloc.pc_rel = 1; - inst.instruction |= (REG_PC << 16); - pre_inc = 1; + inst.instruction = THUMB_OP16 (inst.instruction); + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[1].reg << 3; } +} - inst.instruction |= (pre_inc ? PRE_INDEX : 0); - end_of_line (str); +static void +do_t_mrs (void) +{ + /* mrs only accepts CPSR/SPSR/CPSR_all/SPSR_all. */ + constraint ((inst.operands[1].imm & (PSR_c|PSR_x|PSR_s|PSR_f)) + != (PSR_c|PSR_f), + _("'CPSR' or 'SPSR' expected")); + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= (inst.operands[1].imm & SPSR_BIT) >> 2; } static void -do_ldstt (char * str) +do_t_msr (void) { - int conflict_reg; + constraint (!inst.operands[1].isreg, + _("Thumb encoding does not support an immediate here")); + inst.instruction |= (inst.operands[0].imm & SPSR_BIT) >> 2; + inst.instruction |= (inst.operands[0].imm & ~SPSR_BIT) >> 8; + inst.instruction |= inst.operands[1].reg << 16; +} - skip_whitespace (str); +static void +do_t_mul (void) +{ + if (!inst.operands[2].present) + inst.operands[2].reg = inst.operands[0].reg; - if ((conflict_reg = reg_required_here (& str, 12)) == FAIL) + /* There is no 32-bit MULS and no 16-bit MUL. */ + if (unified_syntax && inst.instruction == T_MNEM_mul) { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } - - if (skip_past_comma (& str) == FAIL) - { - inst.error = _("address expected"); - return; + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[2].reg << 0; } - - if (*str == '[') + else { - int reg; - - str++; + constraint (!unified_syntax + && inst.instruction == T_MNEM_muls, BAD_THUMB32); + constraint (inst.operands[0].reg > 7 || inst.operands[1].reg > 7, + BAD_HIREG); - skip_whitespace (str); + inst.instruction = THUMB_OP16 (inst.instruction); + inst.instruction |= inst.operands[0].reg; - if ((reg = reg_required_here (&str, 16)) == FAIL) - return; + if (inst.operands[0].reg == inst.operands[1].reg) + inst.instruction |= inst.operands[2].reg << 3; + else if (inst.operands[0].reg == inst.operands[2].reg) + inst.instruction |= inst.operands[1].reg << 3; + else + constraint (1, _("dest must overlap one source register")); + } +} - /* ldrt/strt always use post-indexed addressing, so if the base is - the same as Rd, we warn. */ - if (conflict_reg == reg) - as_warn (_("%s register same as write-back base"), - ((inst.instruction & LOAD_BIT) - ? _("destination") : _("source"))); +static void +do_t_mull (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 8; + inst.instruction |= inst.operands[2].reg << 16; + inst.instruction |= inst.operands[3].reg; - skip_whitespace (str); + if (inst.operands[0].reg == inst.operands[1].reg) + as_tsktsk (_("rdhi and rdlo must be different")); +} - if (*str == ']') +static void +do_t_nop (void) +{ + if (unified_syntax) + { + if (inst.size_req == 4 || inst.operands[0].imm > 15) { - str ++; - - if (skip_past_comma (&str) == SUCCESS) - { - /* [Rn],... (post inc) */ - if (ldst_extend (&str) == FAIL) - return; - } - else - { - /* [Rn] */ - skip_whitespace (str); - - /* Skip a write-back '!'. */ - if (*str == '!') - str++; + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction |= inst.operands[0].imm; + } + else + { + inst.instruction = THUMB_OP16 (inst.instruction); + inst.instruction |= inst.operands[0].imm << 4; + } + } + else + { + constraint (inst.operands[0].present, + _("Thumb does not support NOP with hints")); + inst.instruction = 0x46c0; + } +} - inst.instruction |= INDEX_UP; - } +static void +do_t_neg (void) +{ + if (unified_syntax) + { + if (inst.operands[0].reg > 7 || inst.operands[1].reg > 7 + || !THUMB_SETS_FLAGS (inst.instruction) + || inst.size_req == 4) + { + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg << 16; } else { - inst.error = _("post-indexed expression expected"); - return; + inst.instruction = THUMB_OP16 (inst.instruction); + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[1].reg << 3; } } else { - inst.error = _("post-indexed expression expected"); - return; + constraint (inst.operands[0].reg > 7 || inst.operands[1].reg > 7, + BAD_HIREG); + constraint (THUMB_SETS_FLAGS (inst.instruction), BAD_THUMB32); + + inst.instruction = THUMB_OP16 (inst.instruction); + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[1].reg << 3; } +} - end_of_line (str); +static void +do_t_pkhbt (void) +{ + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[2].reg; + if (inst.operands[3].present) + { + unsigned int val = inst.reloc.exp.X_add_number; + constraint (inst.reloc.exp.X_op != O_constant, + _("expression too complex")); + inst.instruction |= (val & 0x1c) << 10; + inst.instruction |= (val & 0x03) << 6; + } } -/* Halfword and signed-byte load/store operations. */ +static void +do_t_pkhtb (void) +{ + if (!inst.operands[3].present) + inst.instruction &= ~0x00000020; + do_t_pkhbt (); +} static void -do_ldstv4 (char * str) +do_t_pld (void) { - int pre_inc = 0; - int conflict_reg; - int value; + encode_thumb32_addr_mode (0, /*is_t=*/FALSE, /*is_d=*/FALSE); +} - skip_whitespace (str); +static void +do_t_push_pop (void) +{ + constraint (inst.operands[0].writeback, + _("push/pop do not support {reglist}^")); + constraint (inst.reloc.type != BFD_RELOC_UNUSED, + _("expression too complex")); - if ((conflict_reg = reg_required_here (& str, 12)) == FAIL) + if ((inst.operands[0].imm & ~0xff) == 0) + inst.instruction = THUMB_OP16 (inst.instruction); + else if ((inst.instruction == T_MNEM_push + && (inst.operands[0].imm & ~0xff) == 1 << REG_LR) + || (inst.instruction == T_MNEM_pop + && (inst.operands[0].imm & ~0xff) == 1 << REG_PC)) { - if (!inst.error) - inst.error = BAD_ARGS; - return; + inst.instruction = THUMB_OP16 (inst.instruction); + inst.instruction |= THUMB_PP_PC_LR; + inst.operands[0].imm &= 0xff; } + else if (unified_syntax) + { + if (inst.operands[1].imm & (1 << 13)) + as_warn (_("SP should not be in register list")); + if (inst.instruction == T_MNEM_push) + { + if (inst.operands[1].imm & (1 << 15)) + as_warn (_("PC should not be in register list")); + } + else + { + if (inst.operands[1].imm & (1 << 14) + && inst.operands[1].imm & (1 << 15)) + as_warn (_("LR and PC should not both be in register list")); + } - if (skip_past_comma (& str) == FAIL) + inst.instruction = THUMB_OP32 (inst.instruction); + } + else { - inst.error = _("address expected"); + inst.error = _("invalid register list to push/pop instruction"); return; } - if (*str == '[') - { - int reg; + inst.instruction |= inst.operands[0].imm; +} - str++; +static void +do_t_rbit (void) +{ + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg << 16; +} - skip_whitespace (str); +static void +do_t_rev (void) +{ + if (inst.operands[0].reg <= 7 && inst.operands[1].reg <= 7 + && inst.size_req != 4) + { + inst.instruction = THUMB_OP16 (inst.instruction); + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[1].reg << 3; + } + else if (unified_syntax) + { + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[1].reg; + } + else + inst.error = BAD_HIREG; +} - if ((reg = reg_required_here (&str, 16)) == FAIL) - return; +static void +do_t_rsb (void) +{ + int Rd, Rs; - /* Conflicts can occur on stores as well as loads. */ - conflict_reg = (conflict_reg == reg); + Rd = inst.operands[0].reg; + Rs = (inst.operands[1].present + ? inst.operands[1].reg /* Rd, Rs, foo */ + : inst.operands[0].reg); /* Rd, foo -> Rd, Rd, foo */ - skip_whitespace (str); + inst.instruction |= Rd << 8; + inst.instruction |= Rs << 16; + if (!inst.operands[2].isreg) + { + inst.instruction = (inst.instruction & 0xe1ffffff) | 0x10000000; + inst.reloc.type = BFD_RELOC_ARM_T32_IMMEDIATE; + } + else + encode_thumb32_shifted_operand (2); +} - if (*str == ']') - { - str ++; +static void +do_t_setend (void) +{ + if (inst.operands[0].imm) + inst.instruction |= 0x8; +} - if (skip_past_comma (&str) == SUCCESS) - { - /* [Rn],... (post inc) */ - if (ldst_extend_v4 (&str) == FAIL) - return; - if (conflict_reg) - as_warn (_("%s register same as write-back base"), - ((inst.instruction & LOAD_BIT) - ? _("destination") : _("source"))); +static void +do_t_shift (void) +{ + if (!inst.operands[1].present) + inst.operands[1].reg = inst.operands[0].reg; + + if (unified_syntax) + { + if (inst.operands[0].reg > 7 + || inst.operands[1].reg > 7 + || !THUMB_SETS_FLAGS (inst.instruction) + || (!inst.operands[2].isreg && inst.instruction == T_MNEM_rors) + || (inst.operands[2].isreg && inst.operands[1].reg != inst.operands[0].reg) + || inst.size_req == 4) + { + if (inst.operands[2].isreg) + { + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[2].reg; } else { - /* [Rn] */ - inst.instruction |= HWOFFSET_IMM; - - skip_whitespace (str); - - if (*str == '!') + inst.operands[1].shifted = 1; + switch (inst.instruction) { - if (conflict_reg) - as_warn (_("%s register same as write-back base"), - ((inst.instruction & LOAD_BIT) - ? _("destination") : _("source"))); - str++; - inst.instruction |= WRITE_BACK; + case T_MNEM_asr: + case T_MNEM_asrs: inst.operands[1].shift_kind = SHIFT_ASR; break; + case T_MNEM_lsl: + case T_MNEM_lsls: inst.operands[1].shift_kind = SHIFT_LSL; break; + case T_MNEM_lsr: + case T_MNEM_lsrs: inst.operands[1].shift_kind = SHIFT_LSR; break; + case T_MNEM_ror: + case T_MNEM_rors: inst.operands[1].shift_kind = SHIFT_ROR; break; + default: abort (); } - - inst.instruction |= INDEX_UP; - pre_inc = 1; + + inst.instruction = THUMB_OP32 (THUMB_SETS_FLAGS (inst.instruction) + ? T_MNEM_movs : T_MNEM_mov); + inst.instruction |= inst.operands[0].reg << 8; + encode_thumb32_shifted_operand (1); + /* Prevent the incorrect generation of an ARM_IMMEDIATE fixup. */ + inst.reloc.type = BFD_RELOC_UNUSED; } } else { - /* [Rn,...] */ - if (skip_past_comma (&str) == FAIL) - { - inst.error = _("pre-indexed expression expected"); - return; - } - - pre_inc = 1; - if (ldst_extend_v4 (&str) == FAIL) - return; - - skip_whitespace (str); - - if (*str++ != ']') + if (inst.operands[2].isreg) { - inst.error = _("missing ]"); - return; + switch (inst.instruction) + { + case T_MNEM_asrs: inst.instruction = T_OPCODE_ASR_R; break; + case T_MNEM_lsls: inst.instruction = T_OPCODE_LSL_R; break; + case T_MNEM_lsrs: inst.instruction = T_OPCODE_LSR_R; break; + case T_MNEM_rors: inst.instruction = T_OPCODE_ROR_R; break; + default: abort (); + } + + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[2].reg << 3; } - - skip_whitespace (str); - - if (*str == '!') + else { - if (conflict_reg) - as_warn (_("%s register same as write-back base"), - ((inst.instruction & LOAD_BIT) - ? _("destination") : _("source"))); - str++; - inst.instruction |= WRITE_BACK; + switch (inst.instruction) + { + case T_MNEM_asrs: inst.instruction = T_OPCODE_ASR_I; break; + case T_MNEM_lsls: inst.instruction = T_OPCODE_LSL_I; break; + case T_MNEM_lsrs: inst.instruction = T_OPCODE_LSR_I; break; + default: abort (); + } + inst.reloc.type = BFD_RELOC_ARM_THUMB_SHIFT; + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[1].reg << 3; } } } - else if (*str == '=') + else { - if ((inst.instruction & LOAD_BIT) == 0) - { - inst.error = _("invalid pseudo operation"); - return; - } - - /* XXX Does this work correctly for half-word/byte ops? */ - /* Parse an "ldr Rd, =expr" instruction; this is another pseudo op. */ - str++; - - skip_whitespace (str); - - if (my_get_expression (&inst.reloc.exp, &str)) - return; - - if (inst.reloc.exp.X_op != O_constant - && inst.reloc.exp.X_op != O_symbol) - { - inst.error = _("constant expression expected"); - return; - } + constraint (inst.operands[0].reg > 7 + || inst.operands[1].reg > 7, BAD_HIREG); + constraint (THUMB_SETS_FLAGS (inst.instruction), BAD_THUMB32); - if (inst.reloc.exp.X_op == O_constant) + if (inst.operands[2].isreg) /* Rd, {Rs,} Rn */ { - value = validate_immediate (inst.reloc.exp.X_add_number); - - if (value != FAIL) - { - /* This can be done with a mov instruction. */ - inst.instruction &= LITERAL_MASK; - inst.instruction |= INST_IMMEDIATE | (OPCODE_MOV << DATA_OP_SHIFT); - inst.instruction |= value & 0xfff; - end_of_line (str); - return; - } - - value = validate_immediate (~ inst.reloc.exp.X_add_number); + constraint (inst.operands[2].reg > 7, BAD_HIREG); + constraint (inst.operands[0].reg != inst.operands[1].reg, + _("source1 and dest must be same register")); - if (value != FAIL) + switch (inst.instruction) { - /* This can be done with a mvn instruction. */ - inst.instruction &= LITERAL_MASK; - inst.instruction |= INST_IMMEDIATE | (OPCODE_MVN << DATA_OP_SHIFT); - inst.instruction |= value & 0xfff; - end_of_line (str); - return; + case T_MNEM_asr: inst.instruction = T_OPCODE_ASR_R; break; + case T_MNEM_lsl: inst.instruction = T_OPCODE_LSL_R; break; + case T_MNEM_lsr: inst.instruction = T_OPCODE_LSR_R; break; + case T_MNEM_ror: inst.instruction = T_OPCODE_ROR_R; break; + default: abort (); } + + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[2].reg << 3; } - - /* Insert into literal pool. */ - if (add_to_lit_pool () == FAIL) + else { - if (!inst.error) - inst.error = _("literal pool insertion failed"); - return; + switch (inst.instruction) + { + case T_MNEM_asr: inst.instruction = T_OPCODE_ASR_I; break; + case T_MNEM_lsl: inst.instruction = T_OPCODE_LSL_I; break; + case T_MNEM_lsr: inst.instruction = T_OPCODE_LSR_I; break; + case T_MNEM_ror: inst.error = _("ror #imm not supported"); return; + default: abort (); + } + inst.reloc.type = BFD_RELOC_ARM_THUMB_SHIFT; + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[1].reg << 3; } - - /* Change the instruction exp to point to the pool. */ - inst.instruction |= HWOFFSET_IMM; - inst.reloc.type = BFD_RELOC_ARM_HWLITERAL; - inst.reloc.pc_rel = 1; - inst.instruction |= (REG_PC << 16); - pre_inc = 1; - } - else - { - if (my_get_expression (&inst.reloc.exp, &str)) - return; - - inst.instruction |= HWOFFSET_IMM; - inst.reloc.type = BFD_RELOC_ARM_OFFSET_IMM8; -#ifndef TE_WINCE - /* PC rel adjust. */ - inst.reloc.exp.X_add_number -= 8; -#endif - inst.reloc.pc_rel = 1; - inst.instruction |= (REG_PC << 16); - pre_inc = 1; } +} - inst.instruction |= (pre_inc ? PRE_INDEX : 0); - end_of_line (str); +static void +do_t_simd (void) +{ + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[2].reg; } static void -do_ldsttv4 (char * str) +do_t_smi (void) { - int conflict_reg; + unsigned int value = inst.reloc.exp.X_add_number; + constraint (inst.reloc.exp.X_op != O_constant, + _("expression too complex")); + inst.reloc.type = BFD_RELOC_UNUSED; + inst.instruction |= (value & 0xf000) >> 12; + inst.instruction |= (value & 0x0ff0); + inst.instruction |= (value & 0x000f) << 16; +} - skip_whitespace (str); +static void +do_t_ssat (void) +{ + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].imm - 1; + inst.instruction |= inst.operands[2].reg << 16; - if ((conflict_reg = reg_required_here (& str, 12)) == FAIL) + if (inst.operands[3].present) { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + constraint (inst.reloc.exp.X_op != O_constant, + _("expression too complex")); - if (skip_past_comma (& str) == FAIL) - { - inst.error = _("address expected"); - return; + if (inst.reloc.exp.X_add_number != 0) + { + if (inst.operands[3].shift_kind == SHIFT_ASR) + inst.instruction |= 0x00200000; /* sh bit */ + inst.instruction |= (inst.reloc.exp.X_add_number & 0x1c) << 10; + inst.instruction |= (inst.reloc.exp.X_add_number & 0x03) << 6; + } + inst.reloc.type = BFD_RELOC_UNUSED; } +} - if (*str == '[') - { - int reg; - - str++; - - skip_whitespace (str); +static void +do_t_ssat16 (void) +{ + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].imm - 1; + inst.instruction |= inst.operands[2].reg << 16; +} - if ((reg = reg_required_here (&str, 16)) == FAIL) - return; +static void +do_t_strex (void) +{ + constraint (!inst.operands[2].isreg || !inst.operands[2].preind + || inst.operands[2].postind || inst.operands[2].writeback + || inst.operands[2].immisreg || inst.operands[2].shifted + || inst.operands[2].negative, + _("instruction does not accept this addressing mode")); - /* ldrt/strt always use post-indexed addressing, so if the base is - the same as Rd, we warn. */ - if (conflict_reg == reg) - as_warn (_("%s register same as write-back base"), - ((inst.instruction & LOAD_BIT) - ? _("destination") : _("source"))); + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg << 12; + inst.instruction |= inst.operands[2].reg << 16; + inst.reloc.type = BFD_RELOC_ARM_T32_OFFSET_U8; +} - skip_whitespace (str); +static void +do_t_strexd (void) +{ + if (!inst.operands[2].present) + inst.operands[2].reg = inst.operands[1].reg + 1; - if (*str == ']') - { - str ++; + constraint (inst.operands[0].reg == inst.operands[1].reg + || inst.operands[0].reg == inst.operands[2].reg + || inst.operands[0].reg == inst.operands[3].reg + || inst.operands[1].reg == inst.operands[2].reg, + BAD_OVERLAP); - if (skip_past_comma (&str) == SUCCESS) - { - /* [Rn],... (post inc) */ - if (ldst_extend_v4 (&str) == FAIL) - return; - } - else - { - /* [Rn] */ - skip_whitespace (str); + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[1].reg << 12; + inst.instruction |= inst.operands[2].reg << 8; + inst.instruction |= inst.operands[3].reg << 16; +} - /* Skip a write-back '!'. */ - if (*str == '!') - str++; +static void +do_t_sxtah (void) +{ + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[2].reg; + inst.instruction |= inst.operands[3].imm << 4; +} - inst.instruction |= (INDEX_UP|HWOFFSET_IMM); - } - } - else - { - inst.error = _("post-indexed expression expected"); - return; - } +static void +do_t_sxth (void) +{ + if (inst.instruction <= 0xffff && inst.size_req != 4 + && inst.operands[0].reg <= 7 && inst.operands[1].reg <= 7 + && (!inst.operands[2].present || inst.operands[2].imm == 0)) + { + inst.instruction = THUMB_OP16 (inst.instruction); + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[1].reg << 3; + } + else if (unified_syntax) + { + if (inst.instruction <= 0xffff) + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg; + inst.instruction |= inst.operands[2].imm << 4; } else { - inst.error = _("post-indexed expression expected"); - return; + constraint (inst.operands[2].present && inst.operands[2].imm != 0, + _("Thumb encoding does not support rotation")); + constraint (1, BAD_HIREG); } - - end_of_line (str); } +static void +do_t_swi (void) +{ + inst.reloc.type = BFD_RELOC_ARM_SWI; +} -static long -reg_list (char ** strp) +static void +do_t_usat (void) { - char * str = * strp; - long range = 0; - int another_range; + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].imm; + inst.instruction |= inst.operands[2].reg << 16; - /* We come back here if we get ranges concatenated by '+' or '|'. */ - do + if (inst.operands[3].present) { - another_range = 0; - - if (*str == '{') + constraint (inst.reloc.exp.X_op != O_constant, + _("expression too complex")); + if (inst.reloc.exp.X_add_number != 0) { - int in_range = 0; - int cur_reg = -1; + if (inst.operands[3].shift_kind == SHIFT_ASR) + inst.instruction |= 0x00200000; /* sh bit */ - str++; - do - { - int reg; + inst.instruction |= (inst.reloc.exp.X_add_number & 0x1c) << 10; + inst.instruction |= (inst.reloc.exp.X_add_number & 0x03) << 6; + } + inst.reloc.type = BFD_RELOC_UNUSED; + } +} - skip_whitespace (str); +static void +do_t_usat16 (void) +{ + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].imm; + inst.instruction |= inst.operands[2].reg << 16; +} + +/* Overall per-instruction processing. */ - if ((reg = reg_required_here (& str, -1)) == FAIL) - return FAIL; +/* We need to be able to fix up arbitrary expressions in some statements. + This is so that we can handle symbols that are an arbitrary distance from + the pc. The most common cases are of the form ((+/-sym -/+ . - 8) & mask), + which returns part of an address in a form which will be valid for + a data instruction. We do this by pushing the expression into a symbol + in the expr_section, and creating a fix for that. */ - if (in_range) - { - int i; +static void +fix_new_arm (fragS * frag, + int where, + short int size, + expressionS * exp, + int pc_rel, + int reloc) +{ + fixS * new_fix; - if (reg <= cur_reg) - { - inst.error = _("bad range in register list"); - return FAIL; - } - - for (i = cur_reg + 1; i < reg; i++) - { - if (range & (1 << i)) - as_tsktsk - (_("Warning: duplicated register (r%d) in register list"), - i); - else - range |= 1 << i; - } - in_range = 0; - } - - if (range & (1 << reg)) - as_tsktsk (_("Warning: duplicated register (r%d) in register list"), - reg); - else if (reg <= cur_reg) - as_tsktsk (_("Warning: register range not in ascending order")); - - range |= 1 << reg; - cur_reg = reg; - } - while (skip_past_comma (&str) != FAIL - || (in_range = 1, *str++ == '-')); - str--; - skip_whitespace (str); - - if (*str++ != '}') - { - inst.error = _("missing `}'"); - return FAIL; - } - } - else - { - expressionS expr; - - if (my_get_expression (&expr, &str)) - return FAIL; - - if (expr.X_op == O_constant) - { - if (expr.X_add_number - != (expr.X_add_number & 0x0000ffff)) - { - inst.error = _("invalid register mask"); - return FAIL; - } - - if ((range & expr.X_add_number) != 0) - { - int regno = range & expr.X_add_number; - - regno &= -regno; - regno = (1 << regno) - 1; - as_tsktsk - (_("Warning: duplicated register (r%d) in register list"), - regno); - } - - range |= expr.X_add_number; - } - else - { - if (inst.reloc.type != 0) - { - inst.error = _("expression too complex"); - return FAIL; - } - - memcpy (&inst.reloc.exp, &expr, sizeof (expressionS)); - inst.reloc.type = BFD_RELOC_ARM_MULTI; - inst.reloc.pc_rel = 0; - } - } - - skip_whitespace (str); + switch (exp->X_op) + { + case O_constant: + case O_symbol: + case O_add: + case O_subtract: + new_fix = fix_new_exp (frag, where, size, exp, pc_rel, reloc); + break; - if (*str == '|' || *str == '+') - { - str++; - another_range = 1; - } + default: + new_fix = fix_new (frag, where, size, make_expr_symbol (exp), 0, + pc_rel, reloc); + break; } - while (another_range); - *strp = str; - return range; + /* Mark whether the fix is to a THUMB instruction, or an ARM + instruction. */ + new_fix->tc_fix_data = thumb_mode; } static void -do_ldmstm (char * str) +output_inst (const char * str) { - int base_reg; - long range; - - skip_whitespace (str); - - if ((base_reg = reg_required_here (&str, 16)) == FAIL) - return; + char * to = NULL; - if (base_reg == REG_PC) + if (inst.error) { - inst.error = _("r15 not allowed as base register"); + as_bad ("%s -- `%s'", inst.error, str); return; } + if (inst.size == 0) + return; - skip_whitespace (str); + to = frag_more (inst.size); - if (*str == '!') + if (thumb_mode && (inst.size > THUMB_SIZE)) { - inst.instruction |= WRITE_BACK; - str++; + assert (inst.size == (2 * THUMB_SIZE)); + md_number_to_chars (to, inst.instruction >> 16, THUMB_SIZE); + md_number_to_chars (to + THUMB_SIZE, inst.instruction, THUMB_SIZE); } - - if (skip_past_comma (&str) == FAIL - || (range = reg_list (&str)) == FAIL) + else if (inst.size > INSN_SIZE) { - if (! inst.error) - inst.error = BAD_ARGS; - return; + assert (inst.size == (2 * INSN_SIZE)); + md_number_to_chars (to, inst.instruction, INSN_SIZE); + md_number_to_chars (to + INSN_SIZE, inst.instruction, INSN_SIZE); } + else + md_number_to_chars (to, inst.instruction, inst.size); + + if (inst.reloc.type != BFD_RELOC_UNUSED) + fix_new_arm (frag_now, to - frag_now->fr_literal, + inst.size, & inst.reloc.exp, inst.reloc.pc_rel, + inst.reloc.type); + +#ifdef OBJ_ELF + dwarf2_emit_insn (inst.size); +#endif +} - if (*str == '^') +/* Tag values used in struct asm_opcode's tag field. */ +enum opcode_tag +{ + OT_unconditional, /* Instruction cannot be conditionalized. + The ARM condition field is still 0xE. */ + OT_unconditionalF, /* Instruction cannot be conditionalized + and carries 0xF in its ARM condition field. */ + OT_csuffix, /* Instruction takes a conditional suffix. */ + OT_cinfix3, /* Instruction takes a conditional infix, + beginning at character index 3. (In + unified mode, it becomes a suffix.) */ + OT_csuf_or_in3, /* Instruction takes either a conditional + suffix or an infix at character index 3. + (In unified mode, a suffix only. */ + OT_odd_infix_unc, /* This is the unconditional variant of an + instruction that takes a conditional infix + at an unusual position. In unified mode, + this variant will accept a suffix. */ + OT_odd_infix_0 /* Values greater than or equal to OT_odd_infix_0 + are the conditional variants of instructions that + take conditional infixes in unusual positions. + The infix appears at character index + (tag - OT_odd_infix_0). These are not accepted + in unified mode. */ +}; + +/* Subroutine of md_assemble, responsible for looking up the primary + opcode from the mnemonic the user wrote. STR points to the + beginning of the mnemonic. + + This is not simply a hash table lookup, because of conditional + variants. Most instructions have conditional variants, which are + expressed with a _conditional affix_ to the mnemonic. If we were + to encode each conditional variant as a literal string in the opcode + table, it would have approximately 20,000 entries. + + Most mnemonics take this affix as a suffix, and in unified syntax, + 'most' is upgraded to 'all'. However, in the divided syntax, some + instructions take the affix as an infix, notably the s-variants of + the arithmetic instructions. Of those instructions, all but six + have the infix appear after the third character of the mnemonic. + + Accordingly, the algorithm for looking up primary opcodes given + an identifier is: + + 1. Look up the identifier in the opcode table. + If we find a match, go to step U. + + 2. Look up the last two characters of the identifier in the + conditions table. If we find a match, look up the first N-2 + characters of the identifier in the opcode table. If we + find a match, go to step CE. + + 3. Look up the fourth and fifth characters of the identifier in + the conditions table. If we find a match, extract those + characters from the identifier, and look up the remaining + characters in the opcode table. If we find a match, go + to step CM. + + 4. Fail. + + U. Examine the tag field of the opcode structure, in case this is + one of the six instructions with its conditional infix in an + unusual place. If it is, the tag tells us where to find the + infix; look it up in the conditions table and set inst.cond + accordingly. Otherwise, this is an unconditional instruction. + Again set inst.cond accordingly. Return the opcode structure. + + CE. Examine the tag field to make sure this is an instruction that + should receive a conditional suffix. If it is not, fail. + Otherwise, set inst.cond from the suffix we already looked up, + and return the opcode structure. + + CM. Examine the tag field to make sure this is an instruction that + should receive a conditional infix after the third character. + If it is not, fail. Otherwise, undo the edits to the current + line of input and proceed as for case CE. */ + +static const struct asm_opcode * +opcode_lookup (char **str) +{ + char *end, *base; + char *affix; + const struct asm_opcode *opcode; + const struct asm_cond *cond; + + /* Scan up to the end of the mnemonic, which must end in white space, + '.' (in unified mode only), or end of string. */ + for (base = end = *str; *end != '\0'; end++) + if (*end == ' ' || (unified_syntax && *end == '.')) + break; + + if (end == base) + return 0; + + /* Handle a possible width suffix. */ + if (end[0] == '.') { - str++; - inst.instruction |= LDM_TYPE_2_OR_3; + if (end[1] == 'w' && (end[2] == ' ' || end[2] == '\0')) + inst.size_req = 4; + else if (end[1] == 'n' && (end[2] == ' ' || end[2] == '\0')) + inst.size_req = 2; + else + return 0; + + *str = end + 2; } + else + *str = end; - if (inst.instruction & WRITE_BACK) + /* Look for unaffixed or special-case affixed mnemonic. */ + opcode = hash_find_n (arm_ops_hsh, base, end - base); + if (opcode) { - /* Check for unpredictable uses of writeback. */ - if (inst.instruction & LOAD_BIT) - { - /* Not allowed in LDM type 2. */ - if ((inst.instruction & LDM_TYPE_2_OR_3) - && ((range & (1 << REG_PC)) == 0)) - as_warn (_("writeback of base register is UNPREDICTABLE")); - /* Only allowed if base reg not in list for other types. */ - else if (range & (1 << base_reg)) - as_warn (_("writeback of base register when in register list is UNPREDICTABLE")); - } - else /* STM. */ + /* step U */ + if (opcode->tag < OT_odd_infix_0) { - /* Not allowed for type 2. */ - if (inst.instruction & LDM_TYPE_2_OR_3) - as_warn (_("writeback of base register is UNPREDICTABLE")); - /* Only allowed if base reg not in list, or first in list. */ - else if ((range & (1 << base_reg)) - && (range & ((1 << base_reg) - 1))) - as_warn (_("if writeback register is in list, it must be the lowest reg in the list")); + inst.cond = COND_ALWAYS; + return opcode; } - } - inst.instruction |= range; - end_of_line (str); -} + if (unified_syntax) + as_warn (_("conditional infixes are deprecated in unified syntax")); + affix = base + (opcode->tag - OT_odd_infix_0); + cond = hash_find_n (arm_cond_hsh, affix, 2); + assert (cond); -static void -do_smi (char * str) -{ - skip_whitespace (str); + inst.cond = cond->value; + return opcode; + } - /* Allow optional leading '#'. */ - if (is_immediate_prefix (*str)) - str++; + /* Cannot have a conditional suffix on a mnemonic of less than two + characters. */ + if (end - base < 3) + return 0; - if (my_get_expression (& inst.reloc.exp, & str)) - return; + /* Look for suffixed mnemonic. */ + affix = end - 2; + cond = hash_find_n (arm_cond_hsh, affix, 2); + opcode = hash_find_n (arm_ops_hsh, base, affix - base); + if (opcode && cond) + { + /* step CE */ + switch (opcode->tag) + { + case OT_cinfix3: + case OT_odd_infix_unc: + if (!unified_syntax) + return 0; + /* else fall through */ + + case OT_csuffix: + case OT_csuf_or_in3: + inst.cond = cond->value; + return opcode; + + case OT_unconditional: + case OT_unconditionalF: + /* delayed diagnostic */ + inst.error = BAD_COND; + inst.cond = COND_ALWAYS; + return opcode; - inst.reloc.type = BFD_RELOC_ARM_SMI; - inst.reloc.pc_rel = 0; - end_of_line (str); -} + default: + return 0; + } + } -static void -do_swi (char * str) -{ - skip_whitespace (str); + /* Cannot have a usual-position infix on a mnemonic of less than + six characters (five would be a suffix). */ + if (end - base < 6) + return 0; - /* Allow optional leading '#'. */ - if (is_immediate_prefix (*str)) - str++; + /* Look for infixed mnemonic in the usual position. */ + affix = base + 3; + cond = hash_find_n (arm_cond_hsh, affix, 2); + if (cond) + { + char save[2]; + memcpy (save, affix, 2); + memmove (affix, affix + 2, (end - affix) - 2); + opcode = hash_find_n (arm_ops_hsh, base, (end - base) - 2); + memmove (affix + 2, affix, (end - affix) - 2); + memcpy (affix, save, 2); + } + if (opcode && (opcode->tag == OT_cinfix3 || opcode->tag == OT_csuf_or_in3)) + { + /* step CM */ + if (unified_syntax) + as_warn (_("conditional infixes are deprecated in unified syntax")); - if (my_get_expression (& inst.reloc.exp, & str)) - return; + inst.cond = cond->value; + return opcode; + } - inst.reloc.type = BFD_RELOC_ARM_SWI; - inst.reloc.pc_rel = 0; - end_of_line (str); + return 0; } -static void -do_swap (char * str) +void +md_assemble (char *str) { - int reg; + char *p = str; + const struct asm_opcode * opcode; - skip_whitespace (str); - - if ((reg = reg_required_here (&str, 12)) == FAIL) - return; - - if (reg == REG_PC) + /* Align the previous label if needed. */ + if (last_label_seen != NULL) { - inst.error = _("r15 not allowed in swap"); - return; + symbol_set_frag (last_label_seen, frag_now); + S_SET_VALUE (last_label_seen, (valueT) frag_now_fix ()); + S_SET_SEGMENT (last_label_seen, now_seg); } - if (skip_past_comma (&str) == FAIL - || (reg = reg_required_here (&str, 0)) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + memset (&inst, '\0', sizeof (inst)); + inst.reloc.type = BFD_RELOC_UNUSED; - if (reg == REG_PC) + opcode = opcode_lookup (&p); + if (!opcode) { - inst.error = _("r15 not allowed in swap"); + /* It wasn't an instruction, but it might be a register alias of + the form alias .req reg. */ + if (!create_register_alias (str, p)) + as_bad (_("bad instruction `%s'"), str); + return; } - if (skip_past_comma (&str) == FAIL - || *str++ != '[') + if (thumb_mode) { - inst.error = BAD_ARGS; - return; - } + /* Check that this instruction is supported for this CPU. */ + if (thumb_mode == 1 && (opcode->tvariant & cpu_variant) == 0) + { + as_bad (_("selected processor does not support `%s'"), str); + return; + } + if (inst.cond != COND_ALWAYS && !unified_syntax + && opcode->tencode != do_t_branch) + { + as_bad (_("Thumb does not support conditional execution")); + return; + } - skip_whitespace (str); + mapping_state (MAP_THUMB); + inst.instruction = opcode->tvalue; - if ((reg = reg_required_here (&str, 16)) == FAIL) - return; + if (!parse_operands (p, opcode->operands)) + opcode->tencode (); - if (reg == REG_PC) - { - inst.error = BAD_PC; - return; + if (!inst.error) + { + assert (inst.instruction < 0xe800 || inst.instruction > 0xffff); + inst.size = (inst.instruction > 0xffff ? 4 : 2); + if (inst.size_req && inst.size_req != inst.size) + { + as_bad (_("cannot honor width suffix -- `%s'"), str); + return; + } + } } - - skip_whitespace (str); - - if (*str++ != ']') + else { - inst.error = _("missing ]"); - return; + /* Check that this instruction is supported for this CPU. */ + if ((opcode->avariant & cpu_variant) == 0) + { + as_bad (_("selected processor does not support `%s'"), str); + return; + } + if (inst.size_req) + { + as_bad (_("width suffixes are invalid in ARM mode -- `%s'"), str); + return; + } + + mapping_state (MAP_ARM); + inst.instruction = opcode->avalue; + if (opcode->tag == OT_unconditionalF) + inst.instruction |= 0xF << 28; + else + inst.instruction |= inst.cond << 28; + inst.size = INSN_SIZE; + if (!parse_operands (p, opcode->operands)) + opcode->aencode (); } + output_inst (str); +} + +/* Various frobbings of labels and their addresses. */ - end_of_line (str); +void +arm_start_line_hook (void) +{ + last_label_seen = NULL; } -static void -do_branch (char * str) +void +arm_frob_label (symbolS * sym) { - if (my_get_expression (&inst.reloc.exp, &str)) - return; + last_label_seen = sym; -#ifdef OBJ_ELF - { - char * save_in; - - /* ScottB: February 5, 1998 - Check to see of PLT32 reloc - required for the instruction. */ + ARM_SET_THUMB (sym, thumb_mode); - /* arm_parse_reloc () works on input_line_pointer. - We actually want to parse the operands to the branch instruction - passed in 'str'. Save the input pointer and restore it later. */ - save_in = input_line_pointer; - input_line_pointer = str; - if (inst.reloc.exp.X_op == O_symbol - && *str == '(' - && arm_parse_reloc () == BFD_RELOC_ARM_PLT32) - { - inst.reloc.type = BFD_RELOC_ARM_PLT32; - inst.reloc.pc_rel = 0; - /* Modify str to point to after parsed operands, otherwise - end_of_line() will complain about the (PLT) left in str. */ - str = input_line_pointer; - } - else - { - inst.reloc.type = BFD_RELOC_ARM_PCREL_BRANCH; - inst.reloc.pc_rel = 1; - } - input_line_pointer = save_in; - } -#else - inst.reloc.type = BFD_RELOC_ARM_PCREL_BRANCH; - inst.reloc.pc_rel = 1; -#endif /* OBJ_ELF */ +#if defined OBJ_COFF || defined OBJ_ELF + ARM_SET_INTERWORK (sym, support_interwork); +#endif - end_of_line (str); -} + /* Note - do not allow local symbols (.Lxxx) to be labeled + as Thumb functions. This is because these labels, whilst + they exist inside Thumb code, are not the entry points for + possible ARM->Thumb calls. Also, these labels can be used + as part of a computed goto or switch statement. eg gcc + can generate code that looks like this: -static void -do_cdp (char * str) -{ - /* Co-processor data operation. - Format: CDP{cond} CP#,,CRd,CRn,CRm{,} */ - skip_whitespace (str); + ldr r2, [pc, .Laaa] + lsl r3, r3, #2 + ldr r2, [r3, r2] + mov pc, r2 - if (co_proc_number (&str) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + .Lbbb: .word .Lxxx + .Lccc: .word .Lyyy + ..etc... + .Laaa: .word Lbbb - if (skip_past_comma (&str) == FAIL - || cp_opc_expr (&str, 20,4) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + The first instruction loads the address of the jump table. + The second instruction converts a table index into a byte offset. + The third instruction gets the jump address out of the table. + The fourth instruction performs the jump. - if (skip_past_comma (&str) == FAIL - || cp_reg_required_here (&str, 12) == FAIL) + If the address stored at .Laaa is that of a symbol which has the + Thumb_Func bit set, then the linker will arrange for this address + to have the bottom bit set, which in turn would mean that the + address computation performed by the third instruction would end + up with the bottom bit set. Since the ARM is capable of unaligned + word loads, the instruction would then load the incorrect address + out of the jump table, and chaos would ensue. */ + if (label_is_thumb_function_name + && (S_GET_NAME (sym)[0] != '.' || S_GET_NAME (sym)[1] != 'L') + && (bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0) { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + /* When the address of a Thumb function is taken the bottom + bit of that address should be set. This will allow + interworking between Arm and Thumb functions to work + correctly. */ - if (skip_past_comma (&str) == FAIL - || cp_reg_required_here (&str, 16) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + THUMB_SET_FUNC (sym, 1); - if (skip_past_comma (&str) == FAIL - || cp_reg_required_here (&str, 0) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; + label_is_thumb_function_name = FALSE; } +} - if (skip_past_comma (&str) == SUCCESS) +int +arm_data_in_code (void) +{ + if (thumb_mode && ! strncmp (input_line_pointer + 1, "data:", 5)) { - if (cp_opc_expr (&str, 5, 3) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + *input_line_pointer = '/'; + input_line_pointer += 5; + *input_line_pointer = 0; + return 1; } - end_of_line (str); + return 0; } -static void -do_lstc (char * str) +char * +arm_canonicalize_symbol_name (char * name) { - /* Co-processor register load/store. - Format: */ + int len; - skip_whitespace (str); + if (thumb_mode && (len = strlen (name)) > 5 + && streq (name + len - 5, "/data")) + *(name + len - 5) = 0; - if (co_proc_number (&str) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + return name; +} + +/* Table of all register names defined by default. The user can + define additional names with .req. Note that all register names + should appear in both upper and lowercase variants. Some registers + also have mixed-case names. */ + +#define REGDEF(s,n,t) { #s, n, REG_TYPE_##t, TRUE } +#define REGNUM(p,n,t) REGDEF(p##n, n, t) +#define REGSET(p,t) \ + REGNUM(p, 0,t), REGNUM(p, 1,t), REGNUM(p, 2,t), REGNUM(p, 3,t), \ + REGNUM(p, 4,t), REGNUM(p, 5,t), REGNUM(p, 6,t), REGNUM(p, 7,t), \ + REGNUM(p, 8,t), REGNUM(p, 9,t), REGNUM(p,10,t), REGNUM(p,11,t), \ + REGNUM(p,12,t), REGNUM(p,13,t), REGNUM(p,14,t), REGNUM(p,15,t) + +static const struct reg_entry reg_names[] = +{ + /* ARM integer registers. */ + REGSET(r, RN), REGSET(R, RN), + + /* ATPCS synonyms. */ + REGDEF(a1,0,RN), REGDEF(a2,1,RN), REGDEF(a3, 2,RN), REGDEF(a4, 3,RN), + REGDEF(v1,4,RN), REGDEF(v2,5,RN), REGDEF(v3, 6,RN), REGDEF(v4, 7,RN), + REGDEF(v5,8,RN), REGDEF(v6,9,RN), REGDEF(v7,10,RN), REGDEF(v8,11,RN), + + REGDEF(A1,0,RN), REGDEF(A2,1,RN), REGDEF(A3, 2,RN), REGDEF(A4, 3,RN), + REGDEF(V1,4,RN), REGDEF(V2,5,RN), REGDEF(V3, 6,RN), REGDEF(V4, 7,RN), + REGDEF(V5,8,RN), REGDEF(V6,9,RN), REGDEF(V7,10,RN), REGDEF(V8,11,RN), - if (skip_past_comma (&str) == FAIL - || cp_reg_required_here (&str, 12) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + /* Well-known aliases. */ + REGDEF(wr, 7,RN), REGDEF(sb, 9,RN), REGDEF(sl,10,RN), REGDEF(fp,11,RN), + REGDEF(ip,12,RN), REGDEF(sp,13,RN), REGDEF(lr,14,RN), REGDEF(pc,15,RN), - if (skip_past_comma (&str) == FAIL - || cp_address_required_here (&str, CP_WB_OK) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } + REGDEF(WR, 7,RN), REGDEF(SB, 9,RN), REGDEF(SL,10,RN), REGDEF(FP,11,RN), + REGDEF(IP,12,RN), REGDEF(SP,13,RN), REGDEF(LR,14,RN), REGDEF(PC,15,RN), - end_of_line (str); -} + /* Coprocessor numbers. */ + REGSET(p, CP), REGSET(P, CP), -static void -do_co_reg (char * str) + /* Coprocessor register numbers. The "cr" variants are for backward + compatibility. */ + REGSET(c, CN), REGSET(C, CN), + REGSET(cr, CN), REGSET(CR, CN), + + /* FPA registers. */ + REGNUM(f,0,FN), REGNUM(f,1,FN), REGNUM(f,2,FN), REGNUM(f,3,FN), + REGNUM(f,4,FN), REGNUM(f,5,FN), REGNUM(f,6,FN), REGNUM(f,7, FN), + + REGNUM(F,0,FN), REGNUM(F,1,FN), REGNUM(F,2,FN), REGNUM(F,3,FN), + REGNUM(F,4,FN), REGNUM(F,5,FN), REGNUM(F,6,FN), REGNUM(F,7, FN), + + /* VFP SP registers. */ + REGSET(s,VFS), + REGNUM(s,16,VFS), REGNUM(s,17,VFS), REGNUM(s,18,VFS), REGNUM(s,19,VFS), + REGNUM(s,20,VFS), REGNUM(s,21,VFS), REGNUM(s,22,VFS), REGNUM(s,23,VFS), + REGNUM(s,24,VFS), REGNUM(s,25,VFS), REGNUM(s,26,VFS), REGNUM(s,27,VFS), + REGNUM(s,28,VFS), REGNUM(s,29,VFS), REGNUM(s,30,VFS), REGNUM(s,31,VFS), + + REGSET(S,VFS), + REGNUM(S,16,VFS), REGNUM(S,17,VFS), REGNUM(S,18,VFS), REGNUM(S,19,VFS), + REGNUM(S,20,VFS), REGNUM(S,21,VFS), REGNUM(S,22,VFS), REGNUM(S,23,VFS), + REGNUM(S,24,VFS), REGNUM(S,25,VFS), REGNUM(S,26,VFS), REGNUM(S,27,VFS), + REGNUM(S,28,VFS), REGNUM(S,29,VFS), REGNUM(S,30,VFS), REGNUM(S,31,VFS), + + /* VFP DP Registers. */ + REGSET(d,VFD), REGSET(D,VFS), + + /* VFP control registers. */ + REGDEF(fpsid,0,VFC), REGDEF(fpscr,1,VFC), REGDEF(fpexc,8,VFC), + REGDEF(FPSID,0,VFC), REGDEF(FPSCR,1,VFC), REGDEF(FPEXC,8,VFC), + + /* Maverick DSP coprocessor registers. */ + REGSET(mvf,MVF), REGSET(mvd,MVD), REGSET(mvfx,MVFX), REGSET(mvdx,MVDX), + REGSET(MVF,MVF), REGSET(MVD,MVD), REGSET(MVFX,MVFX), REGSET(MVDX,MVDX), + + REGNUM(mvax,0,MVAX), REGNUM(mvax,1,MVAX), + REGNUM(mvax,2,MVAX), REGNUM(mvax,3,MVAX), + REGDEF(dspsc,0,DSPSC), + + REGNUM(MVAX,0,MVAX), REGNUM(MVAX,1,MVAX), + REGNUM(MVAX,2,MVAX), REGNUM(MVAX,3,MVAX), + REGDEF(DSPSC,0,DSPSC), + + /* iWMMXt data registers - p0, c0-15. */ + REGSET(wr,MMXWR), REGSET(wR,MMXWR), REGSET(WR, MMXWR), + + /* iWMMXt control registers - p1, c0-3. */ + REGDEF(wcid, 0,MMXWC), REGDEF(wCID, 0,MMXWC), REGDEF(WCID, 0,MMXWC), + REGDEF(wcon, 1,MMXWC), REGDEF(wCon, 1,MMXWC), REGDEF(WCON, 1,MMXWC), + REGDEF(wcssf, 2,MMXWC), REGDEF(wCSSF, 2,MMXWC), REGDEF(WCSSF, 2,MMXWC), + REGDEF(wcasf, 3,MMXWC), REGDEF(wCASF, 3,MMXWC), REGDEF(WCASF, 3,MMXWC), + + /* iWMMXt scalar (constant/offset) registers - p1, c8-11. */ + REGDEF(wcgr0, 8,MMXWCG), REGDEF(wCGR0, 8,MMXWCG), REGDEF(WCGR0, 8,MMXWCG), + REGDEF(wcgr1, 9,MMXWCG), REGDEF(wCGR1, 9,MMXWCG), REGDEF(WCGR1, 9,MMXWCG), + REGDEF(wcgr2,10,MMXWCG), REGDEF(wCGR2,10,MMXWCG), REGDEF(WCGR2,10,MMXWCG), + REGDEF(wcgr3,11,MMXWCG), REGDEF(wCGR3,11,MMXWCG), REGDEF(WCGR3,11,MMXWCG), + + /* XScale accumulator registers. */ + REGNUM(acc,0,XSCALE), REGNUM(ACC,0,XSCALE), +}; +#undef REGDEF +#undef REGNUM +#undef REGSET + +/* Table of all PSR suffixes. Bare "CPSR" and "SPSR" are handled + within psr_required_here. */ +static const struct asm_psr psrs[] = { - /* Co-processor register transfer. - Format: {cond} CP#,,Rd,CRn,CRm{,} */ + /* Backward compatibility notation. Note that "all" is no longer + truly all possible PSR bits. */ + {"all", PSR_c | PSR_f}, + {"flg", PSR_f}, + {"ctl", PSR_c}, + + /* Individual flags. */ + {"f", PSR_f}, + {"c", PSR_c}, + {"x", PSR_x}, + {"s", PSR_s}, + /* Combinations of flags. */ + {"fs", PSR_f | PSR_s}, + {"fx", PSR_f | PSR_x}, + {"fc", PSR_f | PSR_c}, + {"sf", PSR_s | PSR_f}, + {"sx", PSR_s | PSR_x}, + {"sc", PSR_s | PSR_c}, + {"xf", PSR_x | PSR_f}, + {"xs", PSR_x | PSR_s}, + {"xc", PSR_x | PSR_c}, + {"cf", PSR_c | PSR_f}, + {"cs", PSR_c | PSR_s}, + {"cx", PSR_c | PSR_x}, + {"fsx", PSR_f | PSR_s | PSR_x}, + {"fsc", PSR_f | PSR_s | PSR_c}, + {"fxs", PSR_f | PSR_x | PSR_s}, + {"fxc", PSR_f | PSR_x | PSR_c}, + {"fcs", PSR_f | PSR_c | PSR_s}, + {"fcx", PSR_f | PSR_c | PSR_x}, + {"sfx", PSR_s | PSR_f | PSR_x}, + {"sfc", PSR_s | PSR_f | PSR_c}, + {"sxf", PSR_s | PSR_x | PSR_f}, + {"sxc", PSR_s | PSR_x | PSR_c}, + {"scf", PSR_s | PSR_c | PSR_f}, + {"scx", PSR_s | PSR_c | PSR_x}, + {"xfs", PSR_x | PSR_f | PSR_s}, + {"xfc", PSR_x | PSR_f | PSR_c}, + {"xsf", PSR_x | PSR_s | PSR_f}, + {"xsc", PSR_x | PSR_s | PSR_c}, + {"xcf", PSR_x | PSR_c | PSR_f}, + {"xcs", PSR_x | PSR_c | PSR_s}, + {"cfs", PSR_c | PSR_f | PSR_s}, + {"cfx", PSR_c | PSR_f | PSR_x}, + {"csf", PSR_c | PSR_s | PSR_f}, + {"csx", PSR_c | PSR_s | PSR_x}, + {"cxf", PSR_c | PSR_x | PSR_f}, + {"cxs", PSR_c | PSR_x | PSR_s}, + {"fsxc", PSR_f | PSR_s | PSR_x | PSR_c}, + {"fscx", PSR_f | PSR_s | PSR_c | PSR_x}, + {"fxsc", PSR_f | PSR_x | PSR_s | PSR_c}, + {"fxcs", PSR_f | PSR_x | PSR_c | PSR_s}, + {"fcsx", PSR_f | PSR_c | PSR_s | PSR_x}, + {"fcxs", PSR_f | PSR_c | PSR_x | PSR_s}, + {"sfxc", PSR_s | PSR_f | PSR_x | PSR_c}, + {"sfcx", PSR_s | PSR_f | PSR_c | PSR_x}, + {"sxfc", PSR_s | PSR_x | PSR_f | PSR_c}, + {"sxcf", PSR_s | PSR_x | PSR_c | PSR_f}, + {"scfx", PSR_s | PSR_c | PSR_f | PSR_x}, + {"scxf", PSR_s | PSR_c | PSR_x | PSR_f}, + {"xfsc", PSR_x | PSR_f | PSR_s | PSR_c}, + {"xfcs", PSR_x | PSR_f | PSR_c | PSR_s}, + {"xsfc", PSR_x | PSR_s | PSR_f | PSR_c}, + {"xscf", PSR_x | PSR_s | PSR_c | PSR_f}, + {"xcfs", PSR_x | PSR_c | PSR_f | PSR_s}, + {"xcsf", PSR_x | PSR_c | PSR_s | PSR_f}, + {"cfsx", PSR_c | PSR_f | PSR_s | PSR_x}, + {"cfxs", PSR_c | PSR_f | PSR_x | PSR_s}, + {"csfx", PSR_c | PSR_s | PSR_f | PSR_x}, + {"csxf", PSR_c | PSR_s | PSR_x | PSR_f}, + {"cxfs", PSR_c | PSR_x | PSR_f | PSR_s}, + {"cxsf", PSR_c | PSR_x | PSR_s | PSR_f}, +}; - skip_whitespace (str); +/* Table of all shift-in-operand names. */ +static const struct asm_shift_name shift_names [] = +{ + { "asl", SHIFT_LSL }, { "ASL", SHIFT_LSL }, + { "lsl", SHIFT_LSL }, { "LSL", SHIFT_LSL }, + { "lsr", SHIFT_LSR }, { "LSR", SHIFT_LSR }, + { "asr", SHIFT_ASR }, { "ASR", SHIFT_ASR }, + { "ror", SHIFT_ROR }, { "ROR", SHIFT_ROR }, + { "rrx", SHIFT_RRX }, { "RRX", SHIFT_RRX } +}; - if (co_proc_number (&str) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } +/* Table of all explicit relocation names. */ +#ifdef OBJ_ELF +static struct reloc_entry reloc_names[] = +{ + { "got", BFD_RELOC_ARM_GOT32 }, { "GOT", BFD_RELOC_ARM_GOT32 }, + { "gotoff", BFD_RELOC_ARM_GOTOFF }, { "GOTOFF", BFD_RELOC_ARM_GOTOFF }, + { "plt", BFD_RELOC_ARM_PLT32 }, { "PLT", BFD_RELOC_ARM_PLT32 }, + { "target1", BFD_RELOC_ARM_TARGET1 }, { "TARGET1", BFD_RELOC_ARM_TARGET1 }, + { "target2", BFD_RELOC_ARM_TARGET2 }, { "TARGET2", BFD_RELOC_ARM_TARGET2 }, + { "sbrel", BFD_RELOC_ARM_SBREL32 }, { "SBREL", BFD_RELOC_ARM_SBREL32 }, + { "tlsgd", BFD_RELOC_ARM_TLS_GD32}, { "TLSGD", BFD_RELOC_ARM_TLS_GD32}, + { "tlsldm", BFD_RELOC_ARM_TLS_LDM32}, { "TLSLDM", BFD_RELOC_ARM_TLS_LDM32}, + { "tlsldo", BFD_RELOC_ARM_TLS_LDO32}, { "TLSLDO", BFD_RELOC_ARM_TLS_LDO32}, + { "gottpoff",BFD_RELOC_ARM_TLS_IE32}, { "GOTTPOFF",BFD_RELOC_ARM_TLS_IE32}, + { "tpoff", BFD_RELOC_ARM_TLS_LE32}, { "TPOFF", BFD_RELOC_ARM_TLS_LE32} +}; +#endif - if (skip_past_comma (&str) == FAIL - || cp_opc_expr (&str, 21, 3) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } +/* Table of all conditional affixes. 0xF is not defined as a condition code. */ +static const struct asm_cond conds[] = +{ + {"eq", 0x0}, + {"ne", 0x1}, + {"cs", 0x2}, {"hs", 0x2}, + {"cc", 0x3}, {"ul", 0x3}, {"lo", 0x3}, + {"mi", 0x4}, + {"pl", 0x5}, + {"vs", 0x6}, + {"vc", 0x7}, + {"hi", 0x8}, + {"ls", 0x9}, + {"ge", 0xa}, + {"lt", 0xb}, + {"gt", 0xc}, + {"le", 0xd}, + {"al", 0xe} +}; + +/* Table of ARM-format instructions. */ + +/* Macros for gluing together operand strings. N.B. In all cases + other than OPS0, the trailing OP_stop comes from default + zero-initialization of the unspecified elements of the array. */ +#define OPS0() { OP_stop, } +#define OPS1(a) { OP_##a, } +#define OPS2(a,b) { OP_##a,OP_##b, } +#define OPS3(a,b,c) { OP_##a,OP_##b,OP_##c, } +#define OPS4(a,b,c,d) { OP_##a,OP_##b,OP_##c,OP_##d, } +#define OPS5(a,b,c,d,e) { OP_##a,OP_##b,OP_##c,OP_##d,OP_##e, } +#define OPS6(a,b,c,d,e,f) { OP_##a,OP_##b,OP_##c,OP_##d,OP_##e,OP_##f, } + +/* These macros abstract out the exact format of the mnemonic table and + save some repeated characters. */ + +/* The normal sort of mnemonic; has a Thumb variant; takes a conditional suffix. */ +#define TxCE(mnem, op, top, nops, ops, ae, te) \ + { #mnem, OPS##nops ops, OT_csuffix, 0x##op, top, ARM_VARIANT, \ + THUMB_VARIANT, do_##ae, do_##te } + +/* Two variants of the above - TCE for a numeric Thumb opcode, tCE for + a T_MNEM_xyz enumerator. */ +#define TCE(mnem, aop, top, nops, ops, ae, te) \ + TxCE(mnem, aop, 0x##top, nops, ops, ae, te) +#define tCE(mnem, aop, top, nops, ops, ae, te) \ + TxCE(mnem, aop, T_MNEM_##top, nops, ops, ae, te) + +/* Second most common sort of mnemonic: has a Thumb variant, takes a conditional + infix after the third character. */ +#define TxC3(mnem, op, top, nops, ops, ae, te) \ + { #mnem, OPS##nops ops, OT_cinfix3, 0x##op, top, ARM_VARIANT, \ + THUMB_VARIANT, do_##ae, do_##te } +#define TC3(mnem, aop, top, nops, ops, ae, te) \ + TxC3(mnem, aop, 0x##top, nops, ops, ae, te) +#define tC3(mnem, aop, top, nops, ops, ae, te) \ + TxC3(mnem, aop, T_MNEM_##top, nops, ops, ae, te) + +/* Mnemonic with a conditional infix in an unusual place. Each and every variant has to + appear in the condition table. */ +#define TxCM_(m1, m2, m3, op, top, nops, ops, ae, te) \ + { #m1 #m2 #m3, OPS##nops ops, sizeof(#m2) == 1 ? OT_odd_infix_unc : OT_odd_infix_0 + sizeof(#m1) - 1, \ + 0x##op, top, ARM_VARIANT, THUMB_VARIANT, do_##ae, do_##te } + +#define TxCM(m1, m2, op, top, nops, ops, ae, te) \ + TxCM_(m1, , m2, op, top, nops, ops, ae, te), \ + TxCM_(m1, eq, m2, op, top, nops, ops, ae, te), \ + TxCM_(m1, ne, m2, op, top, nops, ops, ae, te), \ + TxCM_(m1, cs, m2, op, top, nops, ops, ae, te), \ + TxCM_(m1, hs, m2, op, top, nops, ops, ae, te), \ + TxCM_(m1, cc, m2, op, top, nops, ops, ae, te), \ + TxCM_(m1, ul, m2, op, top, nops, ops, ae, te), \ + TxCM_(m1, lo, m2, op, top, nops, ops, ae, te), \ + TxCM_(m1, mi, m2, op, top, nops, ops, ae, te), \ + TxCM_(m1, pl, m2, op, top, nops, ops, ae, te), \ + TxCM_(m1, vs, m2, op, top, nops, ops, ae, te), \ + TxCM_(m1, vc, m2, op, top, nops, ops, ae, te), \ + TxCM_(m1, hi, m2, op, top, nops, ops, ae, te), \ + TxCM_(m1, ls, m2, op, top, nops, ops, ae, te), \ + TxCM_(m1, ge, m2, op, top, nops, ops, ae, te), \ + TxCM_(m1, lt, m2, op, top, nops, ops, ae, te), \ + TxCM_(m1, gt, m2, op, top, nops, ops, ae, te), \ + TxCM_(m1, le, m2, op, top, nops, ops, ae, te), \ + TxCM_(m1, al, m2, op, top, nops, ops, ae, te) + +#define TCM(m1,m2, aop, top, nops, ops, ae, te) \ + TxCM(m1,m2, aop, 0x##top, nops, ops, ae, te) +#define tCM(m1,m2, aop, top, nops, ops, ae, te) \ + TxCM(m1,m2, aop, T_MNEM_##top, nops, ops, ae, te) + +/* Mnemonic that cannot be conditionalized. The ARM condition-code + field is still 0xE. */ +#define TUE(mnem, op, top, nops, ops, ae, te) \ + { #mnem, OPS##nops ops, OT_unconditional, 0x##op, 0x##top, ARM_VARIANT, \ + THUMB_VARIANT, do_##ae, do_##te } + +/* Mnemonic that cannot be conditionalized, and bears 0xF in its ARM + condition code field. */ +#define TUF(mnem, op, top, nops, ops, ae, te) \ + { #mnem, OPS##nops ops, OT_unconditionalF, 0x##op, 0x##top, ARM_VARIANT, \ + THUMB_VARIANT, do_##ae, do_##te } + +/* ARM-only variants of all the above. */ +#define CE(mnem, op, nops, ops, ae) \ + { #mnem, OPS##nops ops, OT_csuffix, 0x##op, 0x0, ARM_VARIANT, 0, do_##ae, NULL } + +#define C3(mnem, op, nops, ops, ae) \ + { #mnem, OPS##nops ops, OT_cinfix3, 0x##op, 0x0, ARM_VARIANT, 0, do_##ae, NULL } + +#define xCM_(m1, m2, m3, op, nops, ops, ae) \ + { #m1 #m2 #m3, OPS##nops ops, \ + sizeof(#m2) == 1 ? OT_odd_infix_unc : OT_odd_infix_0 + sizeof(#m1) - 1, \ + 0x##op, 0x0, ARM_VARIANT, 0, do_##ae, NULL } + +#define CM(m1, m2, op, nops, ops, ae) \ + xCM_(m1, , m2, op, nops, ops, ae), \ + xCM_(m1, eq, m2, op, nops, ops, ae), \ + xCM_(m1, ne, m2, op, nops, ops, ae), \ + xCM_(m1, cs, m2, op, nops, ops, ae), \ + xCM_(m1, hs, m2, op, nops, ops, ae), \ + xCM_(m1, cc, m2, op, nops, ops, ae), \ + xCM_(m1, ul, m2, op, nops, ops, ae), \ + xCM_(m1, lo, m2, op, nops, ops, ae), \ + xCM_(m1, mi, m2, op, nops, ops, ae), \ + xCM_(m1, pl, m2, op, nops, ops, ae), \ + xCM_(m1, vs, m2, op, nops, ops, ae), \ + xCM_(m1, vc, m2, op, nops, ops, ae), \ + xCM_(m1, hi, m2, op, nops, ops, ae), \ + xCM_(m1, ls, m2, op, nops, ops, ae), \ + xCM_(m1, ge, m2, op, nops, ops, ae), \ + xCM_(m1, lt, m2, op, nops, ops, ae), \ + xCM_(m1, gt, m2, op, nops, ops, ae), \ + xCM_(m1, le, m2, op, nops, ops, ae), \ + xCM_(m1, al, m2, op, nops, ops, ae) + +#define UE(mnem, op, nops, ops, ae) \ + { #mnem, OPS##nops ops, OT_unconditional, 0x##op, 0, ARM_VARIANT, 0, do_##ae, NULL } + +#define UF(mnem, op, nops, ops, ae) \ + { #mnem, OPS##nops ops, OT_unconditionalF, 0x##op, 0, ARM_VARIANT, 0, do_##ae, NULL } + +#define do_0 0 + +/* Thumb-only, unconditional. */ +#define UT(mnem, op, nops, ops, te) TUE(mnem, 0, op, nops, ops, 0, te) + +/* ARM-only, takes either a suffix or a position-3 infix + (for an FPA corner case). */ +#define C3E(mnem, op, nops, ops, ae) \ + { #mnem, OPS##nops ops, OT_csuf_or_in3, 0x##op, 0, ARM_VARIANT, 0, do_##ae, 0 } - if (skip_past_comma (&str) == FAIL - || reg_required_here (&str, 12) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } +static const struct asm_opcode insns[] = +{ +#define ARM_VARIANT ARM_EXT_V1 /* Core ARM Instructions. */ +#define THUMB_VARIANT ARM_EXT_V4T + tCE(and, 0000000, and, 3, (RR, oRR, SH), arit, t_arit3c), + tC3(ands, 0100000, ands, 3, (RR, oRR, SH), arit, t_arit3c), + tCE(eor, 0200000, eor, 3, (RR, oRR, SH), arit, t_arit3c), + tC3(eors, 0300000, eors, 3, (RR, oRR, SH), arit, t_arit3c), + tCE(sub, 0400000, sub, 3, (RR, oRR, SH), arit, t_add_sub), + tC3(subs, 0500000, subs, 3, (RR, oRR, SH), arit, t_add_sub), + tCE(add, 0800000, add, 3, (RR, oRR, SH), arit, t_add_sub), + tC3(adds, 0900000, adds, 3, (RR, oRR, SH), arit, t_add_sub), + tCE(adc, 0a00000, adc, 3, (RR, oRR, SH), arit, t_arit3c), + tC3(adcs, 0b00000, adcs, 3, (RR, oRR, SH), arit, t_arit3c), + tCE(sbc, 0c00000, sbc, 3, (RR, oRR, SH), arit, t_arit3), + tC3(sbcs, 0d00000, sbcs, 3, (RR, oRR, SH), arit, t_arit3), + tCE(orr, 1800000, orr, 3, (RR, oRR, SH), arit, t_arit3c), + tC3(orrs, 1900000, orrs, 3, (RR, oRR, SH), arit, t_arit3c), + tCE(bic, 1c00000, bic, 3, (RR, oRR, SH), arit, t_arit3), + tC3(bics, 1d00000, bics, 3, (RR, oRR, SH), arit, t_arit3), + + /* The p-variants of tst/cmp/cmn/teq (below) are the pre-V6 mechanism + for setting PSR flag bits. They are obsolete in V6 and do not + have Thumb equivalents. */ + tCE(tst, 1100000, tst, 2, (RR, SH), cmp, t_mvn_tst), + tC3(tsts, 1100000, tst, 2, (RR, SH), cmp, t_mvn_tst), + C3(tstp, 110f000, 2, (RR, SH), cmp), + tCE(cmp, 1500000, cmp, 2, (RR, SH), cmp, t_mov_cmp), + tC3(cmps, 1500000, cmp, 2, (RR, SH), cmp, t_mov_cmp), + C3(cmpp, 150f000, 2, (RR, SH), cmp), + tCE(cmn, 1700000, cmn, 2, (RR, SH), cmp, t_mvn_tst), + tC3(cmns, 1700000, cmn, 2, (RR, SH), cmp, t_mvn_tst), + C3(cmnp, 170f000, 2, (RR, SH), cmp), + + tCE(mov, 1a00000, mov, 2, (RR, SH), mov, t_mov_cmp), + tC3(movs, 1b00000, movs, 2, (RR, SH), mov, t_mov_cmp), + tCE(mvn, 1e00000, mvn, 2, (RR, SH), mov, t_mvn_tst), + tC3(mvns, 1f00000, mvns, 2, (RR, SH), mov, t_mvn_tst), + + tCE(ldr, 4100000, ldr, 2, (RR, ADDR), ldst, t_ldst), + tC3(ldrb, 4500000, ldrb, 2, (RR, ADDR), ldst, t_ldst), + tCE(str, 4000000, str, 2, (RR, ADDR), ldst, t_ldst), + tC3(strb, 4400000, strb, 2, (RR, ADDR), ldst, t_ldst), + + tC3(stmia, 8800000, stmia, 2, (RRw, REGLST), ldmstm, t_ldmstm), + tC3(stmea, 8800000, stmia, 2, (RRw, REGLST), ldmstm, t_ldmstm), + tC3(ldmia, 8900000, ldmia, 2, (RRw, REGLST), ldmstm, t_ldmstm), + tC3(ldmfd, 8900000, ldmia, 2, (RRw, REGLST), ldmstm, t_ldmstm), - if (skip_past_comma (&str) == FAIL - || cp_reg_required_here (&str, 16) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + TCE(swi, f000000, df00, 1, (EXPi), swi, t_swi), +#ifdef TE_WINCE + /* XXX This is the wrong place to do this. Think multi-arch. */ + TCE(b, a000000, e7fe, 1, (EXPr), branch, t_branch), + TCE(bl, b000000, f7fffffe, 1, (EXPr), branch, t_branch23), +#else + TCE(b, afffffe, e7fe, 1, (EXPr), branch, t_branch), + TCE(bl, bfffffe, f7fffffe, 1, (EXPr), branch, t_branch23), +#endif - if (skip_past_comma (&str) == FAIL - || cp_reg_required_here (&str, 0) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + /* Pseudo ops. */ + TCE(adr, 28f0000, 000f, 2, (RR, EXP), adr, t_adr), + C3(adrl, 28f0000, 2, (RR, EXP), adrl), + tCE(nop, 1a00000, nop, 1, (oI255c), nop, t_nop), + + /* Thumb-compatibility pseudo ops. */ + tCE(lsl, 1a00000, lsl, 3, (RR, oRR, SH), shift, t_shift), + tC3(lsls, 1b00000, lsls, 3, (RR, oRR, SH), shift, t_shift), + tCE(lsr, 1a00020, lsr, 3, (RR, oRR, SH), shift, t_shift), + tC3(lsrs, 1b00020, lsrs, 3, (RR, oRR, SH), shift, t_shift), + tCE(asr, 1a00040, asr, 3, (RR, oRR, SH), shift, t_shift), + tC3(asrs, 1b00040, asrs, 3, (RR, oRR, SH), shift, t_shift), + tCE(ror, 1a00060, ror, 3, (RR, oRR, SH), shift, t_shift), + tC3(rors, 1b00060, rors, 3, (RR, oRR, SH), shift, t_shift), + tCE(neg, 2600000, neg, 2, (RR, RR), rd_rn, t_neg), + tC3(negs, 2700000, negs, 2, (RR, RR), rd_rn, t_neg), + tCE(push, 92d0000, push, 1, (REGLST), push_pop, t_push_pop), + tCE(pop, 8bd0000, pop, 1, (REGLST), push_pop, t_push_pop), + +#undef THUMB_VARIANT +#define THUMB_VARIANT ARM_EXT_V6 + TCE(cpy, 1a00000, 4600, 2, (RR, RR), rd_rm, t_cpy), + + /* V1 instructions with no Thumb analogue prior to V6T2. */ +#undef THUMB_VARIANT +#define THUMB_VARIANT ARM_EXT_V6T2 + TCE(rsb, 0600000, ebc00000, 3, (RR, oRR, SH), arit, t_rsb), + TC3(rsbs, 0700000, ebd00000, 3, (RR, oRR, SH), arit, t_rsb), + TCE(teq, 1300000, ea900f00, 2, (RR, SH), cmp, t_mvn_tst), + TC3(teqs, 1300000, ea900f00, 2, (RR, SH), cmp, t_mvn_tst), + C3(teqp, 130f000, 2, (RR, SH), cmp), + + TC3(ldrt, 4300000, f8500e00, 2, (RR, ADDR), ldstt, t_ldstt), + TC3(ldrbt, 4700000, f8300e00, 2, (RR, ADDR), ldstt, t_ldstt), + TC3(strt, 4200000, f8400e00, 2, (RR, ADDR), ldstt, t_ldstt), + TC3(strbt, 4600000, f8200e00, 2, (RR, ADDR), ldstt, t_ldstt), + + TC3(stmdb, 9000000, e9100000, 2, (RRw, REGLST), ldmstm, t_ldmstm), + TC3(stmfd, 9000000, e9100000, 2, (RRw, REGLST), ldmstm, t_ldmstm), + + TC3(ldmdb, 9100000, e9000000, 2, (RRw, REGLST), ldmstm, t_ldmstm), + TC3(ldmea, 9100000, e9000000, 2, (RRw, REGLST), ldmstm, t_ldmstm), + + /* V1 instructions with no Thumb analogue at all. */ + CE(rsc, 0e00000, 3, (RR, oRR, SH), arit), + C3(rscs, 0f00000, 3, (RR, oRR, SH), arit), + + C3(stmib, 9800000, 2, (RRw, REGLST), ldmstm), + C3(stmfa, 9800000, 2, (RRw, REGLST), ldmstm), + C3(stmda, 8000000, 2, (RRw, REGLST), ldmstm), + C3(stmed, 8000000, 2, (RRw, REGLST), ldmstm), + C3(ldmib, 9900000, 2, (RRw, REGLST), ldmstm), + C3(ldmed, 9900000, 2, (RRw, REGLST), ldmstm), + C3(ldmda, 8100000, 2, (RRw, REGLST), ldmstm), + C3(ldmfa, 8100000, 2, (RRw, REGLST), ldmstm), + +#undef ARM_VARIANT +#define ARM_VARIANT ARM_EXT_V2 /* ARM 2 - multiplies. */ +#undef THUMB_VARIANT +#define THUMB_VARIANT ARM_EXT_V4T + tCE(mul, 0000090, mul, 3, (RRnpc, RRnpc, oRR), mul, t_mul), + tC3(muls, 0100090, muls, 3, (RRnpc, RRnpc, oRR), mul, t_mul), + +#undef THUMB_VARIANT +#define THUMB_VARIANT ARM_EXT_V6T2 + TCE(mla, 0200090, fb000000, 4, (RRnpc, RRnpc, RRnpc, RRnpc), mlas, t_mla), + C3(mlas, 0300090, 4, (RRnpc, RRnpc, RRnpc, RRnpc), mlas), + + /* Generic coprocessor instructions. */ + TCE(cdp, e000000, ee000000, 6, (RCP, I15b, RCN, RCN, RCN, oI7b), cdp, cdp), + TCE(ldc, c100000, ec100000, 3, (RCP, RCN, ADDR), lstc, lstc), + TC3(ldcl, c500000, ec500000, 3, (RCP, RCN, ADDR), lstc, lstc), + TCE(stc, c000000, ec000000, 3, (RCP, RCN, ADDR), lstc, lstc), + TC3(stcl, c400000, ec400000, 3, (RCP, RCN, ADDR), lstc, lstc), + TCE(mcr, e000010, ee000010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), + TCE(mrc, e100010, ee100010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), + +#undef ARM_VARIANT +#define ARM_VARIANT ARM_EXT_V2S /* ARM 3 - swp instructions. */ + CE(swp, 1000090, 3, (RRnpc, RRnpc, RRnpcb), rd_rm_rn), + C3(swpb, 1400090, 3, (RRnpc, RRnpc, RRnpcb), rd_rm_rn), + +#undef ARM_VARIANT +#define ARM_VARIANT ARM_EXT_V3 /* ARM 6 Status register instructions. */ + TCE(mrs, 10f0000, f3ef8000, 2, (RR, PSR), mrs, t_mrs), + TCE(msr, 120f000, f3808000, 2, (PSR, RR_EXi), msr, t_msr), + +#undef ARM_VARIANT +#define ARM_VARIANT ARM_EXT_V3M /* ARM 7M long multiplies. */ + TCE(smull, 0c00090, fb800000, 4, (RRnpc, RRnpc, RRnpc, RRnpc), mull, t_mull), + CM(smull,s, 0d00090, 4, (RRnpc, RRnpc, RRnpc, RRnpc), mull), + TCE(umull, 0800090, fba00000, 4, (RRnpc, RRnpc, RRnpc, RRnpc), mull, t_mull), + CM(umull,s, 0900090, 4, (RRnpc, RRnpc, RRnpc, RRnpc), mull), + TCE(smlal, 0e00090, fbc00000, 4, (RRnpc, RRnpc, RRnpc, RRnpc), mull, t_mull), + CM(smlal,s, 0f00090, 4, (RRnpc, RRnpc, RRnpc, RRnpc), mull), + TCE(umlal, 0a00090, fbe00000, 4, (RRnpc, RRnpc, RRnpc, RRnpc), mull, t_mull), + CM(umlal,s, 0b00090, 4, (RRnpc, RRnpc, RRnpc, RRnpc), mull), + +#undef ARM_VARIANT +#define ARM_VARIANT ARM_EXT_V4 /* ARM Architecture 4. */ +#undef THUMB_VARIANT +#define THUMB_VARIANT ARM_EXT_V4T + tC3(ldrh, 01000b0, ldrh, 2, (RR, ADDR), ldstv4, t_ldst), + tC3(strh, 00000b0, strh, 2, (RR, ADDR), ldstv4, t_ldst), + tC3(ldrsh, 01000f0, ldrsh, 2, (RR, ADDR), ldstv4, t_ldst), + tC3(ldrsb, 01000d0, ldrsb, 2, (RR, ADDR), ldstv4, t_ldst), + tCM(ld,sh, 01000f0, ldrsh, 2, (RR, ADDR), ldstv4, t_ldst), + tCM(ld,sb, 01000d0, ldrsb, 2, (RR, ADDR), ldstv4, t_ldst), - if (skip_past_comma (&str) == SUCCESS) - { - if (cp_opc_expr (&str, 5, 3) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } - } +#undef ARM_VARIANT +#define ARM_VARIANT ARM_EXT_V4T|ARM_EXT_V5 + /* ARM Architecture 4T. */ + /* Note: bx (and blx) are required on V5, even if the processor does + not support Thumb. */ + TCE(bx, 12fff10, 4700, 1, (RR), bx, t_bx), - end_of_line (str); -} +#undef ARM_VARIANT +#define ARM_VARIANT ARM_EXT_V5 /* ARM Architecture 5T. */ +#undef THUMB_VARIANT +#define THUMB_VARIANT ARM_EXT_V5T + /* Note: blx has 2 variants; the .value coded here is for + BLX(2). Only this variant has conditional execution. */ + TCE(blx, 12fff30, 4780, 1, (RR_EXr), blx, t_blx), + TUE(bkpt, 1200070, be00, 1, (oIffffb), bkpt, t_bkpt), + +#undef THUMB_VARIANT +#define THUMB_VARIANT ARM_EXT_V6T2 + TCE(clz, 16f0f10, fab0f080, 2, (RRnpc, RRnpc), rd_rm, t_clz), + TUF(ldc2, c100000, fc100000, 3, (RCP, RCN, ADDR), lstc, lstc), + TUF(ldc2l, c500000, fc500000, 3, (RCP, RCN, ADDR), lstc, lstc), + TUF(stc2, c000000, fc000000, 3, (RCP, RCN, ADDR), lstc, lstc), + TUF(stc2l, c400000, fc400000, 3, (RCP, RCN, ADDR), lstc, lstc), + TUF(cdp2, e000000, fe000000, 6, (RCP, I15b, RCN, RCN, RCN, oI7b), cdp, cdp), + TUF(mcr2, e000010, fe000010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), + TUF(mrc2, e100010, fe100010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), + +#undef ARM_VARIANT +#define ARM_VARIANT ARM_EXT_V5ExP /* ARM Architecture 5TExP. */ + TCE(smlabb, 1000080, fb100000, 4, (RRnpc, RRnpc, RRnpc, RRnpc), smla, t_mla), + TCE(smlatb, 10000a0, fb100020, 4, (RRnpc, RRnpc, RRnpc, RRnpc), smla, t_mla), + TCE(smlabt, 10000c0, fb100010, 4, (RRnpc, RRnpc, RRnpc, RRnpc), smla, t_mla), + TCE(smlatt, 10000e0, fb100030, 4, (RRnpc, RRnpc, RRnpc, RRnpc), smla, t_mla), + + TCE(smlawb, 1200080, fb300000, 4, (RRnpc, RRnpc, RRnpc, RRnpc), smla, t_mla), + TCE(smlawt, 12000c0, fb300010, 4, (RRnpc, RRnpc, RRnpc, RRnpc), smla, t_mla), + + TCE(smlalbb, 1400080, fbc00080, 4, (RRnpc, RRnpc, RRnpc, RRnpc), smlal, t_mlal), + TCE(smlaltb, 14000a0, fbc000a0, 4, (RRnpc, RRnpc, RRnpc, RRnpc), smlal, t_mlal), + TCE(smlalbt, 14000c0, fbc00090, 4, (RRnpc, RRnpc, RRnpc, RRnpc), smlal, t_mlal), + TCE(smlaltt, 14000e0, fbc000b0, 4, (RRnpc, RRnpc, RRnpc, RRnpc), smlal, t_mlal), + + TCE(smulbb, 1600080, fb10f000, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), + TCE(smultb, 16000a0, fb10f020, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), + TCE(smulbt, 16000c0, fb10f010, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), + TCE(smultt, 16000e0, fb10f030, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), + + TCE(smulwb, 12000a0, fb30f000, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), + TCE(smulwt, 12000e0, fb30f010, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), + + TCE(qadd, 1000050, fa80f080, 3, (RRnpc, RRnpc, RRnpc), rd_rm_rn, rd_rm_rn), + TCE(qdadd, 1400050, fa80f090, 3, (RRnpc, RRnpc, RRnpc), rd_rm_rn, rd_rm_rn), + TCE(qsub, 1200050, fa80f0a0, 3, (RRnpc, RRnpc, RRnpc), rd_rm_rn, rd_rm_rn), + TCE(qdsub, 1600050, fa80f0b0, 3, (RRnpc, RRnpc, RRnpc), rd_rm_rn, rd_rm_rn), + +#undef ARM_VARIANT +#define ARM_VARIANT ARM_EXT_V5E /* ARM Architecture 5TE. */ + TUF(pld, 450f000, f810f000, 1, (ADDR), pld, t_pld), + TC3(ldrd, 00000d0, e9500000, 3, (RRnpc, oRRnpc, ADDR), ldrd, t_ldstd), + TC3(strd, 00000f0, e9400000, 3, (RRnpc, oRRnpc, ADDR), ldrd, t_ldstd), + + TCE(mcrr, c400000, ec400000, 5, (RCP, I15b, RRnpc, RRnpc, RCN), co_reg2c, co_reg2c), + TCE(mrrc, c500000, ec500000, 5, (RCP, I15b, RRnpc, RRnpc, RCN), co_reg2c, co_reg2c), + +#undef ARM_VARIANT +#define ARM_VARIANT ARM_EXT_V5J /* ARM Architecture 5TEJ. */ + TCE(bxj, 12fff20, f3c08f00, 1, (RR), bxj, t_bxj), + +#undef ARM_VARIANT +#define ARM_VARIANT ARM_EXT_V6 /* ARM V6. */ +#undef THUMB_VARIANT +#define THUMB_VARIANT ARM_EXT_V6 + TUF(cpsie, 1080000, b660, 2, (CPSF, oI31b), cpsi, t_cpsi), + TUF(cpsid, 10c0000, b670, 2, (CPSF, oI31b), cpsi, t_cpsi), + tCE(rev, 6bf0f30, rev, 2, (RRnpc, RRnpc), rd_rm, t_rev), + tCE(rev16, 6bf0fb0, rev16, 2, (RRnpc, RRnpc), rd_rm, t_rev), + tCE(revsh, 6ff0fb0, revsh, 2, (RRnpc, RRnpc), rd_rm, t_rev), + tCE(sxth, 6bf0070, sxth, 3, (RRnpc, RRnpc, oROR), sxth, t_sxth), + tCE(uxth, 6ff0070, uxth, 3, (RRnpc, RRnpc, oROR), sxth, t_sxth), + tCE(sxtb, 6af0070, sxtb, 3, (RRnpc, RRnpc, oROR), sxth, t_sxth), + tCE(uxtb, 6ef0070, uxtb, 3, (RRnpc, RRnpc, oROR), sxth, t_sxth), + TUF(setend, 1010000, b650, 1, (ENDI), setend, t_setend), + +#undef THUMB_VARIANT +#define THUMB_VARIANT ARM_EXT_V6T2 + TUF(cps, 1020000, f3af8100, 1, (I31b), imm0, imm0), + TCE(ldrex, 1900f9f, e8500f00, 2, (RRnpc, ADDR), ldrex, t_ldrex), + TUF(mcrr2, c400000, fc400000, 5, (RCP, I15b, RRnpc, RRnpc, RCN), co_reg2c, co_reg2c), + TUF(mrrc2, c500000, fc500000, 5, (RCP, I15b, RRnpc, RRnpc, RCN), co_reg2c, co_reg2c), + TCE(pkhbt, 6800010, eac00000, 4, (RRnpc, RRnpc, RRnpc, oSHll), pkhbt, t_pkhbt), + TCE(pkhtb, 6800050, eac00020, 4, (RRnpc, RRnpc, RRnpc, oSHar), pkhtb, t_pkhtb), + TCE(qadd16, 6200f10, fa90f010, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(qadd8, 6200f90, fa80f010, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(qaddsubx, 6200f30, faa0f010, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(qsub16, 6200f70, fad0f010, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(qsub8, 6200ff0, fac0f010, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(qsubaddx, 6200f50, fae0f010, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(sadd16, 6100f10, fa90f000, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(sadd8, 6100f90, fa80f000, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(saddsubx, 6100f30, faa0f000, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(shadd16, 6300f10, fa90f020, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(shadd8, 6300f90, fa80f020, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(shaddsubx, 6300f30, faa0f020, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(shsub16, 6300f70, fad0f020, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(shsub8, 6300ff0, fac0f020, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(shsubaddx, 6300f50, fae0f020, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(ssub16, 6100f70, fad0f000, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(ssub8, 6100ff0, fac0f000, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(ssubaddx, 6100f50, fae0f000, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(uadd16, 6500f10, fa90f040, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(uadd8, 6500f90, fa80f040, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(uaddsubx, 6500f30, faa0f040, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(uhadd16, 6700f10, fa90f060, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(uhadd8, 6700f90, fa80f060, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(uhaddsubx, 6700f30, faa0f060, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(uhsub16, 6700f70, fad0f060, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(uhsub8, 6700ff0, fac0f060, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(uhsubaddx, 6700f50, fae0f060, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(uqadd16, 6600f10, fa90f050, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(uqadd8, 6600f90, fa80f050, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(uqaddsubx, 6600f30, faa0f050, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(uqsub16, 6600f70, fad0f050, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(uqsub8, 6600ff0, fac0f050, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(uqsubaddx, 6600f50, fae0f050, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(usub16, 6500f70, fad0f040, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(usub8, 6500ff0, fac0f040, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(usubaddx, 6500f50, fae0f040, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TUF(rfeia, 8900a00, e990c000, 1, (RRw), rfe, rfe), + UF(rfeib, 9900a00, 1, (RRw), rfe), + UF(rfeda, 8100a00, 1, (RRw), rfe), + TUF(rfedb, 9100a00, e810c000, 1, (RRw), rfe, rfe), + TUF(rfefd, 8900a00, e990c000, 1, (RRw), rfe, rfe), + UF(rfefa, 9900a00, 1, (RRw), rfe), + UF(rfeea, 8100a00, 1, (RRw), rfe), + TUF(rfeed, 9100a00, e810c000, 1, (RRw), rfe, rfe), + TCE(sxtah, 6b00070, fa00f080, 4, (RRnpc, RRnpc, RRnpc, oROR), sxtah, t_sxtah), + TCE(sxtab16, 6800070, fa20f080, 4, (RRnpc, RRnpc, RRnpc, oROR), sxtah, t_sxtah), + TCE(sxtab, 6a00070, fa40f080, 4, (RRnpc, RRnpc, RRnpc, oROR), sxtah, t_sxtah), + TCE(sxtb16, 68f0070, fa2ff080, 3, (RRnpc, RRnpc, oROR), sxth, t_sxth), + TCE(uxtah, 6f00070, fa10f080, 4, (RRnpc, RRnpc, RRnpc, oROR), sxtah, t_sxtah), + TCE(uxtab16, 6c00070, fa30f080, 4, (RRnpc, RRnpc, RRnpc, oROR), sxtah, t_sxtah), + TCE(uxtab, 6e00070, fa50f080, 4, (RRnpc, RRnpc, RRnpc, oROR), sxtah, t_sxtah), + TCE(uxtb16, 6cf0070, fa3ff080, 3, (RRnpc, RRnpc, oROR), sxth, t_sxth), + TCE(sel, 68000b0, faa0f080, 3, (RRnpc, RRnpc, RRnpc), rd_rn_rm, t_simd), + TCE(smlad, 7000010, fb200000, 4, (RRnpc, RRnpc, RRnpc, RRnpc),smla, t_mla), + TCE(smladx, 7000030, fb200010, 4, (RRnpc, RRnpc, RRnpc, RRnpc),smla, t_mla), + TCE(smlald, 7400010, fbc000c0, 4, (RRnpc, RRnpc, RRnpc, RRnpc),smlal,t_mlal), + TCE(smlaldx, 7400030, fbc000d0, 4, (RRnpc, RRnpc, RRnpc, RRnpc),smlal,t_mlal), + TCE(smlsd, 7000050, fb400000, 4, (RRnpc, RRnpc, RRnpc, RRnpc),smla, t_mla), + TCE(smlsdx, 7000070, fb400010, 4, (RRnpc, RRnpc, RRnpc, RRnpc),smla, t_mla), + TCE(smlsld, 7400050, fbd000c0, 4, (RRnpc, RRnpc, RRnpc, RRnpc),smlal,t_mlal), + TCE(smlsldx, 7400070, fbd000d0, 4, (RRnpc, RRnpc, RRnpc, RRnpc),smlal,t_mlal), + TCE(smmla, 7500010, fb500000, 4, (RRnpc, RRnpc, RRnpc, RRnpc),smla, t_mla), + TCE(smmlar, 7500030, fb500010, 4, (RRnpc, RRnpc, RRnpc, RRnpc),smla, t_mla), + TCE(smmls, 75000d0, fb600000, 4, (RRnpc, RRnpc, RRnpc, RRnpc),smla, t_mla), + TCE(smmlsr, 75000f0, fb600010, 4, (RRnpc, RRnpc, RRnpc, RRnpc),smla, t_mla), + TCE(smmul, 750f010, fb50f000, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), + TCE(smmulr, 750f030, fb50f010, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), + TCE(smuad, 700f010, fb20f000, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), + TCE(smuadx, 700f030, fb20f010, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), + TCE(smusd, 700f050, fb40f000, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), + TCE(smusdx, 700f070, fb40f010, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), + TUF(srsia, 8cd0500, e980c000, 1, (I31w), srs, srs), + UF(srsib, 9cd0500, 1, (I31w), srs), + UF(srsda, 84d0500, 1, (I31w), srs), + TUF(srsdb, 94d0500, e800c000, 1, (I31w), srs, srs), + TCE(ssat, 6a00010, f3000000, 4, (RRnpc, I32, RRnpc, oSHllar),ssat, t_ssat), + TCE(ssat16, 6a00f30, f3200000, 3, (RRnpc, I16, RRnpc), ssat16, t_ssat16), + TCE(strex, 1800f90, e8400000, 3, (RRnpc, RRnpc, ADDR), strex, t_strex), + TCE(umaal, 0400090, fbe00060, 4, (RRnpc, RRnpc, RRnpc, RRnpc),smlal, t_mlal), + TCE(usad8, 780f010, fb70f000, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), + TCE(usada8, 7800010, fb700000, 4, (RRnpc, RRnpc, RRnpc, RRnpc),smla, t_mla), + TCE(usat, 6e00010, f3800000, 4, (RRnpc, I31, RRnpc, oSHllar),usat, t_usat), + TCE(usat16, 6e00f30, f3a00000, 3, (RRnpc, I15, RRnpc), usat16, t_usat16), + +#undef ARM_VARIANT +#define ARM_VARIANT ARM_EXT_V6K +#undef THUMB_VARIANT +#define THUMB_VARIANT ARM_EXT_V6K + tCE(yield, 320f001, yield, 0, (), noargs, t_hint), + tCE(wfe, 320f002, wfe, 0, (), noargs, t_hint), + tCE(wfi, 320f003, wfi, 0, (), noargs, t_hint), + tCE(sev, 320f004, sev, 0, (), noargs, t_hint), + +#undef THUMB_VARIANT +#define THUMB_VARIANT ARM_EXT_V6T2 + TCE(ldrexb, 1d00f9f, e8d00f4f, 2, (RRnpc, RRnpcb), rd_rn, rd_rn), + TCE(ldrexh, 1f00f9f, e8d00f5f, 2, (RRnpc, RRnpcb), rd_rn, rd_rn), + TCE(ldrexd, 1b00f9f, e8d0007f, 3, (RRnpc, oRRnpc, RRnpcb), ldrexd, t_ldrexd), + TCE(strexb, 1c00f90, e8c00f40, 3, (RRnpc, RRnpc, ADDR), strex, rm_rd_rn), + TCE(strexh, 1e00f90, e8c00f50, 3, (RRnpc, RRnpc, ADDR), strex, rm_rd_rn), + TCE(strexd, 1a00f90, e8c00070, 4, (RRnpc, RRnpc, oRRnpc, RRnpcb), strexd, t_strexd), + TUF(clrex, 57ff01f, f3bf8f2f, 0, (), noargs, noargs), + +#undef ARM_VARIANT +#define ARM_VARIANT ARM_EXT_V6Z + TCE(smi, 1600070, f7f08000, 1, (EXPi), smi, t_smi), + +#undef ARM_VARIANT +#define ARM_VARIANT ARM_EXT_V6T2 + TCE(bfc, 7c0001f, f36f0000, 3, (RRnpc, I31, I32), bfc, t_bfc), + TCE(bfi, 7c00010, f3600000, 4, (RRnpc, RRnpc_I0, I31, I32), bfi, t_bfi), + TCE(sbfx, 7a00050, f3400000, 4, (RR, RR, I31, I32), bfx, t_bfx), + TCE(ubfx, 7e00050, f3c00000, 4, (RR, RR, I31, I32), bfx, t_bfx), + + TCE(mls, 0600090, fb000010, 4, (RRnpc, RRnpc, RRnpc, RRnpc), mlas, t_mla), + TCE(movw, 3000000, f2400000, 2, (RRnpc, Iffff), mov16, t_mov16), + TCE(movt, 3400000, f2c00000, 2, (RRnpc, Iffff), mov16, t_mov16), + TCE(rbit, 3ff0f30, fa90f0a0, 2, (RR, RR), rd_rm, t_rbit), + + TC3(ldrht, 03000b0, f8300e00, 2, (RR, ADDR), ldsttv4, t_ldstt), + TC3(ldrsht, 03000f0, f9300e00, 2, (RR, ADDR), ldsttv4, t_ldstt), + TC3(ldrsbt, 03000d0, f9100e00, 2, (RR, ADDR), ldsttv4, t_ldstt), + TC3(strht, 02000b0, f8200e00, 2, (RR, ADDR), ldsttv4, t_ldstt), + + UT(cbnz, b900, 2, (RR, EXP), t_czb), + UT(cbz, b100, 2, (RR, EXP), t_czb), + /* ARM does not really have an IT instruction. */ + TUE(it, 0, bf08, 1, (COND), it, t_it), + TUE(itt, 0, bf0c, 1, (COND), it, t_it), + TUE(ite, 0, bf04, 1, (COND), it, t_it), + TUE(ittt, 0, bf0e, 1, (COND), it, t_it), + TUE(itet, 0, bf06, 1, (COND), it, t_it), + TUE(itte, 0, bf0a, 1, (COND), it, t_it), + TUE(itee, 0, bf02, 1, (COND), it, t_it), + TUE(itttt, 0, bf0f, 1, (COND), it, t_it), + TUE(itett, 0, bf07, 1, (COND), it, t_it), + TUE(ittet, 0, bf0b, 1, (COND), it, t_it), + TUE(iteet, 0, bf03, 1, (COND), it, t_it), + TUE(ittte, 0, bf0d, 1, (COND), it, t_it), + TUE(itete, 0, bf05, 1, (COND), it, t_it), + TUE(ittee, 0, bf09, 1, (COND), it, t_it), + TUE(iteee, 0, bf01, 1, (COND), it, t_it), + +#undef ARM_VARIANT +#define ARM_VARIANT FPU_FPA_EXT_V1 /* Core FPA instruction set (V1). */ + CE(wfs, e200110, 1, (RR), rd), + CE(rfs, e300110, 1, (RR), rd), + CE(wfc, e400110, 1, (RR), rd), + CE(rfc, e500110, 1, (RR), rd), + + C3(ldfs, c100100, 2, (RF, ADDR), rd_cpaddr), + C3(ldfd, c108100, 2, (RF, ADDR), rd_cpaddr), + C3(ldfe, c500100, 2, (RF, ADDR), rd_cpaddr), + C3(ldfp, c508100, 2, (RF, ADDR), rd_cpaddr), + + C3(stfs, c000100, 2, (RF, ADDR), rd_cpaddr), + C3(stfd, c008100, 2, (RF, ADDR), rd_cpaddr), + C3(stfe, c400100, 2, (RF, ADDR), rd_cpaddr), + C3(stfp, c408100, 2, (RF, ADDR), rd_cpaddr), + + C3(mvfs, e008100, 2, (RF, RF_IF), rd_rm), + C3(mvfsp, e008120, 2, (RF, RF_IF), rd_rm), + C3(mvfsm, e008140, 2, (RF, RF_IF), rd_rm), + C3(mvfsz, e008160, 2, (RF, RF_IF), rd_rm), + C3(mvfd, e008180, 2, (RF, RF_IF), rd_rm), + C3(mvfdp, e0081a0, 2, (RF, RF_IF), rd_rm), + C3(mvfdm, e0081c0, 2, (RF, RF_IF), rd_rm), + C3(mvfdz, e0081e0, 2, (RF, RF_IF), rd_rm), + C3(mvfe, e088100, 2, (RF, RF_IF), rd_rm), + C3(mvfep, e088120, 2, (RF, RF_IF), rd_rm), + C3(mvfem, e088140, 2, (RF, RF_IF), rd_rm), + C3(mvfez, e088160, 2, (RF, RF_IF), rd_rm), + + C3(mnfs, e108100, 2, (RF, RF_IF), rd_rm), + C3(mnfsp, e108120, 2, (RF, RF_IF), rd_rm), + C3(mnfsm, e108140, 2, (RF, RF_IF), rd_rm), + C3(mnfsz, e108160, 2, (RF, RF_IF), rd_rm), + C3(mnfd, e108180, 2, (RF, RF_IF), rd_rm), + C3(mnfdp, e1081a0, 2, (RF, RF_IF), rd_rm), + C3(mnfdm, e1081c0, 2, (RF, RF_IF), rd_rm), + C3(mnfdz, e1081e0, 2, (RF, RF_IF), rd_rm), + C3(mnfe, e188100, 2, (RF, RF_IF), rd_rm), + C3(mnfep, e188120, 2, (RF, RF_IF), rd_rm), + C3(mnfem, e188140, 2, (RF, RF_IF), rd_rm), + C3(mnfez, e188160, 2, (RF, RF_IF), rd_rm), + + C3(abss, e208100, 2, (RF, RF_IF), rd_rm), + C3(abssp, e208120, 2, (RF, RF_IF), rd_rm), + C3(abssm, e208140, 2, (RF, RF_IF), rd_rm), + C3(abssz, e208160, 2, (RF, RF_IF), rd_rm), + C3(absd, e208180, 2, (RF, RF_IF), rd_rm), + C3(absdp, e2081a0, 2, (RF, RF_IF), rd_rm), + C3(absdm, e2081c0, 2, (RF, RF_IF), rd_rm), + C3(absdz, e2081e0, 2, (RF, RF_IF), rd_rm), + C3(abse, e288100, 2, (RF, RF_IF), rd_rm), + C3(absep, e288120, 2, (RF, RF_IF), rd_rm), + C3(absem, e288140, 2, (RF, RF_IF), rd_rm), + C3(absez, e288160, 2, (RF, RF_IF), rd_rm), + + C3(rnds, e308100, 2, (RF, RF_IF), rd_rm), + C3(rndsp, e308120, 2, (RF, RF_IF), rd_rm), + C3(rndsm, e308140, 2, (RF, RF_IF), rd_rm), + C3(rndsz, e308160, 2, (RF, RF_IF), rd_rm), + C3(rndd, e308180, 2, (RF, RF_IF), rd_rm), + C3(rnddp, e3081a0, 2, (RF, RF_IF), rd_rm), + C3(rnddm, e3081c0, 2, (RF, RF_IF), rd_rm), + C3(rnddz, e3081e0, 2, (RF, RF_IF), rd_rm), + C3(rnde, e388100, 2, (RF, RF_IF), rd_rm), + C3(rndep, e388120, 2, (RF, RF_IF), rd_rm), + C3(rndem, e388140, 2, (RF, RF_IF), rd_rm), + C3(rndez, e388160, 2, (RF, RF_IF), rd_rm), + + C3(sqts, e408100, 2, (RF, RF_IF), rd_rm), + C3(sqtsp, e408120, 2, (RF, RF_IF), rd_rm), + C3(sqtsm, e408140, 2, (RF, RF_IF), rd_rm), + C3(sqtsz, e408160, 2, (RF, RF_IF), rd_rm), + C3(sqtd, e408180, 2, (RF, RF_IF), rd_rm), + C3(sqtdp, e4081a0, 2, (RF, RF_IF), rd_rm), + C3(sqtdm, e4081c0, 2, (RF, RF_IF), rd_rm), + C3(sqtdz, e4081e0, 2, (RF, RF_IF), rd_rm), + C3(sqte, e488100, 2, (RF, RF_IF), rd_rm), + C3(sqtep, e488120, 2, (RF, RF_IF), rd_rm), + C3(sqtem, e488140, 2, (RF, RF_IF), rd_rm), + C3(sqtez, e488160, 2, (RF, RF_IF), rd_rm), + + C3(logs, e508100, 2, (RF, RF_IF), rd_rm), + C3(logsp, e508120, 2, (RF, RF_IF), rd_rm), + C3(logsm, e508140, 2, (RF, RF_IF), rd_rm), + C3(logsz, e508160, 2, (RF, RF_IF), rd_rm), + C3(logd, e508180, 2, (RF, RF_IF), rd_rm), + C3(logdp, e5081a0, 2, (RF, RF_IF), rd_rm), + C3(logdm, e5081c0, 2, (RF, RF_IF), rd_rm), + C3(logdz, e5081e0, 2, (RF, RF_IF), rd_rm), + C3(loge, e588100, 2, (RF, RF_IF), rd_rm), + C3(logep, e588120, 2, (RF, RF_IF), rd_rm), + C3(logem, e588140, 2, (RF, RF_IF), rd_rm), + C3(logez, e588160, 2, (RF, RF_IF), rd_rm), + + C3(lgns, e608100, 2, (RF, RF_IF), rd_rm), + C3(lgnsp, e608120, 2, (RF, RF_IF), rd_rm), + C3(lgnsm, e608140, 2, (RF, RF_IF), rd_rm), + C3(lgnsz, e608160, 2, (RF, RF_IF), rd_rm), + C3(lgnd, e608180, 2, (RF, RF_IF), rd_rm), + C3(lgndp, e6081a0, 2, (RF, RF_IF), rd_rm), + C3(lgndm, e6081c0, 2, (RF, RF_IF), rd_rm), + C3(lgndz, e6081e0, 2, (RF, RF_IF), rd_rm), + C3(lgne, e688100, 2, (RF, RF_IF), rd_rm), + C3(lgnep, e688120, 2, (RF, RF_IF), rd_rm), + C3(lgnem, e688140, 2, (RF, RF_IF), rd_rm), + C3(lgnez, e688160, 2, (RF, RF_IF), rd_rm), + + C3(exps, e708100, 2, (RF, RF_IF), rd_rm), + C3(expsp, e708120, 2, (RF, RF_IF), rd_rm), + C3(expsm, e708140, 2, (RF, RF_IF), rd_rm), + C3(expsz, e708160, 2, (RF, RF_IF), rd_rm), + C3(expd, e708180, 2, (RF, RF_IF), rd_rm), + C3(expdp, e7081a0, 2, (RF, RF_IF), rd_rm), + C3(expdm, e7081c0, 2, (RF, RF_IF), rd_rm), + C3(expdz, e7081e0, 2, (RF, RF_IF), rd_rm), + C3(expe, e788100, 2, (RF, RF_IF), rd_rm), + C3(expep, e788120, 2, (RF, RF_IF), rd_rm), + C3(expem, e788140, 2, (RF, RF_IF), rd_rm), + C3(expdz, e788160, 2, (RF, RF_IF), rd_rm), + + C3(sins, e808100, 2, (RF, RF_IF), rd_rm), + C3(sinsp, e808120, 2, (RF, RF_IF), rd_rm), + C3(sinsm, e808140, 2, (RF, RF_IF), rd_rm), + C3(sinsz, e808160, 2, (RF, RF_IF), rd_rm), + C3(sind, e808180, 2, (RF, RF_IF), rd_rm), + C3(sindp, e8081a0, 2, (RF, RF_IF), rd_rm), + C3(sindm, e8081c0, 2, (RF, RF_IF), rd_rm), + C3(sindz, e8081e0, 2, (RF, RF_IF), rd_rm), + C3(sine, e888100, 2, (RF, RF_IF), rd_rm), + C3(sinep, e888120, 2, (RF, RF_IF), rd_rm), + C3(sinem, e888140, 2, (RF, RF_IF), rd_rm), + C3(sinez, e888160, 2, (RF, RF_IF), rd_rm), + + C3(coss, e908100, 2, (RF, RF_IF), rd_rm), + C3(cossp, e908120, 2, (RF, RF_IF), rd_rm), + C3(cossm, e908140, 2, (RF, RF_IF), rd_rm), + C3(cossz, e908160, 2, (RF, RF_IF), rd_rm), + C3(cosd, e908180, 2, (RF, RF_IF), rd_rm), + C3(cosdp, e9081a0, 2, (RF, RF_IF), rd_rm), + C3(cosdm, e9081c0, 2, (RF, RF_IF), rd_rm), + C3(cosdz, e9081e0, 2, (RF, RF_IF), rd_rm), + C3(cose, e988100, 2, (RF, RF_IF), rd_rm), + C3(cosep, e988120, 2, (RF, RF_IF), rd_rm), + C3(cosem, e988140, 2, (RF, RF_IF), rd_rm), + C3(cosez, e988160, 2, (RF, RF_IF), rd_rm), + + C3(tans, ea08100, 2, (RF, RF_IF), rd_rm), + C3(tansp, ea08120, 2, (RF, RF_IF), rd_rm), + C3(tansm, ea08140, 2, (RF, RF_IF), rd_rm), + C3(tansz, ea08160, 2, (RF, RF_IF), rd_rm), + C3(tand, ea08180, 2, (RF, RF_IF), rd_rm), + C3(tandp, ea081a0, 2, (RF, RF_IF), rd_rm), + C3(tandm, ea081c0, 2, (RF, RF_IF), rd_rm), + C3(tandz, ea081e0, 2, (RF, RF_IF), rd_rm), + C3(tane, ea88100, 2, (RF, RF_IF), rd_rm), + C3(tanep, ea88120, 2, (RF, RF_IF), rd_rm), + C3(tanem, ea88140, 2, (RF, RF_IF), rd_rm), + C3(tanez, ea88160, 2, (RF, RF_IF), rd_rm), + + C3(asns, eb08100, 2, (RF, RF_IF), rd_rm), + C3(asnsp, eb08120, 2, (RF, RF_IF), rd_rm), + C3(asnsm, eb08140, 2, (RF, RF_IF), rd_rm), + C3(asnsz, eb08160, 2, (RF, RF_IF), rd_rm), + C3(asnd, eb08180, 2, (RF, RF_IF), rd_rm), + C3(asndp, eb081a0, 2, (RF, RF_IF), rd_rm), + C3(asndm, eb081c0, 2, (RF, RF_IF), rd_rm), + C3(asndz, eb081e0, 2, (RF, RF_IF), rd_rm), + C3(asne, eb88100, 2, (RF, RF_IF), rd_rm), + C3(asnep, eb88120, 2, (RF, RF_IF), rd_rm), + C3(asnem, eb88140, 2, (RF, RF_IF), rd_rm), + C3(asnez, eb88160, 2, (RF, RF_IF), rd_rm), + + C3(acss, ec08100, 2, (RF, RF_IF), rd_rm), + C3(acssp, ec08120, 2, (RF, RF_IF), rd_rm), + C3(acssm, ec08140, 2, (RF, RF_IF), rd_rm), + C3(acssz, ec08160, 2, (RF, RF_IF), rd_rm), + C3(acsd, ec08180, 2, (RF, RF_IF), rd_rm), + C3(acsdp, ec081a0, 2, (RF, RF_IF), rd_rm), + C3(acsdm, ec081c0, 2, (RF, RF_IF), rd_rm), + C3(acsdz, ec081e0, 2, (RF, RF_IF), rd_rm), + C3(acse, ec88100, 2, (RF, RF_IF), rd_rm), + C3(acsep, ec88120, 2, (RF, RF_IF), rd_rm), + C3(acsem, ec88140, 2, (RF, RF_IF), rd_rm), + C3(acsez, ec88160, 2, (RF, RF_IF), rd_rm), + + C3(atns, ed08100, 2, (RF, RF_IF), rd_rm), + C3(atnsp, ed08120, 2, (RF, RF_IF), rd_rm), + C3(atnsm, ed08140, 2, (RF, RF_IF), rd_rm), + C3(atnsz, ed08160, 2, (RF, RF_IF), rd_rm), + C3(atnd, ed08180, 2, (RF, RF_IF), rd_rm), + C3(atndp, ed081a0, 2, (RF, RF_IF), rd_rm), + C3(atndm, ed081c0, 2, (RF, RF_IF), rd_rm), + C3(atndz, ed081e0, 2, (RF, RF_IF), rd_rm), + C3(atne, ed88100, 2, (RF, RF_IF), rd_rm), + C3(atnep, ed88120, 2, (RF, RF_IF), rd_rm), + C3(atnem, ed88140, 2, (RF, RF_IF), rd_rm), + C3(atnez, ed88160, 2, (RF, RF_IF), rd_rm), + + C3(urds, ee08100, 2, (RF, RF_IF), rd_rm), + C3(urdsp, ee08120, 2, (RF, RF_IF), rd_rm), + C3(urdsm, ee08140, 2, (RF, RF_IF), rd_rm), + C3(urdsz, ee08160, 2, (RF, RF_IF), rd_rm), + C3(urdd, ee08180, 2, (RF, RF_IF), rd_rm), + C3(urddp, ee081a0, 2, (RF, RF_IF), rd_rm), + C3(urddm, ee081c0, 2, (RF, RF_IF), rd_rm), + C3(urddz, ee081e0, 2, (RF, RF_IF), rd_rm), + C3(urde, ee88100, 2, (RF, RF_IF), rd_rm), + C3(urdep, ee88120, 2, (RF, RF_IF), rd_rm), + C3(urdem, ee88140, 2, (RF, RF_IF), rd_rm), + C3(urdez, ee88160, 2, (RF, RF_IF), rd_rm), + + C3(nrms, ef08100, 2, (RF, RF_IF), rd_rm), + C3(nrmsp, ef08120, 2, (RF, RF_IF), rd_rm), + C3(nrmsm, ef08140, 2, (RF, RF_IF), rd_rm), + C3(nrmsz, ef08160, 2, (RF, RF_IF), rd_rm), + C3(nrmd, ef08180, 2, (RF, RF_IF), rd_rm), + C3(nrmdp, ef081a0, 2, (RF, RF_IF), rd_rm), + C3(nrmdm, ef081c0, 2, (RF, RF_IF), rd_rm), + C3(nrmdz, ef081e0, 2, (RF, RF_IF), rd_rm), + C3(nrme, ef88100, 2, (RF, RF_IF), rd_rm), + C3(nrmep, ef88120, 2, (RF, RF_IF), rd_rm), + C3(nrmem, ef88140, 2, (RF, RF_IF), rd_rm), + C3(nrmez, ef88160, 2, (RF, RF_IF), rd_rm), + + C3(adfs, e000100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(adfsp, e000120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(adfsm, e000140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(adfsz, e000160, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(adfd, e000180, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(adfdp, e0001a0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(adfdm, e0001c0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(adfdz, e0001e0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(adfe, e080100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(adfep, e080120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(adfem, e080140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(adfez, e080160, 3, (RF, RF, RF_IF), rd_rn_rm), + + C3(sufs, e200100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(sufsp, e200120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(sufsm, e200140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(sufsz, e200160, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(sufd, e200180, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(sufdp, e2001a0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(sufdm, e2001c0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(sufdz, e2001e0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(sufe, e280100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(sufep, e280120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(sufem, e280140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(sufez, e280160, 3, (RF, RF, RF_IF), rd_rn_rm), + + C3(rsfs, e300100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rsfsp, e300120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rsfsm, e300140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rsfsz, e300160, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rsfd, e300180, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rsfdp, e3001a0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rsfdm, e3001c0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rsfdz, e3001e0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rsfe, e380100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rsfep, e380120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rsfem, e380140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rsfez, e380160, 3, (RF, RF, RF_IF), rd_rn_rm), + + C3(mufs, e100100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(mufsp, e100120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(mufsm, e100140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(mufsz, e100160, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(mufd, e100180, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(mufdp, e1001a0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(mufdm, e1001c0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(mufdz, e1001e0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(mufe, e180100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(mufep, e180120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(mufem, e180140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(mufez, e180160, 3, (RF, RF, RF_IF), rd_rn_rm), + + C3(dvfs, e400100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(dvfsp, e400120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(dvfsm, e400140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(dvfsz, e400160, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(dvfd, e400180, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(dvfdp, e4001a0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(dvfdm, e4001c0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(dvfdz, e4001e0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(dvfe, e480100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(dvfep, e480120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(dvfem, e480140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(dvfez, e480160, 3, (RF, RF, RF_IF), rd_rn_rm), + + C3(rdfs, e500100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rdfsp, e500120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rdfsm, e500140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rdfsz, e500160, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rdfd, e500180, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rdfdp, e5001a0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rdfdm, e5001c0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rdfdz, e5001e0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rdfe, e580100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rdfep, e580120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rdfem, e580140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rdfez, e580160, 3, (RF, RF, RF_IF), rd_rn_rm), + + C3(pows, e600100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(powsp, e600120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(powsm, e600140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(powsz, e600160, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(powd, e600180, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(powdp, e6001a0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(powdm, e6001c0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(powdz, e6001e0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(powe, e680100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(powep, e680120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(powem, e680140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(powez, e680160, 3, (RF, RF, RF_IF), rd_rn_rm), + + C3(rpws, e700100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rpwsp, e700120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rpwsm, e700140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rpwsz, e700160, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rpwd, e700180, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rpwdp, e7001a0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rpwdm, e7001c0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rpwdz, e7001e0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rpwe, e780100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rpwep, e780120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rpwem, e780140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rpwez, e780160, 3, (RF, RF, RF_IF), rd_rn_rm), + + C3(rmfs, e800100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rmfsp, e800120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rmfsm, e800140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rmfsz, e800160, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rmfd, e800180, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rmfdp, e8001a0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rmfdm, e8001c0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rmfdz, e8001e0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rmfe, e880100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rmfep, e880120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rmfem, e880140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(rmfez, e880160, 3, (RF, RF, RF_IF), rd_rn_rm), + + C3(fmls, e900100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fmlsp, e900120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fmlsm, e900140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fmlsz, e900160, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fmld, e900180, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fmldp, e9001a0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fmldm, e9001c0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fmldz, e9001e0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fmle, e980100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fmlep, e980120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fmlem, e980140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fmlez, e980160, 3, (RF, RF, RF_IF), rd_rn_rm), + + C3(fdvs, ea00100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fdvsp, ea00120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fdvsm, ea00140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fdvsz, ea00160, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fdvd, ea00180, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fdvdp, ea001a0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fdvdm, ea001c0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fdvdz, ea001e0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fdve, ea80100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fdvep, ea80120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fdvem, ea80140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(fdvez, ea80160, 3, (RF, RF, RF_IF), rd_rn_rm), + + C3(frds, eb00100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(frdsp, eb00120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(frdsm, eb00140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(frdsz, eb00160, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(frdd, eb00180, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(frddp, eb001a0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(frddm, eb001c0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(frddz, eb001e0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(frde, eb80100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(frdep, eb80120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(frdem, eb80140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(frdez, eb80160, 3, (RF, RF, RF_IF), rd_rn_rm), + + C3(pols, ec00100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(polsp, ec00120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(polsm, ec00140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(polsz, ec00160, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(pold, ec00180, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(poldp, ec001a0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(poldm, ec001c0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(poldz, ec001e0, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(pole, ec80100, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(polep, ec80120, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(polem, ec80140, 3, (RF, RF, RF_IF), rd_rn_rm), + C3(polez, ec80160, 3, (RF, RF, RF_IF), rd_rn_rm), + + CE(cmf, e90f110, 2, (RF, RF_IF), fpa_cmp), + C3E(cmfe, ed0f110, 2, (RF, RF_IF), fpa_cmp), + CE(cnf, eb0f110, 2, (RF, RF_IF), fpa_cmp), + C3E(cnfe, ef0f110, 2, (RF, RF_IF), fpa_cmp), + + C3(flts, e000110, 2, (RF, RR), rn_rd), + C3(fltsp, e000130, 2, (RF, RR), rn_rd), + C3(fltsm, e000150, 2, (RF, RR), rn_rd), + C3(fltsz, e000170, 2, (RF, RR), rn_rd), + C3(fltd, e000190, 2, (RF, RR), rn_rd), + C3(fltdp, e0001b0, 2, (RF, RR), rn_rd), + C3(fltdm, e0001d0, 2, (RF, RR), rn_rd), + C3(fltdz, e0001f0, 2, (RF, RR), rn_rd), + C3(flte, e080110, 2, (RF, RR), rn_rd), + C3(fltep, e080130, 2, (RF, RR), rn_rd), + C3(fltem, e080150, 2, (RF, RR), rn_rd), + C3(fltez, e080170, 2, (RF, RR), rn_rd), -static void -do_fpa_ctrl (char * str) -{ - /* FP control registers. - Format: {cond} Rn */ + /* The implementation of the FIX instruction is broken on some + assemblers, in that it accepts a precision specifier as well as a + rounding specifier, despite the fact that this is meaningless. + To be more compatible, we accept it as well, though of course it + does not set any bits. */ + CE(fix, e100110, 2, (RR, RF), rd_rm), + C3(fixp, e100130, 2, (RR, RF), rd_rm), + C3(fixm, e100150, 2, (RR, RF), rd_rm), + C3(fixz, e100170, 2, (RR, RF), rd_rm), + C3(fixsp, e100130, 2, (RR, RF), rd_rm), + C3(fixsm, e100150, 2, (RR, RF), rd_rm), + C3(fixsz, e100170, 2, (RR, RF), rd_rm), + C3(fixdp, e100130, 2, (RR, RF), rd_rm), + C3(fixdm, e100150, 2, (RR, RF), rd_rm), + C3(fixdz, e100170, 2, (RR, RF), rd_rm), + C3(fixep, e100130, 2, (RR, RF), rd_rm), + C3(fixem, e100150, 2, (RR, RF), rd_rm), + C3(fixez, e100170, 2, (RR, RF), rd_rm), - skip_whitespace (str); + /* Instructions that were new with the real FPA, call them V2. */ +#undef ARM_VARIANT +#define ARM_VARIANT FPU_FPA_EXT_V2 + CE(lfm, c100200, 3, (RF, I4b, ADDR), fpa_ldmstm), + C3(lfmfd, c900200, 3, (RF, I4b, ADDR), fpa_ldmstm), + C3(lfmea, d100200, 3, (RF, I4b, ADDR), fpa_ldmstm), + CE(sfm, c000200, 3, (RF, I4b, ADDR), fpa_ldmstm), + C3(sfmfd, d000200, 3, (RF, I4b, ADDR), fpa_ldmstm), + C3(sfmea, c800200, 3, (RF, I4b, ADDR), fpa_ldmstm), - if (reg_required_here (&str, 12) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } +#undef ARM_VARIANT +#define ARM_VARIANT FPU_VFP_EXT_V1xD /* VFP V1xD (single precision). */ + /* Moves and type conversions. */ + CE(fcpys, eb00a40, 2, (RVS, RVS), vfp_sp_monadic), + CE(fmrs, e100a10, 2, (RR, RVS), vfp_reg_from_sp), + CE(fmsr, e000a10, 2, (RVS, RR), vfp_sp_from_reg), + CE(fmstat, ef1fa10, 0, (), noargs), + CE(fsitos, eb80ac0, 2, (RVS, RVS), vfp_sp_monadic), + CE(fuitos, eb80a40, 2, (RVS, RVS), vfp_sp_monadic), + CE(ftosis, ebd0a40, 2, (RVS, RVS), vfp_sp_monadic), + CE(ftosizs, ebd0ac0, 2, (RVS, RVS), vfp_sp_monadic), + CE(ftouis, ebc0a40, 2, (RVS, RVS), vfp_sp_monadic), + CE(ftouizs, ebc0ac0, 2, (RVS, RVS), vfp_sp_monadic), + CE(fmrx, ef00a10, 2, (RR, RVC), rd_rn), + CE(fmxr, ee00a10, 2, (RVC, RR), rn_rd), + + /* Memory operations. */ + CE(flds, d100a00, 2, (RVS, ADDR), vfp_sp_ldst), + CE(fsts, d000a00, 2, (RVS, ADDR), vfp_sp_ldst), + CE(fldmias, c900a00, 2, (RRw, VRSLST), vfp_sp_ldstmia), + CE(fldmfds, c900a00, 2, (RRw, VRSLST), vfp_sp_ldstmia), + CE(fldmdbs, d300a00, 2, (RRw, VRSLST), vfp_sp_ldstmdb), + CE(fldmeas, d300a00, 2, (RRw, VRSLST), vfp_sp_ldstmdb), + CE(fldmiax, c900b00, 2, (RRw, VRDLST), vfp_xp_ldstmia), + CE(fldmfdx, c900b00, 2, (RRw, VRDLST), vfp_xp_ldstmia), + CE(fldmdbx, d300b00, 2, (RRw, VRDLST), vfp_xp_ldstmdb), + CE(fldmeax, d300b00, 2, (RRw, VRDLST), vfp_xp_ldstmdb), + CE(fstmias, c800a00, 2, (RRw, VRSLST), vfp_sp_ldstmia), + CE(fstmeas, c800a00, 2, (RRw, VRSLST), vfp_sp_ldstmia), + CE(fstmdbs, d200a00, 2, (RRw, VRSLST), vfp_sp_ldstmdb), + CE(fstmfds, d200a00, 2, (RRw, VRSLST), vfp_sp_ldstmdb), + CE(fstmiax, c800b00, 2, (RRw, VRDLST), vfp_xp_ldstmia), + CE(fstmeax, c800b00, 2, (RRw, VRDLST), vfp_xp_ldstmia), + CE(fstmdbx, d200b00, 2, (RRw, VRDLST), vfp_xp_ldstmdb), + CE(fstmfdx, d200b00, 2, (RRw, VRDLST), vfp_xp_ldstmdb), - end_of_line (str); -} + /* Monadic operations. */ + CE(fabss, eb00ac0, 2, (RVS, RVS), vfp_sp_monadic), + CE(fnegs, eb10a40, 2, (RVS, RVS), vfp_sp_monadic), + CE(fsqrts, eb10ac0, 2, (RVS, RVS), vfp_sp_monadic), + + /* Dyadic operations. */ + CE(fadds, e300a00, 3, (RVS, RVS, RVS), vfp_sp_dyadic), + CE(fsubs, e300a40, 3, (RVS, RVS, RVS), vfp_sp_dyadic), + CE(fmuls, e200a00, 3, (RVS, RVS, RVS), vfp_sp_dyadic), + CE(fdivs, e800a00, 3, (RVS, RVS, RVS), vfp_sp_dyadic), + CE(fmacs, e000a00, 3, (RVS, RVS, RVS), vfp_sp_dyadic), + CE(fmscs, e100a00, 3, (RVS, RVS, RVS), vfp_sp_dyadic), + CE(fnmuls, e200a40, 3, (RVS, RVS, RVS), vfp_sp_dyadic), + CE(fnmacs, e000a40, 3, (RVS, RVS, RVS), vfp_sp_dyadic), + CE(fnmscs, e100a40, 3, (RVS, RVS, RVS), vfp_sp_dyadic), -static void -do_fpa_ldst (char * str) -{ - skip_whitespace (str); + /* Comparisons. */ + CE(fcmps, eb40a40, 2, (RVS, RVS), vfp_sp_monadic), + CE(fcmpzs, eb50a40, 1, (RVS), vfp_sp_compare_z), + CE(fcmpes, eb40ac0, 2, (RVS, RVS), vfp_sp_monadic), + CE(fcmpezs, eb50ac0, 1, (RVS), vfp_sp_compare_z), - if (fp_reg_required_here (&str, 12) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } +#undef ARM_VARIANT +#define ARM_VARIANT FPU_VFP_EXT_V1 /* VFP V1 (Double precision). */ + /* Moves and type conversions. */ + CE(fcpyd, eb00b40, 2, (RVD, RVD), rd_rm), + CE(fcvtds, eb70ac0, 2, (RVD, RVS), vfp_dp_sp_cvt), + CE(fcvtsd, eb70bc0, 2, (RVS, RVD), vfp_sp_dp_cvt), + CE(fmdhr, e200b10, 2, (RVD, RR), rn_rd), + CE(fmdlr, e000b10, 2, (RVD, RR), rn_rd), + CE(fmrdh, e300b10, 2, (RR, RVD), rd_rn), + CE(fmrdl, e100b10, 2, (RR, RVD), rd_rn), + CE(fsitod, eb80bc0, 2, (RVD, RVS), vfp_dp_sp_cvt), + CE(fuitod, eb80b40, 2, (RVD, RVS), vfp_dp_sp_cvt), + CE(ftosid, ebd0b40, 2, (RVS, RVD), vfp_sp_dp_cvt), + CE(ftosizd, ebd0bc0, 2, (RVS, RVD), vfp_sp_dp_cvt), + CE(ftouid, ebc0b40, 2, (RVS, RVD), vfp_sp_dp_cvt), + CE(ftouizd, ebc0bc0, 2, (RVS, RVD), vfp_sp_dp_cvt), + + /* Memory operations. */ + CE(fldd, d100b00, 2, (RVD, ADDR), vfp_dp_ldst), + CE(fstd, d000b00, 2, (RVD, ADDR), vfp_dp_ldst), + CE(fldmiad, c900b00, 2, (RRw, VRDLST), vfp_dp_ldstmia), + CE(fldmfdd, c900b00, 2, (RRw, VRDLST), vfp_dp_ldstmia), + CE(fldmdbd, d300b00, 2, (RRw, VRDLST), vfp_dp_ldstmdb), + CE(fldmead, d300b00, 2, (RRw, VRDLST), vfp_dp_ldstmdb), + CE(fstmiad, c800b00, 2, (RRw, VRDLST), vfp_dp_ldstmia), + CE(fstmead, c800b00, 2, (RRw, VRDLST), vfp_dp_ldstmia), + CE(fstmdbd, d200b00, 2, (RRw, VRDLST), vfp_dp_ldstmdb), + CE(fstmfdd, d200b00, 2, (RRw, VRDLST), vfp_dp_ldstmdb), - if (skip_past_comma (&str) == FAIL - || cp_address_required_here (&str, CP_WB_OK) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + /* Monadic operations. */ + CE(fabsd, eb00bc0, 2, (RVD, RVD), rd_rm), + CE(fnegd, eb10b40, 2, (RVD, RVD), rd_rm), + CE(fsqrtd, eb10bc0, 2, (RVD, RVD), rd_rm), + + /* Dyadic operations. */ + CE(faddd, e300b00, 3, (RVD, RVD, RVD), rd_rn_rm), + CE(fsubd, e300b40, 3, (RVD, RVD, RVD), rd_rn_rm), + CE(fmuld, e200b00, 3, (RVD, RVD, RVD), rd_rn_rm), + CE(fdivd, e800b00, 3, (RVD, RVD, RVD), rd_rn_rm), + CE(fmacd, e000b00, 3, (RVD, RVD, RVD), rd_rn_rm), + CE(fmscd, e100b00, 3, (RVD, RVD, RVD), rd_rn_rm), + CE(fnmuld, e200b40, 3, (RVD, RVD, RVD), rd_rn_rm), + CE(fnmacd, e000b40, 3, (RVD, RVD, RVD), rd_rn_rm), + CE(fnmscd, e100b40, 3, (RVD, RVD, RVD), rd_rn_rm), - end_of_line (str); -} + /* Comparisons. */ + CE(fcmpd, eb40b40, 2, (RVD, RVD), rd_rm), + CE(fcmpzd, eb50b40, 1, (RVD), rd), + CE(fcmped, eb40bc0, 2, (RVD, RVD), rd_rm), + CE(fcmpezd, eb50bc0, 1, (RVD), rd), + +#undef ARM_VARIANT +#define ARM_VARIANT FPU_VFP_EXT_V2 + CE(fmsrr, c400a10, 3, (VRSLST, RR, RR), vfp_sp2_from_reg2), + CE(fmrrs, c500a10, 3, (RR, RR, VRSLST), vfp_reg2_from_sp2), + CE(fmdrr, c400b10, 3, (RVD, RR, RR), rm_rd_rn), + CE(fmrrd, c500b10, 3, (RR, RR, RVD), rd_rn_rm), + +#undef ARM_VARIANT +#define ARM_VARIANT ARM_CEXT_XSCALE /* Intel XScale extensions. */ + CE(mia, e200010, 3, (RXA, RRnpc, RRnpc), xsc_mia), + CE(miaph, e280010, 3, (RXA, RRnpc, RRnpc), xsc_mia), + CE(miabb, e2c0010, 3, (RXA, RRnpc, RRnpc), xsc_mia), + CE(miabt, e2d0010, 3, (RXA, RRnpc, RRnpc), xsc_mia), + CE(miatb, e2e0010, 3, (RXA, RRnpc, RRnpc), xsc_mia), + CE(miatt, e2f0010, 3, (RXA, RRnpc, RRnpc), xsc_mia), + CE(mar, c400000, 3, (RXA, RRnpc, RRnpc), xsc_mar), + CE(mra, c500000, 3, (RRnpc, RRnpc, RXA), xsc_mra), + +#undef ARM_VARIANT +#define ARM_VARIANT ARM_CEXT_IWMMXT /* Intel Wireless MMX technology. */ + CE(tandcb, e13f130, 1, (RR), iwmmxt_tandorc), + CE(tandch, e53f130, 1, (RR), iwmmxt_tandorc), + CE(tandcw, e93f130, 1, (RR), iwmmxt_tandorc), + CE(tbcstb, e400010, 2, (RIWR, RR), rn_rd), + CE(tbcsth, e400050, 2, (RIWR, RR), rn_rd), + CE(tbcstw, e400090, 2, (RIWR, RR), rn_rd), + CE(textrcb, e130170, 2, (RR, I7), iwmmxt_textrc), + CE(textrch, e530170, 2, (RR, I7), iwmmxt_textrc), + CE(textrcw, e930170, 2, (RR, I7), iwmmxt_textrc), + CE(textrmub, e100070, 3, (RR, RIWR, I7), iwmmxt_textrm), + CE(textrmuh, e500070, 3, (RR, RIWR, I7), iwmmxt_textrm), + CE(textrmuw, e900070, 3, (RR, RIWR, I7), iwmmxt_textrm), + CE(textrmsb, e100078, 3, (RR, RIWR, I7), iwmmxt_textrm), + CE(textrmsh, e500078, 3, (RR, RIWR, I7), iwmmxt_textrm), + CE(textrmsw, e900078, 3, (RR, RIWR, I7), iwmmxt_textrm), + CE(tinsrb, e600010, 3, (RIWR, RR, I7), iwmmxt_tinsr), + CE(tinsrh, e600050, 3, (RIWR, RR, I7), iwmmxt_tinsr), + CE(tinsrw, e600090, 3, (RIWR, RR, I7), iwmmxt_tinsr), + CE(tmcr, e000110, 2, (RIWC, RR), rn_rd), + CE(tmcrr, c400000, 3, (RIWR, RR, RR), rm_rd_rn), + CE(tmia, e200010, 3, (RIWR, RR, RR), iwmmxt_tmia), + CE(tmiaph, e280010, 3, (RIWR, RR, RR), iwmmxt_tmia), + CE(tmiabb, e2c0010, 3, (RIWR, RR, RR), iwmmxt_tmia), + CE(tmiabt, e2d0010, 3, (RIWR, RR, RR), iwmmxt_tmia), + CE(tmiatb, e2e0010, 3, (RIWR, RR, RR), iwmmxt_tmia), + CE(tmiatt, e2f0010, 3, (RIWR, RR, RR), iwmmxt_tmia), + CE(tmovmskb, e100030, 2, (RR, RIWR), rd_rn), + CE(tmovmskh, e500030, 2, (RR, RIWR), rd_rn), + CE(tmovmskw, e900030, 2, (RR, RIWR), rd_rn), + CE(tmrc, e100110, 2, (RR, RIWC), rd_rn), + CE(tmrrc, c500000, 3, (RR, RR, RIWR), rd_rn_rm), + CE(torcb, e13f150, 1, (RR), iwmmxt_tandorc), + CE(torch, e53f150, 1, (RR), iwmmxt_tandorc), + CE(torcw, e93f150, 1, (RR), iwmmxt_tandorc), + CE(waccb, e0001c0, 2, (RIWR, RIWR), rd_rn), + CE(wacch, e4001c0, 2, (RIWR, RIWR), rd_rn), + CE(waccw, e8001c0, 2, (RIWR, RIWR), rd_rn), + CE(waddbss, e300180, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(waddb, e000180, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(waddbus, e100180, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(waddhss, e700180, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(waddh, e400180, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(waddhus, e500180, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(waddwss, eb00180, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(waddw, e800180, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(waddwus, e900180, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(waligni, e000020, 4, (RIWR, RIWR, RIWR, I7), iwmmxt_waligni), + CE(walignr0, e800020, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(walignr1, e900020, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(walignr2, ea00020, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(walignr3, eb00020, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wand, e200000, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wandn, e300000, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wavg2b, e800000, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wavg2br, e900000, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wavg2h, ec00000, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wavg2hr, ed00000, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wcmpeqb, e000060, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wcmpeqh, e400060, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wcmpeqw, e800060, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wcmpgtub, e100060, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wcmpgtuh, e500060, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wcmpgtuw, e900060, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wcmpgtsb, e300060, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wcmpgtsh, e700060, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wcmpgtsw, eb00060, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wldrb, c100000, 2, (RIWR, ADDR), iwmmxt_wldstbh), + CE(wldrh, c500000, 2, (RIWR, ADDR), iwmmxt_wldstbh), + CE(wldrw, c100100, 2, (RIWR_RIWC, ADDR), iwmmxt_wldstw), + CE(wldrd, c500100, 2, (RIWR, ADDR), iwmmxt_wldstd), + CE(wmacs, e600100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wmacsz, e700100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wmacu, e400100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wmacuz, e500100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wmadds, ea00100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wmaddu, e800100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wmaxsb, e200160, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wmaxsh, e600160, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wmaxsw, ea00160, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wmaxub, e000160, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wmaxuh, e400160, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wmaxuw, e800160, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wminsb, e300160, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wminsh, e700160, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wminsw, eb00160, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wminub, e100160, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wminuh, e500160, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wminuw, e900160, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wmov, e000000, 2, (RIWR, RIWR), iwmmxt_wmov), + CE(wmulsm, e300100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wmulsl, e200100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wmulum, e100100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wmulul, e000100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wor, e000000, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wpackhss, e700080, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wpackhus, e500080, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wpackwss, eb00080, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wpackwus, e900080, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wpackdss, ef00080, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wpackdus, ed00080, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wrorh, e700040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wrorhg, e700148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), + CE(wrorw, eb00040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wrorwg, eb00148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), + CE(wrord, ef00040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wrordg, ef00148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), + CE(wsadb, e000120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wsadbz, e100120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wsadh, e400120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wsadhz, e500120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wshufh, e0001e0, 3, (RIWR, RIWR, I255), iwmmxt_wshufh), + CE(wsllh, e500040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wsllhg, e500148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), + CE(wsllw, e900040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wsllwg, e900148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), + CE(wslld, ed00040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wslldg, ed00148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), + CE(wsrah, e400040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wsrahg, e400148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), + CE(wsraw, e800040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wsrawg, e800148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), + CE(wsrad, ec00040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wsradg, ec00148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), + CE(wsrlh, e600040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wsrlhg, e600148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), + CE(wsrlw, ea00040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wsrlwg, ea00148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), + CE(wsrld, ee00040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wsrldg, ee00148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), + CE(wstrb, c000000, 2, (RIWR, ADDR), iwmmxt_wldstbh), + CE(wstrh, c400000, 2, (RIWR, ADDR), iwmmxt_wldstbh), + CE(wstrw, c000100, 2, (RIWR_RIWC, ADDR), iwmmxt_wldstw), + CE(wstrd, c400100, 2, (RIWR, ADDR), iwmmxt_wldstd), + CE(wsubbss, e3001a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wsubb, e0001a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wsubbus, e1001a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wsubhss, e7001a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wsubh, e4001a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wsubhus, e5001a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wsubwss, eb001a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wsubw, e8001a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wsubwus, e9001a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wunpckehub,e0000c0, 2, (RIWR, RIWR), rd_rn), + CE(wunpckehuh,e4000c0, 2, (RIWR, RIWR), rd_rn), + CE(wunpckehuw,e8000c0, 2, (RIWR, RIWR), rd_rn), + CE(wunpckehsb,e2000c0, 2, (RIWR, RIWR), rd_rn), + CE(wunpckehsh,e6000c0, 2, (RIWR, RIWR), rd_rn), + CE(wunpckehsw,ea000c0, 2, (RIWR, RIWR), rd_rn), + CE(wunpckihb, e1000c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wunpckihh, e5000c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wunpckihw, e9000c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wunpckelub,e0000e0, 2, (RIWR, RIWR), rd_rn), + CE(wunpckeluh,e4000e0, 2, (RIWR, RIWR), rd_rn), + CE(wunpckeluw,e8000e0, 2, (RIWR, RIWR), rd_rn), + CE(wunpckelsb,e2000e0, 2, (RIWR, RIWR), rd_rn), + CE(wunpckelsh,e6000e0, 2, (RIWR, RIWR), rd_rn), + CE(wunpckelsw,ea000e0, 2, (RIWR, RIWR), rd_rn), + CE(wunpckilb, e1000e0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wunpckilh, e5000e0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wunpckilw, e9000e0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wxor, e100000, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + CE(wzero, e300000, 1, (RIWR), iwmmxt_wzero), + +#undef ARM_VARIANT +#define ARM_VARIANT ARM_CEXT_MAVERICK /* Cirrus Maverick instructions. */ + CE(cfldrs, c100400, 2, (RMF, ADDR), rd_cpaddr), + CE(cfldrd, c500400, 2, (RMD, ADDR), rd_cpaddr), + CE(cfldr32, c100500, 2, (RMFX, ADDR), rd_cpaddr), + CE(cfldr64, c500500, 2, (RMDX, ADDR), rd_cpaddr), + CE(cfstrs, c000400, 2, (RMF, ADDR), rd_cpaddr), + CE(cfstrd, c400400, 2, (RMD, ADDR), rd_cpaddr), + CE(cfstr32, c000500, 2, (RMFX, ADDR), rd_cpaddr), + CE(cfstr64, c400500, 2, (RMDX, ADDR), rd_cpaddr), + CE(cfmvsr, e000450, 2, (RMF, RR), rn_rd), + CE(cfmvrs, e100450, 2, (RR, RMF), rd_rn), + CE(cfmvdlr, e000410, 2, (RMD, RR), rn_rd), + CE(cfmvrdl, e100410, 2, (RR, RMD), rd_rn), + CE(cfmvdhr, e000430, 2, (RMD, RR), rn_rd), + CE(cfmvrdh, e100430, 2, (RR, RMD), rd_rn), + CE(cfmv64lr, e000510, 2, (RMDX, RR), rn_rd), + CE(cfmvr64l, e100510, 2, (RR, RMDX), rd_rn), + CE(cfmv64hr, e000530, 2, (RMDX, RR), rn_rd), + CE(cfmvr64h, e100530, 2, (RR, RMDX), rd_rn), + CE(cfmval32, e200440, 2, (RMAX, RMFX), rd_rn), + CE(cfmv32al, e100440, 2, (RMFX, RMAX), rd_rn), + CE(cfmvam32, e200460, 2, (RMAX, RMFX), rd_rn), + CE(cfmv32am, e100460, 2, (RMFX, RMAX), rd_rn), + CE(cfmvah32, e200480, 2, (RMAX, RMFX), rd_rn), + CE(cfmv32ah, e100480, 2, (RMFX, RMAX), rd_rn), + CE(cfmva32, e2004a0, 2, (RMAX, RMFX), rd_rn), + CE(cfmv32a, e1004a0, 2, (RMFX, RMAX), rd_rn), + CE(cfmva64, e2004c0, 2, (RMAX, RMDX), rd_rn), + CE(cfmv64a, e1004c0, 2, (RMDX, RMAX), rd_rn), + CE(cfmvsc32, e2004e0, 2, (RMDS, RMDX), mav_dspsc), + CE(cfmv32sc, e1004e0, 2, (RMDX, RMDS), rd), + CE(cfcpys, e000400, 2, (RMF, RMF), rd_rn), + CE(cfcpyd, e000420, 2, (RMD, RMD), rd_rn), + CE(cfcvtsd, e000460, 2, (RMD, RMF), rd_rn), + CE(cfcvtds, e000440, 2, (RMF, RMD), rd_rn), + CE(cfcvt32s, e000480, 2, (RMF, RMFX), rd_rn), + CE(cfcvt32d, e0004a0, 2, (RMD, RMFX), rd_rn), + CE(cfcvt64s, e0004c0, 2, (RMF, RMDX), rd_rn), + CE(cfcvt64d, e0004e0, 2, (RMD, RMDX), rd_rn), + CE(cfcvts32, e100580, 2, (RMFX, RMF), rd_rn), + CE(cfcvtd32, e1005a0, 2, (RMFX, RMD), rd_rn), + CE(cftruncs32,e1005c0, 2, (RMFX, RMF), rd_rn), + CE(cftruncd32,e1005e0, 2, (RMFX, RMD), rd_rn), + CE(cfrshl32, e000550, 3, (RMFX, RMFX, RR), mav_triple), + CE(cfrshl64, e000570, 3, (RMDX, RMDX, RR), mav_triple), + CE(cfsh32, e000500, 3, (RMFX, RMFX, I63s), mav_shift), + CE(cfsh64, e200500, 3, (RMDX, RMDX, I63s), mav_shift), + CE(cfcmps, e100490, 3, (RR, RMF, RMF), rd_rn_rm), + CE(cfcmpd, e1004b0, 3, (RR, RMD, RMD), rd_rn_rm), + CE(cfcmp32, e100590, 3, (RR, RMFX, RMFX), rd_rn_rm), + CE(cfcmp64, e1005b0, 3, (RR, RMDX, RMDX), rd_rn_rm), + CE(cfabss, e300400, 2, (RMF, RMF), rd_rn), + CE(cfabsd, e300420, 2, (RMD, RMD), rd_rn), + CE(cfnegs, e300440, 2, (RMF, RMF), rd_rn), + CE(cfnegd, e300460, 2, (RMD, RMD), rd_rn), + CE(cfadds, e300480, 3, (RMF, RMF, RMF), rd_rn_rm), + CE(cfaddd, e3004a0, 3, (RMD, RMD, RMD), rd_rn_rm), + CE(cfsubs, e3004c0, 3, (RMF, RMF, RMF), rd_rn_rm), + CE(cfsubd, e3004e0, 3, (RMD, RMD, RMD), rd_rn_rm), + CE(cfmuls, e100400, 3, (RMF, RMF, RMF), rd_rn_rm), + CE(cfmuld, e100420, 3, (RMD, RMD, RMD), rd_rn_rm), + CE(cfabs32, e300500, 2, (RMFX, RMFX), rd_rn), + CE(cfabs64, e300520, 2, (RMDX, RMDX), rd_rn), + CE(cfneg32, e300540, 2, (RMFX, RMFX), rd_rn), + CE(cfneg64, e300560, 2, (RMDX, RMDX), rd_rn), + CE(cfadd32, e300580, 3, (RMFX, RMFX, RMFX), rd_rn_rm), + CE(cfadd64, e3005a0, 3, (RMDX, RMDX, RMDX), rd_rn_rm), + CE(cfsub32, e3005c0, 3, (RMFX, RMFX, RMFX), rd_rn_rm), + CE(cfsub64, e3005e0, 3, (RMDX, RMDX, RMDX), rd_rn_rm), + CE(cfmul32, e100500, 3, (RMFX, RMFX, RMFX), rd_rn_rm), + CE(cfmul64, e100520, 3, (RMDX, RMDX, RMDX), rd_rn_rm), + CE(cfmac32, e100540, 3, (RMFX, RMFX, RMFX), rd_rn_rm), + CE(cfmsc32, e100560, 3, (RMFX, RMFX, RMFX), rd_rn_rm), + CE(cfmadd32, e000600, 4, (RMAX, RMFX, RMFX, RMFX), mav_quad), + CE(cfmsub32, e100600, 4, (RMAX, RMFX, RMFX, RMFX), mav_quad), + CE(cfmadda32, e200600, 4, (RMAX, RMAX, RMFX, RMFX), mav_quad), + CE(cfmsuba32, e300600, 4, (RMAX, RMAX, RMFX, RMFX), mav_quad), +}; +#undef ARM_VARIANT +#undef THUMB_VARIANT +#undef TCE +#undef TCM +#undef TUE +#undef TUF +#undef TCC +#undef CE +#undef CM +#undef UE +#undef UF +#undef UT +#undef OPS0 +#undef OPS1 +#undef OPS2 +#undef OPS3 +#undef OPS4 +#undef OPS5 +#undef OPS6 +#undef do_0 + +/* MD interface: bits in the object file. */ -static void -do_fpa_ldmstm (char * str) +/* Turn an integer of n bytes (in val) into a stream of bytes appropriate + for use in the a.out file, and stores them in the array pointed to by buf. + This knows about the endian-ness of the target machine and does + THE RIGHT THING, whatever it is. Possible values for n are 1 (byte) + 2 (short) and 4 (long) Floating numbers are put out as a series of + LITTLENUMS (shorts, here at least). */ + +void +md_number_to_chars (char * buf, valueT val, int n) { - int num_regs; + if (target_big_endian) + number_to_chars_bigendian (buf, val, n); + else + number_to_chars_littleendian (buf, val, n); +} - skip_whitespace (str); +static valueT +md_chars_to_number (char * buf, int n) +{ + valueT result = 0; + unsigned char * where = (unsigned char *) buf; - if (fp_reg_required_here (&str, 12) == FAIL) + if (target_big_endian) { - if (! inst.error) - inst.error = BAD_ARGS; - return; + while (n--) + { + result <<= 8; + result |= (*where++ & 255); + } } - - /* Get Number of registers to transfer. */ - if (skip_past_comma (&str) == FAIL - || my_get_expression (&inst.reloc.exp, &str)) + else { - if (! inst.error) - inst.error = _("constant expression expected"); - return; + while (n--) + { + result <<= 8; + result |= (where[n] & 255); + } } - if (inst.reloc.exp.X_op != O_constant) - { - inst.error = _("constant value required for number of registers"); - return; - } + return result; +} - num_regs = inst.reloc.exp.X_add_number; +/* MD interface: Sections. */ - if (num_regs < 1 || num_regs > 4) - { - inst.error = _("number of registers must be in the range [1:4]"); - return; - } +int +md_estimate_size_before_relax (fragS * fragP ATTRIBUTE_UNUSED, + segT segtype ATTRIBUTE_UNUSED) +{ + as_fatal (_("md_estimate_size_before_relax\n")); + return 1; +} - switch (num_regs) - { - case 1: - inst.instruction |= CP_T_X; - break; - case 2: - inst.instruction |= CP_T_Y; - break; - case 3: - inst.instruction |= CP_T_Y | CP_T_X; - break; - case 4: - break; - default: - abort (); - } +/* Round up a section size to the appropriate boundary. */ - if (inst.instruction & (CP_T_Pre | CP_T_UD)) /* ea/fd format. */ - { - int reg; - int write_back; - int offset; +valueT +md_section_align (segT segment ATTRIBUTE_UNUSED, + valueT size) +{ +#ifdef OBJ_ELF + return size; +#else + /* Round all sects to multiple of 4. */ + return (size + 3) & ~3; +#endif +} - /* The instruction specified "ea" or "fd", so we can only accept - [Rn]{!}. The instruction does not really support stacking or - unstacking, so we have to emulate these by setting appropriate - bits and offsets. */ - if (skip_past_comma (&str) == FAIL - || *str != '[') - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } - - str++; - skip_whitespace (str); +/* This is called from HANDLE_ALIGN in write.c. Fill in the contents + of an rs_align_code fragment. */ - if ((reg = reg_required_here (&str, 16)) == FAIL) - return; +void +arm_handle_align (fragS * fragP) +{ + static char const arm_noop[4] = { 0x00, 0x00, 0xa0, 0xe1 }; + static char const thumb_noop[2] = { 0xc0, 0x46 }; + static char const arm_bigend_noop[4] = { 0xe1, 0xa0, 0x00, 0x00 }; + static char const thumb_bigend_noop[2] = { 0x46, 0xc0 }; - skip_whitespace (str); + int bytes, fix, noop_size; + char * p; + const char * noop; - if (*str != ']') - { - inst.error = BAD_ARGS; - return; - } + if (fragP->fr_type != rs_align_code) + return; - str++; - if (*str == '!') - { - write_back = 1; - str++; - if (reg == REG_PC) - { - inst.error = - _("r15 not allowed as base register with write-back"); - return; - } - } - else - write_back = 0; + bytes = fragP->fr_next->fr_address - fragP->fr_address - fragP->fr_fix; + p = fragP->fr_literal + fragP->fr_fix; + fix = 0; - if (inst.instruction & CP_T_Pre) - { - /* Pre-decrement. */ - offset = 3 * num_regs; - if (write_back) - inst.instruction |= CP_T_WB; - } - else - { - /* Post-increment. */ - if (write_back) - { - inst.instruction |= CP_T_WB; - offset = 3 * num_regs; - } - else - { - /* No write-back, so convert this into a standard pre-increment - instruction -- aesthetically more pleasing. */ - inst.instruction |= CP_T_Pre | CP_T_UD; - offset = 0; - } - } + if (bytes > MAX_MEM_FOR_RS_ALIGN_CODE) + bytes &= MAX_MEM_FOR_RS_ALIGN_CODE; - inst.instruction |= offset; - } - else if (skip_past_comma (&str) == FAIL - || cp_address_required_here (&str, CP_WB_OK) == FAIL) + if (fragP->tc_frag_data) { - if (! inst.error) - inst.error = BAD_ARGS; - return; + if (target_big_endian) + noop = thumb_bigend_noop; + else + noop = thumb_noop; + noop_size = sizeof (thumb_noop); } - - end_of_line (str); -} - -static void -do_fpa_dyadic (char * str) -{ - skip_whitespace (str); - - if (fp_reg_required_here (&str, 12) == FAIL) + else { - if (! inst.error) - inst.error = BAD_ARGS; - return; + if (target_big_endian) + noop = arm_bigend_noop; + else + noop = arm_noop; + noop_size = sizeof (arm_noop); } - if (skip_past_comma (&str) == FAIL - || fp_reg_required_here (&str, 16) == FAIL) + if (bytes & (noop_size - 1)) { - if (! inst.error) - inst.error = BAD_ARGS; - return; + fix = bytes & (noop_size - 1); + memset (p, 0, fix); + p += fix; + bytes -= fix; } - if (skip_past_comma (&str) == FAIL - || fp_op2 (&str) == FAIL) + while (bytes >= noop_size) { - if (! inst.error) - inst.error = BAD_ARGS; - return; + memcpy (p, noop, noop_size); + p += noop_size; + bytes -= noop_size; + fix += noop_size; } - end_of_line (str); + fragP->fr_fix += fix; + fragP->fr_var = noop_size; } -static void -do_fpa_monadic (char * str) -{ - skip_whitespace (str); - - if (fp_reg_required_here (&str, 12) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } - - if (skip_past_comma (&str) == FAIL - || fp_op2 (&str) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } - - end_of_line (str); -} +/* Called from md_do_align. Used to create an alignment + frag in a code section. */ -static void -do_fpa_cmp (char * str) +void +arm_frag_align_code (int n, int max) { - skip_whitespace (str); - - if (fp_reg_required_here (&str, 16) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } + char * p; - if (skip_past_comma (&str) == FAIL - || fp_op2 (&str) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } + /* We assume that there will never be a requirement + to support alignments greater than 32 bytes. */ + if (max > MAX_MEM_FOR_RS_ALIGN_CODE) + as_fatal (_("alignments greater than 32 bytes not supported in .text sections.")); - end_of_line (str); + p = frag_var (rs_align_code, + MAX_MEM_FOR_RS_ALIGN_CODE, + 1, + (relax_substateT) max, + (symbolS *) NULL, + (offsetT) n, + (char *) NULL); + *p = 0; } -static void -do_fpa_from_reg (char * str) -{ - skip_whitespace (str); - - if (fp_reg_required_here (&str, 16) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } - - if (skip_past_comma (&str) == FAIL - || reg_required_here (&str, 12) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } - - end_of_line (str); -} +/* Perform target specific initialisation of a frag. */ -static void -do_fpa_to_reg (char * str) +void +arm_init_frag (fragS * fragP) { - skip_whitespace (str); - - if (reg_required_here (&str, 12) == FAIL) - return; - - if (skip_past_comma (&str) == FAIL - || fp_reg_required_here (&str, 0) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } - - end_of_line (str); + /* Record whether this frag is in an ARM or a THUMB area. */ + fragP->tc_frag_data = thumb_mode; } -/* Encode a VFP SP register number. */ +#ifdef OBJ_ELF +/* When we change sections we need to issue a new mapping symbol. */ -static void -vfp_sp_encode_reg (int reg, enum vfp_sp_reg_pos pos) +void +arm_elf_change_section (void) { - switch (pos) - { - case VFP_REG_Sd: - inst.instruction |= ((reg >> 1) << 12) | ((reg & 1) << 22); - break; - - case VFP_REG_Sn: - inst.instruction |= ((reg >> 1) << 16) | ((reg & 1) << 7); - break; - - case VFP_REG_Sm: - inst.instruction |= ((reg >> 1) << 0) | ((reg & 1) << 5); - break; + flagword flags; + segment_info_type *seginfo; - default: - abort (); - } -} + /* Link an unlinked unwind index table section to the .text section. */ + if (elf_section_type (now_seg) == SHT_ARM_EXIDX + && elf_linked_to_section (now_seg) == NULL) + elf_linked_to_section (now_seg) = text_section; -static int -vfp_sp_reg_required_here (char ** str, - enum vfp_sp_reg_pos pos) -{ - int reg; - char * start = *str; + if (!SEG_NORMAL (now_seg)) + return; - if ((reg = arm_reg_parse (str, all_reg_maps[REG_TYPE_SN].htab)) != FAIL) - { - vfp_sp_encode_reg (reg, pos); - return reg; - } + flags = bfd_get_section_flags (stdoutput, now_seg); - /* In the few cases where we might be able to accept something else - this error can be overridden. */ - inst.error = _(all_reg_maps[REG_TYPE_SN].expected); + /* We can ignore sections that only contain debug info. */ + if ((flags & SEC_ALLOC) == 0) + return; - /* Restore the start point. */ - *str = start; - return FAIL; + seginfo = seg_info (now_seg); + mapstate = seginfo->tc_segment_info_data.mapstate; + marked_pr_dependency = seginfo->tc_segment_info_data.marked_pr_dependency; } -static int -vfp_dp_reg_required_here (char ** str, - enum vfp_dp_reg_pos pos) +int +arm_elf_section_type (const char * str, size_t len) { - int reg; - char * start = *str; - - if ((reg = arm_reg_parse (str, all_reg_maps[REG_TYPE_DN].htab)) != FAIL) - { - switch (pos) - { - case VFP_REG_Dd: - inst.instruction |= reg << 12; - break; + if (len == 5 && strncmp (str, "exidx", 5) == 0) + return SHT_ARM_EXIDX; - case VFP_REG_Dn: - inst.instruction |= reg << 16; - break; + return -1; +} + +/* Code to deal with unwinding tables. */ - case VFP_REG_Dm: - inst.instruction |= reg << 0; - break; +static void add_unwind_adjustsp (offsetT); - default: - abort (); - } - return reg; - } +/* Cenerate and deferred unwind frame offset. */ - /* In the few cases where we might be able to accept something else - this error can be overridden. */ - inst.error = _(all_reg_maps[REG_TYPE_DN].expected); +static void +flush_pending_unwind (void) +{ + offsetT offset; - /* Restore the start point. */ - *str = start; - return FAIL; + offset = unwind.pending_offset; + unwind.pending_offset = 0; + if (offset != 0) + add_unwind_adjustsp (offset); } +/* Add an opcode to this list for this function. Two-byte opcodes should + be passed as op[0] << 8 | op[1]. The list of opcodes is built in reverse + order. */ + static void -do_vfp_sp_monadic (char * str) +add_unwind_opcode (valueT op, int length) { - skip_whitespace (str); + /* Add any deferred stack adjustment. */ + if (unwind.pending_offset) + flush_pending_unwind (); - if (vfp_sp_reg_required_here (&str, VFP_REG_Sd) == FAIL) - return; + unwind.sp_restored = 0; - if (skip_past_comma (&str) == FAIL - || vfp_sp_reg_required_here (&str, VFP_REG_Sm) == FAIL) + if (unwind.opcode_count + length > unwind.opcode_alloc) { - if (! inst.error) - inst.error = BAD_ARGS; - return; + unwind.opcode_alloc += ARM_OPCODE_CHUNK_SIZE; + if (unwind.opcodes) + unwind.opcodes = xrealloc (unwind.opcodes, + unwind.opcode_alloc); + else + unwind.opcodes = xmalloc (unwind.opcode_alloc); + } + while (length > 0) + { + length--; + unwind.opcodes[unwind.opcode_count] = op & 0xff; + op >>= 8; + unwind.opcode_count++; } - - end_of_line (str); } +/* Add unwind opcodes to adjust the stack pointer. */ + static void -do_vfp_dp_monadic (char * str) +add_unwind_adjustsp (offsetT offset) { - skip_whitespace (str); - - if (vfp_dp_reg_required_here (&str, VFP_REG_Dd) == FAIL) - return; + valueT op; - if (skip_past_comma (&str) == FAIL - || vfp_dp_reg_required_here (&str, VFP_REG_Dm) == FAIL) + if (offset > 0x200) { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } + /* We need at most 5 bytes to hold a 32-bit value in a uleb128. */ + char bytes[5]; + int n; + valueT o; + + /* Long form: 0xb2, uleb128. */ + /* This might not fit in a word so add the individual bytes, + remembering the list is built in reverse order. */ + o = (valueT) ((offset - 0x204) >> 2); + if (o == 0) + add_unwind_opcode (0, 1); - end_of_line (str); + /* Calculate the uleb128 encoding of the offset. */ + n = 0; + while (o) + { + bytes[n] = o & 0x7f; + o >>= 7; + if (o) + bytes[n] |= 0x80; + n++; + } + /* Add the insn. */ + for (; n; n--) + add_unwind_opcode (bytes[n - 1], 1); + add_unwind_opcode (0xb2, 1); + } + else if (offset > 0x100) + { + /* Two short opcodes. */ + add_unwind_opcode (0x3f, 1); + op = (offset - 0x104) >> 2; + add_unwind_opcode (op, 1); + } + else if (offset > 0) + { + /* Short opcode. */ + op = (offset - 4) >> 2; + add_unwind_opcode (op, 1); + } + else if (offset < 0) + { + offset = -offset; + while (offset > 0x100) + { + add_unwind_opcode (0x7f, 1); + offset -= 0x100; + } + op = ((offset - 4) >> 2) | 0x40; + add_unwind_opcode (op, 1); + } } +/* Finish the list of unwind opcodes for this function. */ static void -do_vfp_sp_dyadic (char * str) +finish_unwind_opcodes (void) { - skip_whitespace (str); - - if (vfp_sp_reg_required_here (&str, VFP_REG_Sd) == FAIL) - return; + valueT op; - if (skip_past_comma (&str) == FAIL - || vfp_sp_reg_required_here (&str, VFP_REG_Sn) == FAIL - || skip_past_comma (&str) == FAIL - || vfp_sp_reg_required_here (&str, VFP_REG_Sm) == FAIL) + if (unwind.fp_used) { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } + /* Adjust sp as neccessary. */ + unwind.pending_offset += unwind.fp_offset - unwind.frame_size; + flush_pending_unwind (); - end_of_line (str); + /* After restoring sp from the frame pointer. */ + op = 0x90 | unwind.fp_reg; + add_unwind_opcode (op, 1); + } + else + flush_pending_unwind (); } + +/* Start an exception table entry. If idx is nonzero this is an index table + entry. */ + static void -do_vfp_dp_dyadic (char * str) +start_unwind_section (const segT text_seg, int idx) { - skip_whitespace (str); - - if (vfp_dp_reg_required_here (&str, VFP_REG_Dd) == FAIL) - return; + const char * text_name; + const char * prefix; + const char * prefix_once; + const char * group_name; + size_t prefix_len; + size_t text_len; + char * sec_name; + size_t sec_name_len; + int type; + int flags; + int linkonce; - if (skip_past_comma (&str) == FAIL - || vfp_dp_reg_required_here (&str, VFP_REG_Dn) == FAIL - || skip_past_comma (&str) == FAIL - || vfp_dp_reg_required_here (&str, VFP_REG_Dm) == FAIL) + if (idx) { - if (! inst.error) - inst.error = BAD_ARGS; - return; + prefix = ELF_STRING_ARM_unwind; + prefix_once = ELF_STRING_ARM_unwind_once; + type = SHT_ARM_EXIDX; + } + else + { + prefix = ELF_STRING_ARM_unwind_info; + prefix_once = ELF_STRING_ARM_unwind_info_once; + type = SHT_PROGBITS; } - end_of_line (str); -} + text_name = segment_name (text_seg); + if (streq (text_name, ".text")) + text_name = ""; -static void -do_vfp_reg_from_sp (char * str) -{ - skip_whitespace (str); + if (strncmp (text_name, ".gnu.linkonce.t.", + strlen (".gnu.linkonce.t.")) == 0) + { + prefix = prefix_once; + text_name += strlen (".gnu.linkonce.t."); + } - if (reg_required_here (&str, 12) == FAIL) - return; + prefix_len = strlen (prefix); + text_len = strlen (text_name); + sec_name_len = prefix_len + text_len; + sec_name = xmalloc (sec_name_len + 1); + memcpy (sec_name, prefix, prefix_len); + memcpy (sec_name + prefix_len, text_name, text_len); + sec_name[prefix_len + text_len] = '\0'; + + flags = SHF_ALLOC; + linkonce = 0; + group_name = 0; - if (skip_past_comma (&str) == FAIL - || vfp_sp_reg_required_here (&str, VFP_REG_Sn) == FAIL) + /* Handle COMDAT group. */ + if (prefix != prefix_once && (text_seg->flags & SEC_LINK_ONCE) != 0) { - if (! inst.error) - inst.error = BAD_ARGS; - return; + group_name = elf_group_name (text_seg); + if (group_name == NULL) + { + as_bad ("Group section `%s' has no group signature", + segment_name (text_seg)); + ignore_rest_of_line (); + return; + } + flags |= SHF_GROUP; + linkonce = 1; } - end_of_line (str); + obj_elf_change_section (sec_name, type, flags, 0, group_name, linkonce, 0); + + /* Set the setion link for index tables. */ + if (idx) + elf_linked_to_section (now_seg) = text_seg; } -/* Parse a VFP register list. If the string is invalid return FAIL. - Otherwise return the number of registers, and set PBASE to the first - register. Double precision registers are matched if DP is nonzero. */ -static int -vfp_parse_reg_list (char **str, int *pbase, int dp) -{ - int base_reg; - int new_base; - int regtype; - int max_regs; - int count = 0; - int warned = 0; - unsigned long mask = 0; - int i; +/* Start an unwind table entry. HAVE_DATA is nonzero if we have additional + personality routine data. Returns zero, or the index table value for + and inline entry. */ - if (**str != '{') - return FAIL; +static valueT +create_unwind_entry (int have_data) +{ + int size; + addressT where; + char *ptr; + /* The current word of data. */ + valueT data; + /* The number of bytes left in this word. */ + int n; - (*str)++; - skip_whitespace (*str); + finish_unwind_opcodes (); - if (dp) - { - regtype = REG_TYPE_DN; - max_regs = 16; - } - else - { - regtype = REG_TYPE_SN; - max_regs = 32; - } + /* Remember the current text section. */ + unwind.saved_seg = now_seg; + unwind.saved_subseg = now_subseg; - base_reg = max_regs; + start_unwind_section (now_seg, 0); - do + if (unwind.personality_routine == NULL) { - new_base = arm_reg_parse (str, all_reg_maps[regtype].htab); - if (new_base == FAIL) - { - inst.error = _(all_reg_maps[regtype].expected); - return FAIL; - } - - if (new_base < base_reg) - base_reg = new_base; - - if (mask & (1 << new_base)) + if (unwind.personality_index == -2) { - inst.error = _("invalid register list"); - return FAIL; + if (have_data) + as_bad (_("handerdata in cantunwind frame")); + return 1; /* EXIDX_CANTUNWIND. */ } - if ((mask >> new_base) != 0 && ! warned) + /* Use a default personality routine if none is specified. */ + if (unwind.personality_index == -1) { - as_tsktsk (_("register list not in ascending order")); - warned = 1; + if (unwind.opcode_count > 3) + unwind.personality_index = 1; + else + unwind.personality_index = 0; } - mask |= 1 << new_base; - count++; - - skip_whitespace (*str); - - if (**str == '-') /* We have the start of a range expression */ + /* Space for the personality routine entry. */ + if (unwind.personality_index == 0) { - int high_range; - - (*str)++; - - if ((high_range - = arm_reg_parse (str, all_reg_maps[regtype].htab)) - == FAIL) - { - inst.error = _(all_reg_maps[regtype].expected); - return FAIL; - } - - if (high_range <= new_base) - { - inst.error = _("register range not in ascending order"); - return FAIL; - } + if (unwind.opcode_count > 3) + as_bad (_("too many unwind opcodes for personality routine 0")); - for (new_base++; new_base <= high_range; new_base++) + if (!have_data) { - if (mask & (1 << new_base)) + /* All the data is inline in the index table. */ + data = 0x80; + n = 3; + while (unwind.opcode_count > 0) { - inst.error = _("invalid register list"); - return FAIL; + unwind.opcode_count--; + data = (data << 8) | unwind.opcodes[unwind.opcode_count]; + n--; } - mask |= 1 << new_base; - count++; + /* Pad with "finish" opcodes. */ + while (n--) + data = (data << 8) | 0xb0; + + return data; } + size = 0; } + else + /* We get two opcodes "free" in the first word. */ + size = unwind.opcode_count - 2; } - while (skip_past_comma (str) != FAIL); + else + /* An extra byte is required for the opcode count. */ + size = unwind.opcode_count + 1; - (*str)++; + size = (size + 3) >> 2; + if (size > 0xff) + as_bad (_("too many unwind opcodes")); - /* Sanity check -- should have raised a parse error above. */ - if (count == 0 || count > max_regs) - abort (); + frag_align (2, 0, 0); + record_alignment (now_seg, 2); + unwind.table_entry = expr_build_dot (); - *pbase = base_reg; + /* Allocate the table entry. */ + ptr = frag_more ((size << 2) + 4); + where = frag_now_fix () - ((size << 2) + 4); - /* Final test -- the registers must be consecutive. */ - mask >>= base_reg; - for (i = 0; i < count; i++) + switch (unwind.personality_index) { - if ((mask & (1u << i)) == 0) - { - inst.error = _("non-contiguous register range"); - return FAIL; - } - } + case -1: + /* ??? Should this be a PLT generating relocation? */ + /* Custom personality routine. */ + fix_new (frag_now, where, 4, unwind.personality_routine, 0, 1, + BFD_RELOC_ARM_PREL31); - return count; -} + where += 4; + ptr += 4; -static void -do_vfp_reg2_from_sp2 (char * str) -{ - int reg; + /* Set the first byte to the number of additional words. */ + data = size - 1; + n = 3; + break; - skip_whitespace (str); + /* ABI defined personality routines. */ + case 0: + /* Three opcodes bytes are packed into the first word. */ + data = 0x80; + n = 3; + break; - if (reg_required_here (&str, 12) == FAIL - || skip_past_comma (&str) == FAIL - || reg_required_here (&str, 16) == FAIL - || skip_past_comma (&str) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } + case 1: + case 2: + /* The size and first two opcode bytes go in the first word. */ + data = ((0x80 + unwind.personality_index) << 8) | size; + n = 2; + break; - /* We require exactly two consecutive SP registers. */ - if (vfp_parse_reg_list (&str, ®, 0) != 2) - { - if (! inst.error) - inst.error = _("only two consecutive VFP SP registers allowed here"); + default: + /* Should never happen. */ + abort (); } - vfp_sp_encode_reg (reg, VFP_REG_Sm); - - end_of_line (str); -} - -static void -do_vfp_sp_from_reg (char * str) -{ - skip_whitespace (str); - - if (vfp_sp_reg_required_here (&str, VFP_REG_Sn) == FAIL) - return; - if (skip_past_comma (&str) == FAIL - || reg_required_here (&str, 12) == FAIL) + /* Pack the opcodes into words (MSB first), reversing the list at the same + time. */ + while (unwind.opcode_count > 0) { - if (! inst.error) - inst.error = BAD_ARGS; - return; + if (n == 0) + { + md_number_to_chars (ptr, data, 4); + ptr += 4; + n = 4; + data = 0; + } + unwind.opcode_count--; + n--; + data = (data << 8) | unwind.opcodes[unwind.opcode_count]; } - end_of_line (str); -} - -static void -do_vfp_sp2_from_reg2 (char * str) -{ - int reg; - - skip_whitespace (str); - - /* We require exactly two consecutive SP registers. */ - if (vfp_parse_reg_list (&str, ®, 0) != 2) + /* Finish off the last word. */ + if (n < 4) { - if (! inst.error) - inst.error = _("only two consecutive VFP SP registers allowed here"); + /* Pad with "finish" opcodes. */ + while (n--) + data = (data << 8) | 0xb0; + + md_number_to_chars (ptr, data, 4); } - vfp_sp_encode_reg (reg, VFP_REG_Sm); - if (skip_past_comma (&str) == FAIL - || reg_required_here (&str, 12) == FAIL - || skip_past_comma (&str) == FAIL - || reg_required_here (&str, 16) == FAIL) + if (!have_data) { - if (! inst.error) - inst.error = BAD_ARGS; - return; + /* Add an empty descriptor if there is no user-specified data. */ + ptr = frag_more (4); + md_number_to_chars (ptr, 0, 4); } - end_of_line (str); + return 0; } -static void -do_vfp_reg_from_dp (char * str) -{ - skip_whitespace (str); +/* Convert REGNAME to a DWARF-2 register number. */ - if (reg_required_here (&str, 12) == FAIL) - return; +int +tc_arm_regname_to_dw2regnum (const char *regname) +{ + int reg = arm_reg_parse ((char **) ®name, REG_TYPE_RN); - if (skip_past_comma (&str) == FAIL - || vfp_dp_reg_required_here (&str, VFP_REG_Dn) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } + if (reg == FAIL) + return -1; - end_of_line (str); + return reg; } -static void -do_vfp_reg2_from_dp (char * str) +/* Initialize the DWARF-2 unwind information for this procedure. */ + +void +tc_arm_frame_initial_instructions (void) { - skip_whitespace (str); + cfi_add_CFA_def_cfa (REG_SP, 0); +} +#endif /* OBJ_ELF */ - if (reg_required_here (&str, 12) == FAIL) - return; - if (skip_past_comma (&str) == FAIL - || reg_required_here (&str, 16) == FAIL - || skip_past_comma (&str) == FAIL - || vfp_dp_reg_required_here (&str, VFP_REG_Dm) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } +/* MD interface: Symbol and relocation handling. */ - end_of_line (str); -} +/* The knowledge of the PC's pipeline offset is built into the insns + themselves. */ -static void -do_vfp_dp_from_reg (char * str) +long +md_pcrel_from (fixS * fixP) { - skip_whitespace (str); - - if (vfp_dp_reg_required_here (&str, VFP_REG_Dn) == FAIL) - return; + if (fixP->fx_addsy + && S_GET_SEGMENT (fixP->fx_addsy) == undefined_section + && fixP->fx_subsy == NULL) + return 0; - if (skip_past_comma (&str) == FAIL - || reg_required_here (&str, 12) == FAIL) + /* PC relative addressing on the Thumb is slightly odd as the bottom + two bits of the PC are forced to zero for the calculation. This + happens *after* application of the pipeline offset. However, + Thumb adrl already adjusts for this, so we need not do it again. */ + switch (fixP->fx_r_type) { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } - - end_of_line (str); -} - -static void -do_vfp_dp_from_reg2 (char * str) -{ - skip_whitespace (str); + case BFD_RELOC_ARM_THUMB_ADD: + return (fixP->fx_where + fixP->fx_frag->fr_address) & ~3; - if (vfp_dp_reg_required_here (&str, VFP_REG_Dm) == FAIL) - return; + case BFD_RELOC_ARM_THUMB_OFFSET: + case BFD_RELOC_ARM_T32_OFFSET_IMM: + return (fixP->fx_where + fixP->fx_frag->fr_address + 4) & ~3; - if (skip_past_comma (&str) == FAIL - || reg_required_here (&str, 12) == FAIL - || skip_past_comma (&str) == FAIL - || reg_required_here (&str, 16) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; + default: + break; } - end_of_line (str); +#ifdef TE_WINCE + /* The pattern was adjusted to accommodate CE's off-by-one fixups, + so we un-adjust here to compensate for the accommodation. */ + return fixP->fx_where + fixP->fx_frag->fr_address + 8; +#else + return fixP->fx_where + fixP->fx_frag->fr_address; +#endif } -static const struct vfp_reg * -vfp_psr_parse (char ** str) -{ - char *start = *str; - char c; - char *p; - const struct vfp_reg *vreg; - - p = start; - - /* Find the end of the current token. */ - do - { - c = *p++; - } - while (ISALPHA (c)); - - /* Mark it. */ - *--p = 0; +/* Under ELF we need to default _GLOBAL_OFFSET_TABLE. + Otherwise we have no need to default values of symbols. */ - for (vreg = vfp_regs + 0; - vreg < vfp_regs + sizeof (vfp_regs) / sizeof (struct vfp_reg); - vreg++) +symbolS * +md_undefined_symbol (char * name ATTRIBUTE_UNUSED) +{ +#ifdef OBJ_ELF + if (name[0] == '_' && name[1] == 'G' + && streq (name, GLOBAL_OFFSET_TABLE_NAME)) { - if (streq (start, vreg->name)) + if (!GOT_symbol) { - *p = c; - *str = p; - return vreg; + if (symbol_find (name)) + as_bad ("GOT already in the symbol table"); + + GOT_symbol = symbol_new (name, undefined_section, + (valueT) 0, & zero_address_frag); } + + return GOT_symbol; } +#endif - *p = c; - return NULL; + return 0; } -static int -vfp_psr_required_here (char ** str) -{ - char *start = *str; - const struct vfp_reg *vreg; +/* Subroutine of md_apply_fix. Check to see if an immediate can be + computed as two separate immediate values, added together. We + already know that this value cannot be computed by just one ARM + instruction. */ - vreg = vfp_psr_parse (str); +static unsigned int +validate_immediate_twopart (unsigned int val, + unsigned int * highpart) +{ + unsigned int a; + unsigned int i; - if (vreg) - { - inst.instruction |= vreg->regno; - return SUCCESS; - } + for (i = 0; i < 32; i += 2) + if (((a = rotate_left (val, i)) & 0xff) != 0) + { + if (a & 0xff00) + { + if (a & ~ 0xffff) + continue; + * highpart = (a >> 8) | ((i + 24) << 7); + } + else if (a & 0xff0000) + { + if (a & 0xff000000) + continue; + * highpart = (a >> 16) | ((i + 16) << 7); + } + else + { + assert (a & 0xff000000); + * highpart = (a >> 24) | ((i + 8) << 7); + } - inst.error = _("VFP system register expected"); + return (a & 0xff) | (i << 7); + } - *str = start; return FAIL; } -static void -do_vfp_reg_from_ctrl (char * str) +static int +validate_offset_imm (unsigned int val, int hwse) { - skip_whitespace (str); - - if (reg_required_here (&str, 12) == FAIL) - return; - - if (skip_past_comma (&str) == FAIL - || vfp_psr_required_here (&str) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } - - end_of_line (str); + if ((hwse && val > 255) || val > 4095) + return FAIL; + return val; } -static void -do_vfp_ctrl_from_reg (char * str) -{ - skip_whitespace (str); - - if (vfp_psr_required_here (&str) == FAIL) - return; - - if (skip_past_comma (&str) == FAIL - || reg_required_here (&str, 12) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } - - end_of_line (str); -} +/* Subroutine of md_apply_fix. Do those data_ops which can take a + negative immediate constant by altering the instruction. A bit of + a hack really. + MOV <-> MVN + AND <-> BIC + ADC <-> SBC + by inverting the second operand, and + ADD <-> SUB + CMP <-> CMN + by negating the second operand. */ -static void -do_vfp_sp_ldst (char * str) +static int +negate_data_op (unsigned long * instruction, + unsigned long value) { - skip_whitespace (str); + int op, new_inst; + unsigned long negated, inverted; - if (vfp_sp_reg_required_here (&str, VFP_REG_Sd) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + negated = encode_arm_immediate (-value); + inverted = encode_arm_immediate (~value); - if (skip_past_comma (&str) == FAIL - || cp_address_required_here (&str, CP_NO_WB) == FAIL) + op = (*instruction >> DATA_OP_SHIFT) & 0xf; + switch (op) { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + /* First negates. */ + case OPCODE_SUB: /* ADD <-> SUB */ + new_inst = OPCODE_ADD; + value = negated; + break; - end_of_line (str); -} + case OPCODE_ADD: + new_inst = OPCODE_SUB; + value = negated; + break; -static void -do_vfp_dp_ldst (char * str) -{ - skip_whitespace (str); + case OPCODE_CMP: /* CMP <-> CMN */ + new_inst = OPCODE_CMN; + value = negated; + break; - if (vfp_dp_reg_required_here (&str, VFP_REG_Dd) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } - - if (skip_past_comma (&str) == FAIL - || cp_address_required_here (&str, CP_NO_WB) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + case OPCODE_CMN: + new_inst = OPCODE_CMP; + value = negated; + break; - end_of_line (str); -} + /* Now Inverted ops. */ + case OPCODE_MOV: /* MOV <-> MVN */ + new_inst = OPCODE_MVN; + value = inverted; + break; + case OPCODE_MVN: + new_inst = OPCODE_MOV; + value = inverted; + break; -static void -vfp_sp_ldstm (char * str, enum vfp_ldstm_type ldstm_type) -{ - int count; - int reg; + case OPCODE_AND: /* AND <-> BIC */ + new_inst = OPCODE_BIC; + value = inverted; + break; - skip_whitespace (str); + case OPCODE_BIC: + new_inst = OPCODE_AND; + value = inverted; + break; - if (reg_required_here (&str, 16) == FAIL) - return; + case OPCODE_ADC: /* ADC <-> SBC */ + new_inst = OPCODE_SBC; + value = inverted; + break; - skip_whitespace (str); + case OPCODE_SBC: + new_inst = OPCODE_ADC; + value = inverted; + break; - if (*str == '!') - { - inst.instruction |= WRITE_BACK; - str++; - } - else if (ldstm_type != VFP_LDSTMIA) - { - inst.error = _("this addressing mode requires base-register writeback"); - return; + /* We cannot do anything. */ + default: + return FAIL; } - if (skip_past_comma (&str) == FAIL - || (count = vfp_parse_reg_list (&str, ®, 0)) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } - vfp_sp_encode_reg (reg, VFP_REG_Sd); + if (value == (unsigned) FAIL) + return FAIL; - inst.instruction |= count; - end_of_line (str); + *instruction &= OPCODE_MASK; + *instruction |= new_inst << DATA_OP_SHIFT; + return value; } -static void -vfp_dp_ldstm (char * str, enum vfp_ldstm_type ldstm_type) +void +md_apply_fix (fixS * fixP, + valueT * valP, + segT seg) { - int count; - int reg; - - skip_whitespace (str); + offsetT value = * valP; + offsetT newval; + unsigned int newimm; + unsigned long temp; + int sign; + char * buf = fixP->fx_where + fixP->fx_frag->fr_literal; - if (reg_required_here (&str, 16) == FAIL) - return; + assert (fixP->fx_r_type <= BFD_RELOC_UNUSED); - skip_whitespace (str); + /* Note whether this will delete the relocation. */ + if (fixP->fx_addsy == 0 && !fixP->fx_pcrel) + fixP->fx_done = 1; - if (*str == '!') - { - inst.instruction |= WRITE_BACK; - str++; - } - else if (ldstm_type != VFP_LDSTMIA && ldstm_type != VFP_LDSTMIAX) + /* If this symbol is in a different section then we need to leave it for + the linker to deal with. Unfortunately, md_pcrel_from can't tell, + so we have to undo its effects here. */ + if (fixP->fx_pcrel) { - inst.error = _("this addressing mode requires base-register writeback"); - return; + if (fixP->fx_addsy != NULL + && S_IS_DEFINED (fixP->fx_addsy) + && S_GET_SEGMENT (fixP->fx_addsy) != seg) + value += md_pcrel_from (fixP); } - if (skip_past_comma (&str) == FAIL - || (count = vfp_parse_reg_list (&str, ®, 1)) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + /* On a 64-bit host, silently truncate 'value' to 32 bits for + consistency with the behavior on 32-bit hosts. Remember value + for emit_reloc. */ + value &= 0xffffffff; + value ^= 0x80000000; + value -= 0x80000000; - count <<= 1; - if (ldstm_type == VFP_LDSTMIAX || ldstm_type == VFP_LDSTMDBX) - count += 1; + *valP = value; + fixP->fx_addnumber = value; - inst.instruction |= (reg << 12) | count; - end_of_line (str); -} + /* Same treatment for fixP->fx_offset. */ + fixP->fx_offset &= 0xffffffff; + fixP->fx_offset ^= 0x80000000; + fixP->fx_offset -= 0x80000000; -static void -do_vfp_sp_ldstmia (char * str) -{ - vfp_sp_ldstm (str, VFP_LDSTMIA); -} + switch (fixP->fx_r_type) + { + case BFD_RELOC_NONE: + /* This will need to go in the object file. */ + fixP->fx_done = 0; + break; -static void -do_vfp_sp_ldstmdb (char * str) -{ - vfp_sp_ldstm (str, VFP_LDSTMDB); -} + case BFD_RELOC_ARM_IMMEDIATE: + /* We claim that this fixup has been processed here, + even if in fact we generate an error because we do + not have a reloc for it, so tc_gen_reloc will reject it. */ + fixP->fx_done = 1; -static void -do_vfp_dp_ldstmia (char * str) -{ - vfp_dp_ldstm (str, VFP_LDSTMIA); -} + if (fixP->fx_addsy + && ! S_IS_DEFINED (fixP->fx_addsy)) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _("undefined symbol %s used as an immediate value"), + S_GET_NAME (fixP->fx_addsy)); + break; + } -static void -do_vfp_dp_ldstmdb (char * str) -{ - vfp_dp_ldstm (str, VFP_LDSTMDB); -} + newimm = encode_arm_immediate (value); + temp = md_chars_to_number (buf, INSN_SIZE); -static void -do_vfp_xp_ldstmia (char *str) -{ - vfp_dp_ldstm (str, VFP_LDSTMIAX); -} + /* If the instruction will fail, see if we can fix things up by + changing the opcode. */ + if (newimm == (unsigned int) FAIL + && (newimm = negate_data_op (&temp, value)) == (unsigned int) FAIL) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid constant (%lx) after fixup"), + (unsigned long) value); + break; + } -static void -do_vfp_xp_ldstmdb (char * str) -{ - vfp_dp_ldstm (str, VFP_LDSTMDBX); -} + newimm |= (temp & 0xfffff000); + md_number_to_chars (buf, (valueT) newimm, INSN_SIZE); + break; -static void -do_vfp_sp_compare_z (char * str) -{ - skip_whitespace (str); + case BFD_RELOC_ARM_ADRL_IMMEDIATE: + { + unsigned int highpart = 0; + unsigned int newinsn = 0xe1a00000; /* nop. */ - if (vfp_sp_reg_required_here (&str, VFP_REG_Sd) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + newimm = encode_arm_immediate (value); + temp = md_chars_to_number (buf, INSN_SIZE); - end_of_line (str); -} + /* If the instruction will fail, see if we can fix things up by + changing the opcode. */ + if (newimm == (unsigned int) FAIL + && (newimm = negate_data_op (& temp, value)) == (unsigned int) FAIL) + { + /* No ? OK - try using two ADD instructions to generate + the value. */ + newimm = validate_immediate_twopart (value, & highpart); -static void -do_vfp_dp_compare_z (char * str) -{ - skip_whitespace (str); + /* Yes - then make sure that the second instruction is + also an add. */ + if (newimm != (unsigned int) FAIL) + newinsn = temp; + /* Still No ? Try using a negated value. */ + else if ((newimm = validate_immediate_twopart (- value, & highpart)) != (unsigned int) FAIL) + temp = newinsn = (temp & OPCODE_MASK) | OPCODE_SUB << DATA_OP_SHIFT; + /* Otherwise - give up. */ + else + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _("unable to compute ADRL instructions for PC offset of 0x%lx"), + (long) value); + break; + } - if (vfp_dp_reg_required_here (&str, VFP_REG_Dd) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + /* Replace the first operand in the 2nd instruction (which + is the PC) with the destination register. We have + already added in the PC in the first instruction and we + do not want to do it again. */ + newinsn &= ~ 0xf0000; + newinsn |= ((newinsn & 0x0f000) << 4); + } - end_of_line (str); -} + newimm |= (temp & 0xfffff000); + md_number_to_chars (buf, (valueT) newimm, INSN_SIZE); -static void -do_vfp_dp_sp_cvt (char * str) -{ - skip_whitespace (str); + highpart |= (newinsn & 0xfffff000); + md_number_to_chars (buf + INSN_SIZE, (valueT) highpart, INSN_SIZE); + } + break; - if (vfp_dp_reg_required_here (&str, VFP_REG_Dd) == FAIL) - return; + case BFD_RELOC_ARM_OFFSET_IMM: + case BFD_RELOC_ARM_LITERAL: + sign = value >= 0; - if (skip_past_comma (&str) == FAIL - || vfp_sp_reg_required_here (&str, VFP_REG_Sm) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } + if (value < 0) + value = - value; - end_of_line (str); -} + if (validate_offset_imm (value, 0) == FAIL) + { + if (fixP->fx_r_type == BFD_RELOC_ARM_LITERAL) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid literal constant: pool needs to be closer")); + else + as_bad_where (fixP->fx_file, fixP->fx_line, + _("bad immediate value for offset (%ld)"), + (long) value); + break; + } -static void -do_vfp_sp_dp_cvt (char * str) -{ - skip_whitespace (str); + newval = md_chars_to_number (buf, INSN_SIZE); + newval &= 0xff7ff000; + newval |= value | (sign ? INDEX_UP : 0); + md_number_to_chars (buf, newval, INSN_SIZE); + break; - if (vfp_sp_reg_required_here (&str, VFP_REG_Sd) == FAIL) - return; + case BFD_RELOC_ARM_OFFSET_IMM8: + case BFD_RELOC_ARM_HWLITERAL: + sign = value >= 0; - if (skip_past_comma (&str) == FAIL - || vfp_dp_reg_required_here (&str, VFP_REG_Dm) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } + if (value < 0) + value = - value; - end_of_line (str); -} + if (validate_offset_imm (value, 1) == FAIL) + { + if (fixP->fx_r_type == BFD_RELOC_ARM_HWLITERAL) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid literal constant: pool needs to be closer")); + else + as_bad (_("bad immediate value for half-word offset (%ld)"), + (long) value); + break; + } -/* Thumb specific routines. */ + newval = md_chars_to_number (buf, INSN_SIZE); + newval &= 0xff7ff0f0; + newval |= ((value >> 4) << 8) | (value & 0xf) | (sign ? INDEX_UP : 0); + md_number_to_chars (buf, newval, INSN_SIZE); + break; -/* Parse an add or subtract instruction, SUBTRACT is non-zero if the opcode - was SUB. */ + case BFD_RELOC_ARM_T32_OFFSET_U8: + if (value < 0 || value > 1020 || value % 4 != 0) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("bad immediate value for offset (%ld)"), (long) value); + value /= 4; -static void -thumb_add_sub (char * str, int subtract) -{ - int Rd, Rs, Rn = FAIL; - - skip_whitespace (str); - - if ((Rd = thumb_reg (&str, THUMB_REG_ANY)) == FAIL - || skip_past_comma (&str) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } - - if (is_immediate_prefix (*str)) - { - Rs = Rd; - str++; - if (my_get_expression (&inst.reloc.exp, &str)) - return; - } - else - { - if ((Rs = thumb_reg (&str, THUMB_REG_ANY)) == FAIL) - return; - - if (skip_past_comma (&str) == FAIL) - { - /* Two operand format, shuffle the registers - and pretend there are 3. */ - Rn = Rs; - Rs = Rd; - } - else if (is_immediate_prefix (*str)) - { - str++; - if (my_get_expression (&inst.reloc.exp, &str)) - return; - } - else if ((Rn = thumb_reg (&str, THUMB_REG_ANY)) == FAIL) - return; - } + newval = md_chars_to_number (buf+2, THUMB_SIZE); + newval &= 0xff00; + newval |= value; + md_number_to_chars (buf+2, newval, THUMB_SIZE); + break; + + case BFD_RELOC_ARM_T32_OFFSET_IMM: + /* This is a complicated relocation used for all varieties of Thumb32 + load/store instruction with immediate offset: + + 1110 100P u1WL NNNN XXXX YYYY iiii iiii - +/-(U) pre/post(P) 8-bit, + *4, optional writeback(W) + (doubleword load/store) + + 1111 100S uTTL 1111 XXXX iiii iiii iiii - +/-(U) 12-bit PC-rel + 1111 100S 0TTL NNNN XXXX 1Pu1 iiii iiii - +/-(U) pre/post(P) 8-bit + 1111 100S 0TTL NNNN XXXX 1110 iiii iiii - positive 8-bit (T instruction) + 1111 100S 1TTL NNNN XXXX iiii iiii iiii - positive 12-bit + 1111 100S 0TTL NNNN XXXX 1100 iiii iiii - negative 8-bit + + Uppercase letters indicate bits that are already encoded at + this point. Lowercase letters are our problem. For the + second block of instructions, the secondary opcode nybble + (bits 8..11) is present, and bit 23 is zero, even if this is + a PC-relative operation. */ + newval = md_chars_to_number (buf, THUMB_SIZE); + newval <<= 16; + newval |= md_chars_to_number (buf+THUMB_SIZE, THUMB_SIZE); - /* We now have Rd and Rs set to registers, and Rn set to a register or FAIL; - for the latter case, EXPR contains the immediate that was found. */ - if (Rn != FAIL) - { - /* All register format. */ - if (Rd > 7 || Rs > 7 || Rn > 7) + if ((newval & 0xf0000000) == 0xe0000000) { - if (Rs != Rd) + /* Doubleword load/store: 8-bit offset, scaled by 4. */ + if (value >= 0) + newval |= (1 << 23); + else + value = -value; + if (value % 4 != 0) { - inst.error = _("dest and source1 must be the same register"); - return; + as_bad_where (fixP->fx_file, fixP->fx_line, + _("offset not a multiple of 4")); + break; } - - /* Can't do this for SUB. */ - if (subtract) + value /= 4; + if (value >= 0xff) { - inst.error = _("subtract valid only on lo regs"); - return; + as_bad_where (fixP->fx_file, fixP->fx_line, + _("offset out of range")); + break; } - - inst.instruction = (T_OPCODE_ADD_HI - | (Rd > 7 ? THUMB_H1 : 0) - | (Rn > 7 ? THUMB_H2 : 0)); - inst.instruction |= (Rd & 7) | ((Rn & 7) << 3); + newval &= ~0xff; } - else + else if ((newval & 0x000f0000) == 0x000f0000) { - inst.instruction = subtract ? T_OPCODE_SUB_R3 : T_OPCODE_ADD_R3; - inst.instruction |= Rd | (Rs << 3) | (Rn << 6); + /* PC-relative, 12-bit offset. */ + if (value >= 0) + newval |= (1 << 23); + else + value = -value; + if (value >= 0xfff) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _("offset out of range")); + break; + } + newval &= ~0xfff; } - } - else - { - /* Immediate expression, now things start to get nasty. */ - - /* First deal with HI regs, only very restricted cases allowed: - Adjusting SP, and using PC or SP to get an address. */ - if ((Rd > 7 && (Rd != REG_SP || Rs != REG_SP)) - || (Rs > 7 && Rs != REG_SP && Rs != REG_PC)) + else if ((newval & 0x00000100) == 0x00000100) { - inst.error = _("invalid Hi register with immediate"); - return; + /* Writeback: 8-bit, +/- offset. */ + if (value >= 0) + newval |= (1 << 9); + else + value = -value; + if (value >= 0xff) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _("offset out of range")); + break; + } + newval &= ~0xff; } - - if (inst.reloc.exp.X_op != O_constant) + else if ((newval & 0x00000f00) == 0x00000e00) { - /* Value isn't known yet, all we can do is store all the fragments - we know about in the instruction and let the reloc hacking - work it all out. */ - inst.instruction = (subtract ? 0x8000 : 0) | (Rd << 4) | Rs; - inst.reloc.type = BFD_RELOC_ARM_THUMB_ADD; + /* T-instruction: positive 8-bit offset. */ + if (value < 0 || value >= 0xff) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _("offset out of range")); + break; + } + newval &= ~0xff; + newval |= value; } else { - int offset = inst.reloc.exp.X_add_number; - - if (subtract) - offset = - offset; - - if (offset < 0) - { - offset = - offset; - subtract = 1; - - /* Quick check, in case offset is MIN_INT. */ - if (offset < 0) - { - inst.error = _("immediate value out of range"); - return; - } - } - /* Note - you cannot convert a subtract of 0 into an - add of 0 because the carry flag is set differently. */ - else if (offset > 0) - subtract = 0; - - if (Rd == REG_SP) - { - if (offset & ~0x1fc) - { - inst.error = _("invalid immediate value for stack adjust"); - return; - } - inst.instruction = subtract ? T_OPCODE_SUB_ST : T_OPCODE_ADD_ST; - inst.instruction |= offset >> 2; - } - else if (Rs == REG_PC || Rs == REG_SP) + /* Positive 12-bit or negative 8-bit offset. */ + int limit; + if (value >= 0) { - if (subtract - || (offset & ~0x3fc)) - { - inst.error = _("invalid immediate for address calculation"); - return; - } - inst.instruction = (Rs == REG_PC ? T_OPCODE_ADD_PC - : T_OPCODE_ADD_SP); - inst.instruction |= (Rd << 8) | (offset >> 2); + newval |= (1 << 23); + limit = 0xfff; } - else if (Rs == Rd) + else { - if (offset & ~0xff) - { - inst.error = _("immediate value out of range"); - return; - } - inst.instruction = subtract ? T_OPCODE_SUB_I8 : T_OPCODE_ADD_I8; - inst.instruction |= (Rd << 8) | offset; + value = -value; + limit = 0xff; } - else + if (value > limit) { - if (offset & ~0x7) - { - inst.error = _("immediate value out of range"); - return; - } - inst.instruction = subtract ? T_OPCODE_SUB_I3 : T_OPCODE_ADD_I3; - inst.instruction |= Rd | (Rs << 3) | (offset << 6); + as_bad_where (fixP->fx_file, fixP->fx_line, + _("offset out of range")); + break; } + newval &= ~limit; } - } - - end_of_line (str); -} -static void -thumb_shift (char * str, int shift) -{ - int Rd, Rs, Rn = FAIL; + newval |= value; + md_number_to_chars (buf, (newval >> 16) & 0xffff, THUMB_SIZE); + md_number_to_chars (buf + THUMB_SIZE, newval & 0xffff, THUMB_SIZE); + break; - skip_whitespace (str); + case BFD_RELOC_ARM_SHIFT_IMM: + newval = md_chars_to_number (buf, INSN_SIZE); + if (((unsigned long) value) > 32 + || (value == 32 + && (((newval & 0x60) == 0) || (newval & 0x60) == 0x60))) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _("shift expression is too large")); + break; + } - if ((Rd = thumb_reg (&str, THUMB_REG_LO)) == FAIL - || skip_past_comma (&str) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } + if (value == 0) + /* Shifts of zero must be done as lsl. */ + newval &= ~0x60; + else if (value == 32) + value = 0; + newval &= 0xfffff07f; + newval |= (value & 0x1f) << 7; + md_number_to_chars (buf, newval, INSN_SIZE); + break; - if (is_immediate_prefix (*str)) - { - /* Two operand immediate format, set Rs to Rd. */ - Rs = Rd; - str ++; - if (my_get_expression (&inst.reloc.exp, &str)) - return; - } - else - { - if ((Rs = thumb_reg (&str, THUMB_REG_LO)) == FAIL) - return; + case BFD_RELOC_ARM_T32_IMMEDIATE: + /* We claim that this fixup has been processed here, + even if in fact we generate an error because we do + not have a reloc for it, so tc_gen_reloc will reject it. */ + fixP->fx_done = 1; - if (skip_past_comma (&str) == FAIL) - { - /* Two operand format, shuffle the registers - and pretend there are 3. */ - Rn = Rs; - Rs = Rd; - } - else if (is_immediate_prefix (*str)) + if (fixP->fx_addsy + && ! S_IS_DEFINED (fixP->fx_addsy)) { - str++; - if (my_get_expression (&inst.reloc.exp, &str)) - return; + as_bad_where (fixP->fx_file, fixP->fx_line, + _("undefined symbol %s used as an immediate value"), + S_GET_NAME (fixP->fx_addsy)); + break; } - else if ((Rn = thumb_reg (&str, THUMB_REG_LO)) == FAIL) - return; - } - /* We now have Rd and Rs set to registers, and Rn set to a register or FAIL; - for the latter case, EXPR contains the immediate that was found. */ + newval = md_chars_to_number (buf, THUMB_SIZE); + newval <<= 16; + newval |= md_chars_to_number (buf+2, THUMB_SIZE); - if (Rn != FAIL) - { - if (Rs != Rd) - { - inst.error = _("source1 and dest must be same register"); - return; - } + newimm = encode_thumb32_immediate (value); - switch (shift) + /* FUTURE: Implement analogue of negate_data_op for T32. */ + if (newimm == (unsigned int)FAIL) { - case THUMB_ASR: inst.instruction = T_OPCODE_ASR_R; break; - case THUMB_LSL: inst.instruction = T_OPCODE_LSL_R; break; - case THUMB_LSR: inst.instruction = T_OPCODE_LSR_R; break; + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid constant (%lx) after fixup"), + (unsigned long) value); + break; } - inst.instruction |= Rd | (Rn << 3); - } - else - { - switch (shift) - { - case THUMB_ASR: inst.instruction = T_OPCODE_ASR_I; break; - case THUMB_LSL: inst.instruction = T_OPCODE_LSL_I; break; - case THUMB_LSR: inst.instruction = T_OPCODE_LSR_I; break; - } + newval &= 0xfbff8f00; + newval |= (newimm & 0x800) << 15; + newval |= (newimm & 0x700) << 4; + newval |= (newimm & 0x0ff); + + md_number_to_chars (buf, (valueT) ((newval >> 16) & 0xffff), THUMB_SIZE); + md_number_to_chars (buf+2, (valueT) (newval & 0xffff), THUMB_SIZE); + break; + + case BFD_RELOC_ARM_SMI: + if (((unsigned long) value) > 0xffff) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid smi expression")); + newval = md_chars_to_number (buf, INSN_SIZE) & 0xfff000f0; + newval |= (value & 0xf) | ((value & 0xfff0) << 4); + md_number_to_chars (buf, newval, INSN_SIZE); + break; - if (inst.reloc.exp.X_op != O_constant) + case BFD_RELOC_ARM_SWI: + if (fixP->tc_fix_data != 0) { - /* Value isn't known yet, create a dummy reloc and let reloc - hacking fix it up. */ - inst.reloc.type = BFD_RELOC_ARM_THUMB_SHIFT; + if (((unsigned long) value) > 0xff) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid swi expression")); + newval = md_chars_to_number (buf, THUMB_SIZE) & 0xff00; + newval |= value; + md_number_to_chars (buf, newval, THUMB_SIZE); } else { - unsigned shift_value = inst.reloc.exp.X_add_number; + if (((unsigned long) value) > 0x00ffffff) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid swi expression")); + newval = md_chars_to_number (buf, INSN_SIZE) & 0xff000000; + newval |= value; + md_number_to_chars (buf, newval, INSN_SIZE); + } + break; - if (shift_value > 32 || (shift_value == 32 && shift == THUMB_LSL)) - { - inst.error = _("invalid immediate for shift"); - return; - } + case BFD_RELOC_ARM_MULTI: + if (((unsigned long) value) > 0xffff) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid expression in load/store multiple")); + newval = value | md_chars_to_number (buf, INSN_SIZE); + md_number_to_chars (buf, newval, INSN_SIZE); + break; - /* Shifts of zero are handled by converting to LSL. */ - if (shift_value == 0) - inst.instruction = T_OPCODE_LSL_I; + case BFD_RELOC_ARM_PCREL_BRANCH: + newval = md_chars_to_number (buf, INSN_SIZE); - /* Shifts of 32 are encoded as a shift of zero. */ - if (shift_value == 32) - shift_value = 0; + /* Sign-extend a 24-bit number. */ +#define SEXT24(x) ((((x) & 0xffffff) ^ (~ 0x7fffff)) + 0x800000) - inst.instruction |= shift_value << 6; - } +#ifdef OBJ_ELF + if (!fixP->fx_done) + value = fixP->fx_offset; +#endif - inst.instruction |= Rd | (Rs << 3); - } + /* 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 & ~ ((offsetT) 0x1ffffff)) != 0 + && ((value & ~ ((offsetT) 0x1ffffff)) != ~ ((offsetT) 0x1ffffff))) + { +#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 instruction itself, then we can compute the relocation for + ourselves and not have to bother the linker with it. - end_of_line (str); -} + FIXME: The test for OBJ_ELF is only here because I have not + worked out how to do this for OBJ_COFF. */ + if (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 = * valP; -static void -thumb_load_store (char * str, int load_store, int size) -{ - int Rd, Rb, Ro = FAIL; + /* Permit a backward branch provided that enough bits + are set. Allow a forwards branch, provided that + enough bits are clear. */ + if ( (value & ~ ((offsetT) 0x1ffffff)) == ~ ((offsetT) 0x1ffffff) + || (value & ~ ((offsetT) 0x1ffffff)) == 0) + fixP->fx_done = 1; + } - skip_whitespace (str); + if (! fixP->fx_done) +#endif + as_bad_where (fixP->fx_file, fixP->fx_line, + _("GAS can't handle same-section branch dest >= 0x04000000")); + } - if ((Rd = thumb_reg (&str, THUMB_REG_LO)) == FAIL - || skip_past_comma (&str) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } + value >>= 2; + value += SEXT24 (newval); - if (*str == '[') - { - str++; - if ((Rb = thumb_reg (&str, THUMB_REG_ANY)) == FAIL) - return; + if ( (value & ~ ((offsetT) 0xffffff)) != 0 + && ((value & ~ ((offsetT) 0xffffff)) != ~ ((offsetT) 0xffffff))) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("out of range branch")); - if (skip_past_comma (&str) != FAIL) + if (seg->use_rela_p && !fixP->fx_done) { - if (is_immediate_prefix (*str)) - { - str++; - if (my_get_expression (&inst.reloc.exp, &str)) - return; - } - else if ((Ro = thumb_reg (&str, THUMB_REG_LO)) == FAIL) - return; + /* Must unshift the value before storing it in the addend. */ + value <<= 2; +#ifdef OBJ_ELF + fixP->fx_offset = value; +#endif + fixP->fx_addnumber = value; + newval = newval & 0xff000000; } else - { - inst.reloc.exp.X_op = O_constant; - inst.reloc.exp.X_add_number = 0; - } - - if (*str != ']') - { - inst.error = _("expected ']'"); - return; - } - str++; - } - else if (*str == '=') - { - if (load_store != THUMB_LOAD) - { - inst.error = _("invalid pseudo operation"); - return; - } - - /* Parse an "ldr Rd, =expr" instruction; this is another pseudo op. */ - str++; - - skip_whitespace (str); - - if (my_get_expression (& inst.reloc.exp, & str)) - return; - - end_of_line (str); - - if ( inst.reloc.exp.X_op != O_constant - && inst.reloc.exp.X_op != O_symbol) - { - inst.error = "Constant expression expected"; - return; - } - - if (inst.reloc.exp.X_op == O_constant - && ((inst.reloc.exp.X_add_number & ~0xFF) == 0)) - { - /* This can be done with a mov instruction. */ + newval = (value & 0x00ffffff) | (newval & 0xff000000); + md_number_to_chars (buf, newval, INSN_SIZE); + break; - inst.instruction = T_OPCODE_MOV_I8 | (Rd << 8); - inst.instruction |= inst.reloc.exp.X_add_number; - return; - } + case BFD_RELOC_ARM_PCREL_BLX: + { + offsetT hbit; + newval = md_chars_to_number (buf, INSN_SIZE); - /* Insert into literal pool. */ - if (add_to_lit_pool () == FAIL) - { - if (!inst.error) - inst.error = "literal pool insertion failed"; - return; - } +#ifdef OBJ_ELF + if (!fixP->fx_done) + value = fixP->fx_offset; +#endif + hbit = (value >> 1) & 1; + value = (value >> 2) & 0x00ffffff; + value = (value + (newval & 0x00ffffff)) & 0x00ffffff; - inst.reloc.type = BFD_RELOC_ARM_THUMB_OFFSET; - inst.reloc.pc_rel = 1; - inst.instruction = T_OPCODE_LDR_PC | (Rd << 8); - /* Adjust ARM pipeline offset to Thumb. */ - inst.reloc.exp.X_add_number += 4; + if (seg->use_rela_p && !fixP->fx_done) + { + /* Must sign-extend and unshift the value before storing + it in the addend. */ + value = SEXT24 (value); + value = (value << 2) | hbit; +#ifdef OBJ_ELF + fixP->fx_offset = value; +#endif + fixP->fx_addnumber = value; + newval = newval & 0xfe000000; + } + else + newval = value | (newval & 0xfe000000) | (hbit << 24); + md_number_to_chars (buf, newval, INSN_SIZE); + } + break; - return; - } - else - { - if (my_get_expression (&inst.reloc.exp, &str)) - return; + case BFD_RELOC_THUMB_PCREL_BRANCH7: /* CZB */ + newval = md_chars_to_number (buf, THUMB_SIZE); + { + addressT diff = ((newval & 0x00f8) >> 2) | (newval & 0x0200) >> 3; + /* This one does not have the offset encoded in the pattern. */ + value = value + diff - 4; + /* CZB can only branch forward. */ + if (value & ~0x7e) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("branch out of range")); - inst.instruction = T_OPCODE_LDR_PC | (Rd << 8); - inst.reloc.pc_rel = 1; - inst.reloc.exp.X_add_number -= 4; /* Pipeline offset. */ - inst.reloc.type = BFD_RELOC_ARM_THUMB_OFFSET; - end_of_line (str); - return; - } + newval &= 0xfd07; + if (seg->use_rela_p && !fixP->fx_done) + { +#ifdef OBJ_ELF + fixP->fx_offset = value; +#endif + fixP->fx_addnumber = value; + } + else + newval |= ((value & 0x2e) << 2) | ((value & 0x40) << 3); + } + md_number_to_chars (buf, newval, THUMB_SIZE); + break; - if (Rb == REG_PC || Rb == REG_SP) - { - if (size != THUMB_WORD) - { - inst.error = _("byte or halfword not valid for base register"); - return; - } - else if (Rb == REG_PC && load_store != THUMB_LOAD) - { - inst.error = _("r15 based store not allowed"); - return; - } - else if (Ro != FAIL) - { - inst.error = _("invalid base register for register offset"); - return; - } + case BFD_RELOC_THUMB_PCREL_BRANCH9: /* Conditional branch. */ + newval = md_chars_to_number (buf, THUMB_SIZE); + { + addressT diff = (newval & 0xff) << 1; + if (diff & 0x100) + diff |= ~0xff; - if (Rb == REG_PC) - inst.instruction = T_OPCODE_LDR_PC; - else if (load_store == THUMB_LOAD) - inst.instruction = T_OPCODE_LDR_SP; - else - inst.instruction = T_OPCODE_STR_SP; + value += diff; + if ((value & ~0xff) && ((value & ~0xff) != ~0xff)) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("branch out of range")); + if (seg->use_rela_p && !fixP->fx_done) + { +#ifdef OBJ_ELF + fixP->fx_offset = value; +#endif + fixP->fx_addnumber = value; + newval = newval & 0xff00; + } + else + newval = (newval & 0xff00) | ((value & 0x1ff) >> 1); + } + md_number_to_chars (buf, newval, THUMB_SIZE); + break; - inst.instruction |= Rd << 8; - if (inst.reloc.exp.X_op == O_constant) - { - unsigned offset = inst.reloc.exp.X_add_number; + case BFD_RELOC_THUMB_PCREL_BRANCH12: /* Unconditional branch. */ + newval = md_chars_to_number (buf, THUMB_SIZE); + { + addressT diff = (newval & 0x7ff) << 1; + if (diff & 0x800) + diff |= ~0x7ff; - if (offset & ~0x3fc) - { - inst.error = _("invalid offset"); - return; - } + value += diff; + if ((value & ~0x7ff) && ((value & ~0x7ff) != ~0x7ff)) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("branch out of range")); + if (seg->use_rela_p && !fixP->fx_done) + { +#ifdef OBJ_ELF + fixP->fx_offset = value; +#endif + fixP->fx_addnumber = value; + newval = newval & 0xf800; + } + else + newval = (newval & 0xf800) | ((value & 0xfff) >> 1); + } + md_number_to_chars (buf, newval, THUMB_SIZE); + break; - inst.instruction |= offset >> 2; - } - else - inst.reloc.type = BFD_RELOC_ARM_THUMB_OFFSET; - } - else if (Rb > 7) - { - inst.error = _("invalid base register in load/store"); - return; - } - else if (Ro == FAIL) - { - /* Immediate offset. */ - if (size == THUMB_WORD) - inst.instruction = (load_store == THUMB_LOAD - ? T_OPCODE_LDR_IW : T_OPCODE_STR_IW); - else if (size == THUMB_HALFWORD) - inst.instruction = (load_store == THUMB_LOAD - ? T_OPCODE_LDR_IH : T_OPCODE_STR_IH); - else - inst.instruction = (load_store == THUMB_LOAD - ? T_OPCODE_LDR_IB : T_OPCODE_STR_IB); + case BFD_RELOC_THUMB_PCREL_BRANCH20: + { + offsetT newval2; + addressT diff, S, J1, J2, lo, hi; - inst.instruction |= Rd | (Rb << 3); + newval = md_chars_to_number (buf, THUMB_SIZE); + newval2 = md_chars_to_number (buf + THUMB_SIZE, THUMB_SIZE); - if (inst.reloc.exp.X_op == O_constant) - { - unsigned offset = inst.reloc.exp.X_add_number; + S = !(newval & 0x0400); /* flipped - 0=negative */ + hi = (newval & 0x003f); + J1 = (newval2 & 0x2000) >> 13; + J2 = (newval2 & 0x0800) >> 11; + lo = (newval2 & 0x07ff); - if (offset & ~(0x1f << size)) - { - inst.error = _("invalid offset"); - return; - } - inst.instruction |= (offset >> size) << 6; - } - else - inst.reloc.type = BFD_RELOC_ARM_THUMB_OFFSET; - } - else - { - /* Register offset. */ - if (size == THUMB_WORD) - inst.instruction = (load_store == THUMB_LOAD - ? T_OPCODE_LDR_RW : T_OPCODE_STR_RW); - else if (size == THUMB_HALFWORD) - inst.instruction = (load_store == THUMB_LOAD - ? T_OPCODE_LDR_RH : T_OPCODE_STR_RH); - else - inst.instruction = (load_store == THUMB_LOAD - ? T_OPCODE_LDR_RB : T_OPCODE_STR_RB); + diff = ((S << 20) | (J2 << 19) | (J1 << 18) | (hi << 12) | (lo << 1)); + diff -= (1 << 20); /* sign extend */ + value += diff; - inst.instruction |= Rd | (Rb << 3) | (Ro << 6); - } + if ((value & ~0x1fffff) && ((value & ~0x1fffff) != ~0x1fffff)) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("conditional branch out of range")); - end_of_line (str); -} + newval = newval & 0xfbc0; + newval2 = newval2 & 0xd000; + if (seg->use_rela_p && !fixP->fx_done) + { +#ifdef OBJ_ELF + fixP->fx_offset = value; +#endif + fixP->fx_addnumber = value; + } + else + { + S = (value & 0x00100000) >> 20; + J2 = (value & 0x00080000) >> 19; + J1 = (value & 0x00040000) >> 18; + hi = (value & 0x0003f000) >> 12; + lo = (value & 0x00000ffe) >> 1; -/* A register must be given at this point. + newval = newval | (S << 10) | hi; + newval2 = newval2 | (J1 << 13) | (J2 << 11) | lo; + } - Shift is the place to put it in inst.instruction. + md_number_to_chars (buf, newval, THUMB_SIZE); + md_number_to_chars (buf + THUMB_SIZE, newval2, THUMB_SIZE); + } + break; - Restores input start point on err. - Returns the reg#, or FAIL. */ + case BFD_RELOC_THUMB_PCREL_BLX: + case BFD_RELOC_THUMB_PCREL_BRANCH23: + { + offsetT newval2; + addressT diff; -static int -mav_reg_required_here (char ** str, int shift, enum arm_reg_type regtype) -{ - int reg; - char *start = *str; + newval = md_chars_to_number (buf, THUMB_SIZE); + newval2 = md_chars_to_number (buf + THUMB_SIZE, THUMB_SIZE); + diff = ((newval & 0x7ff) << 12) | ((newval2 & 0x7ff) << 1); + if (diff & 0x400000) + diff |= ~0x3fffff; +#ifdef OBJ_ELF + if (!fixP->fx_done) + value = fixP->fx_offset; +#endif + value += diff; - if ((reg = arm_reg_parse (str, all_reg_maps[regtype].htab)) != FAIL) - { - if (shift >= 0) - inst.instruction |= reg << shift; + if ((value & ~0x3fffff) && ((value & ~0x3fffff) != ~0x3fffff)) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("branch with link out of range")); - return reg; - } + if (fixP->fx_r_type == BFD_RELOC_THUMB_PCREL_BLX) + /* For a BLX instruction, make sure that the relocation is rounded up + to a word boundary. This follows the semantics of the instruction + which specifies that bit 1 of the target address will come from bit + 1 of the base address. */ + value = (value + 1) & ~ 1; - /* Restore the start point. */ - *str = start; + if (seg->use_rela_p && !fixP->fx_done) + { +#ifdef OBJ_ELF + fixP->fx_offset = value; +#endif + fixP->fx_addnumber = value; + newval = newval & 0xf800; + newval2 = newval2 & 0xf800; + } + else + { + newval = (newval & 0xf800) | ((value & 0x7fffff) >> 12); + newval2 = (newval2 & 0xf800) | ((value & 0xfff) >> 1); + } + md_number_to_chars (buf, newval, THUMB_SIZE); + md_number_to_chars (buf + THUMB_SIZE, newval2, THUMB_SIZE); + } + break; - /* Try generic coprocessor name if applicable. */ - if (regtype == REG_TYPE_MVF || - regtype == REG_TYPE_MVD || - regtype == REG_TYPE_MVFX || - regtype == REG_TYPE_MVDX) - { - if ((reg = arm_reg_parse (str, all_reg_maps[REG_TYPE_CN].htab)) != FAIL) + case BFD_RELOC_8: + if (seg->use_rela_p && !fixP->fx_done) + break; + if (fixP->fx_done || fixP->fx_pcrel) + md_number_to_chars (buf, value, 1); +#ifdef OBJ_ELF + else { - if (shift >= 0) - inst.instruction |= reg << shift; - - return reg; + value = fixP->fx_offset; + md_number_to_chars (buf, value, 1); } +#endif + break; - /* Restore the start point. */ - *str = start; - } - - /* In the few cases where we might be able to accept something else - this error can be overridden. */ - inst.error = _(all_reg_maps[regtype].expected); - - return FAIL; -} - -/* Cirrus Maverick Instructions. */ + case BFD_RELOC_THUMB_PCREL_BRANCH25: + { + offsetT newval2; + addressT diff, S, I1, I2, lo, hi; -/* Isnsn like "foo X,Y". */ + newval = md_chars_to_number (buf, THUMB_SIZE); + newval2 = md_chars_to_number (buf + THUMB_SIZE, THUMB_SIZE); -static void -do_mav_binops (char * str, - int mode, - enum arm_reg_type reg0, - enum arm_reg_type reg1) -{ - int shift0, shift1; + S = (newval & 0x0400) >> 10; + hi = (newval & 0x03ff); + I1 = (newval2 & 0x2000) >> 13; + I2 = (newval2 & 0x0800) >> 11; + lo = (newval2 & 0x07ff); + + I1 = !(I1 ^ S); + I2 = !(I2 ^ S); + S = !S; - shift0 = mode & 0xff; - shift1 = (mode >> 8) & 0xff; + diff = ((S << 24) | (I1 << 23) | (I2 << 22) | (hi << 12) | (lo << 1)); + diff -= (1 << 24); /* sign extend */ + value += diff; - skip_whitespace (str); + if ((value & ~0x1ffffff) && ((value & ~0x1ffffff) != ~0x1ffffff)) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("branch out of range")); - if (mav_reg_required_here (&str, shift0, reg0) == FAIL - || skip_past_comma (&str) == FAIL - || mav_reg_required_here (&str, shift1, reg1) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - } - else - end_of_line (str); -} - -/* Isnsn like "foo X,Y,Z". */ - -static void -do_mav_triple (char * str, - int mode, - enum arm_reg_type reg0, - enum arm_reg_type reg1, - enum arm_reg_type reg2) -{ - int shift0, shift1, shift2; - - shift0 = mode & 0xff; - shift1 = (mode >> 8) & 0xff; - shift2 = (mode >> 16) & 0xff; - - skip_whitespace (str); - - if (mav_reg_required_here (&str, shift0, reg0) == FAIL - || skip_past_comma (&str) == FAIL - || mav_reg_required_here (&str, shift1, reg1) == FAIL - || skip_past_comma (&str) == FAIL - || mav_reg_required_here (&str, shift2, reg2) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - } - else - end_of_line (str); -} - -/* Wrapper functions. */ - -static void -do_mav_binops_1a (char * str) -{ - do_mav_binops (str, MAV_MODE1, REG_TYPE_RN, REG_TYPE_MVF); -} + newval = newval & 0xf800; + newval2 = newval2 & 0xd000; + if (seg->use_rela_p && !fixP->fx_done) + { +#ifdef OBJ_ELF + fixP->fx_offset = value; +#endif + fixP->fx_addnumber = value; + } + else + { + S = (value & 0x01000000) >> 24; + I1 = (value & 0x00800000) >> 23; + I2 = (value & 0x00400000) >> 22; + hi = (value & 0x003ff000) >> 12; + lo = (value & 0x00000ffe) >> 1; -static void -do_mav_binops_1b (char * str) -{ - do_mav_binops (str, MAV_MODE1, REG_TYPE_RN, REG_TYPE_MVD); -} + I1 = !(I1 ^ S); + I2 = !(I2 ^ S); -static void -do_mav_binops_1c (char * str) -{ - do_mav_binops (str, MAV_MODE1, REG_TYPE_RN, REG_TYPE_MVDX); -} + newval = newval | (S << 10) | hi; + newval2 = newval2 | (I1 << 13) | (I2 << 11) | lo; + } + md_number_to_chars (buf, newval, THUMB_SIZE); + md_number_to_chars (buf + THUMB_SIZE, newval2, THUMB_SIZE); + } + break; -static void -do_mav_binops_1d (char * str) -{ - do_mav_binops (str, MAV_MODE1, REG_TYPE_MVF, REG_TYPE_MVF); -} + case BFD_RELOC_16: + if (seg->use_rela_p && !fixP->fx_done) + break; + if (fixP->fx_done || fixP->fx_pcrel) + md_number_to_chars (buf, value, 2); +#ifdef OBJ_ELF + else + { + value = fixP->fx_offset; + md_number_to_chars (buf, value, 2); + } +#endif + break; -static void -do_mav_binops_1e (char * str) -{ - do_mav_binops (str, MAV_MODE1, REG_TYPE_MVD, REG_TYPE_MVD); -} +#ifdef OBJ_ELF + case BFD_RELOC_ARM_TLS_GD32: + case BFD_RELOC_ARM_TLS_LE32: + case BFD_RELOC_ARM_TLS_IE32: + case BFD_RELOC_ARM_TLS_LDM32: + case BFD_RELOC_ARM_TLS_LDO32: + S_SET_THREAD_LOCAL (fixP->fx_addsy); + /* fall through */ -static void -do_mav_binops_1f (char * str) -{ - do_mav_binops (str, MAV_MODE1, REG_TYPE_MVD, REG_TYPE_MVF); -} + case BFD_RELOC_ARM_GOT32: + case BFD_RELOC_ARM_GOTOFF: + case BFD_RELOC_ARM_TARGET2: + if (seg->use_rela_p && !fixP->fx_done) + break; + md_number_to_chars (buf, 0, 4); + break; +#endif -static void -do_mav_binops_1g (char * str) -{ - do_mav_binops (str, MAV_MODE1, REG_TYPE_MVF, REG_TYPE_MVD); -} + case BFD_RELOC_RVA: + case BFD_RELOC_32: + case BFD_RELOC_ARM_TARGET1: + case BFD_RELOC_ARM_ROSEGREL32: + case BFD_RELOC_ARM_SBREL32: + case BFD_RELOC_32_PCREL: + if (seg->use_rela_p && !fixP->fx_done) + break; + if (fixP->fx_done || fixP->fx_pcrel) + md_number_to_chars (buf, value, 4); +#ifdef OBJ_ELF + else + { + value = fixP->fx_offset; + md_number_to_chars (buf, value, 4); + } +#endif + break; -static void -do_mav_binops_1h (char * str) -{ - do_mav_binops (str, MAV_MODE1, REG_TYPE_MVF, REG_TYPE_MVFX); -} +#ifdef OBJ_ELF + case BFD_RELOC_ARM_PREL31: + if (fixP->fx_done || fixP->fx_pcrel) + { + newval = md_chars_to_number (buf, 4) & 0x80000000; + if ((value ^ (value >> 1)) & 0x40000000) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _("rel31 relocation overflow")); + } + newval |= value & 0x7fffffff; + md_number_to_chars (buf, newval, 4); + } + break; -static void -do_mav_binops_1i (char * str) -{ - do_mav_binops (str, MAV_MODE1, REG_TYPE_MVD, REG_TYPE_MVFX); -} + case BFD_RELOC_ARM_PLT32: + /* It appears the instruction is fully prepared at this point. */ + break; +#endif -static void -do_mav_binops_1j (char * str) -{ - do_mav_binops (str, MAV_MODE1, REG_TYPE_MVF, REG_TYPE_MVDX); -} + case BFD_RELOC_ARM_CP_OFF_IMM: + if (value < -1023 || value > 1023 || (value & 3)) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("co-processor offset out of range")); + cp_off_common: + sign = value >= 0; + if (value < 0) + value = -value; + newval = md_chars_to_number (buf, INSN_SIZE) & 0xff7fff00; + newval |= (value >> 2) | (sign ? INDEX_UP : 0); + if (value == 0) + newval &= ~WRITE_BACK; + md_number_to_chars (buf, newval, INSN_SIZE); + break; -static void -do_mav_binops_1k (char * str) -{ - do_mav_binops (str, MAV_MODE1, REG_TYPE_MVD, REG_TYPE_MVDX); -} + case BFD_RELOC_ARM_CP_OFF_IMM_S2: + if (value < -255 || value > 255) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("co-processor offset out of range")); + goto cp_off_common; -static void -do_mav_binops_1l (char * str) -{ - do_mav_binops (str, MAV_MODE1, REG_TYPE_MVFX, REG_TYPE_MVF); -} + case BFD_RELOC_ARM_THUMB_OFFSET: + newval = md_chars_to_number (buf, THUMB_SIZE); + /* Exactly what ranges, and where the offset is inserted depends + on the type of instruction, we can establish this from the + top 4 bits. */ + switch (newval >> 12) + { + case 4: /* PC load. */ + /* Thumb PC loads are somewhat odd, bit 1 of the PC is + forced to zero for these loads; md_pcrel_from has already + compensated for this. */ + if (value & 3) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid offset, target not word aligned (0x%08lX)"), + (((unsigned int) fixP->fx_frag->fr_address + + (unsigned int) fixP->fx_where) & ~3) + value); -static void -do_mav_binops_1m (char * str) -{ - do_mav_binops (str, MAV_MODE1, REG_TYPE_MVFX, REG_TYPE_MVD); -} + if (value & ~0x3fc) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid offset, value too big (0x%08lX)"), + (long) value); -static void -do_mav_binops_1n (char * str) -{ - do_mav_binops (str, MAV_MODE1, REG_TYPE_MVFX, REG_TYPE_MVFX); -} + newval |= value >> 2; + break; -static void -do_mav_binops_1o (char * str) -{ - do_mav_binops (str, MAV_MODE1, REG_TYPE_MVDX, REG_TYPE_MVDX); -} + case 9: /* SP load/store. */ + if (value & ~0x3fc) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid offset, value too big (0x%08lX)"), + (long) value); + newval |= value >> 2; + break; -static void -do_mav_binops_2a (char * str) -{ - do_mav_binops (str, MAV_MODE2, REG_TYPE_MVF, REG_TYPE_RN); -} + case 6: /* Word load/store. */ + if (value & ~0x7c) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid offset, value too big (0x%08lX)"), + (long) value); + newval |= value << 4; /* 6 - 2. */ + break; -static void -do_mav_binops_2b (char * str) -{ - do_mav_binops (str, MAV_MODE2, REG_TYPE_MVD, REG_TYPE_RN); -} + case 7: /* Byte load/store. */ + if (value & ~0x1f) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid offset, value too big (0x%08lX)"), + (long) value); + newval |= value << 6; + break; -static void -do_mav_binops_2c (char * str) -{ - do_mav_binops (str, MAV_MODE2, REG_TYPE_MVDX, REG_TYPE_RN); -} + case 8: /* Halfword load/store. */ + if (value & ~0x3e) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid offset, value too big (0x%08lX)"), + (long) value); + newval |= value << 5; /* 6 - 1. */ + break; -static void -do_mav_binops_3a (char * str) -{ - do_mav_binops (str, MAV_MODE3, REG_TYPE_MVAX, REG_TYPE_MVFX); -} + default: + as_bad_where (fixP->fx_file, fixP->fx_line, + "Unable to process relocation for thumb opcode: %lx", + (unsigned long) newval); + break; + } + md_number_to_chars (buf, newval, THUMB_SIZE); + break; -static void -do_mav_binops_3b (char * str) -{ - do_mav_binops (str, MAV_MODE3, REG_TYPE_MVFX, REG_TYPE_MVAX); -} + case BFD_RELOC_ARM_THUMB_ADD: + /* This is a complicated relocation, since we use it for all of + the following immediate relocations: -static void -do_mav_binops_3c (char * str) -{ - do_mav_binops (str, MAV_MODE3, REG_TYPE_MVAX, REG_TYPE_MVDX); -} + 3bit ADD/SUB + 8bit ADD/SUB + 9bit ADD/SUB SP word-aligned + 10bit ADD PC/SP word-aligned -static void -do_mav_binops_3d (char * str) -{ - do_mav_binops (str, MAV_MODE3, REG_TYPE_MVDX, REG_TYPE_MVAX); -} + The type of instruction being processed is encoded in the + instruction field: -static void -do_mav_triple_4a (char * str) -{ - do_mav_triple (str, MAV_MODE4, REG_TYPE_MVFX, REG_TYPE_MVFX, REG_TYPE_RN); -} + 0x8000 SUB + 0x00F0 Rd + 0x000F Rs + */ + newval = md_chars_to_number (buf, THUMB_SIZE); + { + int rd = (newval >> 4) & 0xf; + int rs = newval & 0xf; + int subtract = !!(newval & 0x8000); -static void -do_mav_triple_4b (char * str) -{ - do_mav_triple (str, MAV_MODE4, REG_TYPE_MVDX, REG_TYPE_MVDX, REG_TYPE_RN); -} + /* Check for HI regs, only very restricted cases allowed: + Adjusting SP, and using PC or SP to get an address. */ + if ((rd > 7 && (rd != REG_SP || rs != REG_SP)) + || (rs > 7 && rs != REG_SP && rs != REG_PC)) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid Hi register with immediate")); -static void -do_mav_triple_5a (char * str) -{ - do_mav_triple (str, MAV_MODE5, REG_TYPE_RN, REG_TYPE_MVF, REG_TYPE_MVF); -} + /* If value is negative, choose the opposite instruction. */ + if (value < 0) + { + value = -value; + subtract = !subtract; + if (value < 0) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("immediate value out of range")); + } -static void -do_mav_triple_5b (char * str) -{ - do_mav_triple (str, MAV_MODE5, REG_TYPE_RN, REG_TYPE_MVD, REG_TYPE_MVD); -} + if (rd == REG_SP) + { + if (value & ~0x1fc) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid immediate for stack address calculation")); + newval = subtract ? T_OPCODE_SUB_ST : T_OPCODE_ADD_ST; + newval |= value >> 2; + } + else if (rs == REG_PC || rs == REG_SP) + { + if (subtract || value & ~0x3fc) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid immediate for address calculation (value = 0x%08lX)"), + (unsigned long) value); + newval = (rs == REG_PC ? T_OPCODE_ADD_PC : T_OPCODE_ADD_SP); + newval |= rd << 8; + newval |= value >> 2; + } + else if (rs == rd) + { + if (value & ~0xff) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("immediate value out of range")); + newval = subtract ? T_OPCODE_SUB_I8 : T_OPCODE_ADD_I8; + newval |= (rd << 8) | value; + } + else + { + if (value & ~0x7) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("immediate value out of range")); + newval = subtract ? T_OPCODE_SUB_I3 : T_OPCODE_ADD_I3; + newval |= rd | (rs << 3) | (value << 6); + } + } + md_number_to_chars (buf, newval, THUMB_SIZE); + break; -static void -do_mav_triple_5c (char * str) -{ - do_mav_triple (str, MAV_MODE5, REG_TYPE_RN, REG_TYPE_MVFX, REG_TYPE_MVFX); -} + case BFD_RELOC_ARM_THUMB_IMM: + newval = md_chars_to_number (buf, THUMB_SIZE); + if (value < 0 || value > 255) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid immediate: %ld is too large"), + (long) value); + newval |= value; + md_number_to_chars (buf, newval, THUMB_SIZE); + break; -static void -do_mav_triple_5d (char * str) -{ - do_mav_triple (str, MAV_MODE5, REG_TYPE_RN, REG_TYPE_MVDX, REG_TYPE_MVDX); -} + case BFD_RELOC_ARM_THUMB_SHIFT: + /* 5bit shift value (0..32). LSL cannot take 32. */ + newval = md_chars_to_number (buf, THUMB_SIZE) & 0xf83f; + temp = newval & 0xf800; + if (value < 0 || value > 32 || (value == 32 && temp == T_OPCODE_LSL_I)) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid shift value: %ld"), (long) value); + /* Shifts of zero must be encoded as LSL. */ + if (value == 0) + newval = (newval & 0x003f) | T_OPCODE_LSL_I; + /* Shifts of 32 are encoded as zero. */ + else if (value == 32) + value = 0; + newval |= value << 6; + md_number_to_chars (buf, newval, THUMB_SIZE); + break; -static void -do_mav_triple_5e (char * str) -{ - do_mav_triple (str, MAV_MODE5, REG_TYPE_MVF, REG_TYPE_MVF, REG_TYPE_MVF); -} + case BFD_RELOC_VTABLE_INHERIT: + case BFD_RELOC_VTABLE_ENTRY: + fixP->fx_done = 0; + return; -static void -do_mav_triple_5f (char * str) -{ - do_mav_triple (str, MAV_MODE5, REG_TYPE_MVD, REG_TYPE_MVD, REG_TYPE_MVD); + case BFD_RELOC_UNUSED: + default: + as_bad_where (fixP->fx_file, fixP->fx_line, + _("bad relocation fixup type (%d)"), fixP->fx_r_type); + } } -static void -do_mav_triple_5g (char * str) -{ - do_mav_triple (str, MAV_MODE5, REG_TYPE_MVFX, REG_TYPE_MVFX, REG_TYPE_MVFX); -} +/* Translate internal representation of relocation info to BFD target + format. */ -static void -do_mav_triple_5h (char * str) +arelent * +tc_gen_reloc (asection * section ATTRIBUTE_UNUSED, + fixS * fixp) { - do_mav_triple (str, MAV_MODE5, REG_TYPE_MVDX, REG_TYPE_MVDX, REG_TYPE_MVDX); -} - -/* Isnsn like "foo W,X,Y,Z". - where W=MVAX[0:3] and X,Y,Z=MVFX[0:15]. */ + arelent * reloc; + bfd_reloc_code_real_type code; -static void -do_mav_quad (char * str, - int mode, - enum arm_reg_type reg0, - enum arm_reg_type reg1, - enum arm_reg_type reg2, - enum arm_reg_type reg3) -{ - int shift0, shift1, shift2, shift3; - - shift0= mode & 0xff; - shift1 = (mode >> 8) & 0xff; - shift2 = (mode >> 16) & 0xff; - shift3 = (mode >> 24) & 0xff; + reloc = xmalloc (sizeof (arelent)); - skip_whitespace (str); + reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *)); + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); + reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; - if (mav_reg_required_here (&str, shift0, reg0) == FAIL - || skip_past_comma (&str) == FAIL - || mav_reg_required_here (&str, shift1, reg1) == FAIL - || skip_past_comma (&str) == FAIL - || mav_reg_required_here (&str, shift2, reg2) == FAIL - || skip_past_comma (&str) == FAIL - || mav_reg_required_here (&str, shift3, reg3) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - } + /* @@ Why fx_addnumber sometimes and fx_offset other times? */ +#ifndef OBJ_ELF + if (fixp->fx_pcrel == 0) + reloc->addend = fixp->fx_offset; else - end_of_line (str); -} - -static void -do_mav_quad_6a (char * str) -{ - do_mav_quad (str, MAV_MODE6, REG_TYPE_MVAX, REG_TYPE_MVFX, REG_TYPE_MVFX, - REG_TYPE_MVFX); -} - -static void -do_mav_quad_6b (char * str) -{ - do_mav_quad (str, MAV_MODE6, REG_TYPE_MVAX, REG_TYPE_MVAX, REG_TYPE_MVFX, - REG_TYPE_MVFX); -} - -/* cfmvsc32 DSPSC,MVDX[15:0]. */ -static void -do_mav_dspsc_1 (char * str) -{ - skip_whitespace (str); + reloc->addend = fixp->fx_offset = reloc->address; +#else /* OBJ_ELF */ + reloc->addend = fixp->fx_offset; +#endif - /* cfmvsc32. */ - if (mav_reg_required_here (&str, -1, REG_TYPE_DSPSC) == FAIL - || skip_past_comma (&str) == FAIL - || mav_reg_required_here (&str, 12, REG_TYPE_MVDX) == FAIL) + switch (fixp->fx_r_type) { - if (!inst.error) - inst.error = BAD_ARGS; - - return; - } - - end_of_line (str); -} + case BFD_RELOC_8: + if (fixp->fx_pcrel) + { + code = BFD_RELOC_8_PCREL; + break; + } -/* cfmv32sc MVDX[15:0],DSPSC. */ -static void -do_mav_dspsc_2 (char * str) -{ - skip_whitespace (str); + case BFD_RELOC_16: + if (fixp->fx_pcrel) + { + code = BFD_RELOC_16_PCREL; + break; + } - /* cfmv32sc. */ - if (mav_reg_required_here (&str, 12, REG_TYPE_MVDX) == FAIL - || skip_past_comma (&str) == FAIL - || mav_reg_required_here (&str, -1, REG_TYPE_DSPSC) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; + case BFD_RELOC_32: + if (fixp->fx_pcrel) + { + code = BFD_RELOC_32_PCREL; + break; + } - return; - } + case BFD_RELOC_NONE: + case BFD_RELOC_ARM_PCREL_BRANCH: + case BFD_RELOC_ARM_PCREL_BLX: + case BFD_RELOC_RVA: + case BFD_RELOC_THUMB_PCREL_BRANCH7: + case BFD_RELOC_THUMB_PCREL_BRANCH9: + case BFD_RELOC_THUMB_PCREL_BRANCH12: + case BFD_RELOC_THUMB_PCREL_BRANCH20: + case BFD_RELOC_THUMB_PCREL_BRANCH23: + case BFD_RELOC_THUMB_PCREL_BRANCH25: + case BFD_RELOC_THUMB_PCREL_BLX: + case BFD_RELOC_VTABLE_ENTRY: + case BFD_RELOC_VTABLE_INHERIT: + code = fixp->fx_r_type; + break; - end_of_line (str); -} + case BFD_RELOC_ARM_LITERAL: + case BFD_RELOC_ARM_HWLITERAL: + /* If this is called then the a literal has + been referenced across a section boundary. */ + as_bad_where (fixp->fx_file, fixp->fx_line, + _("literal referenced across section boundary")); + return NULL; -/* Maverick shift immediate instructions. - cfsh32 MVFX[15:0],MVFX[15:0],Shift[6:0]. - cfsh64 MVDX[15:0],MVDX[15:0],Shift[6:0]. */ +#ifdef OBJ_ELF + case BFD_RELOC_ARM_GOT32: + case BFD_RELOC_ARM_GOTOFF: + case BFD_RELOC_ARM_PLT32: + case BFD_RELOC_ARM_TARGET1: + case BFD_RELOC_ARM_ROSEGREL32: + case BFD_RELOC_ARM_SBREL32: + case BFD_RELOC_ARM_PREL31: + case BFD_RELOC_ARM_TARGET2: + case BFD_RELOC_ARM_TLS_LE32: + case BFD_RELOC_ARM_TLS_LDO32: + code = fixp->fx_r_type; + break; -static void -do_mav_shift (char * str, - enum arm_reg_type reg0, - enum arm_reg_type reg1) -{ - int error; - int imm, neg = 0; + case BFD_RELOC_ARM_TLS_GD32: + case BFD_RELOC_ARM_TLS_IE32: + case BFD_RELOC_ARM_TLS_LDM32: + /* BFD will include the symbol's address in the addend. + But we don't want that, so subtract it out again here. */ + if (!S_IS_COMMON (fixp->fx_addsy)) + reloc->addend -= (*reloc->sym_ptr_ptr)->value; + code = fixp->fx_r_type; + break; +#endif - skip_whitespace (str); + case BFD_RELOC_ARM_IMMEDIATE: + as_bad_where (fixp->fx_file, fixp->fx_line, + _("internal relocation (type: IMMEDIATE) not fixed up")); + return NULL; - error = 0; + case BFD_RELOC_ARM_ADRL_IMMEDIATE: + as_bad_where (fixp->fx_file, fixp->fx_line, + _("ADRL used for a symbol not defined in the same file")); + return NULL; - if (mav_reg_required_here (&str, 12, reg0) == FAIL - || skip_past_comma (&str) == FAIL - || mav_reg_required_here (&str, 16, reg1) == FAIL - || skip_past_comma (&str) == FAIL) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } + case BFD_RELOC_ARM_OFFSET_IMM: + if (fixp->fx_addsy != NULL + && !S_IS_DEFINED (fixp->fx_addsy) + && S_IS_LOCAL (fixp->fx_addsy)) + { + as_bad_where (fixp->fx_file, fixp->fx_line, + _("undefined local label `%s'"), + S_GET_NAME (fixp->fx_addsy)); + return NULL; + } - /* Calculate the immediate operand. - The operand is a 7bit signed number. */ - skip_whitespace (str); + as_bad_where (fixp->fx_file, fixp->fx_line, + _("internal_relocation (type: OFFSET_IMM) not fixed up")); + return NULL; - if (*str == '#') - ++str; + default: + { + char * type; - if (!ISDIGIT (*str) && *str != '-') - { - inst.error = _("expecting immediate, 7bit operand"); - return; + switch (fixp->fx_r_type) + { + case BFD_RELOC_NONE: type = "NONE"; break; + case BFD_RELOC_ARM_OFFSET_IMM8: type = "OFFSET_IMM8"; break; + case BFD_RELOC_ARM_SHIFT_IMM: type = "SHIFT_IMM"; break; + case BFD_RELOC_ARM_SMI: type = "SMI"; break; + case BFD_RELOC_ARM_SWI: type = "SWI"; break; + case BFD_RELOC_ARM_MULTI: type = "MULTI"; break; + case BFD_RELOC_ARM_CP_OFF_IMM: type = "CP_OFF_IMM"; break; + case BFD_RELOC_ARM_THUMB_ADD: type = "THUMB_ADD"; break; + case BFD_RELOC_ARM_THUMB_SHIFT: type = "THUMB_SHIFT"; break; + case BFD_RELOC_ARM_THUMB_IMM: type = "THUMB_IMM"; break; + case BFD_RELOC_ARM_THUMB_OFFSET: type = "THUMB_OFFSET"; break; + default: type = _(""); break; + } + as_bad_where (fixp->fx_file, fixp->fx_line, + _("cannot represent %s relocation in this object file format"), + type); + return NULL; + } } - if (*str == '-') +#ifdef OBJ_ELF + if ((code == BFD_RELOC_32_PCREL || code == BFD_RELOC_32) + && GOT_symbol + && fixp->fx_addsy == GOT_symbol) { - neg = 1; - ++str; + code = BFD_RELOC_ARM_GOTPC; + reloc->addend = fixp->fx_offset = reloc->address; } +#endif - for (imm = 0; *str && ISDIGIT (*str); ++str) - imm = imm * 10 + *str - '0'; + reloc->howto = bfd_reloc_type_lookup (stdoutput, code); - if (imm > 64) + if (reloc->howto == NULL) { - inst.error = _("immediate out of range"); - return; + as_bad_where (fixp->fx_file, fixp->fx_line, + _("cannot represent %s relocation in this object file format"), + bfd_get_reloc_code_name (code)); + return NULL; } - /* Make negative imm's into 7bit signed numbers. */ - if (neg) - { - imm = -imm; - imm &= 0x0000007f; - } + /* HACK: Since arm ELF uses Rel instead of Rela, encode the + vtable entry to be used in the relocation's section offset. */ + if (fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY) + reloc->address = fixp->fx_offset; - /* Bits 0-3 of the insn should have bits 0-3 of the immediate. - Bits 5-7 of the insn should have bits 4-6 of the immediate. - Bit 4 should be 0. */ - imm = (imm & 0xf) | ((imm & 0x70) << 1); - - inst.instruction |= imm; - end_of_line (str); -} - -static void -do_mav_shift_1 (char * str) -{ - do_mav_shift (str, REG_TYPE_MVFX, REG_TYPE_MVFX); + return reloc; } -static void -do_mav_shift_2 (char * str) -{ - do_mav_shift (str, REG_TYPE_MVDX, REG_TYPE_MVDX); -} +/* This fix_new is called by cons via TC_CONS_FIX_NEW. */ -static int -mav_parse_offset (char ** str, int * negative) +void +cons_fix_new_arm (fragS * frag, + int where, + int size, + expressionS * exp) { - char * p = *str; - int offset; - - *negative = 0; - - skip_whitespace (p); - - if (*p == '#') - ++p; - - if (*p == '-') - { - *negative = 1; - ++p; - } + bfd_reloc_code_real_type type; + int pcrel = 0; - if (!ISDIGIT (*p)) + /* Pick a reloc. + FIXME: @@ Should look at CPU word size. */ + switch (size) { - inst.error = _("offset expected"); - return 0; + case 1: + type = BFD_RELOC_8; + break; + case 2: + type = BFD_RELOC_16; + break; + case 4: + default: + type = BFD_RELOC_32; + break; + case 8: + type = BFD_RELOC_64; + break; } - for (offset = 0; *p && ISDIGIT (*p); ++p) - offset = offset * 10 + *p - '0'; + fix_new_exp (frag, where, (int) size, exp, pcrel, type); +} - if (offset > 0x3fc) - { - inst.error = _("offset out of range"); - return 0; - } - if (offset & 0x3) +#if defined OBJ_COFF || defined OBJ_ELF +void +arm_validate_fix (fixS * fixP) +{ + /* If the destination of the branch is a defined symbol which does not have + the THUMB_FUNC attribute, then we must be calling a function which has + the (interfacearm) attribute. We look for the Thumb entry point to that + function and change the branch to refer to that function instead. */ + if (fixP->fx_r_type == BFD_RELOC_THUMB_PCREL_BRANCH23 + && fixP->fx_addsy != NULL + && S_IS_DEFINED (fixP->fx_addsy) + && ! THUMB_IS_FUNC (fixP->fx_addsy)) { - inst.error = _("offset not a multiple of 4"); - return 0; + fixP->fx_addsy = find_real_start (fixP->fx_addsy); } - - *str = p; - - return *negative ? -offset : offset; } +#endif -/* Maverick load/store instructions. - CRd,[Rn,]{!}. - CRd,[Rn],. */ - -static void -do_mav_ldst (char * str, enum arm_reg_type reg0) +int +arm_force_relocation (struct fix * fixp) { - int offset, negative; - - skip_whitespace (str); +#if defined (OBJ_COFF) && defined (TE_PE) + if (fixp->fx_r_type == BFD_RELOC_RVA) + return 1; +#endif - if (mav_reg_required_here (&str, 12, reg0) == FAIL - || skip_past_comma (&str) == FAIL - || *str++ != '[' - || reg_required_here (&str, 16) == FAIL) - goto fail_ldst; + /* Resolve these relocations even if the symbol is extern or weak. */ + if (fixp->fx_r_type == BFD_RELOC_ARM_IMMEDIATE + || fixp->fx_r_type == BFD_RELOC_ARM_OFFSET_IMM + || fixp->fx_r_type == BFD_RELOC_ARM_ADRL_IMMEDIATE) + return 0; - if (skip_past_comma (&str) == SUCCESS) - { - /* You are here: "]{!}". */ - inst.instruction |= PRE_INDEX; + return generic_force_reloc (fixp); +} - offset = mav_parse_offset (&str, &negative); +#ifdef OBJ_COFF +/* This is a little hack to help the gas/arm/adrl.s test. It prevents + local labels from being added to the output symbol table when they + are used with the ADRL pseudo op. The ADRL relocation should always + be resolved before the binbary is emitted, so it is safe to say that + it is adjustable. */ - if (inst.error) - return; +bfd_boolean +arm_fix_adjustable (fixS * fixP) +{ + if (fixP->fx_r_type == BFD_RELOC_ARM_ADRL_IMMEDIATE) + return 1; + return 0; +} +#endif - if (*str++ != ']') - { - inst.error = _("missing ]"); - return; - } +#ifdef OBJ_ELF +/* Relocations against Thumb function names must be left unadjusted, + so that the linker can use this information to correctly set the + bottom bit of their addresses. The MIPS version of this function + also prevents relocations that are mips-16 specific, but I do not + know why it does this. - if (*str == '!') - { - inst.instruction |= WRITE_BACK; - ++str; - } - } - else - { - /* You are here: "], ". */ - if (*str++ != ']') - { - inst.error = _("missing ]"); - return; - } + FIXME: + There is one other problem that ought to be addressed here, but + which currently is not: Taking the address of a label (rather + than a function) and then later jumping to that address. Such + addresses also ought to have their bottom bit set (assuming that + they reside in Thumb code), but at the moment they will not. */ - if (skip_past_comma (&str) == FAIL - || (offset = mav_parse_offset (&str, &negative), inst.error)) - goto fail_ldst; +bfd_boolean +arm_fix_adjustable (fixS * fixP) +{ + if (fixP->fx_addsy == NULL) + return 1; - inst.instruction |= CP_T_WB; /* Post indexed, set bit W. */ - } + if (THUMB_IS_FUNC (fixP->fx_addsy) + && fixP->fx_subsy == NULL) + return 0; - if (negative) - offset = -offset; - else - inst.instruction |= CP_T_UD; /* Positive, so set bit U. */ + /* 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) + return 0; - inst.instruction |= offset >> 2; - end_of_line (str); - return; + /* Don't allow symbols to be discarded on GOT related relocs. */ + if (fixP->fx_r_type == BFD_RELOC_ARM_PLT32 + || fixP->fx_r_type == BFD_RELOC_ARM_GOT32 + || fixP->fx_r_type == BFD_RELOC_ARM_GOTOFF + || fixP->fx_r_type == BFD_RELOC_ARM_TLS_GD32 + || fixP->fx_r_type == BFD_RELOC_ARM_TLS_LE32 + || fixP->fx_r_type == BFD_RELOC_ARM_TLS_IE32 + || fixP->fx_r_type == BFD_RELOC_ARM_TLS_LDM32 + || fixP->fx_r_type == BFD_RELOC_ARM_TLS_LDO32 + || fixP->fx_r_type == BFD_RELOC_ARM_TARGET2) + return 0; -fail_ldst: - if (!inst.error) - inst.error = BAD_ARGS; + return 1; } -static void -do_mav_ldst_1 (char * str) +const char * +elf32_arm_target_format (void) { - do_mav_ldst (str, REG_TYPE_MVF); +#ifdef TE_SYMBIAN + return (target_big_endian + ? "elf32-bigarm-symbian" + : "elf32-littlearm-symbian"); +#elif defined (TE_VXWORKS) + return (target_big_endian + ? "elf32-bigarm-vxworks" + : "elf32-littlearm-vxworks"); +#else + if (target_big_endian) + return "elf32-bigarm"; + else + return "elf32-littlearm"; +#endif } -static void -do_mav_ldst_2 (char * str) +void +armelf_frob_symbol (symbolS * symp, + int * puntp) { - do_mav_ldst (str, REG_TYPE_MVD); + elf_frob_symbol (symp, puntp); } +#endif -static void -do_mav_ldst_3 (char * str) -{ - do_mav_ldst (str, REG_TYPE_MVFX); -} +/* MD interface: Finalization. */ -static void -do_mav_ldst_4 (char * str) -{ - do_mav_ldst (str, REG_TYPE_MVDX); -} +/* A good place to do this, although this was probably not intended + for this kind of use. We need to dump the literal pool before + references are made to a null symbol pointer. */ -static void -do_t_nop (char * str) +void +arm_cleanup (void) { - /* Do nothing. */ - end_of_line (str); + literal_pool * pool; + + for (pool = list_of_pools; pool; pool = pool->next) + { + /* Put it at the end of the relevent section. */ + subseg_set (pool->section, pool->sub_section); +#ifdef OBJ_ELF + arm_elf_change_section (); +#endif + s_ltorg (0); + } } -/* Handle the Format 4 instructions that do not have equivalents in other - formats. That is, ADC, AND, EOR, SBC, ROR, TST, NEG, CMN, ORR, MUL, - BIC and MVN. */ +/* Adjust the symbol table. This marks Thumb symbols as distinct from + ARM ones. */ -static void -do_t_arit (char * str) +void +arm_adjust_symtab (void) { - int Rd, Rs, Rn; - - skip_whitespace (str); - - if ((Rd = thumb_reg (&str, THUMB_REG_LO)) == FAIL - || skip_past_comma (&str) == FAIL - || (Rs = thumb_reg (&str, THUMB_REG_LO)) == FAIL) - { - inst.error = BAD_ARGS; - return; - } +#ifdef OBJ_COFF + symbolS * sym; - if (skip_past_comma (&str) != FAIL) + for (sym = symbol_rootP; sym != NULL; sym = symbol_next (sym)) { - /* Three operand format not allowed for TST, CMN, NEG and MVN. - (It isn't allowed for CMP either, but that isn't handled by this - function.) */ - if (inst.instruction == T_OPCODE_TST - || inst.instruction == T_OPCODE_CMN - || inst.instruction == T_OPCODE_NEG - || inst.instruction == T_OPCODE_MVN) + if (ARM_IS_THUMB (sym)) { - inst.error = BAD_ARGS; - return; - } - - if ((Rn = thumb_reg (&str, THUMB_REG_LO)) == FAIL) - return; + if (THUMB_IS_FUNC (sym)) + { + /* Mark the symbol as a Thumb function. */ + if ( S_GET_STORAGE_CLASS (sym) == C_STAT + || S_GET_STORAGE_CLASS (sym) == C_LABEL) /* This can happen! */ + S_SET_STORAGE_CLASS (sym, C_THUMBSTATFUNC); - if (Rs != Rd) - { - inst.error = _("dest and source1 must be the same register"); - return; + else if (S_GET_STORAGE_CLASS (sym) == C_EXT) + S_SET_STORAGE_CLASS (sym, C_THUMBEXTFUNC); + else + as_bad (_("%s: unexpected function type: %d"), + S_GET_NAME (sym), S_GET_STORAGE_CLASS (sym)); + } + else switch (S_GET_STORAGE_CLASS (sym)) + { + case C_EXT: + S_SET_STORAGE_CLASS (sym, C_THUMBEXT); + break; + case C_STAT: + S_SET_STORAGE_CLASS (sym, C_THUMBSTAT); + break; + case C_LABEL: + S_SET_STORAGE_CLASS (sym, C_THUMBLABEL); + break; + default: + /* Do nothing. */ + break; + } } - Rs = Rn; - } - if (inst.instruction == T_OPCODE_MUL - && Rs == Rd) - as_tsktsk (_("Rs and Rd must be different in MUL")); + if (ARM_IS_INTERWORK (sym)) + coffsymbol (symbol_get_bfdsym (sym))->native->u.syment.n_flags = 0xFF; + } +#endif +#ifdef OBJ_ELF + symbolS * sym; + char bind; - inst.instruction |= Rd | (Rs << 3); - end_of_line (str); -} + for (sym = symbol_rootP; sym != NULL; sym = symbol_next (sym)) + { + if (ARM_IS_THUMB (sym)) + { + elf_symbol_type * elf_sym; -static void -do_t_add (char * str) -{ - thumb_add_sub (str, 0); -} + elf_sym = elf_symbol (symbol_get_bfdsym (sym)); + bind = ELF_ST_BIND (elf_sym->internal_elf_sym.st_info); -static void -do_t_asr (char * str) -{ - thumb_shift (str, THUMB_ASR); + if (! bfd_is_arm_mapping_symbol_name (elf_sym->symbol.name)) + { + /* 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); + else + elf_sym->internal_elf_sym.st_info = + ELF_ST_INFO (bind, STT_ARM_16BIT); + } + } + } +#endif } +/* MD interface: Initialization. */ + static void -do_t_branch9 (char * str) +set_constant_flonums (void) { - if (my_get_expression (&inst.reloc.exp, &str)) - return; - inst.reloc.type = BFD_RELOC_THUMB_PCREL_BRANCH9; - inst.reloc.pc_rel = 1; - end_of_line (str); + int i; + + for (i = 0; i < NUM_FLOAT_VALS; i++) + if (atof_ieee ((char *) fp_const[i], 'x', fp_values[i]) == NULL) + abort (); } -static void -do_t_branch12 (char * str) +void +md_begin (void) { - if (my_get_expression (&inst.reloc.exp, &str)) - return; - inst.reloc.type = BFD_RELOC_THUMB_PCREL_BRANCH12; - inst.reloc.pc_rel = 1; - end_of_line (str); -} + unsigned mach; + unsigned int i; -/* Find the real, Thumb encoded start of a Thumb function. */ + if ( (arm_ops_hsh = hash_new ()) == NULL + || (arm_cond_hsh = hash_new ()) == NULL + || (arm_shift_hsh = hash_new ()) == NULL + || (arm_psr_hsh = hash_new ()) == NULL + || (arm_reg_hsh = hash_new ()) == NULL + || (arm_reloc_hsh = hash_new ()) == NULL) + as_fatal (_("virtual memory exhausted")); -static symbolS * -find_real_start (symbolS * symbolP) -{ - char * real_start; - const char * name = S_GET_NAME (symbolP); - symbolS * new_target; + for (i = 0; i < sizeof (insns) / sizeof (struct asm_opcode); i++) + hash_insert (arm_ops_hsh, insns[i].template, (PTR) (insns + i)); + for (i = 0; i < sizeof (conds) / sizeof (struct asm_cond); i++) + hash_insert (arm_cond_hsh, conds[i].template, (PTR) (conds + i)); + for (i = 0; i < sizeof (shift_names) / sizeof (struct asm_shift_name); i++) + hash_insert (arm_shift_hsh, shift_names[i].name, (PTR) (shift_names + i)); + for (i = 0; i < sizeof (psrs) / sizeof (struct asm_psr); i++) + hash_insert (arm_psr_hsh, psrs[i].template, (PTR) (psrs + i)); + for (i = 0; i < sizeof (reg_names) / sizeof (struct reg_entry); i++) + hash_insert (arm_reg_hsh, reg_names[i].name, (PTR) (reg_names + i)); +#ifdef OBJ_ELF + for (i = 0; i < sizeof (reloc_names) / sizeof (struct reloc_entry); i++) + hash_insert (arm_reloc_hsh, reloc_names[i].name, (PTR) (reloc_names + i)); +#endif - /* This definition must agree with the one in gcc/config/arm/thumb.c. */ -#define STUB_NAME ".real_start_of" + set_constant_flonums (); - if (name == NULL) - abort (); + /* Set the cpu variant based on the command-line options. We prefer + -mcpu= over -march= if both are set (as for GCC); and we prefer + -mfpu= over any other way of setting the floating point unit. + Use of legacy options with new options are faulted. */ + if (legacy_cpu != -1) + { + if (mcpu_cpu_opt != -1 || march_cpu_opt != -1) + as_bad (_("use of old and new-style options to set CPU type")); - /* Names that start with '.' are local labels, not function entry points. - The compiler may generate BL instructions to these labels because it - needs to perform a branch to a far away location. */ - if (name[0] == '.') - return symbolP; + mcpu_cpu_opt = legacy_cpu; + } + else if (mcpu_cpu_opt == -1) + mcpu_cpu_opt = march_cpu_opt; - real_start = malloc (strlen (name) + strlen (STUB_NAME) + 1); - sprintf (real_start, "%s%s", STUB_NAME, name); + if (legacy_fpu != -1) + { + if (mfpu_opt != -1) + as_bad (_("use of old and new-style options to set FPU type")); - new_target = symbol_find (real_start); + mfpu_opt = legacy_fpu; + } + else if (mfpu_opt == -1) + { +#if !(defined (TE_LINUX) || defined (TE_NetBSD) || defined (TE_VXWORKS)) + /* Some environments specify a default FPU. If they don't, infer it + from the processor. */ + if (mcpu_fpu_opt != -1) + mfpu_opt = mcpu_fpu_opt; + else + mfpu_opt = march_fpu_opt; +#else + mfpu_opt = FPU_DEFAULT; +#endif + } - if (new_target == NULL) + if (mfpu_opt == -1) { - as_warn ("Failed to find real start of function: %s\n", name); - new_target = symbolP; + if (mcpu_cpu_opt == -1) + mfpu_opt = FPU_DEFAULT; + else if (mcpu_cpu_opt & ARM_EXT_V5) + mfpu_opt = FPU_ARCH_VFP_V2; + else + mfpu_opt = FPU_ARCH_FPA; } - free (real_start); + if (mcpu_cpu_opt == -1) + mcpu_cpu_opt = CPU_DEFAULT; - return new_target; -} + cpu_variant = mcpu_cpu_opt | mfpu_opt; -static void -do_t_branch23 (char * str) -{ - if (my_get_expression (& inst.reloc.exp, & str)) - return; +#if defined OBJ_COFF || defined OBJ_ELF + { + unsigned int flags = 0; - inst.reloc.type = BFD_RELOC_THUMB_PCREL_BRANCH23; - inst.reloc.pc_rel = 1; - end_of_line (str); +#if defined OBJ_ELF + flags = meabi_flags; - /* If the destination of the branch is a defined symbol which does not have - the THUMB_FUNC attribute, then we must be calling a function which has - the (interfacearm) attribute. We look for the Thumb entry point to that - function and change the branch to refer to that function instead. */ - if ( inst.reloc.exp.X_op == O_symbol - && inst.reloc.exp.X_add_symbol != NULL - && S_IS_DEFINED (inst.reloc.exp.X_add_symbol) - && ! THUMB_IS_FUNC (inst.reloc.exp.X_add_symbol)) - inst.reloc.exp.X_add_symbol = - find_real_start (inst.reloc.exp.X_add_symbol); -} + switch (meabi_flags) + { + case EF_ARM_EABI_UNKNOWN: +#endif + /* 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; + if (pic_code) flags |= F_PIC; + if ((cpu_variant & FPU_ANY) == FPU_NONE + || (cpu_variant & FPU_ANY) == FPU_ARCH_VFP) /* VFP layout only. */ + flags |= F_SOFT_FLOAT; -static void -do_t_bx (char * str) -{ - int reg; + switch (mfloat_abi_opt) + { + case ARM_FLOAT_ABI_SOFT: + case ARM_FLOAT_ABI_SOFTFP: + flags |= F_SOFT_FLOAT; + break; - skip_whitespace (str); + case ARM_FLOAT_ABI_HARD: + if (flags & F_SOFT_FLOAT) + as_bad (_("hard-float conflicts with specified fpu")); + break; + } - if ((reg = thumb_reg (&str, THUMB_REG_ANY)) == FAIL) - return; + /* Using VFP conventions (even if soft-float). */ + if (cpu_variant & FPU_VFP_EXT_NONE) + flags |= F_VFP_FLOAT; - /* This sets THUMB_H2 from the top bit of reg. */ - inst.instruction |= reg << 3; +#if defined OBJ_ELF + if (cpu_variant & FPU_ARCH_MAVERICK) + flags |= EF_ARM_MAVERICK_FLOAT; + break; - /* ??? FIXME: Should add a hacky reloc here if reg is REG_PC. The reloc - should cause the alignment to be checked once it is known. This is - because BX PC only works if the instruction is word aligned. */ + case EF_ARM_EABI_VER4: + /* No additional flags to set. */ + break; - end_of_line (str); -} + default: + abort (); + } +#endif + bfd_set_private_flags (stdoutput, flags); -static void -do_t_compare (char * str) -{ - thumb_mov_compare (str, THUMB_COMPARE); -} + /* We have run out flags in the COFF header to encode the + status of ATPCS support, so instead we create a dummy, + empty, debug section called .arm.atpcs. */ + if (atpcs) + { + asection * sec; -static void -do_t_ldmstm (char * str) -{ - int Rb; - long range; + sec = bfd_make_section (stdoutput, ".arm.atpcs"); - skip_whitespace (str); + if (sec != NULL) + { + bfd_set_section_flags + (stdoutput, sec, SEC_READONLY | SEC_DEBUGGING /* | SEC_HAS_CONTENTS */); + bfd_set_section_size (stdoutput, sec, 0); + bfd_set_section_contents (stdoutput, sec, NULL, 0, 0); + } + } + } +#endif - if ((Rb = thumb_reg (&str, THUMB_REG_LO)) == FAIL) - return; + /* Record the CPU type as well. */ + switch (cpu_variant & ARM_CPU_MASK) + { + case ARM_2: + mach = bfd_mach_arm_2; + break; - if (*str != '!') - as_warn (_("inserted missing '!': load/store multiple always writes back base register")); - else - str++; + case ARM_3: /* Also ARM_250. */ + mach = bfd_mach_arm_2a; + break; - if (skip_past_comma (&str) == FAIL - || (range = reg_list (&str)) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; + case ARM_6: /* Also ARM_7. */ + mach = bfd_mach_arm_3; + break; + + default: + mach = bfd_mach_arm_unknown; + break; } - if (inst.reloc.type != BFD_RELOC_UNUSED) + /* Catch special cases. */ + if (cpu_variant & ARM_CEXT_IWMMXT) + mach = bfd_mach_arm_iWMMXt; + else if (cpu_variant & ARM_CEXT_XSCALE) + mach = bfd_mach_arm_XScale; + else if (cpu_variant & ARM_CEXT_MAVERICK) + mach = bfd_mach_arm_ep9312; + else if (cpu_variant & ARM_EXT_V5E) + mach = bfd_mach_arm_5TE; + else if (cpu_variant & ARM_EXT_V5) { - /* This really doesn't seem worth it. */ - inst.reloc.type = BFD_RELOC_UNUSED; - inst.error = _("expression too complex"); - return; + if (cpu_variant & ARM_EXT_V4T) + mach = bfd_mach_arm_5T; + else + mach = bfd_mach_arm_5; } - - if (range & ~0xff) + else if (cpu_variant & ARM_EXT_V4) { - inst.error = _("only lo-regs valid in load/store multiple"); - return; + if (cpu_variant & ARM_EXT_V4T) + mach = bfd_mach_arm_4T; + else + mach = bfd_mach_arm_4; } + else if (cpu_variant & ARM_EXT_V3M) + mach = bfd_mach_arm_3M; - inst.instruction |= (Rb << 8) | range; - end_of_line (str); -} - -static void -do_t_ldr (char * str) -{ - thumb_load_store (str, THUMB_LOAD, THUMB_WORD); + bfd_set_arch_mach (stdoutput, TARGET_ARCH, mach); } -static void -do_t_ldrb (char * str) -{ - thumb_load_store (str, THUMB_LOAD, THUMB_BYTE); -} +/* Command line processing. */ -static void -do_t_ldrh (char * str) -{ - thumb_load_store (str, THUMB_LOAD, THUMB_HALFWORD); -} +/* md_parse_option + Invocation line includes a switch not recognized by the base assembler. + See if it's a processor-specific option. -static void -do_t_lds (char * str) -{ - int Rd, Rb, Ro; + This routine is somewhat complicated by the need for backwards + compatibility (since older releases of gcc can't be changed). + The new options try to make the interface as compatible as + possible with GCC. - skip_whitespace (str); + New options (supported) are: - if ((Rd = thumb_reg (&str, THUMB_REG_LO)) == FAIL - || skip_past_comma (&str) == FAIL - || *str++ != '[' - || (Rb = thumb_reg (&str, THUMB_REG_LO)) == FAIL - || skip_past_comma (&str) == FAIL - || (Ro = thumb_reg (&str, THUMB_REG_LO)) == FAIL - || *str++ != ']') - { - if (! inst.error) - inst.error = _("syntax: ldrs[b] Rd, [Rb, Ro]"); - return; - } - - inst.instruction |= Rd | (Rb << 3) | (Ro << 6); - end_of_line (str); -} - -static void -do_t_lsl (char * str) -{ - thumb_shift (str, THUMB_LSL); -} - -static void -do_t_lsr (char * str) -{ - thumb_shift (str, THUMB_LSR); -} - -static void -do_t_mov (char * str) -{ - thumb_mov_compare (str, THUMB_MOVE); -} - -static void -do_t_push_pop (char * str) -{ - long range; - - skip_whitespace (str); - - if ((range = reg_list (&str)) == FAIL) - { - if (! inst.error) - inst.error = BAD_ARGS; - return; - } + -mcpu= Assemble for selected processor + -march= Assemble for selected architecture + -mfpu= Assemble for selected FPU. + -EB/-mbig-endian Big-endian + -EL/-mlittle-endian Little-endian + -k Generate PIC code + -mthumb Start in Thumb mode + -mthumb-interwork Code supports ARM/Thumb interworking - if (inst.reloc.type != BFD_RELOC_UNUSED) - { - /* This really doesn't seem worth it. */ - inst.reloc.type = BFD_RELOC_UNUSED; - inst.error = _("expression too complex"); - return; - } + For now we will also provide support for: - if (range & ~0xff) - { - if ((inst.instruction == T_OPCODE_PUSH - && (range & ~0xff) == 1 << REG_LR) - || (inst.instruction == T_OPCODE_POP - && (range & ~0xff) == 1 << REG_PC)) - { - inst.instruction |= THUMB_PP_PC_LR; - range &= 0xff; - } - else - { - inst.error = _("invalid register list to push/pop instruction"); - return; - } - } + -mapcs-32 32-bit Program counter + -mapcs-26 26-bit Program counter + -macps-float Floats passed in FP registers + -mapcs-reentrant Reentrant code + -matpcs + (sometime these will probably be replaced with -mapcs= + and -matpcs=) - inst.instruction |= range; - end_of_line (str); -} + The remaining options are only supported for back-wards compatibility. + Cpu variants, the arm part is optional: + -m[arm]1 Currently not supported. + -m[arm]2, -m[arm]250 Arm 2 and Arm 250 processor + -m[arm]3 Arm 3 processor + -m[arm]6[xx], Arm 6 processors + -m[arm]7[xx][t][[d]m] Arm 7 processors + -m[arm]8[10] Arm 8 processors + -m[arm]9[20][tdmi] Arm 9 processors + -mstrongarm[110[0]] StrongARM processors + -mxscale XScale processors + -m[arm]v[2345[t[e]]] Arm architectures + -mall All (except the ARM1) + FP variants: + -mfpa10, -mfpa11 FPA10 and 11 co-processor instructions + -mfpe-old (No float load/store multiples) + -mvfpxd VFP Single precision + -mvfp All VFP + -mno-fpu Disable all floating point instructions -static void -do_t_str (char * str) -{ - thumb_load_store (str, THUMB_STORE, THUMB_WORD); -} + The following CPU names are recognized: + arm1, arm2, arm250, arm3, arm6, arm600, arm610, arm620, + arm7, arm7m, arm7d, arm7dm, arm7di, arm7dmi, arm70, arm700, + arm700i, arm710 arm710t, arm720, arm720t, arm740t, arm710c, + arm7100, arm7500, arm7500fe, arm7tdmi, arm8, arm810, arm9, + arm920, arm920t, arm940t, arm946, arm966, arm9tdmi, arm9e, + arm10t arm10e, arm1020t, arm1020e, arm10200e, + strongarm, strongarm110, strongarm1100, strongarm1110, xscale. -static void -do_t_strb (char * str) -{ - thumb_load_store (str, THUMB_STORE, THUMB_BYTE); -} + */ -static void -do_t_strh (char * str) -{ - thumb_load_store (str, THUMB_STORE, THUMB_HALFWORD); -} +const char * md_shortopts = "m:k"; -static void -do_t_sub (char * str) -{ - thumb_add_sub (str, 1); -} +#ifdef ARM_BI_ENDIAN +#define OPTION_EB (OPTION_MD_BASE + 0) +#define OPTION_EL (OPTION_MD_BASE + 1) +#else +#if TARGET_BYTES_BIG_ENDIAN +#define OPTION_EB (OPTION_MD_BASE + 0) +#else +#define OPTION_EL (OPTION_MD_BASE + 1) +#endif +#endif -static void -do_t_swi (char * str) +struct option md_longopts[] = { - skip_whitespace (str); - - if (my_get_expression (&inst.reloc.exp, &str)) - return; +#ifdef OPTION_EB + {"EB", no_argument, NULL, OPTION_EB}, +#endif +#ifdef OPTION_EL + {"EL", no_argument, NULL, OPTION_EL}, +#endif + {NULL, no_argument, NULL, 0} +}; - inst.reloc.type = BFD_RELOC_ARM_SWI; - end_of_line (str); -} +size_t md_longopts_size = sizeof (md_longopts); -static void -do_t_adr (char * str) +struct arm_option_table { - 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". */ - skip_whitespace (str); - - /* 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)) - { - if (!inst.error) - inst.error = BAD_ARGS; - return; - } - - inst.reloc.type = BFD_RELOC_ARM_THUMB_ADD; - 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. */ - - end_of_line (str); -} + char *option; /* Option name to match. */ + char *help; /* Help information. */ + int *var; /* Variable to change. */ + int value; /* What to change it to. */ + char *deprecated; /* If non-null, print this message. */ +}; -static void -insert_reg (const struct reg_entry * r, - struct hash_control * htab) +struct arm_option_table arm_opts[] = { - int len = strlen (r->name) + 2; - char * buf = xmalloc (len); - char * buf2 = xmalloc (len); - int i = 0; + {"k", N_("generate PIC code"), &pic_code, 1, NULL}, + {"mthumb", N_("assemble Thumb code"), &thumb_mode, 1, NULL}, + {"mthumb-interwork", N_("support ARM/Thumb interworking"), + &support_interwork, 1, NULL}, + {"mapcs-32", N_("code uses 32-bit program counter"), &uses_apcs_26, 0, NULL}, + {"mapcs-26", N_("code uses 26-bit program counter"), &uses_apcs_26, 1, NULL}, + {"mapcs-float", N_("floating point args are in fp regs"), &uses_apcs_float, + 1, NULL}, + {"mapcs-reentrant", N_("re-entrant code"), &pic_code, 1, NULL}, + {"matpcs", N_("code is ATPCS conformant"), &atpcs, 1, NULL}, + {"mbig-endian", N_("assemble for big-endian"), &target_big_endian, 1, NULL}, + {"mlittle-endian", N_("assemble for little-endian"), &target_big_endian, 0, + NULL}, -#ifdef REGISTER_PREFIX - buf[i++] = REGISTER_PREFIX; -#endif + /* These are recognized by the assembler, but have no affect on code. */ + {"mapcs-frame", N_("use frame pointer"), NULL, 0, NULL}, + {"mapcs-stack-check", N_("use stack size checking"), NULL, 0, NULL}, - strcpy (buf + i, r->name); + /* DON'T add any new processors to this list -- we want the whole list + to go away... Add them to the processors table instead. */ + {"marm1", NULL, &legacy_cpu, ARM_ARCH_V1, N_("use -mcpu=arm1")}, + {"m1", NULL, &legacy_cpu, ARM_ARCH_V1, N_("use -mcpu=arm1")}, + {"marm2", NULL, &legacy_cpu, ARM_ARCH_V2, N_("use -mcpu=arm2")}, + {"m2", NULL, &legacy_cpu, ARM_ARCH_V2, N_("use -mcpu=arm2")}, + {"marm250", NULL, &legacy_cpu, ARM_ARCH_V2S, N_("use -mcpu=arm250")}, + {"m250", NULL, &legacy_cpu, ARM_ARCH_V2S, N_("use -mcpu=arm250")}, + {"marm3", NULL, &legacy_cpu, ARM_ARCH_V2S, N_("use -mcpu=arm3")}, + {"m3", NULL, &legacy_cpu, ARM_ARCH_V2S, N_("use -mcpu=arm3")}, + {"marm6", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm6")}, + {"m6", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm6")}, + {"marm600", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm600")}, + {"m600", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm600")}, + {"marm610", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm610")}, + {"m610", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm610")}, + {"marm620", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm620")}, + {"m620", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm620")}, + {"marm7", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7")}, + {"m7", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7")}, + {"marm70", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm70")}, + {"m70", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm70")}, + {"marm700", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm700")}, + {"m700", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm700")}, + {"marm700i", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm700i")}, + {"m700i", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm700i")}, + {"marm710", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm710")}, + {"m710", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm710")}, + {"marm710c", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm710c")}, + {"m710c", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm710c")}, + {"marm720", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm720")}, + {"m720", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm720")}, + {"marm7d", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7d")}, + {"m7d", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7d")}, + {"marm7di", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7di")}, + {"m7di", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7di")}, + {"marm7m", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -mcpu=arm7m")}, + {"m7m", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -mcpu=arm7m")}, + {"marm7dm", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -mcpu=arm7dm")}, + {"m7dm", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -mcpu=arm7dm")}, + {"marm7dmi", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -mcpu=arm7dmi")}, + {"m7dmi", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -mcpu=arm7dmi")}, + {"marm7100", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7100")}, + {"m7100", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7100")}, + {"marm7500", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7500")}, + {"m7500", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7500")}, + {"marm7500fe", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7500fe")}, + {"m7500fe", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7500fe")}, + {"marm7t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm7tdmi")}, + {"m7t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm7tdmi")}, + {"marm7tdmi", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm7tdmi")}, + {"m7tdmi", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm7tdmi")}, + {"marm710t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm710t")}, + {"m710t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm710t")}, + {"marm720t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm720t")}, + {"m720t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm720t")}, + {"marm740t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm740t")}, + {"m740t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm740t")}, + {"marm8", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -mcpu=arm8")}, + {"m8", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -mcpu=arm8")}, + {"marm810", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -mcpu=arm810")}, + {"m810", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -mcpu=arm810")}, + {"marm9", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm9")}, + {"m9", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm9")}, + {"marm9tdmi", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm9tdmi")}, + {"m9tdmi", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm9tdmi")}, + {"marm920", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm920")}, + {"m920", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm920")}, + {"marm940", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm940")}, + {"m940", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm940")}, + {"mstrongarm", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -mcpu=strongarm")}, + {"mstrongarm110", NULL, &legacy_cpu, ARM_ARCH_V4, + N_("use -mcpu=strongarm110")}, + {"mstrongarm1100", NULL, &legacy_cpu, ARM_ARCH_V4, + N_("use -mcpu=strongarm1100")}, + {"mstrongarm1110", NULL, &legacy_cpu, ARM_ARCH_V4, + N_("use -mcpu=strongarm1110")}, + {"mxscale", NULL, &legacy_cpu, ARM_ARCH_XSCALE, N_("use -mcpu=xscale")}, + {"miwmmxt", NULL, &legacy_cpu, ARM_ARCH_IWMMXT, N_("use -mcpu=iwmmxt")}, + {"mall", NULL, &legacy_cpu, ARM_ANY, N_("use -mcpu=all")}, - for (i = 0; buf[i]; i++) - buf2[i] = TOUPPER (buf[i]); + /* Architecture variants -- don't add any more to this list either. */ + {"mv2", NULL, &legacy_cpu, ARM_ARCH_V2, N_("use -march=armv2")}, + {"marmv2", NULL, &legacy_cpu, ARM_ARCH_V2, N_("use -march=armv2")}, + {"mv2a", NULL, &legacy_cpu, ARM_ARCH_V2S, N_("use -march=armv2a")}, + {"marmv2a", NULL, &legacy_cpu, ARM_ARCH_V2S, N_("use -march=armv2a")}, + {"mv3", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -march=armv3")}, + {"marmv3", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -march=armv3")}, + {"mv3m", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -march=armv3m")}, + {"marmv3m", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -march=armv3m")}, + {"mv4", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -march=armv4")}, + {"marmv4", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -march=armv4")}, + {"mv4t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -march=armv4t")}, + {"marmv4t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -march=armv4t")}, + {"mv5", NULL, &legacy_cpu, ARM_ARCH_V5, N_("use -march=armv5")}, + {"marmv5", NULL, &legacy_cpu, ARM_ARCH_V5, N_("use -march=armv5")}, + {"mv5t", NULL, &legacy_cpu, ARM_ARCH_V5T, N_("use -march=armv5t")}, + {"marmv5t", NULL, &legacy_cpu, ARM_ARCH_V5T, N_("use -march=armv5t")}, + {"mv5e", NULL, &legacy_cpu, ARM_ARCH_V5TE, N_("use -march=armv5te")}, + {"marmv5e", NULL, &legacy_cpu, ARM_ARCH_V5TE, N_("use -march=armv5te")}, - buf2[i] = '\0'; + /* Floating point variants -- don't add any more to this list either. */ + {"mfpe-old", NULL, &legacy_fpu, FPU_ARCH_FPE, N_("use -mfpu=fpe")}, + {"mfpa10", NULL, &legacy_fpu, FPU_ARCH_FPA, N_("use -mfpu=fpa10")}, + {"mfpa11", NULL, &legacy_fpu, FPU_ARCH_FPA, N_("use -mfpu=fpa11")}, + {"mno-fpu", NULL, &legacy_fpu, 0, + N_("use either -mfpu=softfpa or -mfpu=softvfp")}, - hash_insert (htab, buf, (PTR) r); - hash_insert (htab, buf2, (PTR) r); -} + {NULL, NULL, NULL, 0, NULL} +}; -static void -build_reg_hsh (struct reg_map * map) +struct arm_cpu_option_table { - const struct reg_entry *r; + char *name; + int value; + /* For some CPUs we assume an FPU unless the user explicitly sets + -mfpu=... */ + int default_fpu; +}; - if ((map->htab = hash_new ()) == NULL) - as_fatal (_("virtual memory exhausted")); - - for (r = map->names; r->name != NULL; r++) - insert_reg (r, map->htab); -} - -static void -insert_reg_alias (char * str, - int regnum, - struct hash_control *htab) -{ - const char * error; - struct reg_entry * new = xmalloc (sizeof (struct reg_entry)); - const char * name = xmalloc (strlen (str) + 1); - - strcpy ((char *) name, str); - - new->name = name; - new->number = regnum; - new->builtin = FALSE; - - error = hash_insert (htab, name, (PTR) new); - if (error) - { - as_bad (_("failed to create an alias for %s, reason: %s"), - str, error); - free ((char *) name); - free (new); - } -} - -/* Look for the .req directive. This is of the form: - - new_register_name .req existing_register_name - - If we find one, or if it looks sufficiently like one that we want to - handle any error here, return non-zero. Otherwise return zero. */ - -static int -create_register_alias (char * newname, char * p) -{ - char * q; - char c; - - q = p; - skip_whitespace (q); - - c = *p; - *p = '\0'; - - if (*q && !strncmp (q, ".req ", 5)) - { - char *copy_of_str; - char *r; - -#ifndef IGNORE_OPCODE_CASE - newname = original_case_string; -#endif - copy_of_str = newname; - - q += 4; - skip_whitespace (q); - - for (r = q; *r != '\0'; r++) - if (*r == ' ') - break; - - if (r != q) - { - enum arm_reg_type new_type, old_type; - int old_regno; - char d = *r; - - *r = '\0'; - old_type = arm_reg_parse_any (q); - *r = d; - - new_type = arm_reg_parse_any (newname); - - if (new_type == REG_TYPE_MAX) - { - if (old_type != REG_TYPE_MAX) - { - old_regno = arm_reg_parse (&q, all_reg_maps[old_type].htab); - insert_reg_alias (newname, old_regno, - all_reg_maps[old_type].htab); - } - else - as_warn (_("register '%s' does not exist\n"), q); - } - else if (old_type == REG_TYPE_MAX) - { - as_warn (_("ignoring redefinition of register alias '%s' to non-existant register '%s'"), - copy_of_str, q); - } - else - { - /* Do not warn about redefinitions to the same alias. */ - if (new_type != old_type - || (arm_reg_parse (&q, all_reg_maps[old_type].htab) - != arm_reg_parse (&q, all_reg_maps[new_type].htab))) - as_warn (_("ignoring redefinition of register alias '%s'"), - copy_of_str); - - } - } - else - as_warn (_("ignoring incomplete .req pseuso op")); - - *p = c; - return 1; - } - - *p = c; - return 0; -} - -static void -set_constant_flonums (void) -{ - int i; - - for (i = 0; i < NUM_FLOAT_VALS; i++) - if (atof_ieee ((char *) fp_const[i], 'x', fp_values[i]) == NULL) - abort (); -} - - -static const struct asm_opcode insns[] = +/* This list should, at a minimum, contain all the cpu names + recognized by GCC. */ +static struct arm_cpu_option_table arm_cpus[] = { - /* Core ARM Instructions. */ - {"and", 0xe0000000, 3, ARM_EXT_V1, do_arit}, - {"ands", 0xe0100000, 3, ARM_EXT_V1, do_arit}, - {"eor", 0xe0200000, 3, ARM_EXT_V1, do_arit}, - {"eors", 0xe0300000, 3, ARM_EXT_V1, do_arit}, - {"sub", 0xe0400000, 3, ARM_EXT_V1, do_arit}, - {"subs", 0xe0500000, 3, ARM_EXT_V1, do_arit}, - {"rsb", 0xe0600000, 3, ARM_EXT_V1, do_arit}, - {"rsbs", 0xe0700000, 3, ARM_EXT_V1, do_arit}, - {"add", 0xe0800000, 3, ARM_EXT_V1, do_arit}, - {"adds", 0xe0900000, 3, ARM_EXT_V1, do_arit}, - {"adc", 0xe0a00000, 3, ARM_EXT_V1, do_arit}, - {"adcs", 0xe0b00000, 3, ARM_EXT_V1, do_arit}, - {"sbc", 0xe0c00000, 3, ARM_EXT_V1, do_arit}, - {"sbcs", 0xe0d00000, 3, ARM_EXT_V1, do_arit}, - {"rsc", 0xe0e00000, 3, ARM_EXT_V1, do_arit}, - {"rscs", 0xe0f00000, 3, ARM_EXT_V1, do_arit}, - {"orr", 0xe1800000, 3, ARM_EXT_V1, do_arit}, - {"orrs", 0xe1900000, 3, ARM_EXT_V1, do_arit}, - {"bic", 0xe1c00000, 3, ARM_EXT_V1, do_arit}, - {"bics", 0xe1d00000, 3, ARM_EXT_V1, do_arit}, - - {"tst", 0xe1100000, 3, ARM_EXT_V1, do_cmp}, - {"tsts", 0xe1100000, 3, ARM_EXT_V1, do_cmp}, - {"tstp", 0xe110f000, 3, ARM_EXT_V1, do_cmp}, - {"teq", 0xe1300000, 3, ARM_EXT_V1, do_cmp}, - {"teqs", 0xe1300000, 3, ARM_EXT_V1, do_cmp}, - {"teqp", 0xe130f000, 3, ARM_EXT_V1, do_cmp}, - {"cmp", 0xe1500000, 3, ARM_EXT_V1, do_cmp}, - {"cmps", 0xe1500000, 3, ARM_EXT_V1, do_cmp}, - {"cmpp", 0xe150f000, 3, ARM_EXT_V1, do_cmp}, - {"cmn", 0xe1700000, 3, ARM_EXT_V1, do_cmp}, - {"cmns", 0xe1700000, 3, ARM_EXT_V1, do_cmp}, - {"cmnp", 0xe170f000, 3, ARM_EXT_V1, do_cmp}, - - {"mov", 0xe1a00000, 3, ARM_EXT_V1, do_mov}, - {"movs", 0xe1b00000, 3, ARM_EXT_V1, do_mov}, - {"mvn", 0xe1e00000, 3, ARM_EXT_V1, do_mov}, - {"mvns", 0xe1f00000, 3, ARM_EXT_V1, do_mov}, - - {"ldr", 0xe4100000, 3, ARM_EXT_V1, do_ldst}, - {"ldrb", 0xe4500000, 3, ARM_EXT_V1, do_ldst}, - {"ldrt", 0xe4300000, 3, ARM_EXT_V1, do_ldstt}, - {"ldrbt", 0xe4700000, 3, ARM_EXT_V1, do_ldstt}, - {"str", 0xe4000000, 3, ARM_EXT_V1, do_ldst}, - {"strb", 0xe4400000, 3, ARM_EXT_V1, do_ldst}, - {"strt", 0xe4200000, 3, ARM_EXT_V1, do_ldstt}, - {"strbt", 0xe4600000, 3, ARM_EXT_V1, do_ldstt}, - - {"stmia", 0xe8800000, 3, ARM_EXT_V1, do_ldmstm}, - {"stmib", 0xe9800000, 3, ARM_EXT_V1, do_ldmstm}, - {"stmda", 0xe8000000, 3, ARM_EXT_V1, do_ldmstm}, - {"stmdb", 0xe9000000, 3, ARM_EXT_V1, do_ldmstm}, - {"stmfd", 0xe9000000, 3, ARM_EXT_V1, do_ldmstm}, - {"stmfa", 0xe9800000, 3, ARM_EXT_V1, do_ldmstm}, - {"stmea", 0xe8800000, 3, ARM_EXT_V1, do_ldmstm}, - {"stmed", 0xe8000000, 3, ARM_EXT_V1, do_ldmstm}, - - {"ldmia", 0xe8900000, 3, ARM_EXT_V1, do_ldmstm}, - {"ldmib", 0xe9900000, 3, ARM_EXT_V1, do_ldmstm}, - {"ldmda", 0xe8100000, 3, ARM_EXT_V1, do_ldmstm}, - {"ldmdb", 0xe9100000, 3, ARM_EXT_V1, do_ldmstm}, - {"ldmfd", 0xe8900000, 3, ARM_EXT_V1, do_ldmstm}, - {"ldmfa", 0xe8100000, 3, ARM_EXT_V1, do_ldmstm}, - {"ldmea", 0xe9100000, 3, ARM_EXT_V1, do_ldmstm}, - {"ldmed", 0xe9900000, 3, ARM_EXT_V1, do_ldmstm}, - - {"swi", 0xef000000, 3, ARM_EXT_V1, do_swi}, -#ifdef TE_WINCE - /* XXX This is the wrong place to do this. Think multi-arch. */ - {"bl", 0xeb000000, 2, ARM_EXT_V1, do_branch}, - {"b", 0xea000000, 1, ARM_EXT_V1, do_branch}, -#else - {"bl", 0xebfffffe, 2, ARM_EXT_V1, do_branch}, - {"b", 0xeafffffe, 1, ARM_EXT_V1, do_branch}, -#endif - - /* Pseudo ops. */ - {"adr", 0xe28f0000, 3, ARM_EXT_V1, do_adr}, - {"adrl", 0xe28f0000, 3, ARM_EXT_V1, do_adrl}, - {"nop", 0xe1a00000, 3, ARM_EXT_V1, do_nop}, - - /* ARM 2 multiplies. */ - {"mul", 0xe0000090, 3, ARM_EXT_V2, do_mul}, - {"muls", 0xe0100090, 3, ARM_EXT_V2, do_mul}, - {"mla", 0xe0200090, 3, ARM_EXT_V2, do_mla}, - {"mlas", 0xe0300090, 3, ARM_EXT_V2, do_mla}, - - /* Generic coprocessor instructions. */ - {"cdp", 0xee000000, 3, ARM_EXT_V2, do_cdp}, - {"ldc", 0xec100000, 3, ARM_EXT_V2, do_lstc}, - {"ldcl", 0xec500000, 3, ARM_EXT_V2, do_lstc}, - {"stc", 0xec000000, 3, ARM_EXT_V2, do_lstc}, - {"stcl", 0xec400000, 3, ARM_EXT_V2, do_lstc}, - {"mcr", 0xee000010, 3, ARM_EXT_V2, do_co_reg}, - {"mrc", 0xee100010, 3, ARM_EXT_V2, do_co_reg}, - - /* ARM 3 - swp instructions. */ - {"swp", 0xe1000090, 3, ARM_EXT_V2S, do_swap}, - {"swpb", 0xe1400090, 3, ARM_EXT_V2S, do_swap}, - - /* ARM 6 Status register instructions. */ - {"mrs", 0xe10f0000, 3, ARM_EXT_V3, do_mrs}, - {"msr", 0xe120f000, 3, ARM_EXT_V3, do_msr}, - /* ScottB: our code uses 0xe128f000 for msr. - NickC: but this is wrong because the bits 16 through 19 are - handled by the PSR_xxx defines above. */ - - /* ARM 7M long multiplies. */ - {"smull", 0xe0c00090, 5, ARM_EXT_V3M, do_mull}, - {"smulls", 0xe0d00090, 5, ARM_EXT_V3M, do_mull}, - {"umull", 0xe0800090, 5, ARM_EXT_V3M, do_mull}, - {"umulls", 0xe0900090, 5, ARM_EXT_V3M, do_mull}, - {"smlal", 0xe0e00090, 5, ARM_EXT_V3M, do_mull}, - {"smlals", 0xe0f00090, 5, ARM_EXT_V3M, do_mull}, - {"umlal", 0xe0a00090, 5, ARM_EXT_V3M, do_mull}, - {"umlals", 0xe0b00090, 5, ARM_EXT_V3M, do_mull}, - - /* ARM Architecture 4. */ - {"ldrh", 0xe01000b0, 3, ARM_EXT_V4, do_ldstv4}, - {"ldrsh", 0xe01000f0, 3, ARM_EXT_V4, do_ldstv4}, - {"ldrsb", 0xe01000d0, 3, ARM_EXT_V4, do_ldstv4}, - {"strh", 0xe00000b0, 3, ARM_EXT_V4, do_ldstv4}, - - /* ARM Architecture 4T. */ - /* Note: bx (and blx) are required on V5, even if the processor does - not support Thumb. */ - {"bx", 0xe12fff10, 2, ARM_EXT_V4T | ARM_EXT_V5, do_bx}, - - /* ARM Architecture 5T. */ - /* Note: blx has 2 variants, so the .value is set dynamically. - Only one of the variants has conditional execution. */ - {"blx", 0xe0000000, 3, ARM_EXT_V5, do_blx}, - {"clz", 0xe16f0f10, 3, ARM_EXT_V5, do_clz}, - {"bkpt", 0xe1200070, 0, ARM_EXT_V5, do_bkpt}, - {"ldc2", 0xfc100000, 0, ARM_EXT_V5, do_lstc2}, - {"ldc2l", 0xfc500000, 0, ARM_EXT_V5, do_lstc2}, - {"stc2", 0xfc000000, 0, ARM_EXT_V5, do_lstc2}, - {"stc2l", 0xfc400000, 0, ARM_EXT_V5, do_lstc2}, - {"cdp2", 0xfe000000, 0, ARM_EXT_V5, do_cdp2}, - {"mcr2", 0xfe000010, 0, ARM_EXT_V5, do_co_reg2}, - {"mrc2", 0xfe100010, 0, ARM_EXT_V5, do_co_reg2}, - - /* ARM Architecture 5TExP. */ - {"smlabb", 0xe1000080, 6, ARM_EXT_V5ExP, do_smla}, - {"smlatb", 0xe10000a0, 6, ARM_EXT_V5ExP, do_smla}, - {"smlabt", 0xe10000c0, 6, ARM_EXT_V5ExP, do_smla}, - {"smlatt", 0xe10000e0, 6, ARM_EXT_V5ExP, do_smla}, - - {"smlawb", 0xe1200080, 6, ARM_EXT_V5ExP, do_smla}, - {"smlawt", 0xe12000c0, 6, ARM_EXT_V5ExP, do_smla}, - - {"smlalbb", 0xe1400080, 7, ARM_EXT_V5ExP, do_smlal}, - {"smlaltb", 0xe14000a0, 7, ARM_EXT_V5ExP, do_smlal}, - {"smlalbt", 0xe14000c0, 7, ARM_EXT_V5ExP, do_smlal}, - {"smlaltt", 0xe14000e0, 7, ARM_EXT_V5ExP, do_smlal}, - - {"smulbb", 0xe1600080, 6, ARM_EXT_V5ExP, do_smul}, - {"smultb", 0xe16000a0, 6, ARM_EXT_V5ExP, do_smul}, - {"smulbt", 0xe16000c0, 6, ARM_EXT_V5ExP, do_smul}, - {"smultt", 0xe16000e0, 6, ARM_EXT_V5ExP, do_smul}, - - {"smulwb", 0xe12000a0, 6, ARM_EXT_V5ExP, do_smul}, - {"smulwt", 0xe12000e0, 6, ARM_EXT_V5ExP, do_smul}, - - {"qadd", 0xe1000050, 4, ARM_EXT_V5ExP, do_qadd}, - {"qdadd", 0xe1400050, 5, ARM_EXT_V5ExP, do_qadd}, - {"qsub", 0xe1200050, 4, ARM_EXT_V5ExP, do_qadd}, - {"qdsub", 0xe1600050, 5, ARM_EXT_V5ExP, do_qadd}, - - /* ARM Architecture 5TE. */ - {"pld", 0xf450f000, 0, ARM_EXT_V5E, do_pld}, - {"ldrd", 0xe00000d0, 3, ARM_EXT_V5E, do_ldrd}, - {"strd", 0xe00000f0, 3, ARM_EXT_V5E, do_ldrd}, - - {"mcrr", 0xec400000, 4, ARM_EXT_V5E, do_co_reg2c}, - {"mrrc", 0xec500000, 4, ARM_EXT_V5E, do_co_reg2c}, - - /* ARM Architecture 5TEJ. */ - {"bxj", 0xe12fff20, 3, ARM_EXT_V5J, do_bxj}, - - /* ARM V6. */ - { "cps", 0xf1020000, 0, ARM_EXT_V6, do_cps}, - { "cpsie", 0xf1080000, 0, ARM_EXT_V6, do_cpsi}, - { "cpsid", 0xf10C0000, 0, ARM_EXT_V6, do_cpsi}, - { "ldrex", 0xe1900f9f, 5, ARM_EXT_V6, do_ldrex}, - { "mcrr2", 0xfc400000, 0, ARM_EXT_V6, do_co_reg2c}, - { "mrrc2", 0xfc500000, 0, ARM_EXT_V6, do_co_reg2c}, - { "pkhbt", 0xe6800010, 5, ARM_EXT_V6, do_pkhbt}, - { "pkhtb", 0xe6800050, 5, ARM_EXT_V6, do_pkhtb}, - { "qadd16", 0xe6200f10, 6, ARM_EXT_V6, do_qadd16}, - { "qadd8", 0xe6200f90, 5, ARM_EXT_V6, do_qadd16}, - { "qaddsubx", 0xe6200f30, 8, ARM_EXT_V6, do_qadd16}, - { "qsub16", 0xe6200f70, 6, ARM_EXT_V6, do_qadd16}, - { "qsub8", 0xe6200ff0, 5, ARM_EXT_V6, do_qadd16}, - { "qsubaddx", 0xe6200f50, 8, ARM_EXT_V6, do_qadd16}, - { "sadd16", 0xe6100f10, 6, ARM_EXT_V6, do_qadd16}, - { "sadd8", 0xe6100f90, 5, ARM_EXT_V6, do_qadd16}, - { "saddsubx", 0xe6100f30, 8, ARM_EXT_V6, do_qadd16}, - { "shadd16", 0xe6300f10, 7, ARM_EXT_V6, do_qadd16}, - { "shadd8", 0xe6300f90, 6, ARM_EXT_V6, do_qadd16}, - { "shaddsubx", 0xe6300f30, 9, ARM_EXT_V6, do_qadd16}, - { "shsub16", 0xe6300f70, 7, ARM_EXT_V6, do_qadd16}, - { "shsub8", 0xe6300ff0, 6, ARM_EXT_V6, do_qadd16}, - { "shsubaddx", 0xe6300f50, 9, ARM_EXT_V6, do_qadd16}, - { "ssub16", 0xe6100f70, 6, ARM_EXT_V6, do_qadd16}, - { "ssub8", 0xe6100ff0, 5, ARM_EXT_V6, do_qadd16}, - { "ssubaddx", 0xe6100f50, 8, ARM_EXT_V6, do_qadd16}, - { "uadd16", 0xe6500f10, 6, ARM_EXT_V6, do_qadd16}, - { "uadd8", 0xe6500f90, 5, ARM_EXT_V6, do_qadd16}, - { "uaddsubx", 0xe6500f30, 8, ARM_EXT_V6, do_qadd16}, - { "uhadd16", 0xe6700f10, 7, ARM_EXT_V6, do_qadd16}, - { "uhadd8", 0xe6700f90, 6, ARM_EXT_V6, do_qadd16}, - { "uhaddsubx", 0xe6700f30, 9, ARM_EXT_V6, do_qadd16}, - { "uhsub16", 0xe6700f70, 7, ARM_EXT_V6, do_qadd16}, - { "uhsub8", 0xe6700ff0, 6, ARM_EXT_V6, do_qadd16}, - { "uhsubaddx", 0xe6700f50, 9, ARM_EXT_V6, do_qadd16}, - { "uqadd16", 0xe6600f10, 7, ARM_EXT_V6, do_qadd16}, - { "uqadd8", 0xe6600f90, 6, ARM_EXT_V6, do_qadd16}, - { "uqaddsubx", 0xe6600f30, 9, ARM_EXT_V6, do_qadd16}, - { "uqsub16", 0xe6600f70, 7, ARM_EXT_V6, do_qadd16}, - { "uqsub8", 0xe6600ff0, 6, ARM_EXT_V6, do_qadd16}, - { "uqsubaddx", 0xe6600f50, 9, ARM_EXT_V6, do_qadd16}, - { "usub16", 0xe6500f70, 6, ARM_EXT_V6, do_qadd16}, - { "usub8", 0xe6500ff0, 5, ARM_EXT_V6, do_qadd16}, - { "usubaddx", 0xe6500f50, 8, ARM_EXT_V6, do_qadd16}, - { "rev", 0xe6bf0f30, 3, ARM_EXT_V6, do_rev}, - { "rev16", 0xe6bf0fb0, 5, ARM_EXT_V6, do_rev}, - { "revsh", 0xe6ff0fb0, 5, ARM_EXT_V6, do_rev}, - { "rfeia", 0xf8900a00, 0, ARM_EXT_V6, do_rfe}, - { "rfeib", 0xf9900a00, 0, ARM_EXT_V6, do_rfe}, - { "rfeda", 0xf8100a00, 0, ARM_EXT_V6, do_rfe}, - { "rfedb", 0xf9100a00, 0, ARM_EXT_V6, do_rfe}, - { "rfefd", 0xf8900a00, 0, ARM_EXT_V6, do_rfe}, - { "rfefa", 0xf9900a00, 0, ARM_EXT_V6, do_rfe}, - { "rfeea", 0xf8100a00, 0, ARM_EXT_V6, do_rfe}, - { "rfeed", 0xf9100a00, 0, ARM_EXT_V6, do_rfe}, - { "sxtah", 0xe6b00070, 5, ARM_EXT_V6, do_sxtah}, - { "sxtab16", 0xe6800070, 7, ARM_EXT_V6, do_sxtah}, - { "sxtab", 0xe6a00070, 5, ARM_EXT_V6, do_sxtah}, - { "sxth", 0xe6bf0070, 4, ARM_EXT_V6, do_sxth}, - { "sxtb16", 0xe68f0070, 6, ARM_EXT_V6, do_sxth}, - { "sxtb", 0xe6af0070, 4, ARM_EXT_V6, do_sxth}, - { "uxtah", 0xe6f00070, 5, ARM_EXT_V6, do_sxtah}, - { "uxtab16", 0xe6c00070, 7, ARM_EXT_V6, do_sxtah}, - { "uxtab", 0xe6e00070, 5, ARM_EXT_V6, do_sxtah}, - { "uxth", 0xe6ff0070, 4, ARM_EXT_V6, do_sxth}, - { "uxtb16", 0xe6cf0070, 6, ARM_EXT_V6, do_sxth}, - { "uxtb", 0xe6ef0070, 4, ARM_EXT_V6, do_sxth}, - { "sel", 0xe68000b0, 3, ARM_EXT_V6, do_qadd16}, - { "setend", 0xf1010000, 0, ARM_EXT_V6, do_setend}, - { "smlad", 0xe7000010, 5, ARM_EXT_V6, do_smlad}, - { "smladx", 0xe7000030, 6, ARM_EXT_V6, do_smlad}, - { "smlald", 0xe7400010, 6, ARM_EXT_V6, do_smlald}, - { "smlaldx", 0xe7400030, 7, ARM_EXT_V6, do_smlald}, - { "smlsd", 0xe7000050, 5, ARM_EXT_V6, do_smlad}, - { "smlsdx", 0xe7000070, 6, ARM_EXT_V6, do_smlad}, - { "smlsld", 0xe7400050, 6, ARM_EXT_V6, do_smlald}, - { "smlsldx", 0xe7400070, 7, ARM_EXT_V6, do_smlald}, - { "smmla", 0xe7500010, 5, ARM_EXT_V6, do_smlad}, - { "smmlar", 0xe7500030, 6, ARM_EXT_V6, do_smlad}, - { "smmls", 0xe75000d0, 5, ARM_EXT_V6, do_smlad}, - { "smmlsr", 0xe75000f0, 6, ARM_EXT_V6, do_smlad}, - { "smmul", 0xe750f010, 5, ARM_EXT_V6, do_smmul}, - { "smmulr", 0xe750f030, 6, ARM_EXT_V6, do_smmul}, - { "smuad", 0xe700f010, 5, ARM_EXT_V6, do_smmul}, - { "smuadx", 0xe700f030, 6, ARM_EXT_V6, do_smmul}, - { "smusd", 0xe700f050, 5, ARM_EXT_V6, do_smmul}, - { "smusdx", 0xe700f070, 6, ARM_EXT_V6, do_smmul}, - { "srsia", 0xf8cd0500, 0, ARM_EXT_V6, do_srs}, - { "srsib", 0xf9cd0500, 0, ARM_EXT_V6, do_srs}, - { "srsda", 0xf84d0500, 0, ARM_EXT_V6, do_srs}, - { "srsdb", 0xf94d0500, 0, ARM_EXT_V6, do_srs}, - { "ssat", 0xe6a00010, 4, ARM_EXT_V6, do_ssat}, - { "ssat16", 0xe6a00f30, 6, ARM_EXT_V6, do_ssat16}, - { "strex", 0xe1800f90, 5, ARM_EXT_V6, do_strex}, - { "umaal", 0xe0400090, 5, ARM_EXT_V6, do_umaal}, - { "usad8", 0xe780f010, 5, ARM_EXT_V6, do_smmul}, - { "usada8", 0xe7800010, 6, ARM_EXT_V6, do_smlad}, - { "usat", 0xe6e00010, 4, ARM_EXT_V6, do_usat}, - { "usat16", 0xe6e00f30, 6, ARM_EXT_V6, do_usat16}, - - /* ARM V6K. */ - { "clrex", 0xf57ff01f, 0, ARM_EXT_V6K, do_empty}, - { "ldrexb", 0xe1d00f9f, 6, ARM_EXT_V6K, do_ldrex}, - { "ldrexd", 0xe1b00f9f, 6, ARM_EXT_V6K, do_ldrex}, - { "ldrexh", 0xe1f00f9f, 6, ARM_EXT_V6K, do_ldrex}, - { "sev", 0xe320f004, 3, ARM_EXT_V6K, do_empty}, - { "strexb", 0xe1c00f90, 6, ARM_EXT_V6K, do_strex}, - { "strexd", 0xe1a00f90, 6, ARM_EXT_V6K, do_strex}, - { "strexh", 0xe1e00f90, 6, ARM_EXT_V6K, do_strex}, - { "wfe", 0xe320f002, 3, ARM_EXT_V6K, do_empty}, - { "wfi", 0xe320f003, 3, ARM_EXT_V6K, do_empty}, - { "yield", 0xe320f001, 5, ARM_EXT_V6K, do_empty}, - - /* ARM V6Z. */ - { "smi", 0xe1600070, 3, ARM_EXT_V6Z, do_smi}, - - /* ARM V6T2. */ - { "bfc", 0xe7c0001f, 3, ARM_EXT_V6T2, do_bfc}, - { "bfi", 0xe7c00010, 3, ARM_EXT_V6T2, do_bfi}, - { "mls", 0xe0600090, 3, ARM_EXT_V6T2, do_mls}, - { "movw", 0xe3000000, 4, ARM_EXT_V6T2, do_mov16}, - { "movt", 0xe3400000, 4, ARM_EXT_V6T2, do_mov16}, - { "rbit", 0xe3ff0f30, 4, ARM_EXT_V6T2, do_rbit}, - { "sbfx", 0xe7a00050, 4, ARM_EXT_V6T2, do_bfx}, - { "ubfx", 0xe7e00050, 4, ARM_EXT_V6T2, do_bfx}, - - { "ldrht", 0xe03000b0, 3, ARM_EXT_V6T2, do_ldsttv4}, - { "ldrsht", 0xe03000f0, 3, ARM_EXT_V6T2, do_ldsttv4}, - { "ldrsbt", 0xe03000d0, 3, ARM_EXT_V6T2, do_ldsttv4}, - { "strht", 0xe02000b0, 3, ARM_EXT_V6T2, do_ldsttv4}, - - /* Core FPA instruction set (V1). */ - {"wfs", 0xee200110, 3, FPU_FPA_EXT_V1, do_fpa_ctrl}, - {"rfs", 0xee300110, 3, FPU_FPA_EXT_V1, do_fpa_ctrl}, - {"wfc", 0xee400110, 3, FPU_FPA_EXT_V1, do_fpa_ctrl}, - {"rfc", 0xee500110, 3, FPU_FPA_EXT_V1, do_fpa_ctrl}, - - {"ldfs", 0xec100100, 3, FPU_FPA_EXT_V1, do_fpa_ldst}, - {"ldfd", 0xec108100, 3, FPU_FPA_EXT_V1, do_fpa_ldst}, - {"ldfe", 0xec500100, 3, FPU_FPA_EXT_V1, do_fpa_ldst}, - {"ldfp", 0xec508100, 3, FPU_FPA_EXT_V1, do_fpa_ldst}, - - {"stfs", 0xec000100, 3, FPU_FPA_EXT_V1, do_fpa_ldst}, - {"stfd", 0xec008100, 3, FPU_FPA_EXT_V1, do_fpa_ldst}, - {"stfe", 0xec400100, 3, FPU_FPA_EXT_V1, do_fpa_ldst}, - {"stfp", 0xec408100, 3, FPU_FPA_EXT_V1, do_fpa_ldst}, - - {"mvfs", 0xee008100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mvfsp", 0xee008120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mvfsm", 0xee008140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mvfsz", 0xee008160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mvfd", 0xee008180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mvfdp", 0xee0081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mvfdm", 0xee0081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mvfdz", 0xee0081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mvfe", 0xee088100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mvfep", 0xee088120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mvfem", 0xee088140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mvfez", 0xee088160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - - {"mnfs", 0xee108100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mnfsp", 0xee108120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mnfsm", 0xee108140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mnfsz", 0xee108160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mnfd", 0xee108180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mnfdp", 0xee1081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mnfdm", 0xee1081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mnfdz", 0xee1081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mnfe", 0xee188100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mnfep", 0xee188120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mnfem", 0xee188140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"mnfez", 0xee188160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - - {"abss", 0xee208100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"abssp", 0xee208120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"abssm", 0xee208140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"abssz", 0xee208160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"absd", 0xee208180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"absdp", 0xee2081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"absdm", 0xee2081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"absdz", 0xee2081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"abse", 0xee288100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"absep", 0xee288120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"absem", 0xee288140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"absez", 0xee288160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - - {"rnds", 0xee308100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"rndsp", 0xee308120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"rndsm", 0xee308140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"rndsz", 0xee308160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"rndd", 0xee308180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"rnddp", 0xee3081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"rnddm", 0xee3081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"rnddz", 0xee3081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"rnde", 0xee388100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"rndep", 0xee388120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"rndem", 0xee388140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"rndez", 0xee388160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - - {"sqts", 0xee408100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sqtsp", 0xee408120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sqtsm", 0xee408140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sqtsz", 0xee408160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sqtd", 0xee408180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sqtdp", 0xee4081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sqtdm", 0xee4081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sqtdz", 0xee4081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sqte", 0xee488100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sqtep", 0xee488120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sqtem", 0xee488140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sqtez", 0xee488160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - - {"logs", 0xee508100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"logsp", 0xee508120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"logsm", 0xee508140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"logsz", 0xee508160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"logd", 0xee508180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"logdp", 0xee5081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"logdm", 0xee5081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"logdz", 0xee5081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"loge", 0xee588100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"logep", 0xee588120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"logem", 0xee588140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"logez", 0xee588160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - - {"lgns", 0xee608100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"lgnsp", 0xee608120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"lgnsm", 0xee608140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"lgnsz", 0xee608160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"lgnd", 0xee608180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"lgndp", 0xee6081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"lgndm", 0xee6081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"lgndz", 0xee6081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"lgne", 0xee688100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"lgnep", 0xee688120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"lgnem", 0xee688140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"lgnez", 0xee688160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - - {"exps", 0xee708100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"expsp", 0xee708120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"expsm", 0xee708140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"expsz", 0xee708160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"expd", 0xee708180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"expdp", 0xee7081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"expdm", 0xee7081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"expdz", 0xee7081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"expe", 0xee788100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"expep", 0xee788120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"expem", 0xee788140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"expdz", 0xee788160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - - {"sins", 0xee808100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sinsp", 0xee808120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sinsm", 0xee808140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sinsz", 0xee808160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sind", 0xee808180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sindp", 0xee8081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sindm", 0xee8081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sindz", 0xee8081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sine", 0xee888100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sinep", 0xee888120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sinem", 0xee888140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"sinez", 0xee888160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - - {"coss", 0xee908100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"cossp", 0xee908120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"cossm", 0xee908140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"cossz", 0xee908160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"cosd", 0xee908180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"cosdp", 0xee9081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"cosdm", 0xee9081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"cosdz", 0xee9081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"cose", 0xee988100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"cosep", 0xee988120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"cosem", 0xee988140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"cosez", 0xee988160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - - {"tans", 0xeea08100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"tansp", 0xeea08120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"tansm", 0xeea08140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"tansz", 0xeea08160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"tand", 0xeea08180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"tandp", 0xeea081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"tandm", 0xeea081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"tandz", 0xeea081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"tane", 0xeea88100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"tanep", 0xeea88120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"tanem", 0xeea88140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"tanez", 0xeea88160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - - {"asns", 0xeeb08100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"asnsp", 0xeeb08120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"asnsm", 0xeeb08140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"asnsz", 0xeeb08160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"asnd", 0xeeb08180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"asndp", 0xeeb081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"asndm", 0xeeb081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"asndz", 0xeeb081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"asne", 0xeeb88100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"asnep", 0xeeb88120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"asnem", 0xeeb88140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"asnez", 0xeeb88160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - - {"acss", 0xeec08100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"acssp", 0xeec08120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"acssm", 0xeec08140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"acssz", 0xeec08160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"acsd", 0xeec08180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"acsdp", 0xeec081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"acsdm", 0xeec081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"acsdz", 0xeec081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"acse", 0xeec88100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"acsep", 0xeec88120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"acsem", 0xeec88140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"acsez", 0xeec88160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - - {"atns", 0xeed08100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"atnsp", 0xeed08120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"atnsm", 0xeed08140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"atnsz", 0xeed08160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"atnd", 0xeed08180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"atndp", 0xeed081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"atndm", 0xeed081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"atndz", 0xeed081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"atne", 0xeed88100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"atnep", 0xeed88120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"atnem", 0xeed88140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"atnez", 0xeed88160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - - {"urds", 0xeee08100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"urdsp", 0xeee08120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"urdsm", 0xeee08140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"urdsz", 0xeee08160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"urdd", 0xeee08180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"urddp", 0xeee081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"urddm", 0xeee081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"urddz", 0xeee081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"urde", 0xeee88100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"urdep", 0xeee88120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"urdem", 0xeee88140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"urdez", 0xeee88160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - - {"nrms", 0xeef08100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"nrmsp", 0xeef08120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"nrmsm", 0xeef08140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"nrmsz", 0xeef08160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"nrmd", 0xeef08180, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"nrmdp", 0xeef081a0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"nrmdm", 0xeef081c0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"nrmdz", 0xeef081e0, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"nrme", 0xeef88100, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"nrmep", 0xeef88120, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"nrmem", 0xeef88140, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - {"nrmez", 0xeef88160, 3, FPU_FPA_EXT_V1, do_fpa_monadic}, - - {"adfs", 0xee000100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"adfsp", 0xee000120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"adfsm", 0xee000140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"adfsz", 0xee000160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"adfd", 0xee000180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"adfdp", 0xee0001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"adfdm", 0xee0001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"adfdz", 0xee0001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"adfe", 0xee080100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"adfep", 0xee080120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"adfem", 0xee080140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"adfez", 0xee080160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - - {"sufs", 0xee200100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"sufsp", 0xee200120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"sufsm", 0xee200140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"sufsz", 0xee200160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"sufd", 0xee200180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"sufdp", 0xee2001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"sufdm", 0xee2001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"sufdz", 0xee2001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"sufe", 0xee280100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"sufep", 0xee280120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"sufem", 0xee280140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"sufez", 0xee280160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - - {"rsfs", 0xee300100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rsfsp", 0xee300120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rsfsm", 0xee300140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rsfsz", 0xee300160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rsfd", 0xee300180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rsfdp", 0xee3001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rsfdm", 0xee3001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rsfdz", 0xee3001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rsfe", 0xee380100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rsfep", 0xee380120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rsfem", 0xee380140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rsfez", 0xee380160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - - {"mufs", 0xee100100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"mufsp", 0xee100120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"mufsm", 0xee100140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"mufsz", 0xee100160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"mufd", 0xee100180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"mufdp", 0xee1001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"mufdm", 0xee1001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"mufdz", 0xee1001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"mufe", 0xee180100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"mufep", 0xee180120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"mufem", 0xee180140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"mufez", 0xee180160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - - {"dvfs", 0xee400100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"dvfsp", 0xee400120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"dvfsm", 0xee400140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"dvfsz", 0xee400160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"dvfd", 0xee400180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"dvfdp", 0xee4001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"dvfdm", 0xee4001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"dvfdz", 0xee4001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"dvfe", 0xee480100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"dvfep", 0xee480120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"dvfem", 0xee480140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"dvfez", 0xee480160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - - {"rdfs", 0xee500100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rdfsp", 0xee500120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rdfsm", 0xee500140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rdfsz", 0xee500160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rdfd", 0xee500180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rdfdp", 0xee5001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rdfdm", 0xee5001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rdfdz", 0xee5001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rdfe", 0xee580100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rdfep", 0xee580120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rdfem", 0xee580140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rdfez", 0xee580160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - - {"pows", 0xee600100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"powsp", 0xee600120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"powsm", 0xee600140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"powsz", 0xee600160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"powd", 0xee600180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"powdp", 0xee6001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"powdm", 0xee6001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"powdz", 0xee6001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"powe", 0xee680100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"powep", 0xee680120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"powem", 0xee680140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"powez", 0xee680160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - - {"rpws", 0xee700100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rpwsp", 0xee700120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rpwsm", 0xee700140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rpwsz", 0xee700160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rpwd", 0xee700180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rpwdp", 0xee7001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rpwdm", 0xee7001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rpwdz", 0xee7001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rpwe", 0xee780100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rpwep", 0xee780120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rpwem", 0xee780140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rpwez", 0xee780160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - - {"rmfs", 0xee800100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rmfsp", 0xee800120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rmfsm", 0xee800140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rmfsz", 0xee800160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rmfd", 0xee800180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rmfdp", 0xee8001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rmfdm", 0xee8001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rmfdz", 0xee8001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rmfe", 0xee880100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rmfep", 0xee880120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rmfem", 0xee880140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"rmfez", 0xee880160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - - {"fmls", 0xee900100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fmlsp", 0xee900120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fmlsm", 0xee900140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fmlsz", 0xee900160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fmld", 0xee900180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fmldp", 0xee9001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fmldm", 0xee9001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fmldz", 0xee9001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fmle", 0xee980100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fmlep", 0xee980120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fmlem", 0xee980140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fmlez", 0xee980160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - - {"fdvs", 0xeea00100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fdvsp", 0xeea00120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fdvsm", 0xeea00140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fdvsz", 0xeea00160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fdvd", 0xeea00180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fdvdp", 0xeea001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fdvdm", 0xeea001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fdvdz", 0xeea001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fdve", 0xeea80100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fdvep", 0xeea80120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fdvem", 0xeea80140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"fdvez", 0xeea80160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - - {"frds", 0xeeb00100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"frdsp", 0xeeb00120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"frdsm", 0xeeb00140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"frdsz", 0xeeb00160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"frdd", 0xeeb00180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"frddp", 0xeeb001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"frddm", 0xeeb001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"frddz", 0xeeb001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"frde", 0xeeb80100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"frdep", 0xeeb80120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"frdem", 0xeeb80140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"frdez", 0xeeb80160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - - {"pols", 0xeec00100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"polsp", 0xeec00120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"polsm", 0xeec00140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"polsz", 0xeec00160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"pold", 0xeec00180, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"poldp", 0xeec001a0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"poldm", 0xeec001c0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"poldz", 0xeec001e0, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"pole", 0xeec80100, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"polep", 0xeec80120, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"polem", 0xeec80140, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - {"polez", 0xeec80160, 3, FPU_FPA_EXT_V1, do_fpa_dyadic}, - - {"cmf", 0xee90f110, 3, FPU_FPA_EXT_V1, do_fpa_cmp}, - {"cmfe", 0xeed0f110, 3, FPU_FPA_EXT_V1, do_fpa_cmp}, - {"cnf", 0xeeb0f110, 3, FPU_FPA_EXT_V1, do_fpa_cmp}, - {"cnfe", 0xeef0f110, 3, FPU_FPA_EXT_V1, do_fpa_cmp}, - /* The FPA10 data sheet suggests that the 'E' of cmfe/cnfe should - not be an optional suffix, but part of the instruction. To be - compatible, we accept either. */ - {"cmfe", 0xeed0f110, 4, FPU_FPA_EXT_V1, do_fpa_cmp}, - {"cnfe", 0xeef0f110, 4, FPU_FPA_EXT_V1, do_fpa_cmp}, - - {"flts", 0xee000110, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, - {"fltsp", 0xee000130, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, - {"fltsm", 0xee000150, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, - {"fltsz", 0xee000170, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, - {"fltd", 0xee000190, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, - {"fltdp", 0xee0001b0, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, - {"fltdm", 0xee0001d0, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, - {"fltdz", 0xee0001f0, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, - {"flte", 0xee080110, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, - {"fltep", 0xee080130, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, - {"fltem", 0xee080150, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, - {"fltez", 0xee080170, 3, FPU_FPA_EXT_V1, do_fpa_from_reg}, - - /* The implementation of the FIX instruction is broken on some - assemblers, in that it accepts a precision specifier as well as a - rounding specifier, despite the fact that this is meaningless. - To be more compatible, we accept it as well, though of course it - does not set any bits. */ - {"fix", 0xee100110, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, - {"fixp", 0xee100130, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, - {"fixm", 0xee100150, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, - {"fixz", 0xee100170, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, - {"fixsp", 0xee100130, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, - {"fixsm", 0xee100150, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, - {"fixsz", 0xee100170, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, - {"fixdp", 0xee100130, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, - {"fixdm", 0xee100150, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, - {"fixdz", 0xee100170, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, - {"fixep", 0xee100130, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, - {"fixem", 0xee100150, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, - {"fixez", 0xee100170, 3, FPU_FPA_EXT_V1, do_fpa_to_reg}, - - /* Instructions that were new with the real FPA, call them V2. */ - {"lfm", 0xec100200, 3, FPU_FPA_EXT_V2, do_fpa_ldmstm}, - {"lfmfd", 0xec900200, 3, FPU_FPA_EXT_V2, do_fpa_ldmstm}, - {"lfmea", 0xed100200, 3, FPU_FPA_EXT_V2, do_fpa_ldmstm}, - {"sfm", 0xec000200, 3, FPU_FPA_EXT_V2, do_fpa_ldmstm}, - {"sfmfd", 0xed000200, 3, FPU_FPA_EXT_V2, do_fpa_ldmstm}, - {"sfmea", 0xec800200, 3, FPU_FPA_EXT_V2, do_fpa_ldmstm}, - - /* VFP V1xD (single precision). */ - /* Moves and type conversions. */ - {"fcpys", 0xeeb00a40, 5, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, - {"fmrs", 0xee100a10, 4, FPU_VFP_EXT_V1xD, do_vfp_reg_from_sp}, - {"fmsr", 0xee000a10, 4, FPU_VFP_EXT_V1xD, do_vfp_sp_from_reg}, - {"fmstat", 0xeef1fa10, 6, FPU_VFP_EXT_V1xD, do_empty}, - {"fsitos", 0xeeb80ac0, 6, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, - {"fuitos", 0xeeb80a40, 6, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, - {"ftosis", 0xeebd0a40, 6, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, - {"ftosizs", 0xeebd0ac0, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, - {"ftouis", 0xeebc0a40, 6, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, - {"ftouizs", 0xeebc0ac0, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, - {"fmrx", 0xeef00a10, 4, FPU_VFP_EXT_V1xD, do_vfp_reg_from_ctrl}, - {"fmxr", 0xeee00a10, 4, FPU_VFP_EXT_V1xD, do_vfp_ctrl_from_reg}, - - /* Memory operations. */ - {"flds", 0xed100a00, 4, FPU_VFP_EXT_V1xD, do_vfp_sp_ldst}, - {"fsts", 0xed000a00, 4, FPU_VFP_EXT_V1xD, do_vfp_sp_ldst}, - {"fldmias", 0xec900a00, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_ldstmia}, - {"fldmfds", 0xec900a00, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_ldstmia}, - {"fldmdbs", 0xed300a00, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_ldstmdb}, - {"fldmeas", 0xed300a00, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_ldstmdb}, - {"fldmiax", 0xec900b00, 7, FPU_VFP_EXT_V1xD, do_vfp_xp_ldstmia}, - {"fldmfdx", 0xec900b00, 7, FPU_VFP_EXT_V1xD, do_vfp_xp_ldstmia}, - {"fldmdbx", 0xed300b00, 7, FPU_VFP_EXT_V1xD, do_vfp_xp_ldstmdb}, - {"fldmeax", 0xed300b00, 7, FPU_VFP_EXT_V1xD, do_vfp_xp_ldstmdb}, - {"fstmias", 0xec800a00, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_ldstmia}, - {"fstmeas", 0xec800a00, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_ldstmia}, - {"fstmdbs", 0xed200a00, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_ldstmdb}, - {"fstmfds", 0xed200a00, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_ldstmdb}, - {"fstmiax", 0xec800b00, 7, FPU_VFP_EXT_V1xD, do_vfp_xp_ldstmia}, - {"fstmeax", 0xec800b00, 7, FPU_VFP_EXT_V1xD, do_vfp_xp_ldstmia}, - {"fstmdbx", 0xed200b00, 7, FPU_VFP_EXT_V1xD, do_vfp_xp_ldstmdb}, - {"fstmfdx", 0xed200b00, 7, FPU_VFP_EXT_V1xD, do_vfp_xp_ldstmdb}, - - /* Monadic operations. */ - {"fabss", 0xeeb00ac0, 5, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, - {"fnegs", 0xeeb10a40, 5, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, - {"fsqrts", 0xeeb10ac0, 6, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, - - /* Dyadic operations. */ - {"fadds", 0xee300a00, 5, FPU_VFP_EXT_V1xD, do_vfp_sp_dyadic}, - {"fsubs", 0xee300a40, 5, FPU_VFP_EXT_V1xD, do_vfp_sp_dyadic}, - {"fmuls", 0xee200a00, 5, FPU_VFP_EXT_V1xD, do_vfp_sp_dyadic}, - {"fdivs", 0xee800a00, 5, FPU_VFP_EXT_V1xD, do_vfp_sp_dyadic}, - {"fmacs", 0xee000a00, 5, FPU_VFP_EXT_V1xD, do_vfp_sp_dyadic}, - {"fmscs", 0xee100a00, 5, FPU_VFP_EXT_V1xD, do_vfp_sp_dyadic}, - {"fnmuls", 0xee200a40, 6, FPU_VFP_EXT_V1xD, do_vfp_sp_dyadic}, - {"fnmacs", 0xee000a40, 6, FPU_VFP_EXT_V1xD, do_vfp_sp_dyadic}, - {"fnmscs", 0xee100a40, 6, FPU_VFP_EXT_V1xD, do_vfp_sp_dyadic}, - - /* Comparisons. */ - {"fcmps", 0xeeb40a40, 5, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, - {"fcmpzs", 0xeeb50a40, 6, FPU_VFP_EXT_V1xD, do_vfp_sp_compare_z}, - {"fcmpes", 0xeeb40ac0, 6, FPU_VFP_EXT_V1xD, do_vfp_sp_monadic}, - {"fcmpezs", 0xeeb50ac0, 7, FPU_VFP_EXT_V1xD, do_vfp_sp_compare_z}, - - /* VFP V1 (Double precision). */ - /* Moves and type conversions. */ - {"fcpyd", 0xeeb00b40, 5, FPU_VFP_EXT_V1, do_vfp_dp_monadic}, - {"fcvtds", 0xeeb70ac0, 6, FPU_VFP_EXT_V1, do_vfp_dp_sp_cvt}, - {"fcvtsd", 0xeeb70bc0, 6, FPU_VFP_EXT_V1, do_vfp_sp_dp_cvt}, - {"fmdhr", 0xee200b10, 5, FPU_VFP_EXT_V1, do_vfp_dp_from_reg}, - {"fmdlr", 0xee000b10, 5, FPU_VFP_EXT_V1, do_vfp_dp_from_reg}, - {"fmrdh", 0xee300b10, 5, FPU_VFP_EXT_V1, do_vfp_reg_from_dp}, - {"fmrdl", 0xee100b10, 5, FPU_VFP_EXT_V1, do_vfp_reg_from_dp}, - {"fsitod", 0xeeb80bc0, 6, FPU_VFP_EXT_V1, do_vfp_dp_sp_cvt}, - {"fuitod", 0xeeb80b40, 6, FPU_VFP_EXT_V1, do_vfp_dp_sp_cvt}, - {"ftosid", 0xeebd0b40, 6, FPU_VFP_EXT_V1, do_vfp_sp_dp_cvt}, - {"ftosizd", 0xeebd0bc0, 7, FPU_VFP_EXT_V1, do_vfp_sp_dp_cvt}, - {"ftouid", 0xeebc0b40, 6, FPU_VFP_EXT_V1, do_vfp_sp_dp_cvt}, - {"ftouizd", 0xeebc0bc0, 7, FPU_VFP_EXT_V1, do_vfp_sp_dp_cvt}, - - /* Memory operations. */ - {"fldd", 0xed100b00, 4, FPU_VFP_EXT_V1, do_vfp_dp_ldst}, - {"fstd", 0xed000b00, 4, FPU_VFP_EXT_V1, do_vfp_dp_ldst}, - {"fldmiad", 0xec900b00, 7, FPU_VFP_EXT_V1, do_vfp_dp_ldstmia}, - {"fldmfdd", 0xec900b00, 7, FPU_VFP_EXT_V1, do_vfp_dp_ldstmia}, - {"fldmdbd", 0xed300b00, 7, FPU_VFP_EXT_V1, do_vfp_dp_ldstmdb}, - {"fldmead", 0xed300b00, 7, FPU_VFP_EXT_V1, do_vfp_dp_ldstmdb}, - {"fstmiad", 0xec800b00, 7, FPU_VFP_EXT_V1, do_vfp_dp_ldstmia}, - {"fstmead", 0xec800b00, 7, FPU_VFP_EXT_V1, do_vfp_dp_ldstmia}, - {"fstmdbd", 0xed200b00, 7, FPU_VFP_EXT_V1, do_vfp_dp_ldstmdb}, - {"fstmfdd", 0xed200b00, 7, FPU_VFP_EXT_V1, do_vfp_dp_ldstmdb}, - - /* Monadic operations. */ - {"fabsd", 0xeeb00bc0, 5, FPU_VFP_EXT_V1, do_vfp_dp_monadic}, - {"fnegd", 0xeeb10b40, 5, FPU_VFP_EXT_V1, do_vfp_dp_monadic}, - {"fsqrtd", 0xeeb10bc0, 6, FPU_VFP_EXT_V1, do_vfp_dp_monadic}, - - /* Dyadic operations. */ - {"faddd", 0xee300b00, 5, FPU_VFP_EXT_V1, do_vfp_dp_dyadic}, - {"fsubd", 0xee300b40, 5, FPU_VFP_EXT_V1, do_vfp_dp_dyadic}, - {"fmuld", 0xee200b00, 5, FPU_VFP_EXT_V1, do_vfp_dp_dyadic}, - {"fdivd", 0xee800b00, 5, FPU_VFP_EXT_V1, do_vfp_dp_dyadic}, - {"fmacd", 0xee000b00, 5, FPU_VFP_EXT_V1, do_vfp_dp_dyadic}, - {"fmscd", 0xee100b00, 5, FPU_VFP_EXT_V1, do_vfp_dp_dyadic}, - {"fnmuld", 0xee200b40, 6, FPU_VFP_EXT_V1, do_vfp_dp_dyadic}, - {"fnmacd", 0xee000b40, 6, FPU_VFP_EXT_V1, do_vfp_dp_dyadic}, - {"fnmscd", 0xee100b40, 6, FPU_VFP_EXT_V1, do_vfp_dp_dyadic}, - - /* Comparisons. */ - {"fcmpd", 0xeeb40b40, 5, FPU_VFP_EXT_V1, do_vfp_dp_monadic}, - {"fcmpzd", 0xeeb50b40, 6, FPU_VFP_EXT_V1, do_vfp_dp_compare_z}, - {"fcmped", 0xeeb40bc0, 6, FPU_VFP_EXT_V1, do_vfp_dp_monadic}, - {"fcmpezd", 0xeeb50bc0, 7, FPU_VFP_EXT_V1, do_vfp_dp_compare_z}, - - /* VFP V2. */ - {"fmsrr", 0xec400a10, 5, FPU_VFP_EXT_V2, do_vfp_sp2_from_reg2}, - {"fmrrs", 0xec500a10, 5, FPU_VFP_EXT_V2, do_vfp_reg2_from_sp2}, - {"fmdrr", 0xec400b10, 5, FPU_VFP_EXT_V2, do_vfp_dp_from_reg2}, - {"fmrrd", 0xec500b10, 5, FPU_VFP_EXT_V2, do_vfp_reg2_from_dp}, - - /* Intel XScale extensions to ARM V5 ISA. (All use CP0). */ - {"mia", 0xee200010, 3, ARM_CEXT_XSCALE, do_xsc_mia}, - {"miaph", 0xee280010, 5, ARM_CEXT_XSCALE, do_xsc_mia}, - {"miabb", 0xee2c0010, 5, ARM_CEXT_XSCALE, do_xsc_mia}, - {"miabt", 0xee2d0010, 5, ARM_CEXT_XSCALE, do_xsc_mia}, - {"miatb", 0xee2e0010, 5, ARM_CEXT_XSCALE, do_xsc_mia}, - {"miatt", 0xee2f0010, 5, ARM_CEXT_XSCALE, do_xsc_mia}, - {"mar", 0xec400000, 3, ARM_CEXT_XSCALE, do_xsc_mar}, - {"mra", 0xec500000, 3, ARM_CEXT_XSCALE, do_xsc_mra}, - - /* Intel Wireless MMX technology instructions. */ - {"tandcb", 0xee130130, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tandc}, - {"tandch", 0xee530130, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tandc}, - {"tandcw", 0xee930130, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tandc}, - {"tbcstb", 0xee400010, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tbcst}, - {"tbcsth", 0xee400050, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tbcst}, - {"tbcstw", 0xee400090, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tbcst}, - {"textrcb", 0xee130170, 7, ARM_CEXT_IWMMXT, do_iwmmxt_textrc}, - {"textrch", 0xee530170, 7, ARM_CEXT_IWMMXT, do_iwmmxt_textrc}, - {"textrcw", 0xee930170, 7, ARM_CEXT_IWMMXT, do_iwmmxt_textrc}, - {"textrmub", 0xee100070, 8, ARM_CEXT_IWMMXT, do_iwmmxt_textrm}, - {"textrmuh", 0xee500070, 8, ARM_CEXT_IWMMXT, do_iwmmxt_textrm}, - {"textrmuw", 0xee900070, 8, ARM_CEXT_IWMMXT, do_iwmmxt_textrm}, - {"textrmsb", 0xee100078, 8, ARM_CEXT_IWMMXT, do_iwmmxt_textrm}, - {"textrmsh", 0xee500078, 8, ARM_CEXT_IWMMXT, do_iwmmxt_textrm}, - {"textrmsw", 0xee900078, 8, ARM_CEXT_IWMMXT, do_iwmmxt_textrm}, - {"tinsrb", 0xee600010, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tinsr}, - {"tinsrh", 0xee600050, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tinsr}, - {"tinsrw", 0xee600090, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tinsr}, - {"tmcr", 0xee000110, 4, ARM_CEXT_IWMMXT, do_iwmmxt_tmcr}, - {"tmcrr", 0xec400000, 5, ARM_CEXT_IWMMXT, do_iwmmxt_tmcrr}, - {"tmia", 0xee200010, 4, ARM_CEXT_IWMMXT, do_iwmmxt_tmia}, - {"tmiaph", 0xee280010, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tmia}, - {"tmiabb", 0xee2c0010, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tmia}, - {"tmiabt", 0xee2d0010, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tmia}, - {"tmiatb", 0xee2e0010, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tmia}, - {"tmiatt", 0xee2f0010, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tmia}, - {"tmovmskb", 0xee100030, 8, ARM_CEXT_IWMMXT, do_iwmmxt_tmovmsk}, - {"tmovmskh", 0xee500030, 8, ARM_CEXT_IWMMXT, do_iwmmxt_tmovmsk}, - {"tmovmskw", 0xee900030, 8, ARM_CEXT_IWMMXT, do_iwmmxt_tmovmsk}, - {"tmrc", 0xee100110, 4, ARM_CEXT_IWMMXT, do_iwmmxt_tmrc}, - {"tmrrc", 0xec500000, 5, ARM_CEXT_IWMMXT, do_iwmmxt_tmrrc}, - {"torcb", 0xee130150, 5, ARM_CEXT_IWMMXT, do_iwmmxt_torc}, - {"torch", 0xee530150, 5, ARM_CEXT_IWMMXT, do_iwmmxt_torc}, - {"torcw", 0xee930150, 5, ARM_CEXT_IWMMXT, do_iwmmxt_torc}, - {"waccb", 0xee0001c0, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, - {"wacch", 0xee4001c0, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, - {"waccw", 0xee8001c0, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, - {"waddbss", 0xee300180, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"waddb", 0xee000180, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"waddbus", 0xee100180, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"waddhss", 0xee700180, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"waddh", 0xee400180, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"waddhus", 0xee500180, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"waddwss", 0xeeb00180, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"waddw", 0xee800180, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"waddwus", 0xee900180, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"waligni", 0xee000020, 7, ARM_CEXT_IWMMXT, do_iwmmxt_waligni}, - {"walignr0", 0xee800020, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"walignr1", 0xee900020, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"walignr2", 0xeea00020, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"walignr3", 0xeeb00020, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wand", 0xee200000, 4, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wandn", 0xee300000, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wavg2b", 0xee800000, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wavg2br", 0xee900000, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wavg2h", 0xeec00000, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wavg2hr", 0xeed00000, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wcmpeqb", 0xee000060, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wcmpeqh", 0xee400060, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wcmpeqw", 0xee800060, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wcmpgtub", 0xee100060, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wcmpgtuh", 0xee500060, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wcmpgtuw", 0xee900060, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wcmpgtsb", 0xee300060, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wcmpgtsh", 0xee700060, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wcmpgtsw", 0xeeb00060, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wldrb", 0xec100000, 5, ARM_CEXT_IWMMXT, do_iwmmxt_byte_addr}, - {"wldrh", 0xec100100, 5, ARM_CEXT_IWMMXT, do_iwmmxt_byte_addr}, - {"wldrw", 0xec100200, 5, ARM_CEXT_IWMMXT, do_iwmmxt_word_addr}, - {"wldrd", 0xec100300, 5, ARM_CEXT_IWMMXT, do_iwmmxt_word_addr}, - {"wmacs", 0xee600100, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wmacsz", 0xee700100, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wmacu", 0xee400100, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wmacuz", 0xee500100, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wmadds", 0xeea00100, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wmaddu", 0xee800100, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wmaxsb", 0xee200160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wmaxsh", 0xee600160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wmaxsw", 0xeea00160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wmaxub", 0xee000160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wmaxuh", 0xee400160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wmaxuw", 0xee800160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wminsb", 0xee300160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wminsh", 0xee700160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wminsw", 0xeeb00160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wminub", 0xee100160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wminuh", 0xee500160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wminuw", 0xee900160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wmov", 0xee000000, 4, ARM_CEXT_IWMMXT, do_iwmmxt_wmov}, - {"wmulsm", 0xee300100, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wmulsl", 0xee200100, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wmulum", 0xee100100, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wmulul", 0xee000100, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wor", 0xee000000, 3, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wpackhss", 0xee700080, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wpackhus", 0xee500080, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wpackwss", 0xeeb00080, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wpackwus", 0xee900080, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wpackdss", 0xeef00080, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wpackdus", 0xeed00080, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wrorh", 0xee700040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wrorhg", 0xee700148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, - {"wrorw", 0xeeb00040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wrorwg", 0xeeb00148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, - {"wrord", 0xeef00040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wrordg", 0xeef00148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, - {"wsadb", 0xee000120, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wsadbz", 0xee100120, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wsadh", 0xee400120, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wsadhz", 0xee500120, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wshufh", 0xee0001e0, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wshufh}, - {"wsllh", 0xee500040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wsllhg", 0xee500148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, - {"wsllw", 0xee900040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wsllwg", 0xee900148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, - {"wslld", 0xeed00040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wslldg", 0xeed00148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, - {"wsrah", 0xee400040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wsrahg", 0xee400148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, - {"wsraw", 0xee800040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wsrawg", 0xee800148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, - {"wsrad", 0xeec00040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wsradg", 0xeec00148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, - {"wsrlh", 0xee600040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wsrlhg", 0xee600148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, - {"wsrlw", 0xeea00040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wsrlwg", 0xeea00148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, - {"wsrld", 0xeee00040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wsrldg", 0xeee00148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, - {"wstrb", 0xec000000, 5, ARM_CEXT_IWMMXT, do_iwmmxt_byte_addr}, - {"wstrh", 0xec000100, 5, ARM_CEXT_IWMMXT, do_iwmmxt_byte_addr}, - {"wstrw", 0xec000200, 5, ARM_CEXT_IWMMXT, do_iwmmxt_word_addr}, - {"wstrd", 0xec000300, 5, ARM_CEXT_IWMMXT, do_iwmmxt_word_addr}, - {"wsubbss", 0xee3001a0, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wsubb", 0xee0001a0, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wsubbus", 0xee1001a0, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wsubhss", 0xee7001a0, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wsubh", 0xee4001a0, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wsubhus", 0xee5001a0, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wsubwss", 0xeeb001a0, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wsubw", 0xee8001a0, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wsubwus", 0xee9001a0, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wunpckehub", 0xee0000c0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, - {"wunpckehuh", 0xee4000c0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, - {"wunpckehuw", 0xee8000c0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, - {"wunpckehsb", 0xee2000c0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, - {"wunpckehsh", 0xee6000c0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, - {"wunpckehsw", 0xeea000c0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, - {"wunpckihb", 0xee1000c0, 9, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wunpckihh", 0xee5000c0, 9, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wunpckihw", 0xee9000c0, 9, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wunpckelub", 0xee0000e0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, - {"wunpckeluh", 0xee4000e0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, - {"wunpckeluw", 0xee8000e0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, - {"wunpckelsb", 0xee2000e0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, - {"wunpckelsh", 0xee6000e0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, - {"wunpckelsw", 0xeea000e0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, - {"wunpckilb", 0xee1000e0, 9, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wunpckilh", 0xee5000e0, 9, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wunpckilw", 0xee9000e0, 9, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wxor", 0xee100000, 4, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, - {"wzero", 0xee300000, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wzero}, - - /* Cirrus Maverick instructions. */ - {"cfldrs", 0xec100400, 6, ARM_CEXT_MAVERICK, do_mav_ldst_1}, - {"cfldrd", 0xec500400, 6, ARM_CEXT_MAVERICK, do_mav_ldst_2}, - {"cfldr32", 0xec100500, 7, ARM_CEXT_MAVERICK, do_mav_ldst_3}, - {"cfldr64", 0xec500500, 7, ARM_CEXT_MAVERICK, do_mav_ldst_4}, - {"cfstrs", 0xec000400, 6, ARM_CEXT_MAVERICK, do_mav_ldst_1}, - {"cfstrd", 0xec400400, 6, ARM_CEXT_MAVERICK, do_mav_ldst_2}, - {"cfstr32", 0xec000500, 7, ARM_CEXT_MAVERICK, do_mav_ldst_3}, - {"cfstr64", 0xec400500, 7, ARM_CEXT_MAVERICK, do_mav_ldst_4}, - {"cfmvsr", 0xee000450, 6, ARM_CEXT_MAVERICK, do_mav_binops_2a}, - {"cfmvrs", 0xee100450, 6, ARM_CEXT_MAVERICK, do_mav_binops_1a}, - {"cfmvdlr", 0xee000410, 7, ARM_CEXT_MAVERICK, do_mav_binops_2b}, - {"cfmvrdl", 0xee100410, 7, ARM_CEXT_MAVERICK, do_mav_binops_1b}, - {"cfmvdhr", 0xee000430, 7, ARM_CEXT_MAVERICK, do_mav_binops_2b}, - {"cfmvrdh", 0xee100430, 7, ARM_CEXT_MAVERICK, do_mav_binops_1b}, - {"cfmv64lr", 0xee000510, 8, ARM_CEXT_MAVERICK, do_mav_binops_2c}, - {"cfmvr64l", 0xee100510, 8, ARM_CEXT_MAVERICK, do_mav_binops_1c}, - {"cfmv64hr", 0xee000530, 8, ARM_CEXT_MAVERICK, do_mav_binops_2c}, - {"cfmvr64h", 0xee100530, 8, ARM_CEXT_MAVERICK, do_mav_binops_1c}, - {"cfmval32", 0xee200440, 8, ARM_CEXT_MAVERICK, do_mav_binops_3a}, - {"cfmv32al", 0xee100440, 8, ARM_CEXT_MAVERICK, do_mav_binops_3b}, - {"cfmvam32", 0xee200460, 8, ARM_CEXT_MAVERICK, do_mav_binops_3a}, - {"cfmv32am", 0xee100460, 8, ARM_CEXT_MAVERICK, do_mav_binops_3b}, - {"cfmvah32", 0xee200480, 8, ARM_CEXT_MAVERICK, do_mav_binops_3a}, - {"cfmv32ah", 0xee100480, 8, ARM_CEXT_MAVERICK, do_mav_binops_3b}, - {"cfmva32", 0xee2004a0, 7, ARM_CEXT_MAVERICK, do_mav_binops_3a}, - {"cfmv32a", 0xee1004a0, 7, ARM_CEXT_MAVERICK, do_mav_binops_3b}, - {"cfmva64", 0xee2004c0, 7, ARM_CEXT_MAVERICK, do_mav_binops_3c}, - {"cfmv64a", 0xee1004c0, 7, ARM_CEXT_MAVERICK, do_mav_binops_3d}, - {"cfmvsc32", 0xee2004e0, 8, ARM_CEXT_MAVERICK, do_mav_dspsc_1}, - {"cfmv32sc", 0xee1004e0, 8, ARM_CEXT_MAVERICK, do_mav_dspsc_2}, - {"cfcpys", 0xee000400, 6, ARM_CEXT_MAVERICK, do_mav_binops_1d}, - {"cfcpyd", 0xee000420, 6, ARM_CEXT_MAVERICK, do_mav_binops_1e}, - {"cfcvtsd", 0xee000460, 7, ARM_CEXT_MAVERICK, do_mav_binops_1f}, - {"cfcvtds", 0xee000440, 7, ARM_CEXT_MAVERICK, do_mav_binops_1g}, - {"cfcvt32s", 0xee000480, 8, ARM_CEXT_MAVERICK, do_mav_binops_1h}, - {"cfcvt32d", 0xee0004a0, 8, ARM_CEXT_MAVERICK, do_mav_binops_1i}, - {"cfcvt64s", 0xee0004c0, 8, ARM_CEXT_MAVERICK, do_mav_binops_1j}, - {"cfcvt64d", 0xee0004e0, 8, ARM_CEXT_MAVERICK, do_mav_binops_1k}, - {"cfcvts32", 0xee100580, 8, ARM_CEXT_MAVERICK, do_mav_binops_1l}, - {"cfcvtd32", 0xee1005a0, 8, ARM_CEXT_MAVERICK, do_mav_binops_1m}, - {"cftruncs32", 0xee1005c0, 10, ARM_CEXT_MAVERICK, do_mav_binops_1l}, - {"cftruncd32", 0xee1005e0, 10, ARM_CEXT_MAVERICK, do_mav_binops_1m}, - {"cfrshl32", 0xee000550, 8, ARM_CEXT_MAVERICK, do_mav_triple_4a}, - {"cfrshl64", 0xee000570, 8, ARM_CEXT_MAVERICK, do_mav_triple_4b}, - {"cfsh32", 0xee000500, 6, ARM_CEXT_MAVERICK, do_mav_shift_1}, - {"cfsh64", 0xee200500, 6, ARM_CEXT_MAVERICK, do_mav_shift_2}, - {"cfcmps", 0xee100490, 6, ARM_CEXT_MAVERICK, do_mav_triple_5a}, - {"cfcmpd", 0xee1004b0, 6, ARM_CEXT_MAVERICK, do_mav_triple_5b}, - {"cfcmp32", 0xee100590, 7, ARM_CEXT_MAVERICK, do_mav_triple_5c}, - {"cfcmp64", 0xee1005b0, 7, ARM_CEXT_MAVERICK, do_mav_triple_5d}, - {"cfabss", 0xee300400, 6, ARM_CEXT_MAVERICK, do_mav_binops_1d}, - {"cfabsd", 0xee300420, 6, ARM_CEXT_MAVERICK, do_mav_binops_1e}, - {"cfnegs", 0xee300440, 6, ARM_CEXT_MAVERICK, do_mav_binops_1d}, - {"cfnegd", 0xee300460, 6, ARM_CEXT_MAVERICK, do_mav_binops_1e}, - {"cfadds", 0xee300480, 6, ARM_CEXT_MAVERICK, do_mav_triple_5e}, - {"cfaddd", 0xee3004a0, 6, ARM_CEXT_MAVERICK, do_mav_triple_5f}, - {"cfsubs", 0xee3004c0, 6, ARM_CEXT_MAVERICK, do_mav_triple_5e}, - {"cfsubd", 0xee3004e0, 6, ARM_CEXT_MAVERICK, do_mav_triple_5f}, - {"cfmuls", 0xee100400, 6, ARM_CEXT_MAVERICK, do_mav_triple_5e}, - {"cfmuld", 0xee100420, 6, ARM_CEXT_MAVERICK, do_mav_triple_5f}, - {"cfabs32", 0xee300500, 7, ARM_CEXT_MAVERICK, do_mav_binops_1n}, - {"cfabs64", 0xee300520, 7, ARM_CEXT_MAVERICK, do_mav_binops_1o}, - {"cfneg32", 0xee300540, 7, ARM_CEXT_MAVERICK, do_mav_binops_1n}, - {"cfneg64", 0xee300560, 7, ARM_CEXT_MAVERICK, do_mav_binops_1o}, - {"cfadd32", 0xee300580, 7, ARM_CEXT_MAVERICK, do_mav_triple_5g}, - {"cfadd64", 0xee3005a0, 7, ARM_CEXT_MAVERICK, do_mav_triple_5h}, - {"cfsub32", 0xee3005c0, 7, ARM_CEXT_MAVERICK, do_mav_triple_5g}, - {"cfsub64", 0xee3005e0, 7, ARM_CEXT_MAVERICK, do_mav_triple_5h}, - {"cfmul32", 0xee100500, 7, ARM_CEXT_MAVERICK, do_mav_triple_5g}, - {"cfmul64", 0xee100520, 7, ARM_CEXT_MAVERICK, do_mav_triple_5h}, - {"cfmac32", 0xee100540, 7, ARM_CEXT_MAVERICK, do_mav_triple_5g}, - {"cfmsc32", 0xee100560, 7, ARM_CEXT_MAVERICK, do_mav_triple_5g}, - {"cfmadd32", 0xee000600, 8, ARM_CEXT_MAVERICK, do_mav_quad_6a}, - {"cfmsub32", 0xee100600, 8, ARM_CEXT_MAVERICK, do_mav_quad_6a}, - {"cfmadda32", 0xee200600, 9, ARM_CEXT_MAVERICK, do_mav_quad_6b}, - {"cfmsuba32", 0xee300600, 9, ARM_CEXT_MAVERICK, do_mav_quad_6b}, + {"all", ARM_ANY, FPU_ARCH_FPA}, + {"arm1", ARM_ARCH_V1, FPU_ARCH_FPA}, + {"arm2", ARM_ARCH_V2, FPU_ARCH_FPA}, + {"arm250", ARM_ARCH_V2S, FPU_ARCH_FPA}, + {"arm3", ARM_ARCH_V2S, FPU_ARCH_FPA}, + {"arm6", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm60", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm600", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm610", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm620", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm7", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm7m", ARM_ARCH_V3M, FPU_ARCH_FPA}, + {"arm7d", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm7dm", ARM_ARCH_V3M, FPU_ARCH_FPA}, + {"arm7di", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm7dmi", ARM_ARCH_V3M, FPU_ARCH_FPA}, + {"arm70", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm700", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm700i", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm710", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm710t", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm720", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm720t", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm740t", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm710c", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm7100", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm7500", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm7500fe", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"arm7t", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm7tdmi", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm7tdmi-s", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm8", ARM_ARCH_V4, FPU_ARCH_FPA}, + {"arm810", ARM_ARCH_V4, FPU_ARCH_FPA}, + {"strongarm", ARM_ARCH_V4, FPU_ARCH_FPA}, + {"strongarm1", ARM_ARCH_V4, FPU_ARCH_FPA}, + {"strongarm110", ARM_ARCH_V4, FPU_ARCH_FPA}, + {"strongarm1100", ARM_ARCH_V4, FPU_ARCH_FPA}, + {"strongarm1110", ARM_ARCH_V4, FPU_ARCH_FPA}, + {"arm9", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm920", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm920t", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm922t", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm940t", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"arm9tdmi", ARM_ARCH_V4T, FPU_ARCH_FPA}, + /* For V5 or later processors we default to using VFP; but the user + should really set the FPU type explicitly. */ + {"arm9e-r0", ARM_ARCH_V5TExP, FPU_ARCH_VFP_V2}, + {"arm9e", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, + {"arm926ej", ARM_ARCH_V5TEJ, FPU_ARCH_VFP_V2}, + {"arm926ejs", ARM_ARCH_V5TEJ, FPU_ARCH_VFP_V2}, + {"arm926ej-s", ARM_ARCH_V5TEJ, FPU_ARCH_VFP_V2}, + {"arm946e-r0", ARM_ARCH_V5TExP, FPU_ARCH_VFP_V2}, + {"arm946e", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, + {"arm966e-r0", ARM_ARCH_V5TExP, FPU_ARCH_VFP_V2}, + {"arm966e", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, + {"arm10t", ARM_ARCH_V5T, FPU_ARCH_VFP_V1}, + {"arm10e", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, + {"arm1020", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, + {"arm1020t", ARM_ARCH_V5T, FPU_ARCH_VFP_V1}, + {"arm1020e", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, + {"arm1026ejs", ARM_ARCH_V5TEJ, FPU_ARCH_VFP_V2}, + {"arm1026ej-s", ARM_ARCH_V5TEJ, FPU_ARCH_VFP_V2}, + {"arm1136js", ARM_ARCH_V6, FPU_NONE}, + {"arm1136j-s", ARM_ARCH_V6, FPU_NONE}, + {"arm1136jfs", ARM_ARCH_V6, FPU_ARCH_VFP_V2}, + {"arm1136jf-s", ARM_ARCH_V6, FPU_ARCH_VFP_V2}, + {"mpcore", ARM_ARCH_V6K, FPU_ARCH_VFP_V2}, + {"mpcorenovfp", ARM_ARCH_V6K, FPU_NONE}, + {"arm1176jz-s", ARM_ARCH_V6ZK, FPU_NONE}, + {"arm1176jzf-s", ARM_ARCH_V6ZK, FPU_ARCH_VFP_V2}, + /* ??? XSCALE is really an architecture. */ + {"xscale", ARM_ARCH_XSCALE, FPU_ARCH_VFP_V2}, + /* ??? iwmmxt is not a processor. */ + {"iwmmxt", ARM_ARCH_IWMMXT, FPU_ARCH_VFP_V2}, + {"i80200", ARM_ARCH_XSCALE, FPU_ARCH_VFP_V2}, + /* Maverick */ + {"ep9312", ARM_ARCH_V4T | ARM_CEXT_MAVERICK, FPU_ARCH_MAVERICK}, + {NULL, 0, 0} }; -/* Iterate over the base tables to create the instruction patterns. */ - -static void -build_arm_ops_hsh (void) -{ - unsigned int i; - unsigned int j; - static struct obstack insn_obstack; - - obstack_begin (&insn_obstack, 4000); - - for (i = 0; i < sizeof (insns) / sizeof (struct asm_opcode); i++) - { - const struct asm_opcode *insn = insns + i; - - if (insn->cond_offset != 0) - { - /* Insn supports conditional execution. Build the varaints - and insert them in the hash table. */ - for (j = 0; j < sizeof (conds) / sizeof (struct asm_cond); j++) - { - unsigned len = strlen (insn->template); - struct asm_opcode *new; - char *template; - - new = obstack_alloc (&insn_obstack, sizeof (struct asm_opcode)); - /* All condition codes are two characters. */ - template = obstack_alloc (&insn_obstack, len + 3); - - strncpy (template, insn->template, insn->cond_offset); - strcpy (template + insn->cond_offset, conds[j].template); - if (len > insn->cond_offset) - strcpy (template + insn->cond_offset + 2, - insn->template + insn->cond_offset); - new->template = template; - new->cond_offset = 0; - new->variant = insn->variant; - new->parms = insn->parms; - new->value = (insn->value & ~COND_MASK) | conds[j].value; - - hash_insert (arm_ops_hsh, new->template, (PTR) new); - } - } - /* Finally, insert the unconditional insn in the table directly; - no need to build a copy. */ - hash_insert (arm_ops_hsh, insn->template, (PTR) insn); - } -} - - -static const struct thumb_opcode tinsns[] = +struct arm_arch_option_table { - /* Thumb v1 (ARMv4T). */ - {"adc", 0x4140, 2, ARM_EXT_V4T, do_t_arit}, - {"add", 0x0000, 2, ARM_EXT_V4T, do_t_add}, - {"and", 0x4000, 2, ARM_EXT_V4T, do_t_arit}, - {"asr", 0x0000, 2, ARM_EXT_V4T, do_t_asr}, - {"b", T_OPCODE_BRANCH, 2, ARM_EXT_V4T, do_t_branch12}, - {"beq", 0xd0fe, 2, ARM_EXT_V4T, do_t_branch9}, - {"bne", 0xd1fe, 2, ARM_EXT_V4T, do_t_branch9}, - {"bcs", 0xd2fe, 2, ARM_EXT_V4T, do_t_branch9}, - {"bhs", 0xd2fe, 2, ARM_EXT_V4T, do_t_branch9}, - {"bcc", 0xd3fe, 2, ARM_EXT_V4T, do_t_branch9}, - {"bul", 0xd3fe, 2, ARM_EXT_V4T, do_t_branch9}, - {"blo", 0xd3fe, 2, ARM_EXT_V4T, do_t_branch9}, - {"bmi", 0xd4fe, 2, ARM_EXT_V4T, do_t_branch9}, - {"bpl", 0xd5fe, 2, ARM_EXT_V4T, do_t_branch9}, - {"bvs", 0xd6fe, 2, ARM_EXT_V4T, do_t_branch9}, - {"bvc", 0xd7fe, 2, ARM_EXT_V4T, do_t_branch9}, - {"bhi", 0xd8fe, 2, ARM_EXT_V4T, do_t_branch9}, - {"bls", 0xd9fe, 2, ARM_EXT_V4T, do_t_branch9}, - {"bge", 0xdafe, 2, ARM_EXT_V4T, do_t_branch9}, - {"blt", 0xdbfe, 2, ARM_EXT_V4T, do_t_branch9}, - {"bgt", 0xdcfe, 2, ARM_EXT_V4T, do_t_branch9}, - {"ble", 0xddfe, 2, ARM_EXT_V4T, do_t_branch9}, - {"bal", 0xdefe, 2, ARM_EXT_V4T, do_t_branch9}, - {"bic", 0x4380, 2, ARM_EXT_V4T, do_t_arit}, - {"bl", 0xf7fffffe, 4, ARM_EXT_V4T, do_t_branch23}, - {"bx", 0x4700, 2, ARM_EXT_V4T, do_t_bx}, - {"cmn", T_OPCODE_CMN, 2, ARM_EXT_V4T, do_t_arit}, - {"cmp", 0x0000, 2, ARM_EXT_V4T, do_t_compare}, - {"eor", 0x4040, 2, ARM_EXT_V4T, do_t_arit}, - {"ldmia", 0xc800, 2, ARM_EXT_V4T, do_t_ldmstm}, - {"ldr", 0x0000, 2, ARM_EXT_V4T, do_t_ldr}, - {"ldrb", 0x0000, 2, ARM_EXT_V4T, do_t_ldrb}, - {"ldrh", 0x0000, 2, ARM_EXT_V4T, do_t_ldrh}, - {"ldrsb", 0x5600, 2, ARM_EXT_V4T, do_t_lds}, - {"ldrsh", 0x5e00, 2, ARM_EXT_V4T, do_t_lds}, - {"ldsb", 0x5600, 2, ARM_EXT_V4T, do_t_lds}, - {"ldsh", 0x5e00, 2, ARM_EXT_V4T, do_t_lds}, - {"lsl", 0x0000, 2, ARM_EXT_V4T, do_t_lsl}, - {"lsr", 0x0000, 2, ARM_EXT_V4T, do_t_lsr}, - {"mov", 0x0000, 2, ARM_EXT_V4T, do_t_mov}, - {"mul", T_OPCODE_MUL, 2, ARM_EXT_V4T, do_t_arit}, - {"mvn", T_OPCODE_MVN, 2, ARM_EXT_V4T, do_t_arit}, - {"neg", T_OPCODE_NEG, 2, ARM_EXT_V4T, do_t_arit}, - {"orr", 0x4300, 2, ARM_EXT_V4T, do_t_arit}, - {"pop", 0xbc00, 2, ARM_EXT_V4T, do_t_push_pop}, - {"push", 0xb400, 2, ARM_EXT_V4T, do_t_push_pop}, - {"ror", 0x41c0, 2, ARM_EXT_V4T, do_t_arit}, - {"sbc", 0x4180, 2, ARM_EXT_V4T, do_t_arit}, - {"stmia", 0xc000, 2, ARM_EXT_V4T, do_t_ldmstm}, - {"str", 0x0000, 2, ARM_EXT_V4T, do_t_str}, - {"strb", 0x0000, 2, ARM_EXT_V4T, do_t_strb}, - {"strh", 0x0000, 2, ARM_EXT_V4T, do_t_strh}, - {"swi", 0xdf00, 2, ARM_EXT_V4T, do_t_swi}, - {"sub", 0x0000, 2, ARM_EXT_V4T, do_t_sub}, - {"tst", T_OPCODE_TST, 2, ARM_EXT_V4T, do_t_arit}, - /* Pseudo ops: */ - {"adr", 0x0000, 2, ARM_EXT_V4T, do_t_adr}, - {"nop", 0x46C0, 2, ARM_EXT_V4T, do_t_nop}, /* mov r8,r8 */ - /* Thumb v2 (ARMv5T). */ - {"blx", 0, 0, ARM_EXT_V5T, do_t_blx}, - {"bkpt", 0xbe00, 2, ARM_EXT_V5T, do_t_bkpt}, - - /* ARM V6. */ - {"cpsie", 0xb660, 2, ARM_EXT_V6, do_t_cps}, - {"cpsid", 0xb670, 2, ARM_EXT_V6, do_t_cps}, - {"cpy", 0x4600, 2, ARM_EXT_V6, do_t_cpy}, - {"rev", 0xba00, 2, ARM_EXT_V6, do_t_arit}, - {"rev16", 0xba40, 2, ARM_EXT_V6, do_t_arit}, - {"revsh", 0xbac0, 2, ARM_EXT_V6, do_t_arit}, - {"setend", 0xb650, 2, ARM_EXT_V6, do_t_setend}, - {"sxth", 0xb200, 2, ARM_EXT_V6, do_t_arit}, - {"sxtb", 0xb240, 2, ARM_EXT_V6, do_t_arit}, - {"uxth", 0xb280, 2, ARM_EXT_V6, do_t_arit}, - {"uxtb", 0xb2c0, 2, ARM_EXT_V6, do_t_arit}, - - /* ARM V6K. */ - {"sev", 0xbf40, 2, ARM_EXT_V6K, do_empty}, - {"wfe", 0xbf20, 2, ARM_EXT_V6K, do_empty}, - {"wfi", 0xbf30, 2, ARM_EXT_V6K, do_empty}, - {"yield", 0xbf10, 2, ARM_EXT_V6K, do_empty}, + char *name; + int value; + int default_fpu; }; -void -md_begin (void) +/* This list should, at a minimum, contain all the architecture names + recognized by GCC. */ +static struct arm_arch_option_table arm_archs[] = { - unsigned mach; - unsigned int i; - - if ( (arm_ops_hsh = hash_new ()) == NULL - || (arm_tops_hsh = hash_new ()) == NULL - || (arm_cond_hsh = hash_new ()) == NULL - || (arm_shift_hsh = hash_new ()) == NULL - || (arm_psr_hsh = hash_new ()) == NULL) - as_fatal (_("virtual memory exhausted")); - - build_arm_ops_hsh (); - for (i = 0; i < sizeof (tinsns) / sizeof (struct thumb_opcode); i++) - hash_insert (arm_tops_hsh, tinsns[i].template, (PTR) (tinsns + i)); - for (i = 0; i < sizeof (conds) / sizeof (struct asm_cond); i++) - hash_insert (arm_cond_hsh, conds[i].template, (PTR) (conds + i)); - for (i = 0; i < sizeof (shift_names) / sizeof (struct asm_shift_name); i++) - hash_insert (arm_shift_hsh, shift_names[i].name, (PTR) (shift_names + i)); - for (i = 0; i < sizeof (psrs) / sizeof (struct asm_psr); i++) - hash_insert (arm_psr_hsh, psrs[i].template, (PTR) (psrs + i)); - - for (i = (int) REG_TYPE_FIRST; i < (int) REG_TYPE_MAX; i++) - build_reg_hsh (all_reg_maps + i); - - set_constant_flonums (); - - /* Set the cpu variant based on the command-line options. We prefer - -mcpu= over -march= if both are set (as for GCC); and we prefer - -mfpu= over any other way of setting the floating point unit. - Use of legacy options with new options are faulted. */ - if (legacy_cpu != -1) - { - if (mcpu_cpu_opt != -1 || march_cpu_opt != -1) - as_bad (_("use of old and new-style options to set CPU type")); - - mcpu_cpu_opt = legacy_cpu; - } - else if (mcpu_cpu_opt == -1) - mcpu_cpu_opt = march_cpu_opt; - - if (legacy_fpu != -1) - { - if (mfpu_opt != -1) - as_bad (_("use of old and new-style options to set FPU type")); - - mfpu_opt = legacy_fpu; - } - else if (mfpu_opt == -1) - { -#if !(defined (TE_LINUX) || defined (TE_NetBSD) || defined (TE_VXWORKS)) - /* Some environments specify a default FPU. If they don't, infer it - from the processor. */ - if (mcpu_fpu_opt != -1) - mfpu_opt = mcpu_fpu_opt; - else - mfpu_opt = march_fpu_opt; -#else - mfpu_opt = FPU_DEFAULT; -#endif - } - - if (mfpu_opt == -1) - { - if (mcpu_cpu_opt == -1) - mfpu_opt = FPU_DEFAULT; - else if (mcpu_cpu_opt & ARM_EXT_V5) - mfpu_opt = FPU_ARCH_VFP_V2; - else - mfpu_opt = FPU_ARCH_FPA; - } - - if (mcpu_cpu_opt == -1) - mcpu_cpu_opt = CPU_DEFAULT; - - cpu_variant = mcpu_cpu_opt | mfpu_opt; - -#if defined OBJ_COFF || defined OBJ_ELF - { - unsigned int flags = 0; - -#if defined OBJ_ELF - flags = meabi_flags; - - switch (meabi_flags) - { - case EF_ARM_EABI_UNKNOWN: -#endif - /* 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; - if (pic_code) flags |= F_PIC; - if ((cpu_variant & FPU_ANY) == FPU_NONE - || (cpu_variant & FPU_ANY) == FPU_ARCH_VFP) /* VFP layout only. */ - flags |= F_SOFT_FLOAT; - - switch (mfloat_abi_opt) - { - case ARM_FLOAT_ABI_SOFT: - case ARM_FLOAT_ABI_SOFTFP: - flags |= F_SOFT_FLOAT; - break; - - case ARM_FLOAT_ABI_HARD: - if (flags & F_SOFT_FLOAT) - as_bad (_("hard-float conflicts with specified fpu")); - break; - } - - /* Using VFP conventions (even if soft-float). */ - if (cpu_variant & FPU_VFP_EXT_NONE) - flags |= F_VFP_FLOAT; - -#if defined OBJ_ELF - if (cpu_variant & FPU_ARCH_MAVERICK) - flags |= EF_ARM_MAVERICK_FLOAT; - break; - - case EF_ARM_EABI_VER4: - /* No additional flags to set. */ - break; - - default: - abort (); - } -#endif - bfd_set_private_flags (stdoutput, flags); - - /* We have run out flags in the COFF header to encode the - status of ATPCS support, so instead we create a dummy, - empty, debug section called .arm.atpcs. */ - if (atpcs) - { - asection * sec; - - sec = bfd_make_section (stdoutput, ".arm.atpcs"); - - if (sec != NULL) - { - bfd_set_section_flags - (stdoutput, sec, SEC_READONLY | SEC_DEBUGGING /* | SEC_HAS_CONTENTS */); - bfd_set_section_size (stdoutput, sec, 0); - bfd_set_section_contents (stdoutput, sec, NULL, 0, 0); - } - } - } -#endif - - /* 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; - - case ARM_6: /* Also ARM_7. */ - mach = bfd_mach_arm_3; - break; - - default: - mach = bfd_mach_arm_unknown; - break; - } - - /* Catch special cases. */ - if (cpu_variant & ARM_CEXT_IWMMXT) - mach = bfd_mach_arm_iWMMXt; - else if (cpu_variant & ARM_CEXT_XSCALE) - mach = bfd_mach_arm_XScale; - else if (cpu_variant & ARM_CEXT_MAVERICK) - mach = bfd_mach_arm_ep9312; - else if (cpu_variant & ARM_EXT_V5E) - mach = bfd_mach_arm_5TE; - else if (cpu_variant & ARM_EXT_V5) - { - if (cpu_variant & ARM_EXT_V4T) - mach = bfd_mach_arm_5T; - else - mach = bfd_mach_arm_5; - } - else if (cpu_variant & ARM_EXT_V4) - { - if (cpu_variant & ARM_EXT_V4T) - mach = bfd_mach_arm_4T; - else - mach = bfd_mach_arm_4; - } - else if (cpu_variant & ARM_EXT_V3M) - 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 - for use in the a.out file, and stores them in the array pointed to by buf. - This knows about the endian-ness of the target machine and does - THE RIGHT THING, whatever it is. Possible values for n are 1 (byte) - 2 (short) and 4 (long) Floating numbers are put out as a series of - LITTLENUMS (shorts, here at least). */ - -void -md_number_to_chars (char * buf, valueT val, int n) -{ - if (target_big_endian) - number_to_chars_bigendian (buf, val, n); - else - number_to_chars_littleendian (buf, val, n); -} - -static valueT -md_chars_to_number (char * buf, int n) -{ - valueT result = 0; - unsigned char * where = (unsigned char *) buf; - - if (target_big_endian) - { - while (n--) - { - result <<= 8; - result |= (*where++ & 255); - } - } - else - { - while (n--) - { - result <<= 8; - result |= (where[n] & 255); - } - } - - return result; -} - -/* Turn a string in input_line_pointer into a floating point constant - of type TYPE, and store the appropriate bytes in *LITP. The number - of LITTLENUMS emitted is stored in *SIZEP. An error message is - returned, or NULL on OK. - - Note that fp constants aren't represent in the normal way on the ARM. - In big endian mode, things are as expected. However, in little endian - mode fp constants are big-endian word-wise, and little-endian byte-wise - within the words. For example, (double) 1.1 in big endian mode is - the byte sequence 3f f1 99 99 99 99 99 9a, and in little endian mode is - the byte sequence 99 99 f1 3f 9a 99 99 99. - - ??? The format of 12 byte floats is uncertain according to gcc's arm.h. */ - -char * -md_atof (int type, char * litP, int * sizeP) -{ - int prec; - LITTLENUM_TYPE words[MAX_LITTLENUMS]; - char *t; - int i; - - switch (type) - { - case 'f': - case 'F': - case 's': - case 'S': - prec = 2; - break; - - case 'd': - case 'D': - case 'r': - case 'R': - prec = 4; - break; - - case 'x': - case 'X': - prec = 6; - break; - - case 'p': - case 'P': - prec = 6; - break; - - default: - *sizeP = 0; - return _("bad call to MD_ATOF()"); - } - - t = atof_ieee (input_line_pointer, type, words); - if (t) - input_line_pointer = t; - *sizeP = prec * 2; - - if (target_big_endian) - { - for (i = 0; i < prec; i++) - { - md_number_to_chars (litP, (valueT) words[i], 2); - litP += 2; - } - } - else - { - if (cpu_variant & FPU_ARCH_VFP) - for (i = prec - 1; i >= 0; i--) - { - md_number_to_chars (litP, (valueT) words[i], 2); - litP += 2; - } - else - /* For a 4 byte float the order of elements in `words' is 1 0. - For an 8 byte float the order is 1 0 3 2. */ - for (i = 0; i < prec; i += 2) - { - md_number_to_chars (litP, (valueT) words[i + 1], 2); - md_number_to_chars (litP + 2, (valueT) words[i], 2); - litP += 4; - } - } - - return 0; -} - -/* The knowledge of the PC's pipeline offset is built into the insns - themselves. */ - -long -md_pcrel_from (fixS * fixP) -{ - if (fixP->fx_addsy - && S_GET_SEGMENT (fixP->fx_addsy) == undefined_section - && fixP->fx_subsy == NULL) - return 0; - - if (fixP->fx_pcrel && (fixP->fx_r_type == BFD_RELOC_ARM_THUMB_ADD)) - { - /* PC relative addressing on the Thumb is slightly odd - as the bottom two bits of the PC are forced to zero - for the calculation. */ - return (fixP->fx_where + fixP->fx_frag->fr_address) & ~3; - } - -#ifdef TE_WINCE - /* The pattern was adjusted to accommodate CE's off-by-one fixups, - so we un-adjust here to compensate for the accommodation. */ - return fixP->fx_where + fixP->fx_frag->fr_address + 8; -#else - return fixP->fx_where + fixP->fx_frag->fr_address; -#endif -} - -/* Round up a section size to the appropriate boundary. */ - -valueT -md_section_align (segT segment ATTRIBUTE_UNUSED, - valueT size) -{ -#ifdef OBJ_ELF - return size; -#else - /* Round all sects to multiple of 4. */ - return (size + 3) & ~3; -#endif -} - -/* Under ELF we need to default _GLOBAL_OFFSET_TABLE. - Otherwise we have no need to default values of symbols. */ - -symbolS * -md_undefined_symbol (char * name ATTRIBUTE_UNUSED) -{ -#ifdef OBJ_ELF - if (name[0] == '_' && name[1] == 'G' - && streq (name, GLOBAL_OFFSET_TABLE_NAME)) - { - if (!GOT_symbol) - { - if (symbol_find (name)) - as_bad ("GOT already in the symbol table"); - - GOT_symbol = symbol_new (name, undefined_section, - (valueT) 0, & zero_address_frag); - } - - return GOT_symbol; - } -#endif - - return 0; -} - -void -md_apply_fix3 (fixS * fixP, - valueT * valP, - segT seg) -{ - offsetT value = * valP; - offsetT newval; - unsigned int newimm; - unsigned long temp; - int sign; - char * buf = fixP->fx_where + fixP->fx_frag->fr_literal; - arm_fix_data * arm_data = (arm_fix_data *) fixP->tc_fix_data; - - assert (fixP->fx_r_type <= BFD_RELOC_UNUSED); - - /* Note whether this will delete the relocation. */ - if (fixP->fx_addsy == 0 && !fixP->fx_pcrel) - fixP->fx_done = 1; - - /* If this symbol is in a different section then we need to leave it for - the linker to deal with. Unfortunately, md_pcrel_from can't tell, - so we have to undo it's effects here. */ - if (fixP->fx_pcrel) - { - if (fixP->fx_addsy != NULL - && S_IS_DEFINED (fixP->fx_addsy) - && S_GET_SEGMENT (fixP->fx_addsy) != seg) - value += md_pcrel_from (fixP); - } - - /* Remember value for emit_reloc. */ - fixP->fx_addnumber = value; - - switch (fixP->fx_r_type) - { - case BFD_RELOC_NONE: - /* This will need to go in the object file. */ - fixP->fx_done = 0; - break; - - case BFD_RELOC_ARM_IMMEDIATE: - /* We claim that this fixup has been processed here, - even if in fact we generate an error because we do - not have a reloc for it, so tc_gen_reloc will reject it. */ - fixP->fx_done = 1; - - if (fixP->fx_addsy - && ! S_IS_DEFINED (fixP->fx_addsy)) - { - as_bad_where (fixP->fx_file, fixP->fx_line, - _("undefined symbol %s used as an immediate value"), - S_GET_NAME (fixP->fx_addsy)); - break; - } - - newimm = validate_immediate (value); - temp = md_chars_to_number (buf, INSN_SIZE); - - /* If the instruction will fail, see if we can fix things up by - changing the opcode. */ - if (newimm == (unsigned int) FAIL - && (newimm = negate_data_op (&temp, value)) == (unsigned int) FAIL) - { - as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid constant (%lx) after fixup"), - (unsigned long) value); - break; - } - - newimm |= (temp & 0xfffff000); - md_number_to_chars (buf, (valueT) newimm, INSN_SIZE); - break; - - case BFD_RELOC_ARM_ADRL_IMMEDIATE: - { - unsigned int highpart = 0; - unsigned int newinsn = 0xe1a00000; /* nop. */ - - newimm = validate_immediate (value); - temp = md_chars_to_number (buf, INSN_SIZE); - - /* If the instruction will fail, see if we can fix things up by - changing the opcode. */ - if (newimm == (unsigned int) FAIL - && (newimm = negate_data_op (& temp, value)) == (unsigned int) FAIL) - { - /* No ? OK - try using two ADD instructions to generate - the value. */ - newimm = validate_immediate_twopart (value, & highpart); - - /* Yes - then make sure that the second instruction is - also an add. */ - if (newimm != (unsigned int) FAIL) - newinsn = temp; - /* Still No ? Try using a negated value. */ - else if ((newimm = validate_immediate_twopart (- value, & highpart)) != (unsigned int) FAIL) - temp = newinsn = (temp & OPCODE_MASK) | OPCODE_SUB << DATA_OP_SHIFT; - /* Otherwise - give up. */ - else - { - as_bad_where (fixP->fx_file, fixP->fx_line, - _("unable to compute ADRL instructions for PC offset of 0x%lx"), - (long) value); - break; - } - - /* Replace the first operand in the 2nd instruction (which - is the PC) with the destination register. We have - already added in the PC in the first instruction and we - do not want to do it again. */ - newinsn &= ~ 0xf0000; - newinsn |= ((newinsn & 0x0f000) << 4); - } - - newimm |= (temp & 0xfffff000); - md_number_to_chars (buf, (valueT) newimm, INSN_SIZE); - - highpart |= (newinsn & 0xfffff000); - md_number_to_chars (buf + INSN_SIZE, (valueT) highpart, INSN_SIZE); - } - break; - - case BFD_RELOC_ARM_OFFSET_IMM: - sign = value >= 0; - - if (value < 0) - value = - value; - - if (validate_offset_imm (value, 0) == FAIL) - { - as_bad_where (fixP->fx_file, fixP->fx_line, - _("bad immediate value for offset (%ld)"), - (long) value); - break; - } - - newval = md_chars_to_number (buf, INSN_SIZE); - newval &= 0xff7ff000; - newval |= value | (sign ? INDEX_UP : 0); - md_number_to_chars (buf, newval, INSN_SIZE); - break; - - case BFD_RELOC_ARM_OFFSET_IMM8: - case BFD_RELOC_ARM_HWLITERAL: - sign = value >= 0; - - if (value < 0) - value = - value; - - if (validate_offset_imm (value, 1) == FAIL) - { - if (fixP->fx_r_type == BFD_RELOC_ARM_HWLITERAL) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid literal constant: pool needs to be closer")); - else - as_bad (_("bad immediate value for half-word offset (%ld)"), - (long) value); - break; - } - - newval = md_chars_to_number (buf, INSN_SIZE); - newval &= 0xff7ff0f0; - newval |= ((value >> 4) << 8) | (value & 0xf) | (sign ? INDEX_UP : 0); - md_number_to_chars (buf, newval, INSN_SIZE); - break; - - case BFD_RELOC_ARM_LITERAL: - sign = value >= 0; - - if (value < 0) - value = - value; - - if (validate_offset_imm (value, 0) == FAIL) - { - as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid literal constant: pool needs to be closer")); - break; - } - - newval = md_chars_to_number (buf, INSN_SIZE); - newval &= 0xff7ff000; - newval |= value | (sign ? INDEX_UP : 0); - md_number_to_chars (buf, newval, INSN_SIZE); - break; - - case BFD_RELOC_ARM_SHIFT_IMM: - newval = md_chars_to_number (buf, INSN_SIZE); - if (((unsigned long) value) > 32 - || (value == 32 - && (((newval & 0x60) == 0) || (newval & 0x60) == 0x60))) - { - as_bad_where (fixP->fx_file, fixP->fx_line, - _("shift expression is too large")); - break; - } - - if (value == 0) - /* Shifts of zero must be done as lsl. */ - newval &= ~0x60; - else if (value == 32) - value = 0; - newval &= 0xfffff07f; - newval |= (value & 0x1f) << 7; - md_number_to_chars (buf, newval, INSN_SIZE); - break; - - case BFD_RELOC_ARM_SMI: - if (((unsigned long) value) > 0xffff) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid smi expression")); - newval = md_chars_to_number (buf, INSN_SIZE) & 0xfff000f0; - newval |= (value & 0xf) | ((value & 0xfff0) << 4); - md_number_to_chars (buf, newval, INSN_SIZE); - break; - - case BFD_RELOC_ARM_SWI: - if (arm_data->thumb_mode) - { - if (((unsigned long) value) > 0xff) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid swi expression")); - newval = md_chars_to_number (buf, THUMB_SIZE) & 0xff00; - newval |= value; - md_number_to_chars (buf, newval, THUMB_SIZE); - } - else - { - if (((unsigned long) value) > 0x00ffffff) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid swi expression")); - newval = md_chars_to_number (buf, INSN_SIZE) & 0xff000000; - newval |= value; - md_number_to_chars (buf, newval, INSN_SIZE); - } - break; - - case BFD_RELOC_ARM_MULTI: - if (((unsigned long) value) > 0xffff) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid expression in load/store multiple")); - newval = value | md_chars_to_number (buf, INSN_SIZE); - md_number_to_chars (buf, newval, INSN_SIZE); - break; - - 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 - value = fixP->fx_offset; -#endif - - /* 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 & ~ ((offsetT) 0x1ffffff)) != 0 - && ((value & ~ ((offsetT) 0x1ffffff)) != ~ ((offsetT) 0x1ffffff))) - { -#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 instruction itself, then we can compute the relocation for - ourselves and not have to bother the linker with it. - - FIXME: The test for OBJ_ELF is only here because I have not - worked out how to do this for OBJ_COFF. */ - if (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 = * valP; - - /* Permit a backward branch provided that enough bits - are set. Allow a forwards branch, provided that - enough bits are clear. */ - if ( (value & ~ ((offsetT) 0x1ffffff)) == ~ ((offsetT) 0x1ffffff) - || (value & ~ ((offsetT) 0x1ffffff)) == 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 & ~ ((offsetT) 0xffffff)) != 0 - && ((value & ~ ((offsetT) 0xffffff)) != ~ ((offsetT) 0xffffff))) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("out of range branch")); - - if (seg->use_rela_p && !fixP->fx_done) - { - /* Must unshift the value before storing it in the addend. */ - value <<= 2; -#ifdef OBJ_ELF - fixP->fx_offset = value; -#endif - fixP->fx_addnumber = value; - newval = newval & 0xff000000; - } - else - newval = (value & 0x00ffffff) | (newval & 0xff000000); - md_number_to_chars (buf, newval, INSN_SIZE); - break; - - case BFD_RELOC_ARM_PCREL_BLX: - { - offsetT hbit; - newval = md_chars_to_number (buf, INSN_SIZE); - -#ifdef OBJ_ELF - value = fixP->fx_offset; -#endif - hbit = (value >> 1) & 1; - value = (value >> 2) & 0x00ffffff; - value = (value + (newval & 0x00ffffff)) & 0x00ffffff; - - if (seg->use_rela_p && !fixP->fx_done) - { - /* Must sign-extend and unshift the value before storing - it in the addend. */ - value = SEXT24 (value); - value = (value << 2) | hbit; -#ifdef OBJ_ELF - fixP->fx_offset = value; -#endif - fixP->fx_addnumber = value; - newval = newval & 0xfe000000; - } - else - newval = value | (newval & 0xfe000000) | (hbit << 24); - md_number_to_chars (buf, newval, INSN_SIZE); - } - break; - - case BFD_RELOC_THUMB_PCREL_BRANCH9: /* Conditional branch. */ - newval = md_chars_to_number (buf, THUMB_SIZE); - { - addressT diff = (newval & 0xff) << 1; - if (diff & 0x100) - diff |= ~0xff; - - value += diff; - if ((value & ~0xff) && ((value & ~0xff) != ~0xff)) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("branch out of range")); - if (seg->use_rela_p && !fixP->fx_done) - { -#ifdef OBJ_ELF - fixP->fx_offset = value; -#endif - fixP->fx_addnumber = value; - newval = newval & 0xff00; - } - else - newval = (newval & 0xff00) | ((value & 0x1ff) >> 1); - } - md_number_to_chars (buf, newval, THUMB_SIZE); - break; - - case BFD_RELOC_THUMB_PCREL_BRANCH12: /* Unconditional branch. */ - newval = md_chars_to_number (buf, THUMB_SIZE); - { - addressT diff = (newval & 0x7ff) << 1; - if (diff & 0x800) - diff |= ~0x7ff; - - value += diff; - if ((value & ~0x7ff) && ((value & ~0x7ff) != ~0x7ff)) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("branch out of range")); - if (seg->use_rela_p && !fixP->fx_done) - { -#ifdef OBJ_ELF - fixP->fx_offset = value; -#endif - fixP->fx_addnumber = value; - newval = newval & 0xf800; - } - else - newval = (newval & 0xf800) | ((value & 0xfff) >> 1); - } - md_number_to_chars (buf, newval, THUMB_SIZE); - break; - - case BFD_RELOC_THUMB_PCREL_BLX: - case BFD_RELOC_THUMB_PCREL_BRANCH23: - { - offsetT newval2; - addressT diff; - - newval = md_chars_to_number (buf, THUMB_SIZE); - newval2 = md_chars_to_number (buf + THUMB_SIZE, THUMB_SIZE); - diff = ((newval & 0x7ff) << 12) | ((newval2 & 0x7ff) << 1); - if (diff & 0x400000) - diff |= ~0x3fffff; -#ifdef OBJ_ELF - value = fixP->fx_offset; -#endif - value += diff; - - if ((value & ~0x3fffff) && ((value & ~0x3fffff) != ~0x3fffff)) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("branch with link out of range")); - - if (fixP->fx_r_type == BFD_RELOC_THUMB_PCREL_BLX) - /* For a BLX instruction, make sure that the relocation is rounded up - to a word boundary. This follows the semantics of the instruction - which specifies that bit 1 of the target address will come from bit - 1 of the base address. */ - value = (value + 1) & ~ 1; - - if (seg->use_rela_p && !fixP->fx_done) - { -#ifdef OBJ_ELF - fixP->fx_offset = value; -#endif - fixP->fx_addnumber = value; - newval = newval & 0xf800; - newval2 = newval2 & 0xf800; - } - else - { - newval = (newval & 0xf800) | ((value & 0x7fffff) >> 12); - newval2 = (newval2 & 0xf800) | ((value & 0xfff) >> 1); - } - md_number_to_chars (buf, newval, THUMB_SIZE); - md_number_to_chars (buf + THUMB_SIZE, newval2, THUMB_SIZE); - } - break; - - case BFD_RELOC_8: - if (seg->use_rela_p && !fixP->fx_done) - break; - if (fixP->fx_done || fixP->fx_pcrel) - md_number_to_chars (buf, value, 1); -#ifdef OBJ_ELF - else - { - value = fixP->fx_offset; - md_number_to_chars (buf, value, 1); - } -#endif - break; - - case BFD_RELOC_16: - if (seg->use_rela_p && !fixP->fx_done) - break; - if (fixP->fx_done || fixP->fx_pcrel) - md_number_to_chars (buf, value, 2); -#ifdef OBJ_ELF - else - { - value = fixP->fx_offset; - md_number_to_chars (buf, value, 2); - } -#endif - break; - -#ifdef OBJ_ELF - case BFD_RELOC_ARM_TLS_GD32: - case BFD_RELOC_ARM_TLS_LE32: - case BFD_RELOC_ARM_TLS_IE32: - case BFD_RELOC_ARM_TLS_LDM32: - case BFD_RELOC_ARM_TLS_LDO32: - S_SET_THREAD_LOCAL (fixP->fx_addsy); - /* fall through */ - - case BFD_RELOC_ARM_GOT32: - case BFD_RELOC_ARM_GOTOFF: - case BFD_RELOC_ARM_TARGET2: - if (seg->use_rela_p && !fixP->fx_done) - break; - md_number_to_chars (buf, 0, 4); - break; -#endif - - case BFD_RELOC_RVA: - case BFD_RELOC_32: - case BFD_RELOC_ARM_TARGET1: - case BFD_RELOC_ARM_ROSEGREL32: - case BFD_RELOC_ARM_SBREL32: - case BFD_RELOC_32_PCREL: - if (seg->use_rela_p && !fixP->fx_done) - break; - if (fixP->fx_done || fixP->fx_pcrel) - md_number_to_chars (buf, value, 4); -#ifdef OBJ_ELF - else - { - value = fixP->fx_offset; - md_number_to_chars (buf, value, 4); - } -#endif - break; - -#ifdef OBJ_ELF - case BFD_RELOC_ARM_PREL31: - if (fixP->fx_done || fixP->fx_pcrel) - { - newval = md_chars_to_number (buf, 4) & 0x80000000; - if ((value ^ (value >> 1)) & 0x40000000) - { - as_bad_where (fixP->fx_file, fixP->fx_line, - _("rel31 relocation overflow")); - } - newval |= value & 0x7fffffff; - md_number_to_chars (buf, newval, 4); - } - break; - - case BFD_RELOC_ARM_PLT32: - /* It appears the instruction is fully prepared at this point. */ - break; -#endif - - case BFD_RELOC_ARM_CP_OFF_IMM: - sign = value >= 0; - if (value < -1023 || value > 1023 || (value & 3)) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("illegal value for co-processor offset")); - if (value < 0) - value = -value; - newval = md_chars_to_number (buf, INSN_SIZE) & 0xff7fff00; - newval |= (value >> 2) | (sign ? INDEX_UP : 0); - md_number_to_chars (buf, newval, INSN_SIZE); - break; - - case BFD_RELOC_ARM_CP_OFF_IMM_S2: - sign = value >= 0; - if (value < -255 || value > 255) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("Illegal value for co-processor offset")); - if (value < 0) - value = -value; - newval = md_chars_to_number (buf, INSN_SIZE) & 0xff7fff00; - newval |= value | (sign ? INDEX_UP : 0); - md_number_to_chars (buf, newval , INSN_SIZE); - break; - - case BFD_RELOC_ARM_THUMB_OFFSET: - newval = md_chars_to_number (buf, THUMB_SIZE); - /* Exactly what ranges, and where the offset is inserted depends - on the type of instruction, we can establish this from the - top 4 bits. */ - switch (newval >> 12) - { - case 4: /* PC load. */ - /* Thumb PC loads are somewhat odd, bit 1 of the PC is - forced to zero for these loads, so we will need to round - up the offset if the instruction address is not word - aligned (since the final address produced must be, and - we can only describe word-aligned immediate offsets). */ - - if ((fixP->fx_frag->fr_address + fixP->fx_where + value) & 3) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid offset, target not word aligned (0x%08X)"), - (unsigned int) (fixP->fx_frag->fr_address - + fixP->fx_where + value)); - - if ((value + 2) & ~0x3fe) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid offset, value too big (0x%08lX)"), - (long) value); - - /* Round up, since pc will be rounded down. */ - newval |= (value + 2) >> 2; - break; - - case 9: /* SP load/store. */ - if (value & ~0x3fc) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid offset, value too big (0x%08lX)"), - (long) value); - newval |= value >> 2; - break; - - case 6: /* Word load/store. */ - if (value & ~0x7c) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid offset, value too big (0x%08lX)"), - (long) value); - newval |= value << 4; /* 6 - 2. */ - break; - - case 7: /* Byte load/store. */ - if (value & ~0x1f) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid offset, value too big (0x%08lX)"), - (long) value); - newval |= value << 6; - break; - - case 8: /* Halfword load/store. */ - if (value & ~0x3e) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid offset, value too big (0x%08lX)"), - (long) value); - newval |= value << 5; /* 6 - 1. */ - break; - - default: - as_bad_where (fixP->fx_file, fixP->fx_line, - "Unable to process relocation for thumb opcode: %lx", - (unsigned long) newval); - break; - } - md_number_to_chars (buf, newval, THUMB_SIZE); - break; - - case BFD_RELOC_ARM_THUMB_ADD: - /* This is a complicated relocation, since we use it for all of - the following immediate relocations: - - 3bit ADD/SUB - 8bit ADD/SUB - 9bit ADD/SUB SP word-aligned - 10bit ADD PC/SP word-aligned - - The type of instruction being processed is encoded in the - instruction field: - - 0x8000 SUB - 0x00F0 Rd - 0x000F Rs - */ - newval = md_chars_to_number (buf, THUMB_SIZE); - { - int rd = (newval >> 4) & 0xf; - int rs = newval & 0xf; - int subtract = newval & 0x8000; - - if (rd == REG_SP) - { - if (value & ~0x1fc) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid immediate for stack address calculation")); - newval = subtract ? T_OPCODE_SUB_ST : T_OPCODE_ADD_ST; - newval |= value >> 2; - } - else if (rs == REG_PC || rs == REG_SP) - { - if (subtract || - value & ~0x3fc) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid immediate for address calculation (value = 0x%08lX)"), - (unsigned long) value); - newval = (rs == REG_PC ? T_OPCODE_ADD_PC : T_OPCODE_ADD_SP); - newval |= rd << 8; - newval |= value >> 2; - } - else if (rs == rd) - { - if (value & ~0xff) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid 8bit immediate")); - newval = subtract ? T_OPCODE_SUB_I8 : T_OPCODE_ADD_I8; - newval |= (rd << 8) | value; - } - else - { - if (value & ~0x7) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid 3bit immediate")); - newval = subtract ? T_OPCODE_SUB_I3 : T_OPCODE_ADD_I3; - newval |= rd | (rs << 3) | (value << 6); - } - } - md_number_to_chars (buf, newval, THUMB_SIZE); - break; - - case BFD_RELOC_ARM_THUMB_IMM: - newval = md_chars_to_number (buf, THUMB_SIZE); - switch (newval >> 11) - { - case 0x04: /* 8bit immediate MOV. */ - case 0x05: /* 8bit immediate CMP. */ - if (value < 0 || value > 255) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid immediate: %ld is too large"), - (long) value); - newval |= value; - break; - - default: - abort (); - } - md_number_to_chars (buf, newval, THUMB_SIZE); - break; - - case BFD_RELOC_ARM_THUMB_SHIFT: - /* 5bit shift value (0..31). */ - if (value < 0 || value > 31) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("illegal Thumb shift value: %ld"), (long) value); - newval = md_chars_to_number (buf, THUMB_SIZE) & 0xf03f; - newval |= value << 6; - md_number_to_chars (buf, newval, THUMB_SIZE); - break; - - case BFD_RELOC_VTABLE_INHERIT: - case BFD_RELOC_VTABLE_ENTRY: - fixP->fx_done = 0; - return; - - case BFD_RELOC_UNUSED: - default: - as_bad_where (fixP->fx_file, fixP->fx_line, - _("bad relocation fixup type (%d)"), fixP->fx_r_type); - } -} - -/* Translate internal representation of relocation info to BFD target - format. */ - -arelent * -tc_gen_reloc (asection * section ATTRIBUTE_UNUSED, - fixS * fixp) -{ - arelent * reloc; - bfd_reloc_code_real_type code; - - reloc = xmalloc (sizeof (arelent)); - - reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *)); - *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); - reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; - - /* @@ Why fx_addnumber sometimes and fx_offset other times? */ -#ifndef OBJ_ELF - if (fixp->fx_pcrel == 0) - reloc->addend = fixp->fx_offset; - else - reloc->addend = fixp->fx_offset = reloc->address; -#else /* OBJ_ELF */ - reloc->addend = fixp->fx_offset; -#endif - - switch (fixp->fx_r_type) - { - case BFD_RELOC_8: - if (fixp->fx_pcrel) - { - code = BFD_RELOC_8_PCREL; - break; - } - - case BFD_RELOC_16: - if (fixp->fx_pcrel) - { - code = BFD_RELOC_16_PCREL; - break; - } - - case BFD_RELOC_32: - if (fixp->fx_pcrel) - { - code = BFD_RELOC_32_PCREL; - break; - } - - case BFD_RELOC_NONE: - case BFD_RELOC_ARM_PCREL_BRANCH: - case BFD_RELOC_ARM_PCREL_BLX: - case BFD_RELOC_RVA: - case BFD_RELOC_THUMB_PCREL_BRANCH9: - case BFD_RELOC_THUMB_PCREL_BRANCH12: - case BFD_RELOC_THUMB_PCREL_BRANCH23: - case BFD_RELOC_THUMB_PCREL_BLX: - case BFD_RELOC_VTABLE_ENTRY: - case BFD_RELOC_VTABLE_INHERIT: - code = fixp->fx_r_type; - break; - - case BFD_RELOC_ARM_LITERAL: - case BFD_RELOC_ARM_HWLITERAL: - /* If this is called then the a literal has - been referenced across a section boundary. */ - as_bad_where (fixp->fx_file, fixp->fx_line, - _("literal referenced across section boundary")); - return NULL; - -#ifdef OBJ_ELF - case BFD_RELOC_ARM_GOT32: - case BFD_RELOC_ARM_GOTOFF: - case BFD_RELOC_ARM_PLT32: - case BFD_RELOC_ARM_TARGET1: - case BFD_RELOC_ARM_ROSEGREL32: - case BFD_RELOC_ARM_SBREL32: - case BFD_RELOC_ARM_PREL31: - case BFD_RELOC_ARM_TARGET2: - case BFD_RELOC_ARM_TLS_LE32: - case BFD_RELOC_ARM_TLS_LDO32: - code = fixp->fx_r_type; - break; - - case BFD_RELOC_ARM_TLS_GD32: - case BFD_RELOC_ARM_TLS_IE32: - case BFD_RELOC_ARM_TLS_LDM32: - /* BFD will include the symbol's address in the addend. - But we don't want that, so subtract it out again here. */ - if (!S_IS_COMMON (fixp->fx_addsy)) - reloc->addend -= (*reloc->sym_ptr_ptr)->value; - code = fixp->fx_r_type; - break; -#endif - - case BFD_RELOC_ARM_IMMEDIATE: - as_bad_where (fixp->fx_file, fixp->fx_line, - _("internal relocation (type: IMMEDIATE) not fixed up")); - return NULL; - - case BFD_RELOC_ARM_ADRL_IMMEDIATE: - as_bad_where (fixp->fx_file, fixp->fx_line, - _("ADRL used for a symbol not defined in the same file")); - return NULL; - - case BFD_RELOC_ARM_OFFSET_IMM: - if (fixp->fx_addsy != NULL - && !S_IS_DEFINED (fixp->fx_addsy) - && S_IS_LOCAL (fixp->fx_addsy)) - { - as_bad_where (fixp->fx_file, fixp->fx_line, - _("undefined local label `%s'"), - S_GET_NAME (fixp->fx_addsy)); - return NULL; - } - - as_bad_where (fixp->fx_file, fixp->fx_line, - _("internal_relocation (type: OFFSET_IMM) not fixed up")); - return NULL; - - default: - { - char * type; - - switch (fixp->fx_r_type) - { - case BFD_RELOC_NONE: type = "NONE"; break; - case BFD_RELOC_ARM_OFFSET_IMM8: type = "OFFSET_IMM8"; break; - case BFD_RELOC_ARM_SHIFT_IMM: type = "SHIFT_IMM"; break; - case BFD_RELOC_ARM_SMI: type = "SMI"; break; - case BFD_RELOC_ARM_SWI: type = "SWI"; break; - case BFD_RELOC_ARM_MULTI: type = "MULTI"; break; - case BFD_RELOC_ARM_CP_OFF_IMM: type = "CP_OFF_IMM"; break; - case BFD_RELOC_ARM_THUMB_ADD: type = "THUMB_ADD"; break; - case BFD_RELOC_ARM_THUMB_SHIFT: type = "THUMB_SHIFT"; break; - case BFD_RELOC_ARM_THUMB_IMM: type = "THUMB_IMM"; break; - case BFD_RELOC_ARM_THUMB_OFFSET: type = "THUMB_OFFSET"; break; - default: type = _(""); break; - } - as_bad_where (fixp->fx_file, fixp->fx_line, - _("cannot represent %s relocation in this object file format"), - type); - return NULL; - } - } - -#ifdef OBJ_ELF - if ((code == BFD_RELOC_32_PCREL || code == BFD_RELOC_32) - && GOT_symbol - && fixp->fx_addsy == GOT_symbol) - { - code = BFD_RELOC_ARM_GOTPC; - reloc->addend = fixp->fx_offset = reloc->address; - } -#endif - - reloc->howto = bfd_reloc_type_lookup (stdoutput, code); - - if (reloc->howto == NULL) - { - as_bad_where (fixp->fx_file, fixp->fx_line, - _("cannot represent %s relocation in this object file format"), - bfd_get_reloc_code_name (code)); - return NULL; - } - - /* HACK: Since arm ELF uses Rel instead of Rela, encode the - vtable entry to be used in the relocation's section offset. */ - if (fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY) - reloc->address = fixp->fx_offset; - - return reloc; -} - -int -md_estimate_size_before_relax (fragS * fragP ATTRIBUTE_UNUSED, - segT segtype ATTRIBUTE_UNUSED) -{ - as_fatal (_("md_estimate_size_before_relax\n")); - return 1; -} - -/* We need to be able to fix up arbitrary expressions in some statements. - This is so that we can handle symbols that are an arbitrary distance from - the pc. The most common cases are of the form ((+/-sym -/+ . - 8) & mask), - which returns part of an address in a form which will be valid for - a data instruction. We do this by pushing the expression into a symbol - in the expr_section, and creating a fix for that. */ - -static void -fix_new_arm (fragS * frag, - int where, - short int size, - expressionS * exp, - int pc_rel, - int reloc) -{ - fixS * new_fix; - arm_fix_data * arm_data; - - switch (exp->X_op) - { - case O_constant: - case O_symbol: - case O_add: - case O_subtract: - new_fix = fix_new_exp (frag, where, size, exp, pc_rel, reloc); - break; - - default: - new_fix = fix_new (frag, where, size, make_expr_symbol (exp), 0, - pc_rel, reloc); - break; - } - - /* Mark whether the fix is to a THUMB instruction, or an ARM - instruction. */ - arm_data = obstack_alloc (& notes, sizeof (arm_fix_data)); - new_fix->tc_fix_data = (PTR) arm_data; - arm_data->thumb_mode = thumb_mode; -} - -static void -output_inst (const char * str) -{ - char * to = NULL; - - if (inst.error) - { - as_bad ("%s -- `%s'", inst.error, str); - return; - } - - to = frag_more (inst.size); - - if (thumb_mode && (inst.size > THUMB_SIZE)) - { - assert (inst.size == (2 * THUMB_SIZE)); - md_number_to_chars (to, inst.instruction >> 16, THUMB_SIZE); - md_number_to_chars (to + THUMB_SIZE, inst.instruction, THUMB_SIZE); - } - else if (inst.size > INSN_SIZE) - { - assert (inst.size == (2 * INSN_SIZE)); - md_number_to_chars (to, inst.instruction, INSN_SIZE); - md_number_to_chars (to + INSN_SIZE, inst.instruction, INSN_SIZE); - } - else - md_number_to_chars (to, inst.instruction, inst.size); - - if (inst.reloc.type != BFD_RELOC_UNUSED) - fix_new_arm (frag_now, to - frag_now->fr_literal, - inst.size, & inst.reloc.exp, inst.reloc.pc_rel, - inst.reloc.type); - -#ifdef OBJ_ELF - dwarf2_emit_insn (inst.size); -#endif -} - -void -md_assemble (char * str) -{ - char c; - char *p; - char *start; - - /* Align the previous label if needed. */ - if (last_label_seen != NULL) - { - symbol_set_frag (last_label_seen, frag_now); - S_SET_VALUE (last_label_seen, (valueT) frag_now_fix ()); - S_SET_SEGMENT (last_label_seen, now_seg); - } - - memset (&inst, '\0', sizeof (inst)); - inst.reloc.type = BFD_RELOC_UNUSED; - - skip_whitespace (str); - - /* Scan up to the end of the op-code, which must end in white space or - end of string. */ - for (start = p = str; *p != '\0'; p++) - if (*p == ' ') - break; - - if (p == str) - { - as_bad (_("no operator -- statement `%s'\n"), str); - return; - } - - if (thumb_mode) - { - const struct thumb_opcode * opcode; - - c = *p; - *p = '\0'; - opcode = (const struct thumb_opcode *) hash_find (arm_tops_hsh, str); - *p = c; - - if (opcode) - { - /* Check that this instruction is supported for this CPU. */ - if (thumb_mode == 1 && (opcode->variant & cpu_variant) == 0) - { - as_bad (_("selected processor does not support `%s'"), str); - return; - } - - mapping_state (MAP_THUMB); - inst.instruction = opcode->value; - inst.size = opcode->size; - opcode->parms (p); - output_inst (str); - return; - } - } - else - { - const struct asm_opcode * opcode; - - c = *p; - *p = '\0'; - opcode = (const struct asm_opcode *) hash_find (arm_ops_hsh, str); - *p = c; - - if (opcode) - { - /* Check that this instruction is supported for this CPU. */ - if ((opcode->variant & cpu_variant) == 0) - { - as_bad (_("selected processor does not support `%s'"), str); - return; - } - - mapping_state (MAP_ARM); - inst.instruction = opcode->value; - inst.size = INSN_SIZE; - opcode->parms (p); - output_inst (str); - return; - } - } - - /* It wasn't an instruction, but it might be a register alias of the form - alias .req reg. */ - if (create_register_alias (str, p)) - return; - - as_bad (_("bad instruction `%s'"), start); -} - -/* md_parse_option - Invocation line includes a switch not recognized by the base assembler. - See if it's a processor-specific option. - - This routine is somewhat complicated by the need for backwards - compatibility (since older releases of gcc can't be changed). - The new options try to make the interface as compatible as - possible with GCC. - - New options (supported) are: - - -mcpu= Assemble for selected processor - -march= Assemble for selected architecture - -mfpu= Assemble for selected FPU. - -EB/-mbig-endian Big-endian - -EL/-mlittle-endian Little-endian - -k Generate PIC code - -mthumb Start in Thumb mode - -mthumb-interwork Code supports ARM/Thumb interworking - - For now we will also provide support for: - - -mapcs-32 32-bit Program counter - -mapcs-26 26-bit Program counter - -macps-float Floats passed in FP registers - -mapcs-reentrant Reentrant code - -matpcs - (sometime these will probably be replaced with -mapcs= - and -matpcs=) - - The remaining options are only supported for back-wards compatibility. - Cpu variants, the arm part is optional: - -m[arm]1 Currently not supported. - -m[arm]2, -m[arm]250 Arm 2 and Arm 250 processor - -m[arm]3 Arm 3 processor - -m[arm]6[xx], Arm 6 processors - -m[arm]7[xx][t][[d]m] Arm 7 processors - -m[arm]8[10] Arm 8 processors - -m[arm]9[20][tdmi] Arm 9 processors - -mstrongarm[110[0]] StrongARM processors - -mxscale XScale processors - -m[arm]v[2345[t[e]]] Arm architectures - -mall All (except the ARM1) - FP variants: - -mfpa10, -mfpa11 FPA10 and 11 co-processor instructions - -mfpe-old (No float load/store multiples) - -mvfpxd VFP Single precision - -mvfp All VFP - -mno-fpu Disable all floating point instructions - - The following CPU names are recognized: - arm1, arm2, arm250, arm3, arm6, arm600, arm610, arm620, - arm7, arm7m, arm7d, arm7dm, arm7di, arm7dmi, arm70, arm700, - arm700i, arm710 arm710t, arm720, arm720t, arm740t, arm710c, - arm7100, arm7500, arm7500fe, arm7tdmi, arm8, arm810, arm9, - arm920, arm920t, arm940t, arm946, arm966, arm9tdmi, arm9e, - arm10t arm10e, arm1020t, arm1020e, arm10200e, - strongarm, strongarm110, strongarm1100, strongarm1110, xscale. - - */ - -const char * md_shortopts = "m:k"; - -#ifdef ARM_BI_ENDIAN -#define OPTION_EB (OPTION_MD_BASE + 0) -#define OPTION_EL (OPTION_MD_BASE + 1) -#else -#if TARGET_BYTES_BIG_ENDIAN -#define OPTION_EB (OPTION_MD_BASE + 0) -#else -#define OPTION_EL (OPTION_MD_BASE + 1) -#endif -#endif - -struct option md_longopts[] = -{ -#ifdef OPTION_EB - {"EB", no_argument, NULL, OPTION_EB}, -#endif -#ifdef OPTION_EL - {"EL", no_argument, NULL, OPTION_EL}, -#endif - {NULL, no_argument, NULL, 0} -}; - -size_t md_longopts_size = sizeof (md_longopts); - -struct arm_option_table -{ - char *option; /* Option name to match. */ - char *help; /* Help information. */ - int *var; /* Variable to change. */ - int value; /* What to change it to. */ - char *deprecated; /* If non-null, print this message. */ -}; - -struct arm_option_table arm_opts[] = -{ - {"k", N_("generate PIC code"), &pic_code, 1, NULL}, - {"mthumb", N_("assemble Thumb code"), &thumb_mode, 1, NULL}, - {"mthumb-interwork", N_("support ARM/Thumb interworking"), - &support_interwork, 1, NULL}, - {"mapcs-32", N_("code uses 32-bit program counter"), &uses_apcs_26, 0, NULL}, - {"mapcs-26", N_("code uses 26-bit program counter"), &uses_apcs_26, 1, NULL}, - {"mapcs-float", N_("floating point args are in fp regs"), &uses_apcs_float, - 1, NULL}, - {"mapcs-reentrant", N_("re-entrant code"), &pic_code, 1, NULL}, - {"matpcs", N_("code is ATPCS conformant"), &atpcs, 1, NULL}, - {"mbig-endian", N_("assemble for big-endian"), &target_big_endian, 1, NULL}, - {"mlittle-endian", N_("assemble for little-endian"), &target_big_endian, 0, - NULL}, - - /* These are recognized by the assembler, but have no affect on code. */ - {"mapcs-frame", N_("use frame pointer"), NULL, 0, NULL}, - {"mapcs-stack-check", N_("use stack size checking"), NULL, 0, NULL}, - - /* DON'T add any new processors to this list -- we want the whole list - to go away... Add them to the processors table instead. */ - {"marm1", NULL, &legacy_cpu, ARM_ARCH_V1, N_("use -mcpu=arm1")}, - {"m1", NULL, &legacy_cpu, ARM_ARCH_V1, N_("use -mcpu=arm1")}, - {"marm2", NULL, &legacy_cpu, ARM_ARCH_V2, N_("use -mcpu=arm2")}, - {"m2", NULL, &legacy_cpu, ARM_ARCH_V2, N_("use -mcpu=arm2")}, - {"marm250", NULL, &legacy_cpu, ARM_ARCH_V2S, N_("use -mcpu=arm250")}, - {"m250", NULL, &legacy_cpu, ARM_ARCH_V2S, N_("use -mcpu=arm250")}, - {"marm3", NULL, &legacy_cpu, ARM_ARCH_V2S, N_("use -mcpu=arm3")}, - {"m3", NULL, &legacy_cpu, ARM_ARCH_V2S, N_("use -mcpu=arm3")}, - {"marm6", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm6")}, - {"m6", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm6")}, - {"marm600", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm600")}, - {"m600", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm600")}, - {"marm610", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm610")}, - {"m610", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm610")}, - {"marm620", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm620")}, - {"m620", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm620")}, - {"marm7", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7")}, - {"m7", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7")}, - {"marm70", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm70")}, - {"m70", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm70")}, - {"marm700", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm700")}, - {"m700", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm700")}, - {"marm700i", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm700i")}, - {"m700i", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm700i")}, - {"marm710", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm710")}, - {"m710", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm710")}, - {"marm710c", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm710c")}, - {"m710c", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm710c")}, - {"marm720", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm720")}, - {"m720", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm720")}, - {"marm7d", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7d")}, - {"m7d", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7d")}, - {"marm7di", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7di")}, - {"m7di", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7di")}, - {"marm7m", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -mcpu=arm7m")}, - {"m7m", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -mcpu=arm7m")}, - {"marm7dm", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -mcpu=arm7dm")}, - {"m7dm", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -mcpu=arm7dm")}, - {"marm7dmi", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -mcpu=arm7dmi")}, - {"m7dmi", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -mcpu=arm7dmi")}, - {"marm7100", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7100")}, - {"m7100", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7100")}, - {"marm7500", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7500")}, - {"m7500", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7500")}, - {"marm7500fe", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7500fe")}, - {"m7500fe", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -mcpu=arm7500fe")}, - {"marm7t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm7tdmi")}, - {"m7t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm7tdmi")}, - {"marm7tdmi", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm7tdmi")}, - {"m7tdmi", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm7tdmi")}, - {"marm710t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm710t")}, - {"m710t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm710t")}, - {"marm720t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm720t")}, - {"m720t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm720t")}, - {"marm740t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm740t")}, - {"m740t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm740t")}, - {"marm8", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -mcpu=arm8")}, - {"m8", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -mcpu=arm8")}, - {"marm810", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -mcpu=arm810")}, - {"m810", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -mcpu=arm810")}, - {"marm9", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm9")}, - {"m9", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm9")}, - {"marm9tdmi", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm9tdmi")}, - {"m9tdmi", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm9tdmi")}, - {"marm920", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm920")}, - {"m920", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm920")}, - {"marm940", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm940")}, - {"m940", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -mcpu=arm940")}, - {"mstrongarm", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -mcpu=strongarm")}, - {"mstrongarm110", NULL, &legacy_cpu, ARM_ARCH_V4, - N_("use -mcpu=strongarm110")}, - {"mstrongarm1100", NULL, &legacy_cpu, ARM_ARCH_V4, - N_("use -mcpu=strongarm1100")}, - {"mstrongarm1110", NULL, &legacy_cpu, ARM_ARCH_V4, - N_("use -mcpu=strongarm1110")}, - {"mxscale", NULL, &legacy_cpu, ARM_ARCH_XSCALE, N_("use -mcpu=xscale")}, - {"miwmmxt", NULL, &legacy_cpu, ARM_ARCH_IWMMXT, N_("use -mcpu=iwmmxt")}, - {"mall", NULL, &legacy_cpu, ARM_ANY, N_("use -mcpu=all")}, - - /* Architecture variants -- don't add any more to this list either. */ - {"mv2", NULL, &legacy_cpu, ARM_ARCH_V2, N_("use -march=armv2")}, - {"marmv2", NULL, &legacy_cpu, ARM_ARCH_V2, N_("use -march=armv2")}, - {"mv2a", NULL, &legacy_cpu, ARM_ARCH_V2S, N_("use -march=armv2a")}, - {"marmv2a", NULL, &legacy_cpu, ARM_ARCH_V2S, N_("use -march=armv2a")}, - {"mv3", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -march=armv3")}, - {"marmv3", NULL, &legacy_cpu, ARM_ARCH_V3, N_("use -march=armv3")}, - {"mv3m", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -march=armv3m")}, - {"marmv3m", NULL, &legacy_cpu, ARM_ARCH_V3M, N_("use -march=armv3m")}, - {"mv4", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -march=armv4")}, - {"marmv4", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -march=armv4")}, - {"mv4t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -march=armv4t")}, - {"marmv4t", NULL, &legacy_cpu, ARM_ARCH_V4T, N_("use -march=armv4t")}, - {"mv5", NULL, &legacy_cpu, ARM_ARCH_V5, N_("use -march=armv5")}, - {"marmv5", NULL, &legacy_cpu, ARM_ARCH_V5, N_("use -march=armv5")}, - {"mv5t", NULL, &legacy_cpu, ARM_ARCH_V5T, N_("use -march=armv5t")}, - {"marmv5t", NULL, &legacy_cpu, ARM_ARCH_V5T, N_("use -march=armv5t")}, - {"mv5e", NULL, &legacy_cpu, ARM_ARCH_V5TE, N_("use -march=armv5te")}, - {"marmv5e", NULL, &legacy_cpu, ARM_ARCH_V5TE, N_("use -march=armv5te")}, - - /* Floating point variants -- don't add any more to this list either. */ - {"mfpe-old", NULL, &legacy_fpu, FPU_ARCH_FPE, N_("use -mfpu=fpe")}, - {"mfpa10", NULL, &legacy_fpu, FPU_ARCH_FPA, N_("use -mfpu=fpa10")}, - {"mfpa11", NULL, &legacy_fpu, FPU_ARCH_FPA, N_("use -mfpu=fpa11")}, - {"mno-fpu", NULL, &legacy_fpu, 0, - N_("use either -mfpu=softfpa or -mfpu=softvfp")}, - - {NULL, NULL, NULL, 0, NULL} -}; - -struct arm_cpu_option_table -{ - char *name; - int value; - /* For some CPUs we assume an FPU unless the user explicitly sets - -mfpu=... */ - int default_fpu; -}; - -/* This list should, at a minimum, contain all the cpu names - recognized by GCC. */ -static struct arm_cpu_option_table arm_cpus[] = -{ - {"all", ARM_ANY, FPU_ARCH_FPA}, - {"arm1", ARM_ARCH_V1, FPU_ARCH_FPA}, - {"arm2", ARM_ARCH_V2, FPU_ARCH_FPA}, - {"arm250", ARM_ARCH_V2S, FPU_ARCH_FPA}, - {"arm3", ARM_ARCH_V2S, FPU_ARCH_FPA}, - {"arm6", ARM_ARCH_V3, FPU_ARCH_FPA}, - {"arm60", ARM_ARCH_V3, FPU_ARCH_FPA}, - {"arm600", ARM_ARCH_V3, FPU_ARCH_FPA}, - {"arm610", ARM_ARCH_V3, FPU_ARCH_FPA}, - {"arm620", ARM_ARCH_V3, FPU_ARCH_FPA}, - {"arm7", ARM_ARCH_V3, FPU_ARCH_FPA}, - {"arm7m", ARM_ARCH_V3M, FPU_ARCH_FPA}, - {"arm7d", ARM_ARCH_V3, FPU_ARCH_FPA}, - {"arm7dm", ARM_ARCH_V3M, FPU_ARCH_FPA}, - {"arm7di", ARM_ARCH_V3, FPU_ARCH_FPA}, - {"arm7dmi", ARM_ARCH_V3M, FPU_ARCH_FPA}, - {"arm70", ARM_ARCH_V3, FPU_ARCH_FPA}, - {"arm700", ARM_ARCH_V3, FPU_ARCH_FPA}, - {"arm700i", ARM_ARCH_V3, FPU_ARCH_FPA}, - {"arm710", ARM_ARCH_V3, FPU_ARCH_FPA}, - {"arm710t", ARM_ARCH_V4T, FPU_ARCH_FPA}, - {"arm720", ARM_ARCH_V3, FPU_ARCH_FPA}, - {"arm720t", ARM_ARCH_V4T, FPU_ARCH_FPA}, - {"arm740t", ARM_ARCH_V4T, FPU_ARCH_FPA}, - {"arm710c", ARM_ARCH_V3, FPU_ARCH_FPA}, - {"arm7100", ARM_ARCH_V3, FPU_ARCH_FPA}, - {"arm7500", ARM_ARCH_V3, FPU_ARCH_FPA}, - {"arm7500fe", ARM_ARCH_V3, FPU_ARCH_FPA}, - {"arm7t", ARM_ARCH_V4T, FPU_ARCH_FPA}, - {"arm7tdmi", ARM_ARCH_V4T, FPU_ARCH_FPA}, - {"arm7tdmi-s", ARM_ARCH_V4T, FPU_ARCH_FPA}, - {"arm8", ARM_ARCH_V4, FPU_ARCH_FPA}, - {"arm810", ARM_ARCH_V4, FPU_ARCH_FPA}, - {"strongarm", ARM_ARCH_V4, FPU_ARCH_FPA}, - {"strongarm1", ARM_ARCH_V4, FPU_ARCH_FPA}, - {"strongarm110", ARM_ARCH_V4, FPU_ARCH_FPA}, - {"strongarm1100", ARM_ARCH_V4, FPU_ARCH_FPA}, - {"strongarm1110", ARM_ARCH_V4, FPU_ARCH_FPA}, - {"arm9", ARM_ARCH_V4T, FPU_ARCH_FPA}, - {"arm920", ARM_ARCH_V4T, FPU_ARCH_FPA}, - {"arm920t", ARM_ARCH_V4T, FPU_ARCH_FPA}, - {"arm922t", ARM_ARCH_V4T, FPU_ARCH_FPA}, - {"arm940t", ARM_ARCH_V4T, FPU_ARCH_FPA}, - {"arm9tdmi", ARM_ARCH_V4T, FPU_ARCH_FPA}, - /* For V5 or later processors we default to using VFP; but the user - should really set the FPU type explicitly. */ - {"arm9e-r0", ARM_ARCH_V5TExP, FPU_ARCH_VFP_V2}, - {"arm9e", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, - {"arm926ej", ARM_ARCH_V5TEJ, FPU_ARCH_VFP_V2}, - {"arm926ejs", ARM_ARCH_V5TEJ, FPU_ARCH_VFP_V2}, - {"arm926ej-s", ARM_ARCH_V5TEJ, FPU_ARCH_VFP_V2}, - {"arm946e-r0", ARM_ARCH_V5TExP, FPU_ARCH_VFP_V2}, - {"arm946e", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, - {"arm966e-r0", ARM_ARCH_V5TExP, FPU_ARCH_VFP_V2}, - {"arm966e", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, - {"arm10t", ARM_ARCH_V5T, FPU_ARCH_VFP_V1}, - {"arm10e", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, - {"arm1020", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, - {"arm1020t", ARM_ARCH_V5T, FPU_ARCH_VFP_V1}, - {"arm1020e", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, - {"arm1026ejs", ARM_ARCH_V5TEJ, FPU_ARCH_VFP_V2}, - {"arm1026ej-s", ARM_ARCH_V5TEJ, FPU_ARCH_VFP_V2}, - {"arm1136js", ARM_ARCH_V6, FPU_NONE}, - {"arm1136j-s", ARM_ARCH_V6, FPU_NONE}, - {"arm1136jfs", ARM_ARCH_V6, FPU_ARCH_VFP_V2}, - {"arm1136jf-s", ARM_ARCH_V6, FPU_ARCH_VFP_V2}, - {"mpcore", ARM_ARCH_V6K, FPU_ARCH_VFP_V2}, - {"mpcorenovfp", ARM_ARCH_V6K, FPU_NONE}, - {"arm1176jz-s", ARM_ARCH_V6ZK, FPU_NONE}, - {"arm1176jzf-s", ARM_ARCH_V6ZK, FPU_ARCH_VFP_V2}, - /* ??? XSCALE is really an architecture. */ - {"xscale", ARM_ARCH_XSCALE, FPU_ARCH_VFP_V2}, - /* ??? iwmmxt is not a processor. */ - {"iwmmxt", ARM_ARCH_IWMMXT, FPU_ARCH_VFP_V2}, - {"i80200", ARM_ARCH_XSCALE, FPU_ARCH_VFP_V2}, - /* Maverick */ - {"ep9312", ARM_ARCH_V4T | ARM_CEXT_MAVERICK, FPU_ARCH_MAVERICK}, - {NULL, 0, 0} -}; - -struct arm_arch_option_table -{ - char *name; - int value; - int default_fpu; -}; - -/* This list should, at a minimum, contain all the architecture names - recognized by GCC. */ -static struct arm_arch_option_table arm_archs[] = -{ - {"all", ARM_ANY, FPU_ARCH_FPA}, - {"armv1", ARM_ARCH_V1, FPU_ARCH_FPA}, - {"armv2", ARM_ARCH_V2, FPU_ARCH_FPA}, - {"armv2a", ARM_ARCH_V2S, FPU_ARCH_FPA}, - {"armv2s", ARM_ARCH_V2S, FPU_ARCH_FPA}, - {"armv3", ARM_ARCH_V3, FPU_ARCH_FPA}, - {"armv3m", ARM_ARCH_V3M, FPU_ARCH_FPA}, - {"armv4", ARM_ARCH_V4, FPU_ARCH_FPA}, - {"armv4xm", ARM_ARCH_V4xM, FPU_ARCH_FPA}, - {"armv4t", ARM_ARCH_V4T, FPU_ARCH_FPA}, - {"armv4txm", ARM_ARCH_V4TxM, FPU_ARCH_FPA}, - {"armv5", ARM_ARCH_V5, FPU_ARCH_VFP}, - {"armv5t", ARM_ARCH_V5T, FPU_ARCH_VFP}, - {"armv5txm", ARM_ARCH_V5TxM, FPU_ARCH_VFP}, - {"armv5te", ARM_ARCH_V5TE, FPU_ARCH_VFP}, - {"armv5texp", ARM_ARCH_V5TExP, FPU_ARCH_VFP}, - {"armv5tej", ARM_ARCH_V5TEJ, FPU_ARCH_VFP}, - {"armv6", ARM_ARCH_V6, FPU_ARCH_VFP}, - {"armv6j", ARM_ARCH_V6, FPU_ARCH_VFP}, - {"armv6k", ARM_ARCH_V6K, FPU_ARCH_VFP}, - {"armv6z", ARM_ARCH_V6Z, FPU_ARCH_VFP}, - {"armv6zk", ARM_ARCH_V6ZK, FPU_ARCH_VFP}, - {"armv6t2", ARM_ARCH_V6T2, FPU_ARCH_VFP}, - {"armv6kt2", ARM_ARCH_V6KT2, FPU_ARCH_VFP}, - {"armv6zt2", ARM_ARCH_V6ZT2, FPU_ARCH_VFP}, - {"armv6zkt2", ARM_ARCH_V6ZKT2, FPU_ARCH_VFP}, - {"xscale", ARM_ARCH_XSCALE, FPU_ARCH_VFP}, - {"iwmmxt", ARM_ARCH_IWMMXT, FPU_ARCH_VFP}, - {NULL, 0, 0} -}; - -/* ISA extensions in the co-processor space. */ -struct arm_arch_extension_table -{ - char *name; - int value; -}; - -static struct arm_arch_extension_table arm_extensions[] = -{ - {"maverick", ARM_CEXT_MAVERICK}, - {"xscale", ARM_CEXT_XSCALE}, - {"iwmmxt", ARM_CEXT_IWMMXT}, - {NULL, 0} -}; - -struct arm_fpu_option_table -{ - char *name; - int value; -}; - -/* This list should, at a minimum, contain all the fpu names - recognized by GCC. */ -static struct arm_fpu_option_table arm_fpus[] = -{ - {"softfpa", FPU_NONE}, - {"fpe", FPU_ARCH_FPE}, - {"fpe2", FPU_ARCH_FPE}, - {"fpe3", FPU_ARCH_FPA}, /* Third release supports LFM/SFM. */ - {"fpa", FPU_ARCH_FPA}, - {"fpa10", FPU_ARCH_FPA}, - {"fpa11", FPU_ARCH_FPA}, - {"arm7500fe", FPU_ARCH_FPA}, - {"softvfp", FPU_ARCH_VFP}, - {"softvfp+vfp", FPU_ARCH_VFP_V2}, - {"vfp", FPU_ARCH_VFP_V2}, - {"vfp9", FPU_ARCH_VFP_V2}, - {"vfp10", FPU_ARCH_VFP_V2}, - {"vfp10-r0", FPU_ARCH_VFP_V1}, - {"vfpxd", FPU_ARCH_VFP_V1xD}, - {"arm1020t", FPU_ARCH_VFP_V1}, - {"arm1020e", FPU_ARCH_VFP_V2}, - {"arm1136jfs", FPU_ARCH_VFP_V2}, - {"arm1136jf-s", FPU_ARCH_VFP_V2}, - {"maverick", FPU_ARCH_MAVERICK}, - {NULL, 0} -}; - -struct arm_float_abi_option_table -{ - char *name; - int value; -}; - -static struct arm_float_abi_option_table arm_float_abis[] = -{ - {"hard", ARM_FLOAT_ABI_HARD}, - {"softfp", ARM_FLOAT_ABI_SOFTFP}, - {"soft", ARM_FLOAT_ABI_SOFT}, - {NULL, 0} -}; - -struct arm_eabi_option_table -{ - char *name; - unsigned int value; -}; - -#ifdef OBJ_ELF -/* We only know how to output GNU and ver 4 (AAELF) formats. */ -static struct arm_eabi_option_table arm_eabis[] = -{ - {"gnu", EF_ARM_EABI_UNKNOWN}, - {"4", EF_ARM_EABI_VER4}, - {NULL, 0} -}; -#endif - -struct arm_long_option_table -{ - char * option; /* Substring to match. */ - char * help; /* Help information. */ - int (* func) (char * subopt); /* Function to decode sub-option. */ - char * deprecated; /* If non-null, print this message. */ -}; - -static int -arm_parse_extension (char * str, int * opt_p) -{ - while (str != NULL && *str != 0) - { - struct arm_arch_extension_table * opt; - char * ext; - int optlen; - - if (*str != '+') - { - as_bad (_("invalid architectural extension")); - return 0; - } - - str++; - ext = strchr (str, '+'); - - if (ext != NULL) - optlen = ext - str; - else - optlen = strlen (str); - - if (optlen == 0) - { - as_bad (_("missing architectural extension")); - return 0; - } - - for (opt = arm_extensions; opt->name != NULL; opt++) - if (strncmp (opt->name, str, optlen) == 0) - { - *opt_p |= opt->value; - break; - } - - if (opt->name == NULL) - { - as_bad (_("unknown architectural extnsion `%s'"), str); - return 0; - } - - str = ext; - }; - - return 1; -} - -static int -arm_parse_cpu (char * str) -{ - struct arm_cpu_option_table * opt; - char * ext = strchr (str, '+'); - int optlen; - - if (ext != NULL) - optlen = ext - str; - else - optlen = strlen (str); - - if (optlen == 0) - { - as_bad (_("missing cpu name `%s'"), str); - return 0; - } - - for (opt = arm_cpus; opt->name != NULL; opt++) - if (strncmp (opt->name, str, optlen) == 0) - { - mcpu_cpu_opt = opt->value; - mcpu_fpu_opt = opt->default_fpu; - - if (ext != NULL) - return arm_parse_extension (ext, &mcpu_cpu_opt); - - return 1; - } - - as_bad (_("unknown cpu `%s'"), str); - return 0; -} - -static int -arm_parse_arch (char * str) -{ - struct arm_arch_option_table *opt; - char *ext = strchr (str, '+'); - int optlen; - - if (ext != NULL) - optlen = ext - str; - else - optlen = strlen (str); - - if (optlen == 0) - { - as_bad (_("missing architecture name `%s'"), str); - return 0; - } - - - for (opt = arm_archs; opt->name != NULL; opt++) - if (streq (opt->name, str)) - { - march_cpu_opt = opt->value; - march_fpu_opt = opt->default_fpu; - - if (ext != NULL) - return arm_parse_extension (ext, &march_cpu_opt); - - return 1; - } - - as_bad (_("unknown architecture `%s'\n"), str); - return 0; -} - -static int -arm_parse_fpu (char * str) -{ - struct arm_fpu_option_table * opt; - - for (opt = arm_fpus; opt->name != NULL; opt++) - if (streq (opt->name, str)) - { - mfpu_opt = opt->value; - return 1; - } - - as_bad (_("unknown floating point format `%s'\n"), str); - return 0; -} - -static int -arm_parse_float_abi (char * str) -{ - struct arm_float_abi_option_table * opt; - - for (opt = arm_float_abis; opt->name != NULL; opt++) - if (streq (opt->name, str)) - { - mfloat_abi_opt = opt->value; - return 1; - } - - as_bad (_("unknown floating point abi `%s'\n"), str); - return 0; -} - -#ifdef OBJ_ELF -static int -arm_parse_eabi (char * str) -{ - struct arm_eabi_option_table *opt; - - for (opt = arm_eabis; opt->name != NULL; opt++) - if (streq (opt->name, str)) - { - meabi_flags = opt->value; - return 1; - } - as_bad (_("unknown EABI `%s'\n"), str); - return 0; -} -#endif - -struct arm_long_option_table arm_long_opts[] = -{ - {"mcpu=", N_("\t assemble for CPU "), - arm_parse_cpu, NULL}, - {"march=", N_("\t assemble for architecture "), - arm_parse_arch, NULL}, - {"mfpu=", N_("\t assemble for FPU architecture "), - arm_parse_fpu, NULL}, - {"mfloat-abi=", N_("\t assemble for floating point ABI "), - arm_parse_float_abi, NULL}, -#ifdef OBJ_ELF - {"meabi=", N_("\t assemble for eabi version "), - arm_parse_eabi, NULL}, -#endif - {NULL, NULL, 0, NULL} -}; - -int -md_parse_option (int c, char * arg) -{ - struct arm_option_table *opt; - struct arm_long_option_table *lopt; - - switch (c) - { -#ifdef OPTION_EB - case OPTION_EB: - target_big_endian = 1; - break; -#endif - -#ifdef OPTION_EL - case OPTION_EL: - target_big_endian = 0; - break; -#endif - - case 'a': - /* Listing option. Just ignore these, we don't support additional - ones. */ - return 0; - - default: - for (opt = arm_opts; opt->option != NULL; opt++) - { - if (c == opt->option[0] - && ((arg == NULL && opt->option[1] == 0) - || streq (arg, opt->option + 1))) - { -#if WARN_DEPRECATED - /* If the option is deprecated, tell the user. */ - if (opt->deprecated != NULL) - as_tsktsk (_("option `-%c%s' is deprecated: %s"), c, - arg ? arg : "", _(opt->deprecated)); -#endif - - if (opt->var != NULL) - *opt->var = opt->value; - - return 1; - } - } - - for (lopt = arm_long_opts; lopt->option != NULL; lopt++) - { - /* These options are expected to have an argument. */ - if (c == lopt->option[0] - && arg != NULL - && strncmp (arg, lopt->option + 1, - strlen (lopt->option + 1)) == 0) - { -#if WARN_DEPRECATED - /* If the option is deprecated, tell the user. */ - if (lopt->deprecated != NULL) - as_tsktsk (_("option `-%c%s' is deprecated: %s"), c, arg, - _(lopt->deprecated)); -#endif - - /* Call the sup-option parser. */ - return lopt->func (arg + strlen (lopt->option) - 1); - } - } - - return 0; - } - - return 1; -} - -void -md_show_usage (FILE * fp) -{ - struct arm_option_table *opt; - struct arm_long_option_table *lopt; - - fprintf (fp, _(" ARM-specific assembler options:\n")); - - for (opt = arm_opts; opt->option != NULL; opt++) - if (opt->help != NULL) - fprintf (fp, " -%-23s%s\n", opt->option, _(opt->help)); - - for (lopt = arm_long_opts; lopt->option != NULL; lopt++) - if (lopt->help != NULL) - fprintf (fp, " -%s%s\n", lopt->option, _(lopt->help)); - -#ifdef OPTION_EB - fprintf (fp, _("\ - -EB assemble code for a big-endian cpu\n")); -#endif - -#ifdef OPTION_EL - fprintf (fp, _("\ - -EL assemble code for a little-endian cpu\n")); -#endif -} - -/* This fix_new is called by cons via TC_CONS_FIX_NEW. */ - -void -cons_fix_new_arm (fragS * frag, - int where, - int size, - expressionS * exp) -{ - bfd_reloc_code_real_type type; - int pcrel = 0; - - /* Pick a reloc. - FIXME: @@ Should look at CPU word size. */ - switch (size) - { - case 1: - type = BFD_RELOC_8; - break; - case 2: - type = BFD_RELOC_16; - break; - case 4: - default: - type = BFD_RELOC_32; - break; - case 8: - type = BFD_RELOC_64; - break; - } - - fix_new_exp (frag, where, (int) size, exp, pcrel, type); -} - -/* A good place to do this, although this was probably not intended - for this kind of use. We need to dump the literal pool before - references are made to a null symbol pointer. */ - -void -arm_cleanup (void) -{ - literal_pool * pool; - - for (pool = list_of_pools; pool; pool = pool->next) - { - /* Put it at the end of the relevent section. */ - subseg_set (pool->section, pool->sub_section); -#ifdef OBJ_ELF - arm_elf_change_section (); -#endif - s_ltorg (0); - } -} - -void -arm_start_line_hook (void) -{ - last_label_seen = NULL; -} - -void -arm_frob_label (symbolS * sym) -{ - last_label_seen = sym; - - ARM_SET_THUMB (sym, thumb_mode); - -#if defined OBJ_COFF || defined OBJ_ELF - ARM_SET_INTERWORK (sym, support_interwork); -#endif - - /* Note - do not allow local symbols (.Lxxx) to be labeled - as Thumb functions. This is because these labels, whilst - they exist inside Thumb code, are not the entry points for - possible ARM->Thumb calls. Also, these labels can be used - as part of a computed goto or switch statement. eg gcc - can generate code that looks like this: - - ldr r2, [pc, .Laaa] - lsl r3, r3, #2 - ldr r2, [r3, r2] - mov pc, r2 - - .Lbbb: .word .Lxxx - .Lccc: .word .Lyyy - ..etc... - .Laaa: .word Lbbb - - The first instruction loads the address of the jump table. - The second instruction converts a table index into a byte offset. - The third instruction gets the jump address out of the table. - The fourth instruction performs the jump. - - If the address stored at .Laaa is that of a symbol which has the - Thumb_Func bit set, then the linker will arrange for this address - to have the bottom bit set, which in turn would mean that the - address computation performed by the third instruction would end - up with the bottom bit set. Since the ARM is capable of unaligned - word loads, the instruction would then load the incorrect address - out of the jump table, and chaos would ensue. */ - if (label_is_thumb_function_name - && (S_GET_NAME (sym)[0] != '.' || S_GET_NAME (sym)[1] != 'L') - && (bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0) - { - /* When the address of a Thumb function is taken the bottom - bit of that address should be set. This will allow - interworking between Arm and Thumb functions to work - correctly. */ - - THUMB_SET_FUNC (sym, 1); - - label_is_thumb_function_name = FALSE; - } -} - -/* Adjust the symbol table. This marks Thumb symbols as distinct from - ARM ones. */ - -void -arm_adjust_symtab (void) -{ -#ifdef OBJ_COFF - symbolS * sym; - - for (sym = symbol_rootP; sym != NULL; sym = symbol_next (sym)) - { - if (ARM_IS_THUMB (sym)) - { - if (THUMB_IS_FUNC (sym)) - { - /* Mark the symbol as a Thumb function. */ - if ( S_GET_STORAGE_CLASS (sym) == C_STAT - || S_GET_STORAGE_CLASS (sym) == C_LABEL) /* This can happen! */ - S_SET_STORAGE_CLASS (sym, C_THUMBSTATFUNC); - - else if (S_GET_STORAGE_CLASS (sym) == C_EXT) - S_SET_STORAGE_CLASS (sym, C_THUMBEXTFUNC); - else - as_bad (_("%s: unexpected function type: %d"), - S_GET_NAME (sym), S_GET_STORAGE_CLASS (sym)); - } - else switch (S_GET_STORAGE_CLASS (sym)) - { - case C_EXT: - S_SET_STORAGE_CLASS (sym, C_THUMBEXT); - break; - case C_STAT: - S_SET_STORAGE_CLASS (sym, C_THUMBSTAT); - break; - case C_LABEL: - S_SET_STORAGE_CLASS (sym, C_THUMBLABEL); - break; - default: - /* Do nothing. */ - break; - } - } - - if (ARM_IS_INTERWORK (sym)) - coffsymbol (symbol_get_bfdsym (sym))->native->u.syment.n_flags = 0xFF; - } -#endif -#ifdef OBJ_ELF - symbolS * sym; - char bind; - - for (sym = symbol_rootP; sym != NULL; sym = symbol_next (sym)) - { - if (ARM_IS_THUMB (sym)) - { - elf_symbol_type * elf_sym; - - elf_sym = elf_symbol (symbol_get_bfdsym (sym)); - bind = ELF_ST_BIND (elf_sym->internal_elf_sym.st_info); - - if (! bfd_is_arm_mapping_symbol_name (elf_sym->symbol.name)) - { - /* 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); - else - elf_sym->internal_elf_sym.st_info = - ELF_ST_INFO (bind, STT_ARM_16BIT); - } - } - } -#endif -} - -int -arm_data_in_code (void) -{ - if (thumb_mode && ! strncmp (input_line_pointer + 1, "data:", 5)) - { - *input_line_pointer = '/'; - input_line_pointer += 5; - *input_line_pointer = 0; - return 1; - } - - return 0; -} - -char * -arm_canonicalize_symbol_name (char * name) -{ - int len; - - if (thumb_mode && (len = strlen (name)) > 5 - && streq (name + len - 5, "/data")) - *(name + len - 5) = 0; - - return name; -} - -#if defined OBJ_COFF || defined OBJ_ELF -void -arm_validate_fix (fixS * fixP) -{ - /* If the destination of the branch is a defined symbol which does not have - the THUMB_FUNC attribute, then we must be calling a function which has - the (interfacearm) attribute. We look for the Thumb entry point to that - function and change the branch to refer to that function instead. */ - if (fixP->fx_r_type == BFD_RELOC_THUMB_PCREL_BRANCH23 - && fixP->fx_addsy != NULL - && S_IS_DEFINED (fixP->fx_addsy) - && ! THUMB_IS_FUNC (fixP->fx_addsy)) - { - fixP->fx_addsy = find_real_start (fixP->fx_addsy); - } -} -#endif - -int -arm_force_relocation (struct fix * fixp) -{ -#if defined (OBJ_COFF) && defined (TE_PE) - if (fixp->fx_r_type == BFD_RELOC_RVA) - return 1; -#endif -#ifdef OBJ_ELF - if (fixp->fx_r_type == BFD_RELOC_ARM_PCREL_BRANCH - || fixp->fx_r_type == BFD_RELOC_ARM_PCREL_BLX - || fixp->fx_r_type == BFD_RELOC_THUMB_PCREL_BLX - || fixp->fx_r_type == BFD_RELOC_THUMB_PCREL_BRANCH23) - return 1; -#endif - - /* Resolve these relocations even if the symbol is extern or weak. */ - if (fixp->fx_r_type == BFD_RELOC_ARM_IMMEDIATE - || fixp->fx_r_type == BFD_RELOC_ARM_OFFSET_IMM - || fixp->fx_r_type == BFD_RELOC_ARM_ADRL_IMMEDIATE) - return 0; - - return generic_force_reloc (fixp); -} - -#ifdef OBJ_COFF -/* This is a little hack to help the gas/arm/adrl.s test. It prevents - local labels from being added to the output symbol table when they - are used with the ADRL pseudo op. The ADRL relocation should always - be resolved before the binbary is emitted, so it is safe to say that - it is adjustable. */ - -bfd_boolean -arm_fix_adjustable (fixS * fixP) -{ - if (fixP->fx_r_type == BFD_RELOC_ARM_ADRL_IMMEDIATE) - return 1; - return 0; -} -#endif - -#ifdef OBJ_ELF -/* Relocations against Thumb function names must be left unadjusted, - so that the linker can use this information to correctly set the - bottom bit of their addresses. The MIPS version of this function - also prevents relocations that are mips-16 specific, but I do not - know why it does this. - - FIXME: - There is one other problem that ought to be addressed here, but - which currently is not: Taking the address of a label (rather - than a function) and then later jumping to that address. Such - addresses also ought to have their bottom bit set (assuming that - they reside in Thumb code), but at the moment they will not. */ - -bfd_boolean -arm_fix_adjustable (fixS * fixP) -{ - if (fixP->fx_addsy == NULL) - return 1; - - if (THUMB_IS_FUNC (fixP->fx_addsy) - && fixP->fx_subsy == NULL) - 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) - return 0; - - /* Don't allow symbols to be discarded on GOT related relocs. */ - if (fixP->fx_r_type == BFD_RELOC_ARM_PLT32 - || fixP->fx_r_type == BFD_RELOC_ARM_GOT32 - || fixP->fx_r_type == BFD_RELOC_ARM_GOTOFF - || fixP->fx_r_type == BFD_RELOC_ARM_TLS_GD32 - || fixP->fx_r_type == BFD_RELOC_ARM_TLS_LE32 - || fixP->fx_r_type == BFD_RELOC_ARM_TLS_IE32 - || fixP->fx_r_type == BFD_RELOC_ARM_TLS_LDM32 - || fixP->fx_r_type == BFD_RELOC_ARM_TLS_LDO32 - || fixP->fx_r_type == BFD_RELOC_ARM_TARGET2) - return 0; - - return 1; -} - -const char * -elf32_arm_target_format (void) -{ -#ifdef TE_SYMBIAN - return (target_big_endian - ? "elf32-bigarm-symbian" - : "elf32-littlearm-symbian"); -#elif defined (TE_VXWORKS) - return (target_big_endian - ? "elf32-bigarm-vxworks" - : "elf32-littlearm-vxworks"); -#else - if (target_big_endian) - return "elf32-bigarm"; - else - return "elf32-littlearm"; -#endif -} - -void -armelf_frob_symbol (symbolS * symp, - int * puntp) -{ - elf_frob_symbol (symp, puntp); -} - -static void -s_arm_elf_cons (int nbytes) -{ - expressionS exp; - -#ifdef md_flush_pending_output - md_flush_pending_output (); -#endif - - if (is_it_end_of_statement ()) - { - demand_empty_rest_of_line (); - return; - } - -#ifdef md_cons_align - md_cons_align (nbytes); -#endif - - mapping_state (MAP_DATA); - do - { - bfd_reloc_code_real_type reloc; - char *sym_start; - int sym_len; - - sym_start = input_line_pointer; - expression (& exp); - sym_len = input_line_pointer - sym_start; - - if (exp.X_op == O_symbol - && * input_line_pointer == '(' - && (reloc = arm_parse_reloc ()) != BFD_RELOC_UNUSED) - { - reloc_howto_type *howto = bfd_reloc_type_lookup (stdoutput, reloc); - int size = bfd_get_reloc_size (howto); - - if (size > nbytes) - as_bad ("%s relocations do not fit in %d bytes", - howto->name, nbytes); - else - { - char *p; - int offset = nbytes - size; - char *saved_buf = alloca (sym_len), *saved_input; - - /* We've parsed an expression stopping at O_symbol. But there - may be more expression left now that we have parsed the - relocation marker. Parse it again. */ - saved_input = input_line_pointer - sym_len; - memcpy (saved_buf, saved_input, sym_len); - memmove (saved_input, sym_start, sym_len); - input_line_pointer = saved_input; - expression (& exp); - memcpy (saved_input, saved_buf, sym_len); - assert (input_line_pointer >= saved_input + sym_len); - - p = frag_more ((int) nbytes); - fix_new_exp (frag_now, p - frag_now->fr_literal + offset, size, - &exp, 0, reloc); - } - } - else - emit_expr (&exp, (unsigned int) nbytes); - } - while (*input_line_pointer++ == ','); - - /* Put terminator back into stream. */ - input_line_pointer --; - demand_empty_rest_of_line (); -} - - -/* Parse a .rel31 directive. */ - -static void -s_arm_rel31 (int ignored ATTRIBUTE_UNUSED) -{ - expressionS exp; - char *p; - valueT highbit; - - SKIP_WHITESPACE (); - - highbit = 0; - if (*input_line_pointer == '1') - highbit = 0x80000000; - else if (*input_line_pointer != '0') - as_bad (_("expected 0 or 1")); - - input_line_pointer++; - SKIP_WHITESPACE (); - if (*input_line_pointer != ',') - as_bad (_("missing comma")); - input_line_pointer++; - -#ifdef md_flush_pending_output - md_flush_pending_output (); -#endif - -#ifdef md_cons_align - md_cons_align (4); -#endif - - mapping_state (MAP_DATA); - - expression (&exp); - - p = frag_more (4); - md_number_to_chars (p, highbit, 4); - fix_new_arm (frag_now, p - frag_now->fr_literal, 4, &exp, 1, - BFD_RELOC_ARM_PREL31); - - demand_empty_rest_of_line (); -} - -/* Code to deal with unwinding tables. */ - -static void add_unwind_adjustsp (offsetT); - -/* Switch to section NAME and create section if necessary. It's - rather ugly that we have to manipulate input_line_pointer but I - don't see any other way to accomplish the same thing without - changing obj-elf.c (which may be the Right Thing, in the end). - Copied from tc-ia64.c. */ - -static void -set_section (char *name) -{ - char *saved_input_line_pointer; - - saved_input_line_pointer = input_line_pointer; - input_line_pointer = name; - obj_elf_section (0); - input_line_pointer = saved_input_line_pointer; -} - -/* Cenerate and deferred unwind frame offset. */ - -static void -flush_pending_unwind (void) -{ - offsetT offset; - - offset = unwind.pending_offset; - unwind.pending_offset = 0; - if (offset != 0) - add_unwind_adjustsp (offset); -} - -/* Add an opcode to this list for this function. Two-byte opcodes should - be passed as op[0] << 8 | op[1]. The list of opcodes is built in reverse - order. */ - -static void -add_unwind_opcode (valueT op, int length) -{ - /* Add any deferred stack adjustment. */ - if (unwind.pending_offset) - flush_pending_unwind (); - - unwind.sp_restored = 0; - - if (unwind.opcode_count + length > unwind.opcode_alloc) - { - unwind.opcode_alloc += ARM_OPCODE_CHUNK_SIZE; - if (unwind.opcodes) - unwind.opcodes = xrealloc (unwind.opcodes, - unwind.opcode_alloc); - else - unwind.opcodes = xmalloc (unwind.opcode_alloc); - } - while (length > 0) - { - length--; - unwind.opcodes[unwind.opcode_count] = op & 0xff; - op >>= 8; - unwind.opcode_count++; - } -} - -/* Add unwind opcodes to adjust the stack pointer. */ - -static void -add_unwind_adjustsp (offsetT offset) -{ - valueT op; - - if (offset > 0x200) - { - /* We need at most 5 bytes to hold a 32-bit value in a uleb128. */ - char bytes[5]; - int n; - valueT o; - - /* Long form: 0xb2, uleb128. */ - /* This might not fit in a word so add the individual bytes, - remembering the list is built in reverse order. */ - o = (valueT) ((offset - 0x204) >> 2); - if (o == 0) - add_unwind_opcode (0, 1); - - /* Calculate the uleb128 encoding of the offset. */ - n = 0; - while (o) - { - bytes[n] = o & 0x7f; - o >>= 7; - if (o) - bytes[n] |= 0x80; - n++; - } - /* Add the insn. */ - for (; n; n--) - add_unwind_opcode (bytes[n - 1], 1); - add_unwind_opcode (0xb2, 1); - } - else if (offset > 0x100) - { - /* Two short opcodes. */ - add_unwind_opcode (0x3f, 1); - op = (offset - 0x104) >> 2; - add_unwind_opcode (op, 1); - } - else if (offset > 0) - { - /* Short opcode. */ - op = (offset - 4) >> 2; - add_unwind_opcode (op, 1); - } - else if (offset < 0) - { - offset = -offset; - while (offset > 0x100) - { - add_unwind_opcode (0x7f, 1); - offset -= 0x100; - } - op = ((offset - 4) >> 2) | 0x40; - add_unwind_opcode (op, 1); - } -} - -/* Finish the list of unwind opcodes for this function. */ -static void -finish_unwind_opcodes (void) -{ - valueT op; - - if (unwind.fp_used) - { - /* Adjust sp as neccessary. */ - unwind.pending_offset += unwind.fp_offset - unwind.frame_size; - flush_pending_unwind (); - - /* After restoring sp from the frame pointer. */ - op = 0x90 | unwind.fp_reg; - add_unwind_opcode (op, 1); - } - else - flush_pending_unwind (); -} - - -/* Start an exception table entry. If idx is nonzero this is an index table - entry. */ - -static void -start_unwind_section (const segT text_seg, int idx) -{ - const char * text_name; - const char * prefix; - const char * prefix_once; - size_t prefix_len; - size_t text_len; - char * sec_name; - size_t sec_name_len; - - if (idx) - { - prefix = ELF_STRING_ARM_unwind; - prefix_once = ELF_STRING_ARM_unwind_once; - } - else - { - prefix = ELF_STRING_ARM_unwind_info; - prefix_once = ELF_STRING_ARM_unwind_info_once; - } - - text_name = segment_name (text_seg); - if (streq (text_name, ".text")) - text_name = ""; - - if (strncmp (text_name, ".gnu.linkonce.t.", - strlen (".gnu.linkonce.t.")) == 0) - { - prefix = prefix_once; - text_name += strlen (".gnu.linkonce.t."); - } - - prefix_len = strlen (prefix); - text_len = strlen (text_name); - sec_name_len = prefix_len + text_len; - sec_name = alloca (sec_name_len + 1); - memcpy (sec_name, prefix, prefix_len); - memcpy (sec_name + prefix_len, text_name, text_len); - sec_name[prefix_len + text_len] = '\0'; - - /* Handle COMDAT group. */ - if (prefix != prefix_once && (text_seg->flags & SEC_LINK_ONCE) != 0) - { - char *section; - size_t len, group_name_len; - const char *group_name = elf_group_name (text_seg); - - if (group_name == NULL) - { - as_bad ("Group section `%s' has no group signature", - segment_name (text_seg)); - ignore_rest_of_line (); - return; - } - /* We have to construct a fake section directive. */ - group_name_len = strlen (group_name); - if (idx) - prefix_len = 13; - else - prefix_len = 16; - - len = (sec_name_len - + prefix_len /* ,"aG",%sectiontype, */ - + group_name_len /* ,group_name */ - + 7); /* ,comdat */ - - section = alloca (len + 1); - memcpy (section, sec_name, sec_name_len); - if (idx) - memcpy (section + sec_name_len, ",\"aG\",%exidx,", 13); - else - memcpy (section + sec_name_len, ",\"aG\",%progbits,", 16); - memcpy (section + sec_name_len + prefix_len, group_name, group_name_len); - memcpy (section + len - 7, ",comdat", 7); - section [len] = '\0'; - set_section (section); - } - else - { - set_section (sec_name); - bfd_set_section_flags (stdoutput, now_seg, - SEC_LOAD | SEC_ALLOC | SEC_READONLY); - } - - /* Set the setion link for index tables. */ - if (idx) - elf_linked_to_section (now_seg) = text_seg; -} - - -/* Start an unwind table entry. HAVE_DATA is nonzero if we have additional - personality routine data. Returns zero, or the index table value for - and inline entry. */ - -static valueT -create_unwind_entry (int have_data) -{ - int size; - addressT where; - char *ptr; - /* The current word of data. */ - valueT data; - /* The number of bytes left in this word. */ - int n; - - finish_unwind_opcodes (); - - /* Remember the current text section. */ - unwind.saved_seg = now_seg; - unwind.saved_subseg = now_subseg; - - start_unwind_section (now_seg, 0); - - if (unwind.personality_routine == NULL) - { - if (unwind.personality_index == -2) - { - if (have_data) - as_bad (_("handerdata in cantunwind frame")); - return 1; /* EXIDX_CANTUNWIND. */ - } - - /* Use a default personality routine if none is specified. */ - if (unwind.personality_index == -1) - { - if (unwind.opcode_count > 3) - unwind.personality_index = 1; - else - unwind.personality_index = 0; - } - - /* Space for the personality routine entry. */ - if (unwind.personality_index == 0) - { - if (unwind.opcode_count > 3) - as_bad (_("too many unwind opcodes for personality routine 0")); - - if (!have_data) - { - /* All the data is inline in the index table. */ - data = 0x80; - n = 3; - while (unwind.opcode_count > 0) - { - unwind.opcode_count--; - data = (data << 8) | unwind.opcodes[unwind.opcode_count]; - n--; - } - - /* Pad with "finish" opcodes. */ - while (n--) - data = (data << 8) | 0xb0; - - return data; - } - size = 0; - } - else - /* We get two opcodes "free" in the first word. */ - size = unwind.opcode_count - 2; - } - else - /* An extra byte is required for the opcode count. */ - size = unwind.opcode_count + 1; - - size = (size + 3) >> 2; - if (size > 0xff) - as_bad (_("too many unwind opcodes")); - - frag_align (2, 0, 0); - record_alignment (now_seg, 2); - unwind.table_entry = expr_build_dot (); - - /* Allocate the table entry. */ - ptr = frag_more ((size << 2) + 4); - where = frag_now_fix () - ((size << 2) + 4); - - switch (unwind.personality_index) - { - case -1: - /* ??? Should this be a PLT generating relocation? */ - /* Custom personality routine. */ - fix_new (frag_now, where, 4, unwind.personality_routine, 0, 1, - BFD_RELOC_ARM_PREL31); - - where += 4; - ptr += 4; - - /* Set the first byte to the number of additional words. */ - data = size - 1; - n = 3; - break; - - /* ABI defined personality routines. */ - case 0: - /* Three opcodes bytes are packed into the first word. */ - data = 0x80; - n = 3; - break; - - case 1: - case 2: - /* The size and first two opcode bytes go in the first word. */ - data = ((0x80 + unwind.personality_index) << 8) | size; - n = 2; - break; - - default: - /* Should never happen. */ - abort (); - } - - /* Pack the opcodes into words (MSB first), reversing the list at the same - time. */ - while (unwind.opcode_count > 0) - { - if (n == 0) - { - md_number_to_chars (ptr, data, 4); - ptr += 4; - n = 4; - data = 0; - } - unwind.opcode_count--; - n--; - data = (data << 8) | unwind.opcodes[unwind.opcode_count]; - } - - /* Finish off the last word. */ - if (n < 4) - { - /* Pad with "finish" opcodes. */ - while (n--) - data = (data << 8) | 0xb0; - - md_number_to_chars (ptr, data, 4); - } - - if (!have_data) - { - /* Add an empty descriptor if there is no user-specified data. */ - ptr = frag_more (4); - md_number_to_chars (ptr, 0, 4); - } - - return 0; -} - - -/* Parse an unwind_fnstart directive. Simply records the current location. */ - -static void -s_arm_unwind_fnstart (int ignored ATTRIBUTE_UNUSED) -{ - demand_empty_rest_of_line (); - /* Mark the start of the function. */ - unwind.proc_start = expr_build_dot (); - - /* Reset the rest of the unwind info. */ - unwind.opcode_count = 0; - unwind.table_entry = NULL; - unwind.personality_routine = NULL; - unwind.personality_index = -1; - unwind.frame_size = 0; - unwind.fp_offset = 0; - unwind.fp_reg = 13; - unwind.fp_used = 0; - unwind.sp_restored = 0; -} - - -/* Parse a handlerdata directive. Creates the exception handling table entry - for the function. */ - -static void -s_arm_unwind_handlerdata (int ignored ATTRIBUTE_UNUSED) -{ - demand_empty_rest_of_line (); - if (unwind.table_entry) - as_bad (_("dupicate .handlerdata directive")); - - create_unwind_entry (1); -} - -/* Parse an unwind_fnend directive. Generates the index table entry. */ - -static void -s_arm_unwind_fnend (int ignored ATTRIBUTE_UNUSED) -{ - long where; - char *ptr; - valueT val; - - demand_empty_rest_of_line (); - - /* Add eh table entry. */ - if (unwind.table_entry == NULL) - val = create_unwind_entry (0); - else - val = 0; - - /* Add index table entry. This is two words. */ - start_unwind_section (unwind.saved_seg, 1); - frag_align (2, 0, 0); - record_alignment (now_seg, 2); - - ptr = frag_more (8); - where = frag_now_fix () - 8; - - /* Self relative offset of the function start. */ - fix_new (frag_now, where, 4, unwind.proc_start, 0, 1, - BFD_RELOC_ARM_PREL31); - - /* Indicate dependency on EHABI-defined personality routines to the - linker, if it hasn't been done already. */ - if (unwind.personality_index >= 0 && unwind.personality_index < 3) - { - char *name[] = { "__aeabi_unwind_cpp_pr0", - "__aeabi_unwind_cpp_pr1", - "__aeabi_unwind_cpp_pr2" }; - if (!(marked_pr_dependency & (1 << unwind.personality_index))) - { - symbolS *pr = symbol_find_or_make (name[unwind.personality_index]); - fix_new (frag_now, where, 0, pr, 0, 1, BFD_RELOC_NONE); - marked_pr_dependency |= 1 << unwind.personality_index; - seg_info (now_seg)->tc_segment_info_data.marked_pr_dependency - = marked_pr_dependency; - } - } - - if (val) - /* Inline exception table entry. */ - md_number_to_chars (ptr + 4, val, 4); - else - /* Self relative offset of the table entry. */ - fix_new (frag_now, where + 4, 4, unwind.table_entry, 0, 1, - BFD_RELOC_ARM_PREL31); - - /* Restore the original section. */ - subseg_set (unwind.saved_seg, unwind.saved_subseg); -} - - -/* Parse an unwind_cantunwind directive. */ - -static void -s_arm_unwind_cantunwind (int ignored ATTRIBUTE_UNUSED) -{ - demand_empty_rest_of_line (); - if (unwind.personality_routine || unwind.personality_index != -1) - as_bad (_("personality routine specified for cantunwind frame")); - - unwind.personality_index = -2; -} - - -/* Parse a personalityindex directive. */ - -static void -s_arm_unwind_personalityindex (int ignored ATTRIBUTE_UNUSED) -{ - expressionS exp; - - if (unwind.personality_routine || unwind.personality_index != -1) - as_bad (_("duplicate .personalityindex directive")); - - SKIP_WHITESPACE (); - - expression (&exp); - - if (exp.X_op != O_constant - || exp.X_add_number < 0 || exp.X_add_number > 15) - { - as_bad (_("bad personality routine number")); - ignore_rest_of_line (); - return; - } - - unwind.personality_index = exp.X_add_number; - - demand_empty_rest_of_line (); -} - - -/* Parse a personality directive. */ - -static void -s_arm_unwind_personality (int ignored ATTRIBUTE_UNUSED) -{ - char *name, *p, c; - - if (unwind.personality_routine || unwind.personality_index != -1) - as_bad (_("duplicate .personality directive")); - - SKIP_WHITESPACE (); - name = input_line_pointer; - c = get_symbol_end (); - p = input_line_pointer; - unwind.personality_routine = symbol_find_or_make (name); - *p = c; - SKIP_WHITESPACE (); - demand_empty_rest_of_line (); -} - - -/* Parse a directive saving core registers. */ - -static void -s_arm_unwind_save_core (void) -{ - valueT op; - long range; - int n; - - SKIP_WHITESPACE (); - range = reg_list (&input_line_pointer); - if (range == FAIL) - { - as_bad (_("expected register list")); - ignore_rest_of_line (); - return; - } - - demand_empty_rest_of_line (); - - /* Turn .unwind_movsp ip followed by .unwind_save {..., ip, ...} - into .unwind_save {..., sp...}. We aren't bothered about the value of - ip because it is clobbered by calls. */ - if (unwind.sp_restored && unwind.fp_reg == 12 - && (range & 0x3000) == 0x1000) - { - unwind.opcode_count--; - unwind.sp_restored = 0; - range = (range | 0x2000) & ~0x1000; - unwind.pending_offset = 0; - } - - /* See if we can use the short opcodes. These pop a block of upto 8 - registers starting with r4, plus maybe r14. */ - for (n = 0; n < 8; n++) - { - /* Break at the first non-saved register. */ - if ((range & (1 << (n + 4))) == 0) - break; - } - /* See if there are any other bits set. */ - if (n == 0 || (range & (0xfff0 << n) & 0xbff0) != 0) - { - /* Use the long form. */ - op = 0x8000 | ((range >> 4) & 0xfff); - add_unwind_opcode (op, 2); - } - else - { - /* Use the short form. */ - if (range & 0x4000) - op = 0xa8; /* Pop r14. */ - else - op = 0xa0; /* Do not pop r14. */ - op |= (n - 1); - add_unwind_opcode (op, 1); - } - - /* Pop r0-r3. */ - if (range & 0xf) - { - op = 0xb100 | (range & 0xf); - add_unwind_opcode (op, 2); - } - - /* Record the number of bytes pushed. */ - for (n = 0; n < 16; n++) - { - if (range & (1 << n)) - unwind.frame_size += 4; - } -} - - -/* Parse a directive saving FPA registers. */ - -static void -s_arm_unwind_save_fpa (int reg) -{ - expressionS exp; - int num_regs; - valueT op; - - /* Get Number of registers to transfer. */ - if (skip_past_comma (&input_line_pointer) != FAIL) - expression (&exp); - else - exp.X_op = O_illegal; - - if (exp.X_op != O_constant) - { - as_bad (_("expected , ")); - ignore_rest_of_line (); - return; - } - - num_regs = exp.X_add_number; - - if (num_regs < 1 || num_regs > 4) - { - as_bad (_("number of registers must be in the range [1:4]")); - ignore_rest_of_line (); - return; - } - - demand_empty_rest_of_line (); - - if (reg == 4) - { - /* Short form. */ - op = 0xb4 | (num_regs - 1); - add_unwind_opcode (op, 1); - } - else - { - /* Long form. */ - op = 0xc800 | (reg << 4) | (num_regs - 1); - add_unwind_opcode (op, 2); - } - unwind.frame_size += num_regs * 12; -} - - -/* Parse a directive saving VFP registers. */ - -static void -s_arm_unwind_save_vfp (void) -{ - int count; - int reg; - valueT op; - - count = vfp_parse_reg_list (&input_line_pointer, ®, 1); - if (count == FAIL) - { - as_bad (_("expected register list")); - ignore_rest_of_line (); - return; - } - - demand_empty_rest_of_line (); - - if (reg == 8) - { - /* Short form. */ - op = 0xb8 | (count - 1); - add_unwind_opcode (op, 1); - } - else - { - /* Long form. */ - op = 0xb300 | (reg << 4) | (count - 1); - add_unwind_opcode (op, 2); - } - unwind.frame_size += count * 8 + 4; -} - - -/* Parse a directive saving iWMMXt registers. */ - -static void -s_arm_unwind_save_wmmx (void) -{ - int reg; - int hi_reg; - int i; - unsigned wcg_mask; - unsigned wr_mask; - valueT op; - - if (*input_line_pointer == '{') - input_line_pointer++; - - wcg_mask = 0; - wr_mask = 0; - do - { - reg = arm_reg_parse (&input_line_pointer, - all_reg_maps[REG_TYPE_IWMMXT].htab); - - if (wr_register (reg)) - { - i = reg & ~WR_PREFIX; - if (wr_mask >> i) - as_tsktsk (_("register list not in ascending order")); - wr_mask |= 1 << i; - } - else if (wcg_register (reg)) - { - i = (reg & ~WC_PREFIX) - 8; - if (wcg_mask >> i) - as_tsktsk (_("register list not in ascending order")); - wcg_mask |= 1 << i; - } - else - { - as_bad (_("expected wr or wcgr")); - goto error; - } - - SKIP_WHITESPACE (); - if (*input_line_pointer == '-') - { - hi_reg = arm_reg_parse (&input_line_pointer, - all_reg_maps[REG_TYPE_IWMMXT].htab); - if (wr_register (reg) && wr_register (hi_reg)) - { - for (; reg < hi_reg; reg++) - wr_mask |= 1 << (reg & ~WR_PREFIX); - } - else if (wcg_register (reg) && wcg_register (hi_reg)) - { - for (; reg < hi_reg; reg++) - wcg_mask |= 1 << ((reg & ~WC_PREFIX) - 8); - } - else - { - as_bad (_("bad register range")); - goto error; - } - } - } - while (skip_past_comma (&input_line_pointer) != FAIL); - - SKIP_WHITESPACE (); - if (*input_line_pointer == '}') - input_line_pointer++; - - demand_empty_rest_of_line (); - - if (wr_mask && wcg_mask) - { - as_bad (_("inconsistent register types")); - goto error; - } - - /* Generate any deferred opcodes becuuse we're going to be looking at - the list. */ - flush_pending_unwind (); - - if (wcg_mask) - { - for (i = 0; i < 16; i++) - { - if (wcg_mask & (1 << i)) - unwind.frame_size += 4; - } - op = 0xc700 | wcg_mask; - add_unwind_opcode (op, 2); - } - else - { - for (i = 0; i < 16; i++) - { - if (wr_mask & (1 << i)) - unwind.frame_size += 8; - } - /* Attempt to combine with a previous opcode. We do this because gcc - likes to output separate unwind directives for a single block of - registers. */ - if (unwind.opcode_count > 0) - { - i = unwind.opcodes[unwind.opcode_count - 1]; - if ((i & 0xf8) == 0xc0) - { - i &= 7; - /* Only merge if the blocks are contiguous. */ - if (i < 6) - { - if ((wr_mask & 0xfe00) == (1 << 9)) - { - wr_mask |= ((1 << (i + 11)) - 1) & 0xfc00; - unwind.opcode_count--; - } - } - else if (i == 6 && unwind.opcode_count >= 2) - { - i = unwind.opcodes[unwind.opcode_count - 2]; - reg = i >> 4; - i &= 0xf; - - op = 0xffff << (reg - 1); - if (reg > 0 - || ((wr_mask & op) == (1u << (reg - 1)))) - { - op = (1 << (reg + i + 1)) - 1; - op &= ~((1 << reg) - 1); - wr_mask |= op; - unwind.opcode_count -= 2; - } - } - } - } - - hi_reg = 15; - /* We want to generate opcodes in the order the registers have been - saved, ie. descending order. */ - for (reg = 15; reg >= -1; reg--) - { - /* Save registers in blocks. */ - if (reg < 0 - || !(wr_mask & (1 << reg))) - { - /* We found an unsaved reg. Generate opcodes to save the - preceeding block. */ - if (reg != hi_reg) - { - if (reg == 9) - { - /* Short form. */ - op = 0xc0 | (hi_reg - 10); - add_unwind_opcode (op, 1); - } - else - { - /* Long form. */ - op = 0xc600 | ((reg + 1) << 4) | ((hi_reg - reg) - 1); - add_unwind_opcode (op, 2); - } - } - hi_reg = reg - 1; - } - } - } - return; -error: - ignore_rest_of_line (); -} - - -/* Parse an unwind_save directive. */ - -static void -s_arm_unwind_save (int ignored ATTRIBUTE_UNUSED) -{ - char *saved_ptr; - int reg; - - /* Figure out what sort of save we have. */ - SKIP_WHITESPACE (); - saved_ptr = input_line_pointer; - - reg = arm_reg_parse (&input_line_pointer, all_reg_maps[REG_TYPE_FN].htab); - if (reg != FAIL) - { - s_arm_unwind_save_fpa (reg); - return; - } - - if (*input_line_pointer == '{') - input_line_pointer++; - - SKIP_WHITESPACE (); - - reg = arm_reg_parse (&input_line_pointer, all_reg_maps[REG_TYPE_RN].htab); - if (reg != FAIL) - { - input_line_pointer = saved_ptr; - s_arm_unwind_save_core (); - return; - } - - reg = arm_reg_parse (&input_line_pointer, all_reg_maps[REG_TYPE_DN].htab); - if (reg != FAIL) - { - input_line_pointer = saved_ptr; - s_arm_unwind_save_vfp (); - return; - } - - reg = arm_reg_parse (&input_line_pointer, - all_reg_maps[REG_TYPE_IWMMXT].htab); - if (reg != FAIL) - { - input_line_pointer = saved_ptr; - s_arm_unwind_save_wmmx (); - return; - } - - /* TODO: Maverick registers. */ - as_bad (_("unrecognised register")); -} - - -/* Parse an unwind_movsp directive. */ - -static void -s_arm_unwind_movsp (int ignored ATTRIBUTE_UNUSED) -{ - int reg; - valueT op; - - SKIP_WHITESPACE (); - reg = reg_required_here (&input_line_pointer, -1); - if (reg == FAIL) - { - as_bad (_("ARM register expected")); - ignore_rest_of_line (); - return; - } + {"all", ARM_ANY, FPU_ARCH_FPA}, + {"armv1", ARM_ARCH_V1, FPU_ARCH_FPA}, + {"armv2", ARM_ARCH_V2, FPU_ARCH_FPA}, + {"armv2a", ARM_ARCH_V2S, FPU_ARCH_FPA}, + {"armv2s", ARM_ARCH_V2S, FPU_ARCH_FPA}, + {"armv3", ARM_ARCH_V3, FPU_ARCH_FPA}, + {"armv3m", ARM_ARCH_V3M, FPU_ARCH_FPA}, + {"armv4", ARM_ARCH_V4, FPU_ARCH_FPA}, + {"armv4xm", ARM_ARCH_V4xM, FPU_ARCH_FPA}, + {"armv4t", ARM_ARCH_V4T, FPU_ARCH_FPA}, + {"armv4txm", ARM_ARCH_V4TxM, FPU_ARCH_FPA}, + {"armv5", ARM_ARCH_V5, FPU_ARCH_VFP}, + {"armv5t", ARM_ARCH_V5T, FPU_ARCH_VFP}, + {"armv5txm", ARM_ARCH_V5TxM, FPU_ARCH_VFP}, + {"armv5te", ARM_ARCH_V5TE, FPU_ARCH_VFP}, + {"armv5texp", ARM_ARCH_V5TExP, FPU_ARCH_VFP}, + {"armv5tej", ARM_ARCH_V5TEJ, FPU_ARCH_VFP}, + {"armv6", ARM_ARCH_V6, FPU_ARCH_VFP}, + {"armv6j", ARM_ARCH_V6, FPU_ARCH_VFP}, + {"armv6k", ARM_ARCH_V6K, FPU_ARCH_VFP}, + {"armv6z", ARM_ARCH_V6Z, FPU_ARCH_VFP}, + {"armv6zk", ARM_ARCH_V6ZK, FPU_ARCH_VFP}, + {"armv6t2", ARM_ARCH_V6T2, FPU_ARCH_VFP}, + {"armv6kt2", ARM_ARCH_V6KT2, FPU_ARCH_VFP}, + {"armv6zt2", ARM_ARCH_V6ZT2, FPU_ARCH_VFP}, + {"armv6zkt2", ARM_ARCH_V6ZKT2, FPU_ARCH_VFP}, + {"xscale", ARM_ARCH_XSCALE, FPU_ARCH_VFP}, + {"iwmmxt", ARM_ARCH_IWMMXT, FPU_ARCH_VFP}, + {NULL, 0, 0} +}; - if (reg == 13 || reg == 15) - { - as_bad (_("r%d not permitted in .unwind_movsp directive"), reg); - ignore_rest_of_line (); - return; - } +/* ISA extensions in the co-processor space. */ +struct arm_option_value_table +{ + char *name; + int value; +}; - if (unwind.fp_reg != 13) - as_bad (_("unexpected .unwind_movsp directive")); +static struct arm_option_value_table arm_extensions[] = +{ + {"maverick", ARM_CEXT_MAVERICK}, + {"xscale", ARM_CEXT_XSCALE}, + {"iwmmxt", ARM_CEXT_IWMMXT}, + {NULL, 0} +}; - /* Generate opcode to restore the value. */ - op = 0x90 | reg; - add_unwind_opcode (op, 1); +/* This list should, at a minimum, contain all the fpu names + recognized by GCC. */ +static struct arm_option_value_table arm_fpus[] = +{ + {"softfpa", FPU_NONE}, + {"fpe", FPU_ARCH_FPE}, + {"fpe2", FPU_ARCH_FPE}, + {"fpe3", FPU_ARCH_FPA}, /* Third release supports LFM/SFM. */ + {"fpa", FPU_ARCH_FPA}, + {"fpa10", FPU_ARCH_FPA}, + {"fpa11", FPU_ARCH_FPA}, + {"arm7500fe", FPU_ARCH_FPA}, + {"softvfp", FPU_ARCH_VFP}, + {"softvfp+vfp", FPU_ARCH_VFP_V2}, + {"vfp", FPU_ARCH_VFP_V2}, + {"vfp9", FPU_ARCH_VFP_V2}, + {"vfp10", FPU_ARCH_VFP_V2}, + {"vfp10-r0", FPU_ARCH_VFP_V1}, + {"vfpxd", FPU_ARCH_VFP_V1xD}, + {"arm1020t", FPU_ARCH_VFP_V1}, + {"arm1020e", FPU_ARCH_VFP_V2}, + {"arm1136jfs", FPU_ARCH_VFP_V2}, + {"arm1136jf-s", FPU_ARCH_VFP_V2}, + {"maverick", FPU_ARCH_MAVERICK}, + {NULL, 0} +}; - /* Record the information for later. */ - unwind.fp_reg = reg; - unwind.fp_offset = unwind.frame_size; - unwind.sp_restored = 1; - demand_empty_rest_of_line (); -} +static struct arm_option_value_table arm_float_abis[] = +{ + {"hard", ARM_FLOAT_ABI_HARD}, + {"softfp", ARM_FLOAT_ABI_SOFTFP}, + {"soft", ARM_FLOAT_ABI_SOFT}, + {NULL, 0} +}; +#ifdef OBJ_ELF +/* We only know how to output GNU and ver 4 (AAELF) formats. */ +static struct arm_option_value_table arm_eabis[] = +{ + {"gnu", EF_ARM_EABI_UNKNOWN}, + {"4", EF_ARM_EABI_VER4}, + {NULL, 0} +}; +#endif -/* Parse #. */ +struct arm_long_option_table +{ + char * option; /* Substring to match. */ + char * help; /* Help information. */ + int (* func) (char * subopt); /* Function to decode sub-option. */ + char * deprecated; /* If non-null, print this message. */ +}; static int -require_hashconst (int * val) +arm_parse_extension (char * str, int * opt_p) { - expressionS exp; - - SKIP_WHITESPACE (); - if (*input_line_pointer == '#') + while (str != NULL && *str != 0) { - input_line_pointer++; - expression (&exp); - } - else - exp.X_op = O_illegal; + struct arm_option_value_table * opt; + char * ext; + int optlen; - if (exp.X_op != O_constant) - { - as_bad (_("expected #constant")); - ignore_rest_of_line (); - return FAIL; - } - *val = exp.X_add_number; - return SUCCESS; -} + if (*str != '+') + { + as_bad (_("invalid architectural extension")); + return 0; + } -/* Parse an unwind_pad directive. */ + str++; + ext = strchr (str, '+'); -static void -s_arm_unwind_pad (int ignored ATTRIBUTE_UNUSED) -{ - int offset; + if (ext != NULL) + optlen = ext - str; + else + optlen = strlen (str); - if (require_hashconst (&offset) == FAIL) - return; + if (optlen == 0) + { + as_bad (_("missing architectural extension")); + return 0; + } - if (offset & 3) - { - as_bad (_("stack increment must be multiple of 4")); - ignore_rest_of_line (); - return; - } + for (opt = arm_extensions; opt->name != NULL; opt++) + if (strncmp (opt->name, str, optlen) == 0) + { + *opt_p |= opt->value; + break; + } - /* Don't generate any opcodes, just record the details for later. */ - unwind.frame_size += offset; - unwind.pending_offset += offset; + if (opt->name == NULL) + { + as_bad (_("unknown architectural extnsion `%s'"), str); + return 0; + } - demand_empty_rest_of_line (); -} + str = ext; + }; -/* Parse an unwind_setfp directive. */ + return 1; +} -static void -s_arm_unwind_setfp (int ignored ATTRIBUTE_UNUSED) +static int +arm_parse_cpu (char * str) { - int sp_reg; - int fp_reg; - int offset; + struct arm_cpu_option_table * opt; + char * ext = strchr (str, '+'); + int optlen; - fp_reg = reg_required_here (&input_line_pointer, -1); - if (skip_past_comma (&input_line_pointer) == FAIL) - sp_reg = FAIL; + if (ext != NULL) + optlen = ext - str; else - sp_reg = reg_required_here (&input_line_pointer, -1); + optlen = strlen (str); - if (fp_reg == FAIL || sp_reg == FAIL) + if (optlen == 0) { - as_bad (_("expected , ")); - ignore_rest_of_line (); - return; + as_bad (_("missing cpu name `%s'"), str); + return 0; } - /* Optonal constant. */ - if (skip_past_comma (&input_line_pointer) != FAIL) - { - if (require_hashconst (&offset) == FAIL) - return; - } - else - offset = 0; + for (opt = arm_cpus; opt->name != NULL; opt++) + if (strncmp (opt->name, str, optlen) == 0) + { + mcpu_cpu_opt = opt->value; + mcpu_fpu_opt = opt->default_fpu; - demand_empty_rest_of_line (); + if (ext != NULL) + return arm_parse_extension (ext, &mcpu_cpu_opt); - if (sp_reg != 13 && sp_reg != unwind.fp_reg) - { - as_bad (_("register must be either sp or set by a previous" - "unwind_movsp directive")); - return; - } + return 1; + } - /* Don't generate any opcodes, just record the information for later. */ - unwind.fp_reg = fp_reg; - unwind.fp_used = 1; - if (sp_reg == 13) - unwind.fp_offset = unwind.frame_size - offset; - else - unwind.fp_offset -= offset; + as_bad (_("unknown cpu `%s'"), str); + return 0; } -/* Parse an unwind_raw directive. */ - -static void -s_arm_unwind_raw (int ignored ATTRIBUTE_UNUSED) +static int +arm_parse_arch (char * str) { - expressionS exp; - /* This is an arbitary limit. */ - unsigned char op[16]; - int count; + struct arm_arch_option_table *opt; + char *ext = strchr (str, '+'); + int optlen; - SKIP_WHITESPACE (); - expression (&exp); - if (exp.X_op == O_constant - && skip_past_comma (&input_line_pointer) != FAIL) - { - unwind.frame_size += exp.X_add_number; - expression (&exp); - } + if (ext != NULL) + optlen = ext - str; else - exp.X_op = O_illegal; + optlen = strlen (str); - if (exp.X_op != O_constant) + if (optlen == 0) { - as_bad (_("expected , ")); - ignore_rest_of_line (); - return; + as_bad (_("missing architecture name `%s'"), str); + return 0; } - count = 0; - - /* Parse the opcode. */ - for (;;) - { - if (count >= 16) - { - as_bad (_("unwind opcode too long")); - ignore_rest_of_line (); - } - if (exp.X_op != O_constant || exp.X_add_number & ~0xff) - { - as_bad (_("invalid unwind opcode")); - ignore_rest_of_line (); - return; - } - op[count++] = exp.X_add_number; - - /* Parse the next byte. */ - if (skip_past_comma (&input_line_pointer) == FAIL) - break; - expression (&exp); - } + for (opt = arm_archs; opt->name != NULL; opt++) + if (streq (opt->name, str)) + { + march_cpu_opt = opt->value; + march_fpu_opt = opt->default_fpu; - /* Add the opcode bytes in reverse order. */ - while (count--) - add_unwind_opcode (op[count], 1); + if (ext != NULL) + return arm_parse_extension (ext, &march_cpu_opt); - demand_empty_rest_of_line (); + return 1; + } + + as_bad (_("unknown architecture `%s'\n"), str); + return 0; } -#endif /* OBJ_ELF */ +static int +arm_parse_fpu (char * str) +{ + struct arm_option_value_table * opt; -/* This is called from HANDLE_ALIGN in write.c. Fill in the contents - of an rs_align_code fragment. */ + for (opt = arm_fpus; opt->name != NULL; opt++) + if (streq (opt->name, str)) + { + mfpu_opt = opt->value; + return 1; + } -void -arm_handle_align (fragS * fragP) + as_bad (_("unknown floating point format `%s'\n"), str); + return 0; +} + +static int +arm_parse_float_abi (char * str) { - static char const arm_noop[4] = { 0x00, 0x00, 0xa0, 0xe1 }; - static char const thumb_noop[2] = { 0xc0, 0x46 }; - static char const arm_bigend_noop[4] = { 0xe1, 0xa0, 0x00, 0x00 }; - static char const thumb_bigend_noop[2] = { 0x46, 0xc0 }; + struct arm_option_value_table * opt; - int bytes, fix, noop_size; - char * p; - const char * noop; + for (opt = arm_float_abis; opt->name != NULL; opt++) + if (streq (opt->name, str)) + { + mfloat_abi_opt = opt->value; + return 1; + } - if (fragP->fr_type != rs_align_code) - return; + as_bad (_("unknown floating point abi `%s'\n"), str); + return 0; +} - bytes = fragP->fr_next->fr_address - fragP->fr_address - fragP->fr_fix; - p = fragP->fr_literal + fragP->fr_fix; - fix = 0; +#ifdef OBJ_ELF +static int +arm_parse_eabi (char * str) +{ + struct arm_option_value_table *opt; - if (bytes > MAX_MEM_FOR_RS_ALIGN_CODE) - bytes &= MAX_MEM_FOR_RS_ALIGN_CODE; + for (opt = arm_eabis; opt->name != NULL; opt++) + if (streq (opt->name, str)) + { + meabi_flags = opt->value; + return 1; + } + as_bad (_("unknown EABI `%s'\n"), str); + return 0; +} +#endif - if (fragP->tc_frag_data) - { - if (target_big_endian) - noop = thumb_bigend_noop; - else - noop = thumb_noop; - noop_size = sizeof (thumb_noop); - } - else - { - if (target_big_endian) - noop = arm_bigend_noop; - else - noop = arm_noop; - noop_size = sizeof (arm_noop); - } +struct arm_long_option_table arm_long_opts[] = +{ + {"mcpu=", N_("\t assemble for CPU "), + arm_parse_cpu, NULL}, + {"march=", N_("\t assemble for architecture "), + arm_parse_arch, NULL}, + {"mfpu=", N_("\t assemble for FPU architecture "), + arm_parse_fpu, NULL}, + {"mfloat-abi=", N_("\t assemble for floating point ABI "), + arm_parse_float_abi, NULL}, +#ifdef OBJ_ELF + {"meabi=", N_("\t assemble for eabi version "), + arm_parse_eabi, NULL}, +#endif + {NULL, NULL, 0, NULL} +}; - if (bytes & (noop_size - 1)) - { - fix = bytes & (noop_size - 1); - memset (p, 0, fix); - p += fix; - bytes -= fix; - } +int +md_parse_option (int c, char * arg) +{ + struct arm_option_table *opt; + struct arm_long_option_table *lopt; - while (bytes >= noop_size) + switch (c) { - memcpy (p, noop, noop_size); - p += noop_size; - bytes -= noop_size; - fix += noop_size; - } +#ifdef OPTION_EB + case OPTION_EB: + target_big_endian = 1; + break; +#endif - fragP->fr_fix += fix; - fragP->fr_var = noop_size; -} +#ifdef OPTION_EL + case OPTION_EL: + target_big_endian = 0; + break; +#endif -/* Called from md_do_align. Used to create an alignment - frag in a code section. */ + case 'a': + /* Listing option. Just ignore these, we don't support additional + ones. */ + return 0; -void -arm_frag_align_code (int n, int max) -{ - char * p; + default: + for (opt = arm_opts; opt->option != NULL; opt++) + { + if (c == opt->option[0] + && ((arg == NULL && opt->option[1] == 0) + || streq (arg, opt->option + 1))) + { +#if WARN_DEPRECATED + /* If the option is deprecated, tell the user. */ + if (opt->deprecated != NULL) + as_tsktsk (_("option `-%c%s' is deprecated: %s"), c, + arg ? arg : "", _(opt->deprecated)); +#endif - /* We assume that there will never be a requirement - to support alignments greater than 32 bytes. */ - if (max > MAX_MEM_FOR_RS_ALIGN_CODE) - as_fatal (_("alignments greater than 32 bytes not supported in .text sections.")); + if (opt->var != NULL) + *opt->var = opt->value; - p = frag_var (rs_align_code, - MAX_MEM_FOR_RS_ALIGN_CODE, - 1, - (relax_substateT) max, - (symbolS *) NULL, - (offsetT) n, - (char *) NULL); - *p = 0; -} + return 1; + } + } -/* Perform target specific initialisation of a frag. */ + for (lopt = arm_long_opts; lopt->option != NULL; lopt++) + { + /* These options are expected to have an argument. */ + if (c == lopt->option[0] + && arg != NULL + && strncmp (arg, lopt->option + 1, + strlen (lopt->option + 1)) == 0) + { +#if WARN_DEPRECATED + /* If the option is deprecated, tell the user. */ + if (lopt->deprecated != NULL) + as_tsktsk (_("option `-%c%s' is deprecated: %s"), c, arg, + _(lopt->deprecated)); +#endif -void -arm_init_frag (fragS * fragP) -{ - /* Record whether this frag is in an ARM or a THUMB area. */ - fragP->tc_frag_data = thumb_mode; -} + /* Call the sup-option parser. */ + return lopt->func (arg + strlen (lopt->option) - 1); + } + } -#ifdef OBJ_ELF + return 0; + } -/* Convert REGNAME to a DWARF-2 register number. */ + return 1; +} -int -tc_arm_regname_to_dw2regnum (const char *regname) +void +md_show_usage (FILE * fp) { - unsigned int i; + struct arm_option_table *opt; + struct arm_long_option_table *lopt; - for (i = 0; rn_table[i].name; i++) - if (streq (regname, rn_table[i].name)) - return rn_table[i].number; + fprintf (fp, _(" ARM-specific assembler options:\n")); - return -1; -} + for (opt = arm_opts; opt->option != NULL; opt++) + if (opt->help != NULL) + fprintf (fp, " -%-23s%s\n", opt->option, _(opt->help)); -/* Initialize the DWARF-2 unwind information for this procedure. */ + for (lopt = arm_long_opts; lopt->option != NULL; lopt++) + if (lopt->help != NULL) + fprintf (fp, " -%s%s\n", lopt->option, _(lopt->help)); -void -tc_arm_frame_initial_instructions (void) -{ - cfi_add_CFA_def_cfa (REG_SP, 0); -} +#ifdef OPTION_EB + fprintf (fp, _("\ + -EB assemble code for a big-endian cpu\n")); #endif -/* 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. */ - -const pseudo_typeS md_pseudo_table[] = -{ - /* Never called because '.req' does not start a line. */ - { "req", s_req, 0 }, - { "unreq", s_unreq, 0 }, - { "bss", s_bss, 0 }, - { "align", s_align, 0 }, - { "arm", s_arm, 0 }, - { "thumb", s_thumb, 0 }, - { "code", s_code, 0 }, - { "force_thumb", s_force_thumb, 0 }, - { "thumb_func", s_thumb_func, 0 }, - { "thumb_set", s_thumb_set, 0 }, - { "even", s_even, 0 }, - { "ltorg", s_ltorg, 0 }, - { "pool", s_ltorg, 0 }, -#ifdef OBJ_ELF - { "word", s_arm_elf_cons, 4 }, - { "long", s_arm_elf_cons, 4 }, - { "rel31", s_arm_rel31, 0 }, - { "fnstart", s_arm_unwind_fnstart, 0 }, - { "fnend", s_arm_unwind_fnend, 0 }, - { "cantunwind", s_arm_unwind_cantunwind, 0 }, - { "personality", s_arm_unwind_personality, 0 }, - { "personalityindex", s_arm_unwind_personalityindex, 0 }, - { "handlerdata", s_arm_unwind_handlerdata, 0 }, - { "save", s_arm_unwind_save, 0 }, - { "movsp", s_arm_unwind_movsp, 0 }, - { "pad", s_arm_unwind_pad, 0 }, - { "setfp", s_arm_unwind_setfp, 0 }, - { "unwind_raw", s_arm_unwind_raw, 0 }, -#else - { "word", cons, 4}, +#ifdef OPTION_EL + fprintf (fp, _("\ + -EL assemble code for a little-endian cpu\n")); #endif - { "extend", float_cons, 'x' }, - { "ldouble", float_cons, 'x' }, - { "packed", float_cons, 'p' }, - { 0, 0, 0 } -}; +} diff -uprN binutils-2.16.90.0.3/gas/config/tc-arm.h binutils-2.16.91.0.1/gas/config/tc-arm.h --- binutils-2.16.90.0.3/gas/config/tc-arm.h 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-arm.h 2005-06-22 13:53:34.828330035 -0700 @@ -96,8 +96,8 @@ struct fix; deliberately not been updated to mark assembler created stabs symbols as Thumb. */ -#define TC_FIX_TYPE PTR -#define TC_INIT_FIX_DATA(FIX) ((FIX)->tc_fix_data = NULL) +#define TC_FIX_TYPE int +#define TC_INIT_FIX_DATA(FIX) ((FIX)->tc_fix_data = 0) /* We need to keep some local information on symbols. */ @@ -127,8 +127,8 @@ struct fix; #define OPTIONAL_REGISTER_PREFIX '%' -#define LOCAL_LABEL(name) (name[0] == '.' && (name[1] == 'L')) -#define LOCAL_LABELS_FB 1 +#define LOCAL_LABEL(name) (name[0] == '.' && name[1] == 'L') +#define LOCAL_LABELS_FB 1 /* This expression evaluates to true if the relocation is for a local object for which we still want to do the relocation at runtime. @@ -140,7 +140,6 @@ struct fix; #define TC_FORCE_RELOCATION_LOCAL(FIX) \ (!(FIX)->fx_pcrel \ || (FIX)->fx_plt \ - || (FIX)->fx_r_type == BFD_RELOC_ARM_GOT12 \ || (FIX)->fx_r_type == BFD_RELOC_ARM_GOT32 \ || (FIX)->fx_r_type == BFD_RELOC_32 \ || TC_FORCE_RELOCATION (FIX)) @@ -169,7 +168,6 @@ struct fix; # define md_elf_section_change_hook() arm_elf_change_section () # define md_elf_section_type(str, len) arm_elf_section_type (str, len) # define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_" -# define LOCAL_LABEL_PREFIX '.' # define TC_SEGMENT_INFO_TYPE struct arm_segment_info_type enum mstate @@ -207,7 +205,7 @@ struct arm_segment_info_type # define EXTERN_FORCE_RELOC 1 # define tc_fix_adjustable(FIX) arm_fix_adjustable (FIX) -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ # define MD_APPLY_SYM_VALUE(FIX) 0 # define TC_VALIDATE_FIX(FIX, SEGTYPE, LABEL) arm_validate_fix (FIX) diff -uprN binutils-2.16.90.0.3/gas/config/tc-avr.c binutils-2.16.91.0.1/gas/config/tc-avr.c --- binutils-2.16.90.0.3/gas/config/tc-avr.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-avr.c 2005-06-22 13:53:34.829329870 -0700 @@ -863,7 +863,7 @@ md_pcrel_from_section (fixp, sec) value in the object file. */ void -md_apply_fix3 (fixP, valP, seg) +md_apply_fix (fixP, valP, seg) fixS *fixP; valueT * valP; segT seg; diff -uprN binutils-2.16.90.0.3/gas/config/tc-avr.h binutils-2.16.91.0.1/gas/config/tc-avr.h --- binutils-2.16.90.0.3/gas/config/tc-avr.h 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-avr.h 2005-06-22 13:53:34.831329539 -0700 @@ -96,7 +96,7 @@ void avr_cons_fix_new(fragS *frag,int wh visible symbols can be overridden. */ #define EXTERN_FORCE_RELOC 0 -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 /* If you define this macro, it should return the offset between the diff -uprN binutils-2.16.90.0.3/gas/config/tc-cris.c binutils-2.16.91.0.1/gas/config/tc-cris.c --- binutils-2.16.90.0.3/gas/config/tc-cris.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-cris.c 2005-06-22 13:53:34.841327887 -0700 @@ -3904,7 +3904,7 @@ md_show_usage (FILE *stream) enough info to complete immediately) to the data in a frag. */ void -md_apply_fix3 (fixS *fixP, valueT *valP, segT seg) +md_apply_fix (fixS *fixP, valueT *valP, segT seg) { /* This assignment truncates upper bits if valueT is 64 bits (as with --enable-64-bit-bfd), which is fine here, though we cast to avoid diff -uprN binutils-2.16.90.0.3/gas/config/tc-crx.c binutils-2.16.91.0.1/gas/config/tc-crx.c --- binutils-2.16.90.0.3/gas/config/tc-crx.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-crx.c 2005-06-22 13:53:34.843327557 -0700 @@ -523,7 +523,7 @@ md_atof (int type, char *litP, int *size fixuping relocations of debug sections. */ void -md_apply_fix3 (fixS *fixP, valueT *valP, segT seg) +md_apply_fix (fixS *fixP, valueT *valP, segT seg) { valueT val = * valP; char *buf = fixP->fx_frag->fr_literal + fixP->fx_where; diff -uprN binutils-2.16.90.0.3/gas/config/tc-d10v.c binutils-2.16.91.0.1/gas/config/tc-d10v.c --- binutils-2.16.90.0.3/gas/config/tc-d10v.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-d10v.c 2005-06-22 13:53:34.845327226 -0700 @@ -1523,7 +1523,7 @@ md_pcrel_from_section (fixS *fixp, segT } void -md_apply_fix3 (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) { char *where; unsigned long insn; diff -uprN binutils-2.16.90.0.3/gas/config/tc-d10v.h binutils-2.16.91.0.1/gas/config/tc-d10v.h --- binutils-2.16.90.0.3/gas/config/tc-d10v.h 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-d10v.h 2005-06-22 13:53:34.845327226 -0700 @@ -65,7 +65,7 @@ int d10v_cleanup (void); #define tc_fix_adjustable(FIX) d10v_fix_adjustable(FIX) bfd_boolean d10v_fix_adjustable (struct fix *); -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 /* No shared lib support, so we don't need to ensure externally diff -uprN binutils-2.16.90.0.3/gas/config/tc-d30v.c binutils-2.16.91.0.1/gas/config/tc-d30v.c --- binutils-2.16.90.0.3/gas/config/tc-d30v.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-d30v.c 2005-06-22 13:53:34.847326896 -0700 @@ -1924,7 +1924,7 @@ d30v_cons_align (int size) } void -md_apply_fix3 (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) { char *where; unsigned long insn, insn2; diff -uprN binutils-2.16.90.0.3/gas/config/tc-d30v.h binutils-2.16.91.0.1/gas/config/tc-d30v.h --- binutils-2.16.90.0.3/gas/config/tc-d30v.h 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-d30v.h 2005-06-22 13:53:34.847326896 -0700 @@ -62,7 +62,7 @@ void d30v_frob_label (symbolS *); void d30v_cons_align (int); #define md_cons_align(nbytes) d30v_cons_align (nbytes) -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 /* No shared lib support, so we don't need to ensure externally diff -uprN binutils-2.16.90.0.3/gas/config/tc-dlx.c binutils-2.16.91.0.1/gas/config/tc-dlx.c --- binutils-2.16.90.0.3/gas/config/tc-dlx.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-dlx.c 2005-06-22 13:53:34.848326731 -0700 @@ -1056,7 +1056,7 @@ md_dlx_fix_adjustable (fixS *fixP) } void -md_apply_fix3 (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) { long val = *valP; char *place = fixP->fx_where + fixP->fx_frag->fr_literal; diff -uprN binutils-2.16.90.0.3/gas/config/tc-dlx.h binutils-2.16.91.0.1/gas/config/tc-dlx.h --- binutils-2.16.90.0.3/gas/config/tc-dlx.h 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-dlx.h 2005-06-22 13:53:34.851326235 -0700 @@ -74,7 +74,7 @@ extern bfd_boolean md_dlx_fix_adjustable #define tc_fix_adjustable(FIX) md_dlx_fix_adjustable (FIX) -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 #define NEED_FX_R_TYPE diff -uprN binutils-2.16.90.0.3/gas/config/tc-fr30.h binutils-2.16.91.0.1/gas/config/tc-fr30.h --- binutils-2.16.90.0.3/gas/config/tc-fr30.h 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-fr30.h 2005-06-22 13:53:34.852326070 -0700 @@ -43,10 +43,10 @@ /* We don't need to handle .word strangely. */ #define WORKING_DOT_WORD -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 -#define md_apply_fix3 gas_cgen_md_apply_fix3 +#define md_apply_fix gas_cgen_md_apply_fix #define tc_fix_adjustable(FIX) fr30_fix_adjustable (FIX) struct fix; diff -uprN binutils-2.16.90.0.3/gas/config/tc-frv.c binutils-2.16.91.0.1/gas/config/tc-frv.c --- binutils-2.16.90.0.3/gas/config/tc-frv.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-frv.c 2005-06-22 13:53:34.862324418 -0700 @@ -1468,7 +1468,7 @@ frv_force_relocation (fix) /* Apply a fixup that could be resolved within the assembler. */ void -md_apply_fix3 (fixP, valP, seg) +md_apply_fix (fixP, valP, seg) fixS * fixP; valueT * valP; segT seg; @@ -1542,7 +1542,7 @@ md_apply_fix3 (fixP, valP, seg) break; } - gas_cgen_md_apply_fix3 (fixP, valP, seg); + gas_cgen_md_apply_fix (fixP, valP, seg); return; } diff -uprN binutils-2.16.90.0.3/gas/config/tc-frv.h binutils-2.16.91.0.1/gas/config/tc-frv.h --- binutils-2.16.90.0.3/gas/config/tc-frv.h 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-frv.h 2005-06-22 13:53:34.862324418 -0700 @@ -44,7 +44,7 @@ extern bfd_boolean frv_md_fdpic_enabled /* We don't need to handle .word strangely. */ #define WORKING_DOT_WORD -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 extern void frv_tomcat_workaround PARAMS ((void)); diff -uprN binutils-2.16.90.0.3/gas/config/tc-h8300.c binutils-2.16.91.0.1/gas/config/tc-h8300.c --- binutils-2.16.90.0.3/gas/config/tc-h8300.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-h8300.c 2005-06-22 13:53:34.864324088 -0700 @@ -2163,7 +2163,7 @@ md_section_align (segT seg, valueT size) void -md_apply_fix3 (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) { char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; long val = *valP; diff -uprN binutils-2.16.90.0.3/gas/config/tc-h8500.c binutils-2.16.91.0.1/gas/config/tc-h8500.c --- binutils-2.16.90.0.3/gas/config/tc-h8500.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-h8500.c 2005-06-22 13:53:34.867323592 -0700 @@ -1284,7 +1284,7 @@ md_section_align (segT seg, valueT size) } void -md_apply_fix3 (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) { long val = * (long *) valP; char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; diff -uprN binutils-2.16.90.0.3/gas/config/tc-hppa.c binutils-2.16.91.0.1/gas/config/tc-hppa.c --- binutils-2.16.90.0.3/gas/config/tc-hppa.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-hppa.c 2005-06-22 13:53:34.874322436 -0700 @@ -1,6 +1,6 @@ /* tc-hppa.c -- Assemble for the PA Copyright 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -1175,7 +1175,7 @@ static struct default_space_dict pa_def_ } \ } -/* Variant of CHECK_FIELD for use in md_apply_fix3 and other places where +/* Variant of CHECK_FIELD for use in md_apply_fix and other places where the current file and line number are not valid. */ #define CHECK_FIELD_WHERE(FIELD, HIGH, LOW, FILENAME, LINE) \ @@ -1641,21 +1641,9 @@ pa_ip (str) the_insn.reloc = R_HPPA_NONE; - /* If this instruction is specific to a particular architecture, - then set a new architecture. */ - /* But do not automatically promote to pa2.0. The automatic promotion - crud is for compatibility with HP's old assemblers only. */ - if (insn->arch < 20 + if (insn->arch >= 20 && bfd_get_mach (stdoutput) < insn->arch) - { - if (!bfd_set_arch_mach (stdoutput, bfd_arch_hppa, insn->arch)) - as_warn (_("could not update architecture and machine")); - } - else if (bfd_get_mach (stdoutput) < insn->arch) - { - match = FALSE; - goto failed; - } + goto failed; /* Build the opcode, checking as we go to make sure that the operands match. */ @@ -3962,6 +3950,16 @@ pa_ip (str) break; } + /* If this instruction is specific to a particular architecture, + then set a new architecture. This automatic promotion crud is + for compatibility with HP's old assemblers only. */ + if (match == TRUE + && bfd_get_mach (stdoutput) < insn->arch) + { + if (!bfd_set_arch_mach (stdoutput, bfd_arch_hppa, insn->arch)) + as_warn (_("could not update architecture and machine")); + } + failed: /* Check if the args matched. */ if (!match) @@ -4424,7 +4422,7 @@ md_undefined_symbol (name) /* Apply a fixup to an instruction. */ void -md_apply_fix3 (fixP, valP, seg) +md_apply_fix (fixP, valP, seg) fixS *fixP; valueT *valP; segT seg ATTRIBUTE_UNUSED; @@ -5939,10 +5937,7 @@ static void pa_block (z) int z ATTRIBUTE_UNUSED; { - char *p; - long int temp_fill; unsigned int temp_size; - unsigned int i; #ifdef OBJ_SOM /* We must have a valid space and subspace. */ @@ -5951,20 +5946,16 @@ pa_block (z) temp_size = get_absolute_expression (); - /* Always fill with zeros, that's what the HP assembler does. */ - temp_fill = 0; - - p = frag_var (rs_fill, (int) temp_size, (int) temp_size, - (relax_substateT) 0, (symbolS *) 0, (offsetT) 1, NULL); - memset (p, 0, temp_size); - - /* Convert 2 bytes at a time. */ - - for (i = 0; i < temp_size; i += 2) + if (temp_size > 0x3FFFFFFF) { - md_number_to_chars (p + i, - (valueT) temp_fill, - (int) ((temp_size - i) > 2 ? 2 : (temp_size - i))); + as_bad (_("Argument to .BLOCK/.BLOCKZ must be between 0 and 0x3fffffff")); + temp_size = 0; + } + else + { + /* Always fill with zeros, that's what the HP assembler does. */ + char *p = frag_var (rs_fill, 1, 1, 0, NULL, temp_size, NULL); + *p = 0; } pa_undefine_label (); diff -uprN binutils-2.16.90.0.3/gas/config/tc-hppa.h binutils-2.16.91.0.1/gas/config/tc-hppa.h --- binutils-2.16.90.0.3/gas/config/tc-hppa.h 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-hppa.h 2005-06-22 13:53:34.875322271 -0700 @@ -134,7 +134,7 @@ int hppa_fix_adjustable PARAMS((struct f normally appear safe to handle it completely within GAS. */ #define TC_FORCE_RELOCATION(FIX) hppa_force_relocation (FIX) -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 #ifdef OBJ_SOM diff -uprN binutils-2.16.90.0.3/gas/config/tc-i370.c binutils-2.16.91.0.1/gas/config/tc-i370.c --- binutils-2.16.90.0.3/gas/config/tc-i370.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-i370.c 2005-06-22 13:53:34.877321940 -0700 @@ -2232,7 +2232,7 @@ md_assemble (char *str) BFD_RELOC_UNUSED plus the operand index. This lets us easily handle fixups for any operand type, although that is admittedly not a very exciting feature. We pick a BFD reloc type in - md_apply_fix3. */ + md_apply_fix. */ for (i = 0; i < fc; i++) { const struct i370_operand *operand; @@ -2476,14 +2476,14 @@ md_pcrel_from_section (fixS *fixp, segT going on here. */ void -md_apply_fix3 (fixS *fixP, valueT * valP, segT seg) +md_apply_fix (fixS *fixP, valueT * valP, segT seg) { valueT value = * valP; if (fixP->fx_addsy != NULL) { #ifdef DEBUG - printf ("\nmd_apply_fix3: symbol %s at 0x%x (%s:%d) val=0x%x addend=0x%x\n", + printf ("\nmd_apply_fix: symbol %s at 0x%x (%s:%d) val=0x%x addend=0x%x\n", S_GET_NAME (fixP->fx_addsy), fixP->fx_frag->fr_address + fixP->fx_where, fixP->fx_file, fixP->fx_line, @@ -2508,7 +2508,7 @@ md_apply_fix3 (fixS *fixP, valueT * valP operand = &i370_operands[opindex]; #ifdef DEBUG - printf ("\nmd_apply_fix3: fixup operand %s at 0x%x in %s:%d addend=0x%x\n", + printf ("\nmd_apply_fix: fixup operand %s at 0x%x in %s:%d addend=0x%x\n", operand->name, fixP->fx_frag->fr_address + fixP->fx_where, fixP->fx_file, fixP->fx_line, @@ -2568,7 +2568,7 @@ md_apply_fix3 (fixS *fixP, valueT * valP i370_elf_validate_fix (fixP, seg); #endif #ifdef DEBUG - printf ("md_apply_fix3: reloc case %d in segment %s %s:%d\n", + printf ("md_apply_fix: reloc case %d in segment %s %s:%d\n", fixP->fx_r_type, segment_name (seg), fixP->fx_file, fixP->fx_line); printf ("\tcurrent fixup value is 0x%x \n", value); #endif diff -uprN binutils-2.16.90.0.3/gas/config/tc-i370.h binutils-2.16.91.0.1/gas/config/tc-i370.h --- binutils-2.16.90.0.3/gas/config/tc-i370.h 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-i370.h 2005-06-22 13:53:34.878321775 -0700 @@ -54,7 +54,7 @@ extern int target_big_endian; /* foo-. gets turned into PC relative relocs. */ #define DIFF_EXPR_OK -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 /* We don't need to handle .word strangely. */ diff -uprN binutils-2.16.90.0.3/gas/config/tc-i386.c binutils-2.16.91.0.1/gas/config/tc-i386.c --- binutils-2.16.90.0.3/gas/config/tc-i386.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-i386.c 2005-06-22 13:53:34.882321114 -0700 @@ -1222,6 +1222,7 @@ reloc (size, pcrel, sign, other) case 1: return BFD_RELOC_8_PCREL; case 2: return BFD_RELOC_16_PCREL; case 4: return BFD_RELOC_32_PCREL; + case 8: return BFD_RELOC_64_PCREL; } as_bad (_("can not do %d byte pc-relative relocation"), size); } @@ -1292,8 +1293,11 @@ tc_i386_fix_adjustable (fixP) || fixP->fx_r_type == BFD_RELOC_X86_64_TLSGD || fixP->fx_r_type == BFD_RELOC_X86_64_TLSLD || fixP->fx_r_type == BFD_RELOC_X86_64_DTPOFF32 + || fixP->fx_r_type == BFD_RELOC_X86_64_DTPOFF64 || fixP->fx_r_type == BFD_RELOC_X86_64_GOTTPOFF || fixP->fx_r_type == BFD_RELOC_X86_64_TPOFF32 + || fixP->fx_r_type == BFD_RELOC_X86_64_TPOFF64 + || fixP->fx_r_type == BFD_RELOC_X86_64_GOTOFF64 || fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) return 0; @@ -1405,7 +1409,11 @@ md_assemble (line) if (i.imm_operands) optimize_imm (); - if (i.disp_operands) + /* Don't optimize displacement for movabs since it only takes 64bit + displacement. */ + if (i.disp_operands + && (flag_code != CODE_64BIT + || strcmp (mnemonic, "movabs") != 0)) optimize_disp (); /* Next, we find a template that matches the given insn, @@ -2061,43 +2069,51 @@ optimize_disp () int op; for (op = i.operands; --op >= 0;) - if ((i.types[op] & Disp) && i.op[op].disps->X_op == O_constant) + if (i.types[op] & Disp) { - offsetT disp = i.op[op].disps->X_add_number; - - if (i.types[op] & Disp16) + if (i.op[op].disps->X_op == O_constant) { - /* We know this operand is at most 16 bits, so - convert to a signed 16 bit number before trying - to see whether it will fit in an even smaller - size. */ + offsetT disp = i.op[op].disps->X_add_number; - disp = (((disp & 0xffff) ^ 0x8000) - 0x8000); - } - else if (i.types[op] & Disp32) - { - /* We know this operand is at most 32 bits, so convert to a - signed 32 bit number before trying to see whether it will - fit in an even smaller size. */ - disp &= (((offsetT) 2 << 31) - 1); - disp = (disp ^ ((offsetT) 1 << 31)) - ((addressT) 1 << 31); - } - if (!disp && (i.types[op] & BaseIndex)) - { - i.types[op] &= ~Disp; - i.op[op].disps = 0; - i.disp_operands--; - } - else if (flag_code == CODE_64BIT) - { - if (fits_in_signed_long (disp)) - i.types[op] |= Disp32S; - if (fits_in_unsigned_long (disp)) - i.types[op] |= Disp32; + if ((i.types[op] & Disp16) + && (disp & ~(offsetT) 0xffff) == 0) + { + /* If this operand is at most 16 bits, convert + to a signed 16 bit number and don't use 64bit + displacement. */ + disp = (((disp & 0xffff) ^ 0x8000) - 0x8000); + i.types[op] &= ~Disp64; + } + if ((i.types[op] & Disp32) + && (disp & ~(((offsetT) 2 << 31) - 1)) == 0) + { + /* If this operand is at most 32 bits, convert + to a signed 32 bit number and don't use 64bit + displacement. */ + disp &= (((offsetT) 2 << 31) - 1); + disp = (disp ^ ((offsetT) 1 << 31)) - ((addressT) 1 << 31); + i.types[op] &= ~Disp64; + } + if (!disp && (i.types[op] & BaseIndex)) + { + i.types[op] &= ~Disp; + i.op[op].disps = 0; + i.disp_operands--; + } + else if (flag_code == CODE_64BIT) + { + if (fits_in_signed_long (disp)) + i.types[op] |= Disp32S; + if (fits_in_unsigned_long (disp)) + i.types[op] |= Disp32; + } + if ((i.types[op] & (Disp32 | Disp32S | Disp16)) + && fits_in_signed_byte (disp)) + i.types[op] |= Disp8; } - if ((i.types[op] & (Disp32 | Disp32S | Disp16)) - && fits_in_signed_byte (disp)) - i.types[op] |= Disp8; + else + /* We only support 64bit displacement on constants. */ + i.types[op] &= ~Disp64; } } @@ -3502,14 +3518,16 @@ output_disp (insn_start_frag, insn_start p = frag_more (size); reloc_type = reloc (size, pcrel, sign, i.reloc[n]); - if (reloc_type == BFD_RELOC_32 - && GOT_symbol + if (GOT_symbol && GOT_symbol == i.op[n].disps->X_add_symbol - && (i.op[n].disps->X_op == O_symbol - || (i.op[n].disps->X_op == O_add - && ((symbol_get_value_expression - (i.op[n].disps->X_op_symbol)->X_op) - == O_subtract)))) + && (((reloc_type == BFD_RELOC_32 + || reloc_type == BFD_RELOC_X86_64_32S) + && (i.op[n].disps->X_op == O_symbol + || (i.op[n].disps->X_op == O_add + && ((symbol_get_value_expression + (i.op[n].disps->X_op_symbol)->X_op) + == O_subtract)))) + || reloc_type == BFD_RELOC_32_PCREL)) { offsetT add; @@ -3526,10 +3544,10 @@ output_disp (insn_start_frag, insn_start add += p - frag_now->fr_literal; } - /* We don't support dynamic linking on x86-64 yet. */ - if (flag_code == CODE_64BIT) - abort (); - reloc_type = BFD_RELOC_386_GOTPC; + if (flag_code != CODE_64BIT) + reloc_type = BFD_RELOC_386_GOTPC; + else + reloc_type = BFD_RELOC_X86_64_GOTPC32; i.op[n].disps->X_add_number += add; } fix_new_exp (frag_now, p - frag_now->fr_literal, size, @@ -3638,7 +3656,8 @@ output_imm (insn_start_frag, insn_start_ * since the expression is not pcrel, I felt it would be * confusing to do it this way. */ - if (reloc_type == BFD_RELOC_32 + if ((reloc_type == BFD_RELOC_32 + || reloc_type == BFD_RELOC_X86_64_32S) && GOT_symbol && GOT_symbol == i.op[n].imms->X_add_symbol && (i.op[n].imms->X_op == O_symbol @@ -3662,10 +3681,10 @@ output_imm (insn_start_frag, insn_start_ add += p - frag_now->fr_literal; } - /* We don't support dynamic linking on x86-64 yet. */ - if (flag_code == CODE_64BIT) - abort (); - reloc_type = BFD_RELOC_386_GOTPC; + if (flag_code != CODE_64BIT) + reloc_type = BFD_RELOC_386_GOTPC; + else + reloc_type = BFD_RELOC_X86_64_GOTPC32; i.op[n].imms->X_add_number += add; } fix_new_exp (frag_now, p - frag_now->fr_literal, size, @@ -3698,7 +3717,7 @@ lex_got (reloc, adjust) const enum bfd_reloc_code_real rel[NUM_FLAG_CODE]; } gotrel[] = { { "PLT", { BFD_RELOC_386_PLT32, 0, BFD_RELOC_X86_64_PLT32 } }, - { "GOTOFF", { BFD_RELOC_386_GOTOFF, 0, 0 } }, + { "GOTOFF", { BFD_RELOC_386_GOTOFF, 0, BFD_RELOC_X86_64_GOTOFF64 } }, { "GOTPCREL", { 0, 0, BFD_RELOC_X86_64_GOTPCREL } }, { "TLSGD", { BFD_RELOC_386_TLS_GD, 0, BFD_RELOC_X86_64_TLSGD } }, { "TLSLDM", { BFD_RELOC_386_TLS_LDM, 0, 0 } }, @@ -3792,7 +3811,7 @@ x86_cons (exp, size) expressionS *exp; int size; { - if (size == 4) + if (size == 4 || (flag_code == CODE_64BIT && size == 8)) { /* Handle @GOTOFF and the like in an expression. */ char *save; @@ -4104,7 +4123,8 @@ i386_displacement (disp_start, disp_end) the symbol table. We will ultimately change the relocation to be relative to the beginning of the section. */ if (i.reloc[this_operand] == BFD_RELOC_386_GOTOFF - || i.reloc[this_operand] == BFD_RELOC_X86_64_GOTPCREL) + || i.reloc[this_operand] == BFD_RELOC_X86_64_GOTPCREL + || i.reloc[this_operand] == BFD_RELOC_X86_64_GOTOFF64) { if (exp->X_op != O_symbol) { @@ -4122,6 +4142,8 @@ i386_displacement (disp_start, disp_end) exp->X_op_symbol = GOT_symbol; if (i.reloc[this_operand] == BFD_RELOC_X86_64_GOTPCREL) i.reloc[this_operand] = BFD_RELOC_32_PCREL; + else if (i.reloc[this_operand] == BFD_RELOC_X86_64_GOTOFF64) + i.reloc[this_operand] = BFD_RELOC_64; else i.reloc[this_operand] = BFD_RELOC_32; } @@ -4793,7 +4815,7 @@ md_create_long_jump (ptr, from_addr, to_ we are handling. */ void -md_apply_fix3 (fixP, valP, seg) +md_apply_fix (fixP, valP, seg) /* The fix we're to put in. */ fixS *fixP; /* Pointer to the value of the bits. */ @@ -4812,6 +4834,9 @@ md_apply_fix3 (fixP, valP, seg) default: break; + case BFD_RELOC_64: + fixP->fx_r_type = BFD_RELOC_64_PCREL; + break; case BFD_RELOC_32: case BFD_RELOC_X86_64_32S: fixP->fx_r_type = BFD_RELOC_32_PCREL; @@ -4827,6 +4852,7 @@ md_apply_fix3 (fixP, valP, seg) if (fixP->fx_addsy != NULL && (fixP->fx_r_type == BFD_RELOC_32_PCREL + || fixP->fx_r_type == BFD_RELOC_64_PCREL || fixP->fx_r_type == BFD_RELOC_16_PCREL || fixP->fx_r_type == BFD_RELOC_8_PCREL) && !use_rela_relocations) @@ -4901,7 +4927,9 @@ md_apply_fix3 (fixP, valP, seg) case BFD_RELOC_386_TLS_LDO_32: case BFD_RELOC_386_TLS_LE_32: case BFD_RELOC_X86_64_DTPOFF32: + case BFD_RELOC_X86_64_DTPOFF64: case BFD_RELOC_X86_64_TPOFF32: + case BFD_RELOC_X86_64_TPOFF64: S_SET_THREAD_LOCAL (fixP->fx_addsy); break; @@ -5339,7 +5367,6 @@ i386_validate_fix (fixp) { if (fixp->fx_subsy && fixp->fx_subsy == GOT_symbol) { - /* GOTOFF relocation are nonsense in 64bit mode. */ if (fixp->fx_r_type == BFD_RELOC_32_PCREL) { if (flag_code != CODE_64BIT) @@ -5348,9 +5375,10 @@ i386_validate_fix (fixp) } else { - if (flag_code == CODE_64BIT) - abort (); - fixp->fx_r_type = BFD_RELOC_386_GOTOFF; + if (flag_code != CODE_64BIT) + fixp->fx_r_type = BFD_RELOC_386_GOTOFF; + else + fixp->fx_r_type = BFD_RELOC_X86_64_GOTOFF64; } fixp->fx_subsy = 0; } @@ -5384,8 +5412,12 @@ tc_gen_reloc (section, fixp) case BFD_RELOC_X86_64_TLSGD: case BFD_RELOC_X86_64_TLSLD: case BFD_RELOC_X86_64_DTPOFF32: + case BFD_RELOC_X86_64_DTPOFF64: case BFD_RELOC_X86_64_GOTTPOFF: case BFD_RELOC_X86_64_TPOFF32: + case BFD_RELOC_X86_64_TPOFF64: + case BFD_RELOC_X86_64_GOTOFF64: + case BFD_RELOC_X86_64_GOTPC32: case BFD_RELOC_RVA: case BFD_RELOC_VTABLE_ENTRY: case BFD_RELOC_VTABLE_INHERIT: @@ -5415,6 +5447,9 @@ tc_gen_reloc (section, fixp) case 1: code = BFD_RELOC_8_PCREL; break; case 2: code = BFD_RELOC_16_PCREL; break; case 4: code = BFD_RELOC_32_PCREL; break; +#ifdef BFD64 + case 8: code = BFD_RELOC_64_PCREL; break; +#endif } } else @@ -5438,14 +5473,14 @@ tc_gen_reloc (section, fixp) break; } - if (code == BFD_RELOC_32 + if ((code == BFD_RELOC_32 || code == BFD_RELOC_32_PCREL) && GOT_symbol && fixp->fx_addsy == GOT_symbol) { - /* We don't support GOTPC on 64bit targets. */ - if (flag_code == CODE_64BIT) - abort (); - code = BFD_RELOC_386_GOTPC; + if (flag_code != CODE_64BIT) + code = BFD_RELOC_386_GOTPC; + else + code = BFD_RELOC_X86_64_GOTPC32; } rel = (arelent *) xmalloc (sizeof (arelent)); diff -uprN binutils-2.16.90.0.3/gas/config/tc-i386.h binutils-2.16.91.0.1/gas/config/tc-i386.h --- binutils-2.16.90.0.3/gas/config/tc-i386.h 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-i386.h 2005-06-22 13:53:34.883320949 -0700 @@ -413,7 +413,7 @@ void i386_validate_fix PARAMS ((struct f #define tc_fix_adjustable(X) tc_i386_fix_adjustable(X) extern int tc_i386_fix_adjustable PARAMS ((struct fix *)); -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 /* ELF wants external syms kept, as does PE COFF. */ diff -uprN binutils-2.16.90.0.3/gas/config/tc-i860.c binutils-2.16.91.0.1/gas/config/tc-i860.c --- binutils-2.16.90.0.3/gas/config/tc-i860.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-i860.c 2005-06-22 13:53:34.884320784 -0700 @@ -1338,7 +1338,7 @@ obtain_reloc_for_imm16 (fixS *fix, long we will have to generate a reloc entry. */ void -md_apply_fix3 (fixS *fix, valueT *valP, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS *fix, valueT *valP, segT seg ATTRIBUTE_UNUSED) { char *buf; long val = *valP; diff -uprN binutils-2.16.90.0.3/gas/config/tc-i860.h binutils-2.16.91.0.1/gas/config/tc-i860.h --- binutils-2.16.90.0.3/gas/config/tc-i860.h 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-i860.h 2005-06-22 13:53:34.885320619 -0700 @@ -79,7 +79,7 @@ extern int target_big_endian; #define md_convert_frag(b,s,f) as_fatal (_("i860_convert_frag\n")); -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 /* No shared lib support, so we don't need to ensure externally diff -uprN binutils-2.16.90.0.3/gas/config/tc-i960.c binutils-2.16.91.0.1/gas/config/tc-i960.c --- binutils-2.16.90.0.3/gas/config/tc-i960.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-i960.c 2005-06-22 13:53:34.887320288 -0700 @@ -2446,7 +2446,7 @@ md_pcrel_from (fixS *fixP) } void -md_apply_fix3 (fixS *fixP, +md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) { diff -uprN binutils-2.16.90.0.3/gas/config/tc-i960.h binutils-2.16.91.0.1/gas/config/tc-i960.h --- binutils-2.16.90.0.3/gas/config/tc-i960.h 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-i960.h 2005-06-22 13:53:34.887320288 -0700 @@ -172,10 +172,10 @@ extern int i960_validate_fix PARAMS ((st #define tc_fix_adjustable(FIX) ((FIX)->fx_bsr == 0) #ifndef OBJ_ELF -/* Values passed to md_apply_fix3 sometimes include symbol values. */ +/* Values passed to md_apply_fix sometimes include symbol values. */ #define MD_APPLY_SYM_VALUE(FIX) tc_fix_adjustable (FIX) #else -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 #endif diff -uprN binutils-2.16.90.0.3/gas/config/tc-ia64.c binutils-2.16.91.0.1/gas/config/tc-ia64.c --- binutils-2.16.90.0.3/gas/config/tc-ia64.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-ia64.c 2005-06-22 13:53:34.914315828 -0700 @@ -695,8 +695,6 @@ typedef struct unw_rec_list { unwind_record r; unsigned long slot_number; fragS *slot_frag; - unsigned long next_slot_number; - fragS *next_slot_frag; struct unw_rec_list *next; } unw_rec_list; @@ -711,6 +709,12 @@ typedef struct label_prologue_count unsigned int prologue_count; } label_prologue_count; +typedef struct proc_pending +{ + symbolS *sym; + struct proc_pending *next; +} proc_pending; + static struct { /* Maintain a list of unwind entries for the current function. */ @@ -722,7 +726,7 @@ static struct unw_rec_list *current_entry; /* These are used to create the unwind table entry for this function. */ - symbolS *proc_start; + proc_pending proc_pending; symbolS *info; /* pointer to unwind info */ symbolS *personality_routine; segT saved_text_seg; @@ -1750,8 +1754,6 @@ alloc_record (unw_record_type t) ptr->next = NULL; ptr->slot_number = SLOT_NUM_NOT_SET; ptr->r.type = t; - ptr->next_slot_number = 0; - ptr->next_slot_frag = 0; return ptr; } @@ -2706,6 +2708,26 @@ slot_index (slot_addr, slot_frag, first_ /* Move to the beginning of the next frag. */ first_frag = first_frag->fr_next; first_addr = (unsigned long) &first_frag->fr_literal; + + /* This can happen if there is section switching in the middle of a + function, causing the frag chain for the function to be broken. */ + if (first_frag == NULL) + { + /* We get six warnings for one problem, because of the loop in + fixup_unw_records, and because fixup_unw_records is called 3 + times: once before creating the variant frag, once to estimate + its size, and once to relax it. This is unreasonable, so we use + a static var to make sure we only emit the warning once. */ + static int warned = 0; + + if (!warned) + { + as_warn ("Corrupted unwind info due to unsupported section switching"); + warned = 1; + } + + return index; + } } /* Add in the used part of the last frag. */ @@ -3074,17 +3096,20 @@ static void dot_radix (dummy) int dummy ATTRIBUTE_UNUSED; { - int radix; + char *radix; + int ch; SKIP_WHITESPACE (); - radix = *input_line_pointer++; - if (radix != 'C' && !is_end_of_line[(unsigned char) radix]) - { - as_bad ("Radix `%c' unsupported", *input_line_pointer); - ignore_rest_of_line (); - return; - } + if (is_it_end_of_statement ()) + return; + radix = input_line_pointer; + ch = get_symbol_end (); + ia64_canonicalize_symbol_name (radix); + if (strcasecmp (radix, "C")) + as_bad ("Radix `%s' unsupported or invalid", radix); + *input_line_pointer = ch; + demand_empty_rest_of_line (); } /* Helper function for .loc directives. If the assembler is not generating @@ -3132,7 +3157,7 @@ unwind_diagnostic (const char * region, static int in_procedure (const char *directive) { - if (unwind.proc_start + if (unwind.proc_pending.sym && (!unwind.saved_text_seg || strcmp (directive, "endp") == 0)) return 1; return unwind_diagnostic ("procedure", directive); @@ -4269,8 +4294,22 @@ dot_proc (dummy) { char *name, *p, c; symbolS *sym; + proc_pending *pending, *last_pending; + + if (unwind.proc_pending.sym) + { + (md.unwind_check == unwind_check_warning + ? as_warn + : as_bad) ("Missing .endp after previous .proc"); + while (unwind.proc_pending.next) + { + pending = unwind.proc_pending.next; + unwind.proc_pending.next = pending->next; + free (pending); + } + } + last_pending = NULL; - unwind.proc_start = 0; /* Parse names of main and alternate entry points and mark them as function symbols: */ while (1) @@ -4286,9 +4325,16 @@ dot_proc (dummy) sym = symbol_find_or_make (name); if (S_IS_DEFINED (sym)) as_bad ("`%s' was already defined", name); - else if (unwind.proc_start == 0) + else if (!last_pending) + { + unwind.proc_pending.sym = sym; + last_pending = &unwind.proc_pending; + } + else { - unwind.proc_start = sym; + pending = xmalloc (sizeof (*pending)); + pending->sym = sym; + last_pending = last_pending->next = pending; } symbol_get_bfdsym (sym)->flags |= BSF_FUNCTION; } @@ -4298,8 +4344,12 @@ dot_proc (dummy) break; ++input_line_pointer; } - if (unwind.proc_start == 0) - unwind.proc_start = expr_build_dot (); + if (!last_pending) + { + unwind.proc_pending.sym = expr_build_dot (); + last_pending = &unwind.proc_pending; + } + last_pending->next = NULL; demand_empty_rest_of_line (); ia64_do_align (16); @@ -4387,13 +4437,11 @@ dot_endp (dummy) int dummy ATTRIBUTE_UNUSED; { expressionS e; - char *ptr; int bytes_per_address; long where; segT saved_seg; subsegT saved_subseg; - char *name, *default_name, *p, c; - symbolS *sym; + proc_pending *pending; int unwind_check = md.unwind_check; md.unwind_check = unwind_check_error; @@ -4434,7 +4482,7 @@ dot_endp (dummy) /* Need space for 3 pointers for procedure start, procedure end, and unwind info. */ - ptr = frag_more (3 * md.pointer_size); + memset (frag_more (3 * md.pointer_size), 0, 3 * md.pointer_size); where = frag_now_fix () - (3 * md.pointer_size); bytes_per_address = bfd_arch_bits_per_address (stdoutput) / 8; @@ -4442,7 +4490,13 @@ dot_endp (dummy) e.X_op = O_pseudo_fixup; e.X_op_symbol = pseudo_func[FUNC_SEG_RELATIVE].u.sym; e.X_add_number = 0; - e.X_add_symbol = unwind.proc_start; + if (!S_IS_LOCAL (unwind.proc_pending.sym) + && S_IS_DEFINED (unwind.proc_pending.sym)) + e.X_add_symbol = symbol_temp_new (S_GET_SEGMENT (unwind.proc_pending.sym), + S_GET_VALUE (unwind.proc_pending.sym), + symbol_get_frag (unwind.proc_pending.sym)); + else + e.X_add_symbol = unwind.proc_pending.sym; ia64_cons_fix_new (frag_now, where, bytes_per_address, &e); e.X_op = O_pseudo_fixup; @@ -4461,69 +4515,25 @@ dot_endp (dummy) ia64_cons_fix_new (frag_now, where + (bytes_per_address * 2), bytes_per_address, &e); } - else - md_number_to_chars (ptr + (bytes_per_address * 2), 0, - bytes_per_address); - } subseg_set (saved_seg, saved_subseg); - if (unwind.proc_start) - default_name = (char *) S_GET_NAME (unwind.proc_start); - else - default_name = NULL; - - /* Parse names of main and alternate entry points and set symbol sizes. */ - while (1) - { - SKIP_WHITESPACE (); - name = input_line_pointer; - c = get_symbol_end (); - p = input_line_pointer; - if (!*name) - { - if (md.unwind_check == unwind_check_warning) + /* Set symbol sizes. */ + pending = &unwind.proc_pending; + if (S_GET_NAME (pending->sym)) + { + do + { + symbolS *sym = pending->sym; + + if (!S_IS_DEFINED (sym)) + as_bad ("`%s' was not defined within procedure", S_GET_NAME (sym)); + else if (S_GET_SIZE (sym) == 0 + && symbol_get_obj (sym)->size == NULL) { - if (default_name) - { - as_warn ("Empty argument of .endp. Use the default name `%s'", - default_name); - name = default_name; - } - else - as_warn ("Empty argument of .endp"); - } - else - as_bad ("Empty argument of .endp"); - } - if (*name) - { - sym = symbol_find (name); - if (!sym - && md.unwind_check == unwind_check_warning - && default_name - && default_name != name) - { - /* We have a bad name. Try the default one if needed. */ - as_warn ("`%s' was not defined within procedure. Use the default name `%s'", - name, default_name); - name = default_name; - sym = symbol_find (name); - } - if (!sym || !S_IS_DEFINED (sym)) - as_bad ("`%s' was not defined within procedure", name); - else if (unwind.proc_start - && (symbol_get_bfdsym (sym)->flags & BSF_FUNCTION) - && S_GET_SIZE (sym) == 0 && symbol_get_obj (sym)->size == NULL) - { - fragS *fr = symbol_get_frag (unwind.proc_start); fragS *frag = symbol_get_frag (sym); - /* Check whether the function label is at or beyond last - .proc directive. */ - while (fr && fr != frag) - fr = fr->fr_next; - if (fr) + if (frag) { if (frag == frag_now && SEG_NORMAL (now_seg)) S_SET_SIZE (sym, frag_now_fix () - S_GET_VALUE (sym)); @@ -4540,6 +4550,36 @@ dot_endp (dummy) } } } + } while ((pending = pending->next) != NULL); + } + + /* Parse names of main and alternate entry points. */ + while (1) + { + char *name, *p, c; + + SKIP_WHITESPACE (); + name = input_line_pointer; + c = get_symbol_end (); + p = input_line_pointer; + if (!*name) + (md.unwind_check == unwind_check_warning + ? as_warn + : as_bad) ("Empty argument of .endp"); + else + { + symbolS *sym = symbol_find (name); + + for (pending = &unwind.proc_pending; pending; pending = pending->next) + { + if (sym == pending->sym) + { + pending->sym = NULL; + break; + } + } + if (!sym || !pending) + as_warn ("`%s' was not specified with previous .proc", name); } *p = c; SKIP_WHITESPACE (); @@ -4548,7 +4588,21 @@ dot_endp (dummy) ++input_line_pointer; } demand_empty_rest_of_line (); - unwind.proc_start = unwind.info = 0; + + /* Deliberately only checking for the main entry point here; the + language spec even says all arguments to .endp are ignored. */ + if (unwind.proc_pending.sym + && S_GET_NAME (unwind.proc_pending.sym) + && strcmp (S_GET_NAME (unwind.proc_pending.sym), FAKE_LABEL_NAME)) + as_warn ("`%s' should be an operand to this .endp", + S_GET_NAME (unwind.proc_pending.sym)); + while (unwind.proc_pending.next) + { + pending = unwind.proc_pending.next; + unwind.proc_pending.next = pending->next; + free (pending); + } + unwind.proc_pending.sym = unwind.info = NULL; } static void @@ -5961,7 +6015,7 @@ operand_match (idesc, index, e) case O_symbol: fix = CURR_SLOT.fixup + CURR_SLOT.num_fixups; /* There are no external relocs for TAG13/TAG13b fields, so we - create a dummy reloc. This will not live past md_apply_fix3. */ + create a dummy reloc. This will not live past md_apply_fix. */ fix->code = BFD_RELOC_UNUSED; fix->code = ia64_gen_real_reloc_type (e->X_op_symbol, fix->code); fix->opnd = idesc->operands[index]; @@ -6479,7 +6533,6 @@ emit_one_bundle () struct ia64_opcode *idesc; int end_of_insn_group = 0, user_template = -1; int n, i, j, first, curr, last_slot; - unw_rec_list *ptr, *last_ptr, *end_ptr; bfd_vma t0 = 0, t1 = 0; struct label_fix *lfix; struct insn_fix *ifix; @@ -6534,7 +6587,9 @@ emit_one_bundle () for (i = 0; i < 3 && md.num_slots_in_use > 0; ++i) { /* If we have unwind records, we may need to update some now. */ - ptr = md.slot[curr].unwind_record; + unw_rec_list *ptr = md.slot[curr].unwind_record; + unw_rec_list *end_ptr = NULL; + if (ptr) { /* Find the last prologue/body record in the list for the current @@ -6544,9 +6599,11 @@ emit_one_bundle () issued. This matters because there may have been nops emitted meanwhile. Any non-prologue non-body record followed by a prologue/body record must also refer to the current point. */ - last_ptr = NULL; - end_ptr = md.slot[(curr + 1) % NUM_SLOTS].unwind_record; - for (; ptr != end_ptr; ptr = ptr->next) + unw_rec_list *last_ptr; + + for (j = 1; end_ptr == NULL && j < md.num_slots_in_use; ++j) + end_ptr = md.slot[(curr + j) % NUM_SLOTS].unwind_record; + for (last_ptr = NULL; ptr != end_ptr; ptr = ptr->next) if (ptr->r.type == prologue || ptr->r.type == prologue_gr || ptr->r.type == body) last_ptr = ptr; @@ -6814,7 +6871,6 @@ emit_one_bundle () /* Set slot numbers for all remaining unwind records belonging to the current insn. There can not be any prologue/body unwind records here. */ - end_ptr = md.slot[(curr + 1) % NUM_SLOTS].unwind_record; for (; ptr != end_ptr; ptr = ptr->next) { ptr->slot_number = (unsigned long) f + i; @@ -6916,12 +6972,6 @@ emit_one_bundle () number_to_chars_littleendian (f + 0, t0, 8); number_to_chars_littleendian (f + 8, t1, 8); - - if (unwind.list) - { - unwind.list->next_slot_number = (unsigned long) f + 16; - unwind.list->next_slot_frag = frag_now; - } } int @@ -7147,8 +7197,9 @@ match (int templ, int type, int slot) return result; } -/* Add a bit of extra goodness if a nop of type F or B would fit - in TEMPL at SLOT. */ +/* For Itanium 1, add a bit of extra goodness if a nop of type F or B would fit + in TEMPL at SLOT. For Itanium 2, add a bit of extra goodness if a nop of + type M or I would fit in TEMPL at SLOT. */ static inline int extra_goodness (int templ, int slot) @@ -7294,7 +7345,7 @@ md_begin () { if (match (t, j, 1)) { - if (match (t, k, 2)) + if ((t == 2 && j == IA64_TYPE_X) || match (t, k, 2)) goodness = 3 + 3 + 3; else goodness = 3 + 3 + extra_goodness (t, 2); @@ -7310,7 +7361,7 @@ md_begin () } else if (match (t, i, 1)) { - if (match (t, j, 2)) + if ((t == 2 && i == IA64_TYPE_X) || match (t, j, 2)) goodness = 3 + 3; else goodness = 3 + extra_goodness (t, 2); @@ -7326,6 +7377,21 @@ md_begin () } } +#ifdef DEBUG_TEMPLATES + /* For debugging changes to the best_template calculations. We don't care + about combinations with invalid instructions, so start the loops at 1. */ + for (i = 0; i < IA64_NUM_TYPES; ++i) + for (j = 0; j < IA64_NUM_TYPES; ++j) + for (k = 0; k < IA64_NUM_TYPES; ++k) + { + char type_letter[IA64_NUM_TYPES] = { 'n', 'a', 'i', 'm', 'b', 'f', + 'x', 'd' }; + fprintf (stderr, "%c%c%c %s\n", type_letter[i], type_letter[j], + type_letter[k], + ia64_templ_desc[best_template[i][j][k]].name); + } +#endif + for (i = 0; i < NUM_SLOTS; ++i) md.slot[i].user_template = -1; @@ -10772,7 +10838,7 @@ md_assemble (str) CURR_SLOT.unwind_record = unwind.current_entry; unwind.current_entry = NULL; } - if (unwind.proc_start && S_IS_DEFINED (unwind.proc_start)) + if (unwind.proc_pending.sym && S_IS_DEFINED (unwind.proc_pending.sym)) unwind.insn = 1; /* Check for dependency violations. */ @@ -11009,7 +11075,7 @@ ia64_cons_fix_new (f, where, nbytes, exp fix = fix_new_exp (f, where, nbytes, exp, 0, code); /* We need to store the byte order in effect in case we're going to fix an 8 or 16 bit relocation (for which there no real - relocs available). See md_apply_fix3(). */ + relocs available). See md_apply_fix(). */ fix->tc_fix_data.bigendian = target_big_endian; } @@ -11254,6 +11320,7 @@ ia64_gen_real_reloc_type (sym, r_type) case BFD_RELOC_IA64_DIR32LSB: width = 32; suffix = "LSB"; break; case BFD_RELOC_IA64_DIR64MSB: width = 64; suffix = "MSB"; break; case BFD_RELOC_IA64_DIR64LSB: width = 64; suffix = "LSB"; break; + case BFD_RELOC_UNUSED: width = 13; break; case BFD_RELOC_IA64_IMM14: width = 14; break; case BFD_RELOC_IA64_IMM22: width = 22; break; case BFD_RELOC_IA64_IMM64: width = 64; suffix = "I"; break; @@ -11355,7 +11422,7 @@ fix_insn (fix, odesc, value) (if possible). */ void -md_apply_fix3 (fix, valP, seg) +md_apply_fix (fix, valP, seg) fixS *fix; valueT *valP; segT seg ATTRIBUTE_UNUSED; diff -uprN binutils-2.16.90.0.3/gas/config/tc-ip2k.c binutils-2.16.91.0.1/gas/config/tc-ip2k.c --- binutils-2.16.90.0.3/gas/config/tc-ip2k.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-ip2k.c 2005-06-22 13:53:34.919315002 -0700 @@ -431,7 +431,7 @@ ip2k_force_relocation (fixS * fix) } void -ip2k_apply_fix3 (fixS *fixP, valueT *valueP, segT seg) +ip2k_apply_fix (fixS *fixP, valueT *valueP, segT seg) { if (fixP->fx_r_type == BFD_RELOC_IP2K_TEXT && ! fixP->fx_addsy @@ -445,7 +445,7 @@ ip2k_apply_fix3 (fixS *fixP, valueT *val /* Must be careful when we are fixing up an FR. We could be fixing up an offset to (SP) or (DP) in which case we don't want to step on the top 2 bits of the FR operand. The - gas_cgen_md_apply_fix3 doesn't know any better and overwrites + gas_cgen_md_apply_fix doesn't know any better and overwrites the entire operand. We counter this by adding the bits to the new value. */ char *where = fixP->fx_frag->fr_literal + fixP->fx_where; @@ -459,7 +459,7 @@ ip2k_apply_fix3 (fixS *fixP, valueT *val *valueP += (insn_value & 0x180); } - gas_cgen_md_apply_fix3 (fixP, valueP, seg); + gas_cgen_md_apply_fix (fixP, valueP, seg); } int diff -uprN binutils-2.16.90.0.3/gas/config/tc-ip2k.h binutils-2.16.91.0.1/gas/config/tc-ip2k.h --- binutils-2.16.90.0.3/gas/config/tc-ip2k.h 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-ip2k.h 2005-06-22 13:53:34.919315002 -0700 @@ -47,10 +47,10 @@ #define LITERAL_PREFIXPERCENT_BIN #define DOUBLESLASH_LINE_COMMENTS -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 -#define md_apply_fix3 ip2k_apply_fix3 +#define md_apply_fix ip2k_apply_fix #define TC_HANDLES_FX_DONE diff -uprN binutils-2.16.90.0.3/gas/config/tc-iq2000.c binutils-2.16.91.0.1/gas/config/tc-iq2000.c --- binutils-2.16.90.0.3/gas/config/tc-iq2000.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-iq2000.c 2005-06-22 13:53:34.921314671 -0700 @@ -574,7 +574,7 @@ iq2000_cgen_record_fixup_exp (fragS * #define FX_OPINFO_R_TYPE(f) ((f)->fx_cgen.opinfo) /* Sort any unmatched HI16 relocs so that they immediately precede - the corresponding LO16 reloc. This is called before md_apply_fix3 and + the corresponding LO16 reloc. This is called before md_apply_fix and tc_gen_reloc. */ void diff -uprN binutils-2.16.90.0.3/gas/config/tc-iq2000.h binutils-2.16.91.0.1/gas/config/tc-iq2000.h --- binutils-2.16.90.0.3/gas/config/tc-iq2000.h 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-iq2000.h 2005-06-22 13:53:34.921314671 -0700 @@ -43,7 +43,7 @@ /* We don't need to handle .word strangely. */ #define WORKING_DOT_WORD -#define md_apply_fix3 gas_cgen_md_apply_fix3 +#define md_apply_fix gas_cgen_md_apply_fix /* Call md_pcrel_from_section(), not md_pcrel_from(). */ #define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC) @@ -59,7 +59,7 @@ /* When relaxing, we need to emit various relocs we otherwise wouldn't. */ #define TC_FORCE_RELOCATION(fix) iq2000_force_relocation (fix) -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 #define tc_gen_reloc gas_cgen_tc_gen_reloc diff -uprN binutils-2.16.90.0.3/gas/config/tc-m32r.c binutils-2.16.91.0.1/gas/config/tc-m32r.c --- binutils-2.16.90.0.3/gas/config/tc-m32r.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-m32r.c 2005-06-22 13:53:34.923314341 -0700 @@ -120,7 +120,7 @@ static int warn_explicit_parallel_confli static int ignore_parallel_conflicts = 0; /* Non-zero if insns can be made parallel. */ -static int use_parallel = 1; +static int use_parallel = 0; /* Non-zero if optimizations should be performed. */ static int optimize; @@ -1995,7 +1995,7 @@ m32r_cgen_record_fixup_exp (fragS *frag, #define FX_OPINFO_R_TYPE(f) ((f)->fx_cgen.opinfo) /* Sort any unmatched HI16 relocs so that they immediately precede - the corresponding LO16 reloc. This is called before md_apply_fix3 and + the corresponding LO16 reloc. This is called before md_apply_fix and tc_gen_reloc. */ void diff -uprN binutils-2.16.90.0.3/gas/config/tc-m32r.h binutils-2.16.91.0.1/gas/config/tc-m32r.h --- binutils-2.16.90.0.3/gas/config/tc-m32r.h 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-m32r.h 2005-06-22 13:53:34.924314176 -0700 @@ -71,10 +71,10 @@ extern void m32r_handle_align (fragS *); #define MAX_MEM_FOR_RS_ALIGN_CODE (1 + 2 + 4) -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 -#define md_apply_fix3 gas_cgen_md_apply_fix3 +#define md_apply_fix gas_cgen_md_apply_fix #define tc_fix_adjustable(FIX) m32r_fix_adjustable (FIX) bfd_boolean m32r_fix_adjustable (struct fix *); diff -uprN binutils-2.16.90.0.3/gas/config/tc-m68hc11.c binutils-2.16.91.0.1/gas/config/tc-m68hc11.c --- binutils-2.16.90.0.3/gas/config/tc-m68hc11.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-m68hc11.c 2005-06-22 13:53:34.926313845 -0700 @@ -3228,7 +3228,7 @@ tc_m68hc11_fix_adjustable (fixS *fixP) } void -md_apply_fix3 (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) { char *where; long value = * valP; diff -uprN binutils-2.16.90.0.3/gas/config/tc-m68hc11.h binutils-2.16.91.0.1/gas/config/tc-m68hc11.h --- binutils-2.16.90.0.3/gas/config/tc-m68hc11.h 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-m68hc11.h 2005-06-22 13:53:34.926313845 -0700 @@ -93,7 +93,7 @@ extern long m68hc11_relax_frag (segT, fr #define DIFF_EXPR_OK /* .-foo gets turned into PC relative relocs */ -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 /* No shared lib support, so we don't need to ensure externally diff -uprN binutils-2.16.90.0.3/gas/config/tc-m68k.c binutils-2.16.91.0.1/gas/config/tc-m68k.c --- binutils-2.16.90.0.3/gas/config/tc-m68k.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-m68k.c 2005-06-22 13:53:34.943311037 -0700 @@ -1089,6 +1089,7 @@ m68k_ip (char *instring) char c; int losing; int opsfound; + struct m68k_op operands_backup[6]; LITTLENUM_TYPE words[6]; LITTLENUM_TYPE *wordp; unsigned long ok_arch = 0; @@ -1213,7 +1214,15 @@ m68k_ip (char *instring) ++losing; else { - for (s = opcode->m_operands, opP = &the_ins.operands[0]; + int i; + + /* Make a copy of the operands of this insn so that + we can modify them safely, should we want to. */ + assert (opsfound <= (int) ARRAY_SIZE (operands_backup)); + for (i = 0; i < opsfound; i++) + operands_backup[i] = the_ins.operands[i]; + + for (s = opcode->m_operands, opP = &operands_backup[0]; *s && !losing; s += 2, opP++) { @@ -1974,6 +1983,12 @@ m68k_ip (char *instring) if (losing) break; } + + /* Since we have found the correct instruction, copy + in the modifications that we may have made. */ + if (!losing) + for (i = 0; i < opsfound; i++) + the_ins.operands[i] = operands_backup[i]; } if (!losing) @@ -4116,6 +4131,9 @@ m68k_compare_opcode (const void * v1, co struct m68k_opcode * op1, * op2; int ret; + if (v1 == v2) + return 0; + op1 = *(struct m68k_opcode **) v1; op2 = *(struct m68k_opcode **) v2; @@ -4126,7 +4144,7 @@ m68k_compare_opcode (const void * v1, co return ret; if (op1 < op2) return -1; - return 0; + return 1; } void @@ -4605,7 +4623,7 @@ md_number_to_chars (char *buf, valueT va } void -md_apply_fix3 (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) { offsetT val = *valP; addressT upper_limit; diff -uprN binutils-2.16.90.0.3/gas/config/tc-m68k.h binutils-2.16.91.0.1/gas/config/tc-m68k.h --- binutils-2.16.90.0.3/gas/config/tc-m68k.h 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-m68k.h 2005-06-22 13:53:34.943311037 -0700 @@ -175,7 +175,7 @@ extern int tc_m68k_fix_adjustable PARAMS #define EXTERN_FORCE_RELOC \ ((strcmp (TARGET_OS, "elf") != 0) && (strcmp (TARGET_OS, "uclinux") != 0)) -/* Values passed to md_apply_fix3 don't include symbol values. */ +/* Values passed to md_apply_fix don't include symbol values. */ #define MD_APPLY_SYM_VALUE(FIX) 0 #define elf_tc_final_processing m68k_elf_final_processing diff -uprN binutils-2.16.90.0.3/gas/config/tc-m88k.c binutils-2.16.91.0.1/gas/config/tc-m88k.c --- binutils-2.16.90.0.3/gas/config/tc-m88k.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-m88k.c 2005-06-22 13:53:34.944310872 -0700 @@ -1018,7 +1018,7 @@ tc_coff_fix2rtype (fixS *fixp) file itself. */ void -md_apply_fix3 (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) { long val = * (long *) valP; char *buf; diff -uprN binutils-2.16.90.0.3/gas/config/tc-maxq.c binutils-2.16.91.0.1/gas/config/tc-maxq.c --- binutils-2.16.90.0.3/gas/config/tc-maxq.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-maxq.c 2005-06-22 13:53:34.946310541 -0700 @@ -583,13 +583,13 @@ maxq_number_to_chars (char *buf, valueT /* GAS will call this for each fixup. It's main objective is to store the correct value in the object file. 'fixup_segment' performs the generic - overflow check on the 'valueT *val' argument after md_apply_fix3 returns. + overflow check on the 'valueT *val' argument after md_apply_fix returns. If the overflow check is relevant for the target machine, then - 'md_apply_fix3' should modify 'valueT *val', typically to the value stored + 'md_apply_fix' should modify 'valueT *val', typically to the value stored in the object file (not to be done in MAXQ). */ void -md_apply_fix3 (fixS *fixP, valueT *valT, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS *fixP, valueT *valT, segT seg ATTRIBUTE_UNUSED) { char *p = fixP->fx_frag->fr_literal + fixP->fx_where; char *frag_to_fix_at = diff -uprN binutils-2.16.90.0.3/gas/config/tc-mcore.c binutils-2.16.91.0.1/gas/config/tc-mcore.c --- binutils-2.16.90.0.3/gas/config/tc-mcore.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-mcore.c 2005-06-22 13:53:34.954309220 -0700 @@ -1984,7 +1984,7 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UN Also sets up addends for 'rela' type relocations. */ void -md_apply_fix3 (fixS * fixP, +md_apply_fix (fixS * fixP, valueT * valP, segT segment ATTRIBUTE_UNUSED) { diff -uprN binutils-2.16.90.0.3/gas/config/tc-mcore.h binutils-2.16.91.0.1/gas/config/tc-mcore.h --- binutils-2.16.90.0.3/gas/config/tc-mcore.h 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-mcore.h 2005-06-22 13:53:34.955309055 -0700 @@ -92,7 +92,7 @@ struct mcore_tc_sy #define tc_fix_adjustable(FIX) mcore_fix_adjustable (FIX) -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 #endif /* OBJ_ELF */ diff -uprN binutils-2.16.90.0.3/gas/config/tc-mips.c binutils-2.16.91.0.1/gas/config/tc-mips.c --- binutils-2.16.90.0.3/gas/config/tc-mips.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-mips.c 2005-06-22 13:53:34.964307568 -0700 @@ -3558,7 +3558,7 @@ load_register (int reg, expressionS *ep, char value[32]; sprintf_vma (value, ep->X_add_number); - as_bad (_("Number (%s) larger than 32 bits"), value); + as_bad (_("Number (0x%s) larger than 32 bits"), value); macro_build (ep, "addiu", "t,r,j", reg, 0, BFD_RELOC_LO16); return; } @@ -5805,7 +5805,7 @@ macro (struct mips_cl_insn *ip) char value [32]; sprintf_vma (value, offset_expr.X_add_number); - as_bad (_("Number (%s) larger than 32 bits"), value); + as_bad (_("Number (0x%s) larger than 32 bits"), value); } /* A constant expression in PIC code can be handled just as it @@ -6399,7 +6399,7 @@ macro (struct mips_cl_insn *ip) char value [32]; sprintf_vma (value, offset_expr.X_add_number); - as_bad (_("Number (%s) larger than 32 bits"), value); + as_bad (_("Number (0x%s) larger than 32 bits"), value); } /* Even on a big endian machine $fn comes before $fn+1. We have @@ -10696,7 +10696,7 @@ mips_frob_file_before_adjust (void) } /* Sort any unmatched HI16 and GOT16 relocs so that they immediately precede - the corresponding LO16 reloc. This is called before md_apply_fix3 and + the corresponding LO16 reloc. This is called before md_apply_fix and tc_gen_reloc. Unmatched relocs can only be generated by use of explicit relocation operators. @@ -10915,7 +10915,7 @@ mips_validate_fix (struct fix *fixP, ase /* Apply a fixup to the object file. */ void -md_apply_fix3 (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) { bfd_byte *buf; long insn; @@ -13778,6 +13778,13 @@ static const struct mips_cpu_info mips_c { "4km", 0, ISA_MIPS32, CPU_MIPS32 }, { "4kp", 0, ISA_MIPS32, CPU_MIPS32 }, + /* MIPS32 Release 2 */ + { "m4k", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "24k", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "24kc", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "24kf", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "24kx", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + /* MIPS 64 */ { "5kc", 0, ISA_MIPS64, CPU_MIPS64 }, { "20kc", 0, ISA_MIPS64, CPU_MIPS64 }, diff -uprN binutils-2.16.90.0.3/gas/config/tc-mips.h binutils-2.16.91.0.1/gas/config/tc-mips.h --- binutils-2.16.90.0.3/gas/config/tc-mips.h 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-mips.h 2005-06-22 13:53:34.965307403 -0700 @@ -107,7 +107,7 @@ extern void mips_frob_file_after_relocs #define tc_fix_adjustable(fixp) mips_fix_adjustable (fixp) extern int mips_fix_adjustable (struct fix *); -/* Values passed to md_apply_fix3 don't include symbol values. */ +/* Values passed to md_apply_fix don't include symbol values. */ #define MD_APPLY_SYM_VALUE(FIX) 0 /* Global syms must not be resolved, to support ELF shared libraries. */ diff -uprN binutils-2.16.90.0.3/gas/config/tc-mmix.c binutils-2.16.91.0.1/gas/config/tc-mmix.c --- binutils-2.16.90.0.3/gas/config/tc-mmix.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-mmix.c 2005-06-22 13:53:34.971306411 -0700 @@ -2365,7 +2365,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNU if (fragP->tc_frag_data == NULL) { /* We must initialize data that's supposed to be "fixed up" to - avoid emitting garbage, because md_apply_fix3 won't do + avoid emitting garbage, because md_apply_fix won't do anything for undefined symbols. */ md_number_to_chars (var_partp, 0, 8); tmpfixP @@ -2413,7 +2413,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNU Note that this function isn't called when linkrelax != 0. */ void -md_apply_fix3 (fixS *fixP, valueT *valP, segT segment) +md_apply_fix (fixS *fixP, valueT *valP, segT segment) { char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; /* Note: use offsetT because it is signed, valueT is unsigned. */ @@ -2652,7 +2652,7 @@ tc_gen_reloc (asection *section ATTRIBUT if (addsy == NULL || bfd_is_abs_section (addsec)) { - /* Resolve this reloc now, as md_apply_fix3 would have done (not + /* Resolve this reloc now, as md_apply_fix would have done (not called if -linkrelax). There is no point in keeping a reloc to an absolute symbol. No reloc that is subject to relaxation must be to an absolute symbol; difference @@ -2852,9 +2852,9 @@ tc_gen_reloc (asection *section ATTRIBUT } /* FALLTHROUGH. */ - /* The others are supposed to be handled by md_apply_fix3. + /* The others are supposed to be handled by md_apply_fix. FIXME: ... which isn't called when -linkrelax. Move over - md_apply_fix3 code here for everything reasonable. */ + md_apply_fix code here for everything reasonable. */ badop: default: as_bad_where @@ -3267,10 +3267,10 @@ mmix_force_relocation (fixS *fixP) if (linkrelax) return 1; - /* All our pcrel relocations are must-keep. Note that md_apply_fix3 is + /* All our pcrel relocations are must-keep. Note that md_apply_fix is called *after* this, and will handle getting rid of the presumed reloc; a relocation isn't *forced* other than to be handled by - md_apply_fix3 (or tc_gen_reloc if linkrelax). */ + md_apply_fix (or tc_gen_reloc if linkrelax). */ if (fixP->fx_pcrel) return 1; diff -uprN binutils-2.16.90.0.3/gas/config/tc-mn10200.c binutils-2.16.91.0.1/gas/config/tc-mn10200.c --- binutils-2.16.90.0.3/gas/config/tc-mn10200.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-mn10200.c 2005-06-22 13:53:34.972306246 -0700 @@ -738,7 +738,7 @@ md_begin (void) op++; } - /* This is both a simplification (we don't have to write md_apply_fix3) + /* This is both a simplification (we don't have to write md_apply_fix) and support for future optimizations (branch shortening and similar stuff in the linker. */ linkrelax = 1; @@ -847,7 +847,7 @@ md_pcrel_from (fixS *fixp) } void -md_apply_fix3 (fixS * fixP, valueT * valP ATTRIBUTE_UNUSED, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS * fixP, valueT * valP ATTRIBUTE_UNUSED, segT seg ATTRIBUTE_UNUSED) { /* We shouldn't ever get here because linkrelax is nonzero. */ abort (); diff -uprN binutils-2.16.90.0.3/gas/config/tc-mn10300.c binutils-2.16.91.0.1/gas/config/tc-mn10300.c --- binutils-2.16.90.0.3/gas/config/tc-mn10300.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-mn10300.c 2005-06-22 13:53:34.974305916 -0700 @@ -2452,7 +2452,7 @@ md_pcrel_from (fixp) } void -md_apply_fix3 (fixP, valP, seg) +md_apply_fix (fixP, valP, seg) fixS * fixP; valueT * valP; segT seg; diff -uprN binutils-2.16.90.0.3/gas/config/tc-msp430.c binutils-2.16.91.0.1/gas/config/tc-msp430.c --- binutils-2.16.90.0.3/gas/config/tc-msp430.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-msp430.c 2005-06-22 13:53:34.976305585 -0700 @@ -1818,7 +1818,7 @@ md_pcrel_from_section (fixS * fixp, segT value in the object file. */ void -md_apply_fix3 (fixS * fixp, valueT * valuep, segT seg) +md_apply_fix (fixS * fixp, valueT * valuep, segT seg) { unsigned char * where; unsigned long insn; diff -uprN binutils-2.16.90.0.3/gas/config/tc-ns32k.c binutils-2.16.91.0.1/gas/config/tc-ns32k.c --- binutils-2.16.90.0.3/gas/config/tc-ns32k.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-ns32k.c 2005-06-22 13:53:34.978305255 -0700 @@ -2012,7 +2012,7 @@ md_fix_pcrel_adjust (fixS *fixP) They all get called from here. */ void -md_apply_fix3 (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) { long val = * (long *) valP; char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; diff -uprN binutils-2.16.90.0.3/gas/config/tc-openrisc.h binutils-2.16.91.0.1/gas/config/tc-openrisc.h --- binutils-2.16.90.0.3/gas/config/tc-openrisc.h 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-openrisc.h 2005-06-22 13:53:34.988303603 -0700 @@ -47,10 +47,10 @@ extern const char openrisc_comment_chars /* We don't need to handle .word strangely. */ #define WORKING_DOT_WORD -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 -#define md_apply_fix3 gas_cgen_md_apply_fix3 +#define md_apply_fix gas_cgen_md_apply_fix extern bfd_boolean openrisc_fix_adjustable (struct fix *); #define tc_fix_adjustable(FIX) openrisc_fix_adjustable (FIX) diff -uprN binutils-2.16.90.0.3/gas/config/tc-or32.c binutils-2.16.91.0.1/gas/config/tc-or32.c --- binutils-2.16.90.0.3/gas/config/tc-or32.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-or32.c 2005-06-22 13:53:34.989303438 -0700 @@ -902,7 +902,7 @@ md_number_to_chars (char *buf, valueT va #ifdef BFD_ASSEMBLER void -md_apply_fix3 (fixS * fixP, valueT * val, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS * fixP, valueT * val, segT seg ATTRIBUTE_UNUSED) { char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; long t_val; @@ -998,7 +998,7 @@ md_apply_fix3 (fixS * fixP, valueT * val } #else void -md_apply_fix3 (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) { long val = *valP; char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; diff -uprN binutils-2.16.90.0.3/gas/config/tc-or32.h binutils-2.16.91.0.1/gas/config/tc-or32.h --- binutils-2.16.90.0.3/gas/config/tc-or32.h 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-or32.h 2005-06-22 13:53:34.990303273 -0700 @@ -55,7 +55,7 @@ extern int or32_unrecognized_line (int); #define EXTERN_FORCE_RELOC 0 #ifdef OBJ_ELF -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 #endif diff -uprN binutils-2.16.90.0.3/gas/config/tc-pdp11.c binutils-2.16.91.0.1/gas/config/tc-pdp11.c --- binutils-2.16.90.0.3/gas/config/tc-pdp11.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-pdp11.c 2005-06-22 13:53:35.003301125 -0700 @@ -230,7 +230,7 @@ md_number_to_chars (char con[], valueT v that they reference. Knows about order of bytes in address. */ void -md_apply_fix3 (fixS *fixP, +md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) { @@ -1400,7 +1400,7 @@ tc_gen_reloc (asection *section ATTRIBUT *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; - /* This is taken account for in md_apply_fix3(). */ + /* This is taken account for in md_apply_fix(). */ reloc->addend = -symbol_get_bfdsym (fixp->fx_addsy)->section->vma; switch (fixp->fx_r_type) diff -uprN binutils-2.16.90.0.3/gas/config/tc-pj.c binutils-2.16.91.0.1/gas/config/tc-pj.c --- binutils-2.16.90.0.3/gas/config/tc-pj.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-pj.c 2005-06-22 13:53:35.004300960 -0700 @@ -410,7 +410,7 @@ PJ options:\n\ /* Apply a fixup to the object file. */ void -md_apply_fix3 (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) { char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; long val = *valP; diff -uprN binutils-2.16.90.0.3/gas/config/tc-pj.h binutils-2.16.91.0.1/gas/config/tc-pj.h --- binutils-2.16.90.0.3/gas/config/tc-pj.h 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-pj.h 2005-06-22 13:53:35.004300960 -0700 @@ -52,7 +52,7 @@ arelent *tc_gen_reloc (asection *, struc visible symbols can be overridden. */ #define EXTERN_FORCE_RELOC 0 -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 #define tc_fix_adjustable(FIX) \ diff -uprN binutils-2.16.90.0.3/gas/config/tc-ppc.c binutils-2.16.91.0.1/gas/config/tc-ppc.c --- binutils-2.16.90.0.3/gas/config/tc-ppc.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-ppc.c 2005-06-22 13:53:35.012299638 -0700 @@ -906,6 +906,12 @@ parse_cpu (const char *arg) ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_64 | PPC_OPCODE_POWER4); } + else if (strcmp (arg, "power5") == 0) + { + ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC + | PPC_OPCODE_64 | PPC_OPCODE_POWER4 + | PPC_OPCODE_POWER5); + } /* -mcom means assemble for the common intersection between Power and PowerPC. At present, we just allow the union, rather than the intersection. */ @@ -1100,6 +1106,7 @@ PowerPC options:\n\ -mbooke64 generate code for 64-bit PowerPC BookE\n\ -mbooke, mbooke32 generate code for 32-bit PowerPC BookE\n\ -mpower4 generate code for Power4 architecture\n\ +-mpower5 generate code for Power5 architecture\n\ -mcom generate code Power/PowerPC common instructions\n\ -many generate code for any architecture (PWR/PWRX/PPC)\n")); fprintf (stream, _("\ @@ -1255,7 +1262,10 @@ ppc_setup_opcodes (void) || (ppc_cpu & PPC_OPCODE_BOOKE) == 0) && ((op->flags & (PPC_OPCODE_POWER4 | PPC_OPCODE_NOPOWER4)) == 0 || ((op->flags & PPC_OPCODE_POWER4) - == (ppc_cpu & PPC_OPCODE_POWER4)))) + == (ppc_cpu & PPC_OPCODE_POWER4))) + && ((op->flags & PPC_OPCODE_POWER5) == 0 + || ((op->flags & PPC_OPCODE_POWER5) + == (ppc_cpu & PPC_OPCODE_POWER5)))) { const char *retval; @@ -2641,7 +2651,7 @@ md_assemble (str) BFD_RELOC_UNUSED plus the operand index. This lets us easily handle fixups for any operand type, although that is admittedly not a very exciting feature. We pick a BFD reloc type in - md_apply_fix3. */ + md_apply_fix. */ for (i = 0; i < fc; i++) { const struct powerpc_operand *operand; @@ -5460,6 +5470,7 @@ ppc_force_relocation (fix) case BFD_RELOC_PPC_B16_BRNTAKEN: case BFD_RELOC_PPC_BA16_BRTAKEN: case BFD_RELOC_PPC_BA16_BRNTAKEN: + case BFD_RELOC_24_PLT_PCREL: case BFD_RELOC_PPC64_TOC: return 1; default: @@ -5499,7 +5510,7 @@ ppc_fix_adjustable (fix) fixup. */ void -md_apply_fix3 (fixP, valP, seg) +md_apply_fix (fixP, valP, seg) fixS *fixP; valueT * valP; segT seg ATTRIBUTE_UNUSED; @@ -5707,8 +5718,6 @@ md_apply_fix3 (fixP, valP, seg) value, 8); break; - case BFD_RELOC_LO16: - case BFD_RELOC_16: case BFD_RELOC_GPREL16: case BFD_RELOC_16_GOT_PCREL: case BFD_RELOC_16_GOTOFF: @@ -5754,19 +5763,45 @@ md_apply_fix3 (fixP, valP, seg) value, 2); break; + case BFD_RELOC_16: + if (fixP->fx_pcrel) + fixP->fx_r_type = BFD_RELOC_16_PCREL; + /* fall through */ + + case BFD_RELOC_16_PCREL: + md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, + value, 2); + break; + + case BFD_RELOC_LO16: + if (fixP->fx_pcrel) + fixP->fx_r_type = BFD_RELOC_LO16_PCREL; + /* fall through */ + + case BFD_RELOC_LO16_PCREL: + md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, + value, 2); + break; + /* This case happens when you write, for example, lis %r3,(L1-L2)@ha where L1 and L2 are defined later. */ case BFD_RELOC_HI16: if (fixP->fx_pcrel) - abort (); + fixP->fx_r_type = BFD_RELOC_HI16_PCREL; + /* fall through */ + + case BFD_RELOC_HI16_PCREL: md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, PPC_HI (value), 2); break; case BFD_RELOC_HI16_S: if (fixP->fx_pcrel) - abort (); + fixP->fx_r_type = BFD_RELOC_HI16_S_PCREL; + /* fall through */ + + case BFD_RELOC_HI16_S_PCREL: md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, PPC_HA (value), 2); break; diff -uprN binutils-2.16.90.0.3/gas/config/tc-ppc.h binutils-2.16.91.0.1/gas/config/tc-ppc.h --- binutils-2.16.90.0.3/gas/config/tc-ppc.h 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-ppc.h 2005-06-22 13:53:35.013299473 -0700 @@ -234,7 +234,7 @@ extern const char *ppc_comment_chars; #define tc_fix_adjustable(FIX) ppc_fix_adjustable (FIX) extern int ppc_fix_adjustable PARAMS ((struct fix *)); -/* Values passed to md_apply_fix3 don't include symbol values. */ +/* Values passed to md_apply_fix don't include symbol values. */ #define MD_APPLY_SYM_VALUE(FIX) 0 #define tc_frob_file_before_adjust ppc_frob_file_before_adjust diff -uprN binutils-2.16.90.0.3/gas/config/tc-s390.c binutils-2.16.91.0.1/gas/config/tc-s390.c --- binutils-2.16.90.0.3/gas/config/tc-s390.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-s390.c 2005-06-22 13:53:35.014299308 -0700 @@ -1449,7 +1449,7 @@ md_gather_operands (str, insn, opcode) BFD_RELOC_UNUSED plus the operand index. This lets us easily handle fixups for any operand type, although that is admittedly not a very exciting feature. We pick a BFD reloc type in - md_apply_fix3. */ + md_apply_fix. */ for (i = 0; i < fc; i++) { @@ -1957,7 +1957,7 @@ tc_s390_force_relocation (fixp) fixup. */ void -md_apply_fix3 (fixP, valP, seg) +md_apply_fix (fixP, valP, seg) fixS *fixP; valueT *valP; segT seg ATTRIBUTE_UNUSED; diff -uprN binutils-2.16.90.0.3/gas/config/tc-s390.h binutils-2.16.91.0.1/gas/config/tc-s390.h --- binutils-2.16.90.0.3/gas/config/tc-s390.h 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-s390.h 2005-06-22 13:53:35.015299143 -0700 @@ -39,7 +39,7 @@ extern int tc_s390_force_relocation PARA #define tc_fix_adjustable(X) tc_s390_fix_adjustable(X) extern int tc_s390_fix_adjustable PARAMS ((struct fix *)); -/* Values passed to md_apply_fix3 don't include symbol values. */ +/* Values passed to md_apply_fix don't include symbol values. */ #define MD_APPLY_SYM_VALUE(FIX) 0 /* The target BFD architecture. */ diff -uprN binutils-2.16.90.0.3/gas/config/tc-sh64.c binutils-2.16.91.0.1/gas/config/tc-sh64.c --- binutils-2.16.90.0.3/gas/config/tc-sh64.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-sh64.c 2005-06-22 13:53:35.021298152 -0700 @@ -39,7 +39,7 @@ symbol" or local symbol. */ #define DATALABEL_SUFFIX " DL" -/* See shmedia_md_apply_fix3 and shmedia_md_pcrel_from_section for usage. */ +/* See shmedia_md_apply_fix and shmedia_md_pcrel_from_section for usage. */ #define SHMEDIA_MD_PCREL_FROM_FIX(FIXP) \ ((FIXP)->fx_size + (FIXP)->fx_where + (FIXP)->fx_frag->fr_address - 4) @@ -136,7 +136,7 @@ static const unsigned char shmedia_littl static void shmedia_md_begin (void); static int shmedia_parse_reg (char *, int *, int *, shmedia_arg_type); static void shmedia_md_assemble (char *); -static void shmedia_md_apply_fix3 (fixS *, valueT *); +static void shmedia_md_apply_fix (fixS *, valueT *); static int shmedia_md_estimate_size_before_relax (fragS *, segT); static int shmedia_init_reloc (arelent *, fixS *); static char *shmedia_get_operands (shmedia_opcode_info *, char *, @@ -577,10 +577,10 @@ shmedia_init_reloc (arelent *rel, fixS * return 0; } -/* Hook called from md_apply_fix3 in tc-sh.c. */ +/* Hook called from md_apply_fix in tc-sh.c. */ static void -shmedia_md_apply_fix3 (fixS *fixP, valueT *valp) +shmedia_md_apply_fix (fixS *fixP, valueT *valp) { offsetT val = *valp; char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; @@ -602,7 +602,7 @@ shmedia_md_apply_fix3 (fixS *fixP, value /* Because write.c calls MD_PCREL_FROM_SECTION twice, we need to undo one of the adjustments, if the relocation is not actually for a symbol within the same segment (which we - cannot check, because we're not called from md_apply_fix3, so + cannot check, because we're not called from md_apply_fix, so we have to keep the reloc). FIXME: This is a bug in write.c:fixup_segment affecting most targets that change ordinary relocs to pcrel relocs in md_apply_fix. */ @@ -2736,7 +2736,7 @@ shmedia_build_Mytes (shmedia_opcode_info insn_loc); else /* This reloc-type is just temporary, so we can distinguish - PTA from PT. It is changed in shmedia_md_apply_fix3 to + PTA from PT. It is changed in shmedia_md_apply_fix to BFD_RELOC_SH_PT_16. */ insn |= shmedia_immediate_op (insn_loc, opjp, 1, opjp->reloctype == BFD_RELOC_NONE diff -uprN binutils-2.16.90.0.3/gas/config/tc-sh.c binutils-2.16.91.0.1/gas/config/tc-sh.c --- binutils-2.16.90.0.3/gas/config/tc-sh.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-sh.c 2005-06-22 13:53:35.017298812 -0700 @@ -3415,7 +3415,7 @@ sh_frob_file (void) } /* Called after relaxing. Set the correct sizes of the fragments, and - create relocs so that md_apply_fix3 will fill in the correct values. */ + create relocs so that md_apply_fix will fill in the correct values. */ void #ifdef BFD_ASSEMBLER @@ -3794,7 +3794,7 @@ sh_elf_final_processing (void) /* Apply a fixup to the object file. */ void -md_apply_fix3 (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) { char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; int lowbyte = target_big_endian ? 1 : 0; @@ -4090,7 +4090,7 @@ md_apply_fix3 (fixS *fixP, valueT *valP, default: #ifdef HAVE_SH64 - shmedia_md_apply_fix3 (fixP, valP); + shmedia_md_apply_fix (fixP, valP); return; #else abort (); @@ -4349,7 +4349,7 @@ sh_coff_reloc_mangle (segment_info_type { /* We can't store the offset in the object file, since this reloc does not take up any space, so we store it in r_offset. - The fx_addnumber field was set in md_apply_fix3. */ + The fx_addnumber field was set in md_apply_fix. */ intr->r_offset = fix->fx_addnumber; } else if (fix->fx_r_type == BFD_RELOC_SH_COUNT) diff -uprN binutils-2.16.90.0.3/gas/config/tc-sh.h binutils-2.16.91.0.1/gas/config/tc-sh.h --- binutils-2.16.90.0.3/gas/config/tc-sh.h 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-sh.h 2005-06-22 13:53:35.018298647 -0700 @@ -212,7 +212,7 @@ extern void sh_elf_final_processing (voi #define tc_fix_adjustable(FIX) sh_fix_adjustable(FIX) extern bfd_boolean sh_fix_adjustable (struct fix *); -/* Values passed to md_apply_fix3 don't include symbol values. */ +/* Values passed to md_apply_fix don't include symbol values. */ #define MD_APPLY_SYM_VALUE(FIX) 0 /* This expression evaluates to true if the relocation is for a local object diff -uprN binutils-2.16.90.0.3/gas/config/tc-sparc.c binutils-2.16.91.0.1/gas/config/tc-sparc.c --- binutils-2.16.90.0.3/gas/config/tc-sparc.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-sparc.c 2005-06-22 13:53:35.024297656 -0700 @@ -2486,12 +2486,12 @@ sparc_ip (str, pinsn) goto error; } - /* Constants that won't fit are checked in md_apply_fix3 + /* Constants that won't fit are checked in md_apply_fix and bfd_install_relocation. ??? It would be preferable to install the constants into the insn here and save having to create a fixS for each one. There already exists code to handle - all the various cases (e.g. in md_apply_fix3 and + all the various cases (e.g. in md_apply_fix and bfd_install_relocation) so duplicating all that code here isn't right. */ } @@ -2879,7 +2879,7 @@ output_insn (insn, the_insn) the_insn->pcrel, the_insn->reloc); /* Turn off overflow checking in fixup_segment. We'll do our - own overflow checking in md_apply_fix3. This is necessary because + own overflow checking in md_apply_fix. This is necessary because the insn size is 4 and fixup_segment will signal an overflow for large 8 byte quantities. */ fixP->fx_no_overflow = 1; @@ -2998,7 +2998,7 @@ md_number_to_chars (buf, val, n) hold. */ void -md_apply_fix3 (fixP, valP, segment) +md_apply_fix (fixP, valP, segment) fixS *fixP; valueT *valP; segT segment ATTRIBUTE_UNUSED; diff -uprN binutils-2.16.90.0.3/gas/config/tc-sparc.h binutils-2.16.91.0.1/gas/config/tc-sparc.h --- binutils-2.16.90.0.3/gas/config/tc-sparc.h 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-sparc.h 2005-06-22 13:53:35.024297656 -0700 @@ -109,7 +109,7 @@ extern void sparc_handle_align PARAMS (( == S_GET_SEGMENT ((FIX)->fx_addsy))) \ || S_IS_LOCAL ((FIX)->fx_addsy))))) -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 /* Finish up the entire symtab. */ diff -uprN binutils-2.16.90.0.3/gas/config/tc-tahoe.c binutils-2.16.91.0.1/gas/config/tc-tahoe.c --- binutils-2.16.90.0.3/gas/config/tc-tahoe.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-tahoe.c 2005-06-22 13:53:35.026297326 -0700 @@ -457,7 +457,7 @@ md_number_to_chars (char con[], /* Retu } void -md_apply_fix3 (fixS *fixP ATTRIBUTE_UNUSED, +md_apply_fix (fixS *fixP ATTRIBUTE_UNUSED, valueT * valP ATTRIBUTE_UNUSED, segT seg ATTRIBUTE_UNUSED) { diff -uprN binutils-2.16.90.0.3/gas/config/tc-tic30.c binutils-2.16.91.0.1/gas/config/tc-tic30.c --- binutils-2.16.90.0.3/gas/config/tc-tic30.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-tic30.c 2005-06-22 13:53:35.027297160 -0700 @@ -1130,7 +1130,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNU } void -md_apply_fix3 (fixS *fixP, +md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) { diff -uprN binutils-2.16.90.0.3/gas/config/tc-tic4x.c binutils-2.16.91.0.1/gas/config/tc-tic4x.c --- binutils-2.16.90.0.3/gas/config/tc-tic4x.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-tic4x.c 2005-06-22 13:53:35.029296830 -0700 @@ -2742,7 +2742,7 @@ md_atof (type, litP, sizeP) } void -md_apply_fix3 (fixP, value, seg) +md_apply_fix (fixP, value, seg) fixS *fixP; valueT *value; segT seg ATTRIBUTE_UNUSED; diff -uprN binutils-2.16.90.0.3/gas/config/tc-tic54x.c binutils-2.16.91.0.1/gas/config/tc-tic54x.c --- binutils-2.16.90.0.3/gas/config/tc-tic54x.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-tic54x.c 2005-06-22 13:53:35.035295839 -0700 @@ -5481,7 +5481,7 @@ tic54x_cons_fix_new (frag, where, octets If fixp->fx_addsy is non-NULL, we'll have to generate a reloc entry. */ void -md_apply_fix3 (fixP, valP, seg) +md_apply_fix (fixP, valP, seg) fixS *fixP; valueT * valP; segT seg ATTRIBUTE_UNUSED; diff -uprN binutils-2.16.90.0.3/gas/config/tc-tic80.c binutils-2.16.91.0.1/gas/config/tc-tic80.c --- binutils-2.16.90.0.3/gas/config/tc-tic80.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-tic80.c 2005-06-22 13:53:35.036295674 -0700 @@ -802,7 +802,7 @@ TIc80 options:\n\ To indicate that a fixup has been eliminated, set fixP->fx_done. */ void -md_apply_fix3 (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) { long val = * (long *) valP; char *dest = fixP->fx_frag->fr_literal + fixP->fx_where; diff -uprN binutils-2.16.90.0.3/gas/config/tc-v850.c binutils-2.16.91.0.1/gas/config/tc-v850.c --- binutils-2.16.90.0.3/gas/config/tc-v850.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-v850.c 2005-06-22 13:53:35.038295343 -0700 @@ -2087,7 +2087,7 @@ md_assemble (char *str) BFD_RELOC_UNUSED plus the operand index. This lets us easily handle fixups for any operand type, although that is admittedly not a very exciting feature. We pick a BFD reloc type in - md_apply_fix3. */ + md_apply_fix. */ for (i = 0; i < fc; i++) { const struct v850_operand *operand; @@ -2125,6 +2125,8 @@ md_assemble (char *str) reloc_howto->pc_relative, reloc); + fixP->tc_fix_data = (void *) operand; + switch (reloc) { case BFD_RELOC_LO16: @@ -2238,7 +2240,7 @@ v850_pcrel_from_section (fixS *fixp, seg } void -md_apply_fix3 (fixS *fixP, valueT *valueP, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS *fixP, valueT *valueP, segT seg ATTRIBUTE_UNUSED) { valueT value = * valueP; char *where; @@ -2319,16 +2321,44 @@ md_apply_fix3 (fixS *fixP, valueT *value /* We still have to insert the value into memory! */ where = fixP->fx_frag->fr_literal + fixP->fx_where; - if (fixP->fx_r_type == BFD_RELOC_V850_LO16_SPLIT_OFFSET) - bfd_putl32 (((value << 16) & 0xfffe0000) - | ((value << 5) & 0x20) - | (bfd_getl32 (where) & ~0xfffe0020), where); - else if (fixP->fx_size == 1) - *where = value & 0xff; - else if (fixP->fx_size == 2) - bfd_putl16 (value & 0xffff, (unsigned char *) where); - else if (fixP->fx_size == 4) - bfd_putl32 (value, (unsigned char *) where); + if (fixP->tc_fix_data != NULL + && ((struct v850_operand *) fixP->tc_fix_data)->insert != NULL) + { + const char * message = NULL; + struct v850_operand * operand = (struct v850_operand *) fixP->tc_fix_data; + unsigned long insn; + + /* The variable "where" currently points at the exact point inside + the insn where we need to insert the value. But we need to + extract the entire insn so we probably need to move "where" + back a few bytes. */ + if (fixP->fx_size == 2) + where -= 2; + else if (fixP->fx_size == 1) + where -= 3; + + insn = bfd_getl32 ((unsigned char *) where); + + /* Use the operand's insertion procedure, if present, in order to + make sure that the value is correctly stored in the insn. */ + insn = operand->insert (insn, (offsetT) value, & message); + /* Ignore message even if it is set. */ + + bfd_putl32 ((bfd_vma) insn, (unsigned char *) where); + } + else + { + if (fixP->fx_r_type == BFD_RELOC_V850_LO16_SPLIT_OFFSET) + bfd_putl32 (((value << 16) & 0xfffe0000) + | ((value << 5) & 0x20) + | (bfd_getl32 (where) & ~0xfffe0020), where); + else if (fixP->fx_size == 1) + *where = value & 0xff; + else if (fixP->fx_size == 2) + bfd_putl16 (value & 0xffff, (unsigned char *) where); + else if (fixP->fx_size == 4) + bfd_putl32 (value, (unsigned char *) where); + } } } diff -uprN binutils-2.16.90.0.3/gas/config/tc-v850.h binutils-2.16.91.0.1/gas/config/tc-v850.h --- binutils-2.16.90.0.3/gas/config/tc-v850.h 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-v850.h 2005-06-22 13:53:35.038295343 -0700 @@ -44,7 +44,7 @@ extern bfd_boolean v850_fix_adjustable ( extern int v850_force_relocation (struct fix *); #ifdef OBJ_ELF -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 #endif @@ -78,3 +78,8 @@ extern void v850_handle_align (fragS *); extern long v850_pcrel_from_section (struct fix *, asection *); #define DWARF2_LINE_MIN_INSN_LENGTH 2 + +/* We need to record the operand involved when a pseudo-reloc is + processed so that the resulting value can be inserted correctly. */ +#define TC_FIX_TYPE void * +#define TC_INIT_FIX_DATA(fixP) (fixP)->tc_fix_data = NULL diff -uprN binutils-2.16.90.0.3/gas/config/tc-vax.c binutils-2.16.91.0.1/gas/config/tc-vax.c --- binutils-2.16.90.0.3/gas/config/tc-vax.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-vax.c 2005-06-22 13:53:35.040295013 -0700 @@ -316,7 +316,7 @@ md_number_to_chars (con, value, nbytes) that they reference. */ void /* Knows about order of bytes in address. */ -md_apply_fix3 (fixP, valueP, seg) +md_apply_fix (fixP, valueP, seg) fixS *fixP; valueT *valueP; segT seg ATTRIBUTE_UNUSED; diff -uprN binutils-2.16.90.0.3/gas/config/tc-vax.h binutils-2.16.91.0.1/gas/config/tc-vax.h --- binutils-2.16.90.0.3/gas/config/tc-vax.h 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-vax.h 2005-06-22 13:53:35.041294848 -0700 @@ -60,7 +60,7 @@ extern const struct relax_type md_relax_ #define TC_GENERIC_RELAX_TABLE md_relax_table #ifdef BFD_ASSEMBLER -/* Values passed to md_apply_fix3 don't include symbol values. */ +/* Values passed to md_apply_fix don't include symbol values. */ #define MD_APPLY_SYM_VALUE(FIX) 0 #define tc_fix_adjustable(FIX) \ diff -uprN binutils-2.16.90.0.3/gas/config/tc-w65.c binutils-2.16.91.0.1/gas/config/tc-w65.c --- binutils-2.16.90.0.3/gas/config/tc-w65.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-w65.c 2005-06-22 13:53:35.042294682 -0700 @@ -879,7 +879,7 @@ md_section_align (segT seg, valueT size) } void -md_apply_fix3 (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) +md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) { long val = * (long *) valP; char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; diff -uprN binutils-2.16.90.0.3/gas/config/tc-xstormy16.c binutils-2.16.91.0.1/gas/config/tc-xstormy16.c --- binutils-2.16.90.0.3/gas/config/tc-xstormy16.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-xstormy16.c 2005-06-22 13:53:35.042294682 -0700 @@ -433,11 +433,11 @@ xstormy16_fix_adjustable (fixS * fixP) return TRUE; } -/* This is a copy of gas_cgen_md_apply_fix3, with some enhancements to +/* This is a copy of gas_cgen_md_apply_fix, with some enhancements to do various things that would not be valid for all ports. */ void -xstormy16_md_apply_fix3 (fixS * fixP, +xstormy16_md_apply_fix (fixS * fixP, valueT * valueP, segT seg ATTRIBUTE_UNUSED) { diff -uprN binutils-2.16.90.0.3/gas/config/tc-xstormy16.h binutils-2.16.91.0.1/gas/config/tc-xstormy16.h --- binutils-2.16.90.0.3/gas/config/tc-xstormy16.h 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-xstormy16.h 2005-06-22 13:53:35.043294517 -0700 @@ -42,10 +42,10 @@ /* We don't need to handle .word strangely. */ #define WORKING_DOT_WORD -/* Values passed to md_apply_fix3 don't include the symbol value. */ +/* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 -#define md_apply_fix3 xstormy16_md_apply_fix3 +#define md_apply_fix xstormy16_md_apply_fix #define tc_fix_adjustable(FIX) xstormy16_fix_adjustable (FIX) extern bfd_boolean xstormy16_fix_adjustable (struct fix *); diff -uprN binutils-2.16.90.0.3/gas/config/tc-xtensa.c binutils-2.16.91.0.1/gas/config/tc-xtensa.c --- binutils-2.16.90.0.3/gas/config/tc-xtensa.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-xtensa.c 2005-06-22 13:53:35.050293361 -0700 @@ -2707,12 +2707,16 @@ xtensa_insnbuf_set_operand (xtensa_insnb if (xtensa_operand_is_PCrelative (xtensa_default_isa, opcode, operand) == 1) as_bad_where ((char *) file, line, - _("operand %u is out of range for '%s'"), value, - xtensa_opcode_name (xtensa_default_isa, opcode)); + _("operand %d of '%s' has out of range value '%u'"), + operand + 1, + xtensa_opcode_name (xtensa_default_isa, opcode), + value); else as_bad_where ((char *) file, line, - _("operand %u is invalid for '%s'"), value, - xtensa_opcode_name (xtensa_default_isa, opcode)); + _("operand %d of '%s' has invalid value '%u'"), + operand + 1, + xtensa_opcode_name (xtensa_default_isa, opcode), + value); return; } @@ -5542,7 +5546,7 @@ xtensa_fix_adjustable (fixS *fixP) void -md_apply_fix3 (fixS *fixP, valueT *valP, segT seg) +md_apply_fix (fixS *fixP, valueT *valP, segT seg) { char *const fixpos = fixP->fx_frag->fr_literal + fixP->fx_where; valueT val; @@ -5784,9 +5788,9 @@ new_resource_table (void *data, rt->opcode_unit_use = ouuf; rt->opcode_unit_stage = ousf; - rt->units = (char **) xcalloc (cycles, sizeof (char *)); + rt->units = (unsigned char **) xcalloc (cycles, sizeof (unsigned char *)); for (i = 0; i < cycles; i++) - rt->units[i] = (char *) xcalloc (nu, sizeof (char)); + rt->units[i] = (unsigned char *) xcalloc (nu, sizeof (unsigned char)); return rt; } @@ -5816,11 +5820,13 @@ resize_resource_table (resource_table *r old_cycles = rt->allocated_cycles; rt->allocated_cycles = cycles; - rt->units = xrealloc (rt->units, sizeof (char *) * rt->allocated_cycles); + rt->units = xrealloc (rt->units, + rt->allocated_cycles * sizeof (unsigned char *)); for (i = 0; i < old_cycles; i++) - rt->units[i] = xrealloc (rt->units[i], sizeof (char) * rt->num_units); + rt->units[i] = xrealloc (rt->units[i], + rt->num_units * sizeof (unsigned char)); for (i = old_cycles; i < cycles; i++) - rt->units[i] = xcalloc (rt->num_units, sizeof (char)); + rt->units[i] = xcalloc (rt->num_units, sizeof (unsigned char)); } @@ -5872,8 +5878,8 @@ release_resources (resource_table *rt, x { xtensa_funcUnit unit = (rt->opcode_unit_use) (rt->data, opcode, i); int stage = (rt->opcode_unit_stage) (rt->data, opcode, i); + assert (rt->units[stage + cycle][unit] > 0); rt->units[stage + cycle][unit]--; - assert (rt->units[stage + cycle][unit] >= 0); } } @@ -6789,7 +6795,7 @@ xg_assemble_vliw_tokens (vliw_insn *vins xtensa_insnbuf_to_chars (isa, vinsn->insnbuf, (unsigned char *) f, 0); - xtensa_dwarf2_emit_insn (insn_size - extra_space, &best_loc); + xtensa_dwarf2_emit_insn (insn_size + extra_space, &best_loc); for (slot = 0; slot < vinsn->num_slots; slot++) { @@ -7135,11 +7141,9 @@ xtensa_mark_zcl_first_insns (void) /* Of course, sometimes (mostly for toy test cases) a zero-cost loop instruction is the last in a section. */ if (targ_frag) - { - targ_frag->tc_frag_data.is_first_loop_insn = TRUE; - if (fragP->fr_subtype == RELAX_CHECK_ALIGN_NEXT_OPCODE) - frag_wane (fragP); - } + targ_frag->tc_frag_data.is_first_loop_insn = TRUE; + if (fragP->fr_subtype == RELAX_CHECK_ALIGN_NEXT_OPCODE) + frag_wane (fragP); } } } diff -uprN binutils-2.16.90.0.3/gas/config/tc-xtensa.h binutils-2.16.91.0.1/gas/config/tc-xtensa.h --- binutils-2.16.90.0.3/gas/config/tc-xtensa.h 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-xtensa.h 2005-06-22 13:53:35.051293196 -0700 @@ -418,7 +418,7 @@ typedef struct opcode_num_units_func opcode_num_units; opcode_funcUnit_use_unit_func opcode_unit_use; opcode_funcUnit_use_stage_func opcode_unit_stage; - char **units; + unsigned char **units; } resource_table; resource_table *new_resource_table diff -uprN binutils-2.16.90.0.3/gas/config/tc-z8k.c binutils-2.16.91.0.1/gas/config/tc-z8k.c --- binutils-2.16.90.0.3/gas/config/tc-z8k.c 2005-05-10 15:46:45.000000000 -0700 +++ binutils-2.16.91.0.1/gas/config/tc-z8k.c 2005-06-22 13:53:35.052293030 -0700 @@ -1410,7 +1410,7 @@ md_section_align (segT seg, valueT size) has been eliminated, set fix->fx_done. If fix->fx_addsy is non-NULL, we will have to generate a reloc entry. */ void -md_apply_fix3 (fixS *fixP, valueT *valP, segT segment ATTRIBUTE_UNUSED) +md_apply_fix (fixS *fixP, valueT *valP, segT segment ATTRIBUTE_UNUSED) { long val = * (long *) valP; char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; @@ -1517,7 +1517,7 @@ md_apply_fix3 (fixS *fixP, valueT *valP, break; default: - printf(_("md_apply_fix3: unknown r_type 0x%x\n"), fixP->fx_r_type); + printf(_("md_apply_fix: unknown r_type 0x%x\n"), fixP->fx_r_type); abort (); } diff -uprN binutils-2.16.90.0.3/gas/configure binutils-2.16.91.0.1/gas/configure --- binutils-2.16.90.0.3/gas/configure 2005-04-29 10:50:27.000000000 -0700 +++ binutils-2.16.91.0.1/gas/configure 2005-06-22 13:53:34.723347381 -0700 @@ -4688,6 +4688,10 @@ _ACEOF fi ;; + ms1) + using_cgen=yes + ;; + i386 | s390 | sparc) if test $this_target = $target ; then diff -uprN binutils-2.16.90.0.3/gas/configure.in binutils-2.16.91.0.1/gas/configure.in --- binutils-2.16.90.0.3/gas/configure.in 2005-04-29 10:50:27.000000000 -0700 +++ binutils-2.16.91.0.1/gas/configure.in 2005-06-22 13:53:34.724347216 -0700 @@ -317,6 +317,10 @@ changequote([,])dnl fi ;; + ms1) + using_cgen=yes + ;; + i386 | s390 | sparc) if test $this_target = $target ; then AC_DEFINE_UNQUOTED(DEFAULT_ARCH, "${arch}", [Default architecture.]) diff -uprN binutils-2.16.90.0.3/gas/configure.tgt binutils-2.16.91.0.1/gas/configure.tgt --- binutils-2.16.90.0.3/gas/configure.tgt 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/configure.tgt 2005-06-22 13:53:34.726346885 -0700 @@ -50,6 +50,7 @@ case ${cpu} in m683??) cpu_type=m68k ;; m5200) cpu_type=m68k ;; m8*) cpu_type=m88k ;; + ms1) cpu_type=ms1 endian=big ;; maxq) cpu_type=maxq ;; mips*el) cpu_type=mips endian=little ;; mips*) cpu_type=mips endian=big ;; diff -uprN binutils-2.16.90.0.3/gas/doc/c-alpha.texi binutils-2.16.91.0.1/gas/doc/c-alpha.texi --- binutils-2.16.90.0.3/gas/doc/c-alpha.texi 2005-04-09 12:03:10.000000000 -0700 +++ binutils-2.16.91.0.1/gas/doc/c-alpha.texi 2005-06-22 13:53:35.062291378 -0700 @@ -203,6 +203,12 @@ Used with a register branch format instr indicate that the literal is used for a call. During relaxation, the code may be altered to use a direct branch (e.g.@: @code{bsr}). +@item !lituse_jsrdirect!@var{N} +Similar to @code{lituse_jsr}, but also that this call cannot be vectored +through a PLT entry. This is useful for functions with special calling +conventions which do not allow the normal call-clobbered registers to be +clobbered. + @item !lituse_bytoff!@var{N} Used with a byte mask instruction (e.g.@: @code{extbl}) to indicate that only the low 3 bits of the address are relevant. During relaxation, diff -uprN binutils-2.16.90.0.3/gas/doc/c-ppc.texi binutils-2.16.91.0.1/gas/doc/c-ppc.texi --- binutils-2.16.90.0.3/gas/doc/c-ppc.texi 2005-04-09 12:03:11.000000000 -0700 +++ binutils-2.16.91.0.1/gas/doc/c-ppc.texi 2005-06-22 13:53:35.067290552 -0700 @@ -73,6 +73,9 @@ Generate code for processors with AltiVe @item -mpower4 Generate code for Power4 architecture. +@item -mpower5 +Generate code for Power5 architecture. + @item -mcom Generate code Power/PowerPC common instructions. diff -uprN binutils-2.16.90.0.3/gas/doc/internals.texi binutils-2.16.91.0.1/gas/doc/internals.texi --- binutils-2.16.90.0.3/gas/doc/internals.texi 2005-05-10 15:46:46.000000000 -0700 +++ binutils-2.16.91.0.1/gas/doc/internals.texi 2005-06-22 13:53:35.077288900 -0700 @@ -512,7 +512,7 @@ A number which is added into the fixup. @item fx_addnumber Some CPU backends use this field to convey information between -@code{md_apply_fix3} and @code{tc_gen_reloc}. The machine independent code does +@code{md_apply_fix} and @code{tc_gen_reloc}. The machine independent code does not use it. @item fx_next @@ -1250,7 +1250,7 @@ given section will be processed when the set. The macro is given the N_TYPE bits for the section in its @var{segT} argument. If the macro evaluates to a non-zero value then the fixups will be converted into relocs, otherwise they will -be passed to @var{md_apply_fix3} as normal. +be passed to @var{md_apply_fix} as normal. @item md_convert_frag @cindex md_convert_frag @@ -1277,11 +1277,11 @@ It may be used to change the fixup in @c the generic code sees it, or to fully process the fixup. In the latter case, a @code{goto @var{skip}} will bypass the generic code. -@item md_apply_fix3 (@var{fixP}, @var{valP}, @var{seg}) -@cindex md_apply_fix3 +@item md_apply_fix (@var{fixP}, @var{valP}, @var{seg}) +@cindex md_apply_fix GAS will call this for each fixup that passes the @code{TC_VALIDATE_FIX} test when @var{linkrelax} is not set. It should store the correct value in the -object file. @code{struct fix *@var{fixP}} is the fixup @code{md_apply_fix3} +object file. @code{struct fix *@var{fixP}} is the fixup @code{md_apply_fix} is operating on. @code{valueT *@var{valP}} is the value to store into the object files, or at least is the generic code's best guess. Specifically, *@var{valP} is the value of the fixup symbol, perhaps modified by @@ -1289,8 +1289,8 @@ object files, or at least is the generic less @code{MD_PCREL_FROM_SECTION} for pc-relative fixups. @code{segT @var{seg}} is the section the fix is in. @code{fixup_segment} performs a generic overflow check on *@var{valP} after -@code{md_apply_fix3} returns. If the overflow check is relevant for the target -machine, then @code{md_apply_fix3} should modify *@var{valP}, typically to the +@code{md_apply_fix} returns. If the overflow check is relevant for the target +machine, then @code{md_apply_fix} should modify *@var{valP}, typically to the value stored in the object file. @item TC_FORCE_RELOCATION (@var{fix}) @@ -1318,7 +1318,7 @@ returns non-zero, will emit relocs. This macro controls resolution of fixup expressions involving the difference of two symbols in the same section. If this macro returns zero, the subtrahend will be resolved and @code{fx_subsy} set to @code{NULL} for -@code{md_apply_fix3}. If undefined, the default of +@code{md_apply_fix}. If undefined, the default of @w{@code{! SEG_NORMAL (@var{seg}) || TC_FORCE_RELOCATION (@var{fix})}} will be used. @@ -1341,7 +1341,7 @@ This macro is evaluated for any fixup wi @item MD_APPLY_SYM_VALUE (@var{fix}) @cindex MD_APPLY_SYM_VALUE This macro controls whether the symbol value becomes part of the value passed -to @code{md_apply_fix3}. If the macro is undefined, or returns non-zero, the +to @code{md_apply_fix}. If the macro is undefined, or returns non-zero, the symbol value will be included. For ELF, a suitable definition might simply be @code{0}, because ELF relocations don't include the symbol value in the addend. diff -uprN binutils-2.16.90.0.3/gas/doc/Makefile.am binutils-2.16.91.0.1/gas/doc/Makefile.am --- binutils-2.16.90.0.3/gas/doc/Makefile.am 2005-05-10 15:46:46.000000000 -0700 +++ binutils-2.16.91.0.1/gas/doc/Makefile.am 2005-06-22 13:53:35.058292039 -0700 @@ -60,7 +60,8 @@ CPU_DOCS = \ gasver.texi: $(srcdir)/../../bfd/configure rm -f $@ - eval `grep '^ *VERSION=' $<`; echo "@set VERSION $$VERSION" > $@ + eval `grep '^ *VERSION=' $(srcdir)/../../bfd/configure`; \ + echo "@set VERSION $$VERSION" > $@ $(srcdir)/as.info: $(srcdir)/as.texinfo asconfig.texi gasver.texi $(CPU_DOCS) as.dvi: $(srcdir)/as.texinfo asconfig.texi gasver.texi $(CPU_DOCS) diff -uprN binutils-2.16.90.0.3/gas/doc/Makefile.in binutils-2.16.91.0.1/gas/doc/Makefile.in --- binutils-2.16.90.0.3/gas/doc/Makefile.in 2005-05-10 15:46:46.000000000 -0700 +++ binutils-2.16.91.0.1/gas/doc/Makefile.in 2005-06-22 13:53:35.058292039 -0700 @@ -582,7 +582,8 @@ asconfig.texi: $(CONFIG).texi gasver.texi: $(srcdir)/../../bfd/configure rm -f $@ - eval `grep '^ *VERSION=' $<`; echo "@set VERSION $$VERSION" > $@ + eval `grep '^ *VERSION=' $(srcdir)/../../bfd/configure`; \ + echo "@set VERSION $$VERSION" > $@ $(srcdir)/as.info: $(srcdir)/as.texinfo asconfig.texi gasver.texi $(CPU_DOCS) as.dvi: $(srcdir)/as.texinfo asconfig.texi gasver.texi $(CPU_DOCS) diff -uprN binutils-2.16.90.0.3/gas/frags.c binutils-2.16.91.0.1/gas/frags.c --- binutils-2.16.90.0.3/gas/frags.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/frags.c 2005-06-22 13:53:34.730346224 -0700 @@ -91,7 +91,14 @@ frag_grow (unsigned int nchars) frag_wane (frag_now); frag_new (0); oldc = frchain_now->frch_obstack.chunk_size; - frchain_now->frch_obstack.chunk_size = 2 * nchars + SIZEOF_STRUCT_FRAG; + /* Try to allocate a bit more than needed right now. But don't do + this if we would waste too much memory. Especially necessary + for extremely big (like 2GB initialized) frags. */ + if (nchars < 0x10000) + frchain_now->frch_obstack.chunk_size = 2 * nchars; + else + frchain_now->frch_obstack.chunk_size = nchars + 0x10000; + frchain_now->frch_obstack.chunk_size += SIZEOF_STRUCT_FRAG; if (frchain_now->frch_obstack.chunk_size > 0) while ((n = obstack_room (&frchain_now->frch_obstack)) < nchars && (unsigned long) frchain_now->frch_obstack.chunk_size > nchars) diff -uprN binutils-2.16.90.0.3/gas/hash.c binutils-2.16.91.0.1/gas/hash.c --- binutils-2.16.90.0.3/gas/hash.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/hash.c 2005-06-22 13:53:34.735345398 -0700 @@ -150,19 +150,13 @@ hash_die (struct hash_control *table) Each time we look up a string, we move it to the start of the list for its hash code, to take advantage of referential locality. */ -static struct hash_entry *hash_lookup (struct hash_control *, - const char *, - struct hash_entry ***, - unsigned long *); - static struct hash_entry * -hash_lookup (struct hash_control *table, const char *key, +hash_lookup (struct hash_control *table, const char *key, size_t len, struct hash_entry ***plist, unsigned long *phash) { - register unsigned long hash; - unsigned int len; - register const unsigned char *s; - register unsigned int c; + unsigned long hash; + size_t n; + unsigned int c; unsigned int index; struct hash_entry **list; struct hash_entry *p; @@ -173,13 +167,11 @@ hash_lookup (struct hash_control *table, #endif hash = 0; - len = 0; - s = (const unsigned char *) key; - while ((c = *s++) != '\0') + for (n = 0; n < len; n++) { + c = key[n]; hash += c + (c << 17); hash ^= hash >> 2; - ++len; } hash += len + (len << 17); hash ^= hash >> 2; @@ -206,7 +198,7 @@ hash_lookup (struct hash_control *table, ++table->string_compares; #endif - if (strcmp (p->string, key) == 0) + if (strncmp (p->string, key, len) == 0 && p->string[len] == '\0') { if (prev != NULL) { @@ -237,7 +229,7 @@ hash_insert (struct hash_control *table, struct hash_entry **list; unsigned long hash; - p = hash_lookup (table, key, &list, &hash); + p = hash_lookup (table, key, strlen (key), &list, &hash); if (p != NULL) return "exists"; @@ -267,7 +259,7 @@ hash_jam (struct hash_control *table, co struct hash_entry **list; unsigned long hash; - p = hash_lookup (table, key, &list, &hash); + p = hash_lookup (table, key, strlen (key), &list, &hash); if (p != NULL) { #ifdef HASH_STATISTICS @@ -304,7 +296,7 @@ hash_replace (struct hash_control *table struct hash_entry *p; PTR ret; - p = hash_lookup (table, key, NULL, NULL); + p = hash_lookup (table, key, strlen (key), NULL, NULL); if (p == NULL) return NULL; @@ -327,7 +319,22 @@ hash_find (struct hash_control *table, c { struct hash_entry *p; - p = hash_lookup (table, key, NULL, NULL); + p = hash_lookup (table, key, strlen (key), NULL, NULL); + if (p == NULL) + return NULL; + + return p->data; +} + +/* As hash_find, but KEY is of length LEN and is not guaranteed to be + NUL-terminated. */ + +PTR +hash_find_n (struct hash_control *table, const char *key, size_t len) +{ + struct hash_entry *p; + + p = hash_lookup (table, key, len, NULL, NULL); if (p == NULL) return NULL; @@ -343,7 +350,7 @@ hash_delete (struct hash_control *table, struct hash_entry *p; struct hash_entry **list; - p = hash_lookup (table, key, &list, NULL); + p = hash_lookup (table, key, strlen (key), &list, NULL); if (p == NULL) return NULL; diff -uprN binutils-2.16.90.0.3/gas/hash.h binutils-2.16.91.0.1/gas/hash.h --- binutils-2.16.90.0.3/gas/hash.h 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/hash.h 2005-06-22 13:53:34.736345233 -0700 @@ -63,6 +63,11 @@ extern PTR hash_replace (struct hash_con extern PTR hash_find (struct hash_control *, const char *key); +/* As hash_find, but KEY is of length LEN and is not guaranteed to be + NUL-terminated. */ + +extern PTR hash_find_n (struct hash_control *, const char *key, size_t len); + /* Delete an entry from a hash table. This returns the value stored for that entry, or NULL if there is no such entry. */ diff -uprN binutils-2.16.90.0.3/gas/input-scrub.c binutils-2.16.91.0.1/gas/input-scrub.c --- binutils-2.16.90.0.3/gas/input-scrub.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/input-scrub.c 2005-06-22 13:53:34.745343746 -0700 @@ -279,7 +279,7 @@ input_scrub_include_sb (sb *from, char * /* Add the sentinel required by read.c. */ sb_add_char (&from_sb, '\n'); } - sb_add_sb (&from_sb, from); + sb_scrub_and_add_sb (&from_sb, from); sb_index = 1; /* These variables are reset by input_scrub_push. Restore them diff -uprN binutils-2.16.90.0.3/gas/Makefile.am binutils-2.16.91.0.1/gas/Makefile.am --- binutils-2.16.90.0.3/gas/Makefile.am 2005-04-29 10:50:27.000000000 -0700 +++ binutils-2.16.91.0.1/gas/Makefile.am 2005-06-22 13:53:34.701351015 -0700 @@ -456,7 +456,7 @@ OBJS = $(CONFIG_OBJS) $(GENERIC_OBJS) POTFILES = $(MULTI_CFILES) $(TARGET_ENV_HFILES) $(OBJ_FORMAT_HFILES) \ $(OBJ_FORMAT_CFILES) $(TARGET_CPU_HFILES) $(TARGET_CPU_CFILES) \ - $(HFILES) $(CFILES) $(GAS_CFILES) + $(HFILES) $(CFILES) po/POTFILES.in: @MAINT@ Makefile for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \ && mv tmp $(srcdir)/po/POTFILES.in @@ -475,6 +475,7 @@ stamp-mk.com: vmsconf.sh Makefile EXTRA_DIST = make-gas.com m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c diststuff: $(EXTRA_DIST) info +all: info DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-desc.h @@ -635,7 +636,7 @@ m68k-parse.c: $(srcdir)/config/m68k-pars cp config/m68k-parse.y . >/dev/null 2>/dev/null; \ f=m68k-parse.y; \ else true; fi; \ - $(SHELL) $(YLWRAP) "$(YACC)" $$f y.tab.c m68k-parse.c --; \ + $(SHELL) $(YLWRAP) $$f y.tab.c m68k-parse.c -- $(YACCCOMPILE); \ if [ $$f = "m68k-parse.y" ]; then \ rm -f m68k-parse.y; \ else true; fi @@ -661,7 +662,7 @@ itbl-parse.o: itbl-parse.c itbl-parse.h itbl-ops.o: $(srcdir)/itbl-ops.c $(srcdir)/itbl-ops.h itbl-parse.h itbl-parse.c itbl-parse.h: $(srcdir)/itbl-parse.y - $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/itbl-parse.y y.tab.c itbl-parse.c y.tab.h itbl-parse.h -- -d + $(SHELL) $(YLWRAP) $(srcdir)/itbl-parse.y y.tab.c itbl-parse.c y.tab.h itbl-parse.h -- $(YACCCOMPILE) -d # stand-alone itbl assembler & disassembler @@ -2439,7 +2440,7 @@ BMKDEP = #DO NOT PUT ANYTHING BETWEEN TH #MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW. app.o: app.c $(INCDIR)/symcat.h as.o: as.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ - output-file.h sb.h macro.h dwarf2dbg.h dw2gencfi.h hash.h \ + output-file.h sb.h macro.h dwarf2dbg.h dw2gencfi.h \ $(INCDIR)/elf/dwarf2.h $(BFDVER_H) atof-generic.o: atof-generic.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h cond.o: cond.c $(INCDIR)/symcat.h macro.h sb.h $(INCDIR)/obstack.h @@ -2474,7 +2475,7 @@ output-file.o: output-file.c $(INCDIR)/s read.o: read.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h sb.h macro.h ecoff.h \ dw2gencfi.h $(INCDIR)/elf/dwarf2.h -sb.o: sb.c sb.h +sb.o: sb.c sb.h $(INCDIR)/symcat.h stabs.o: stabs.c $(INCDIR)/symcat.h $(INCDIR)/obstack.h \ subsegs.h ecoff.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def subsegs.o: subsegs.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h diff -uprN binutils-2.16.90.0.3/gas/Makefile.in binutils-2.16.91.0.1/gas/Makefile.in --- binutils-2.16.90.0.3/gas/Makefile.in 2005-04-29 10:50:27.000000000 -0700 +++ binutils-2.16.91.0.1/gas/Makefile.in 2005-06-22 13:53:34.704350519 -0700 @@ -682,7 +682,7 @@ GENERIC_OBJS = \ OBJS = $(CONFIG_OBJS) $(GENERIC_OBJS) POTFILES = $(MULTI_CFILES) $(TARGET_ENV_HFILES) $(OBJ_FORMAT_HFILES) \ $(OBJ_FORMAT_CFILES) $(TARGET_CPU_HFILES) $(TARGET_CPU_CFILES) \ - $(HFILES) $(CFILES) $(GAS_CFILES) + $(HFILES) $(CFILES) noinst_SCRIPTS = $(GDBINIT) EXTRA_SCRIPTS = .gdbinit @@ -2941,6 +2941,7 @@ stamp-mk.com: vmsconf.sh Makefile $(SHELL) $(srcdir)/../move-if-change new-make.com $(srcdir)/make-gas.com touch stamp-mk.com diststuff: $(EXTRA_DIST) info +all: info $(OBJS): @ALL_OBJ_DEPS@ @@ -3048,7 +3049,7 @@ m68k-parse.c: $(srcdir)/config/m68k-pars cp config/m68k-parse.y . >/dev/null 2>/dev/null; \ f=m68k-parse.y; \ else true; fi; \ - $(SHELL) $(YLWRAP) "$(YACC)" $$f y.tab.c m68k-parse.c --; \ + $(SHELL) $(YLWRAP) $$f y.tab.c m68k-parse.c -- $(YACCCOMPILE); \ if [ $$f = "m68k-parse.y" ]; then \ rm -f m68k-parse.y; \ else true; fi @@ -3074,7 +3075,7 @@ itbl-parse.o: itbl-parse.c itbl-parse.h itbl-ops.o: $(srcdir)/itbl-ops.c $(srcdir)/itbl-ops.h itbl-parse.h itbl-parse.c itbl-parse.h: $(srcdir)/itbl-parse.y - $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/itbl-parse.y y.tab.c itbl-parse.c y.tab.h itbl-parse.h -- -d + $(SHELL) $(YLWRAP) $(srcdir)/itbl-parse.y y.tab.c itbl-parse.c y.tab.h itbl-parse.h -- $(YACCCOMPILE) -d itbl-tops.o: $(srcdir)/itbl-ops.c $(srcdir)/itbl-ops.h itbl-parse.h $(COMPILE) -o itbl-tops.o -DSTAND_ALONE -c $(srcdir)/itbl-ops.c @@ -3368,7 +3369,7 @@ dep-am: DEP #MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW. app.o: app.c $(INCDIR)/symcat.h as.o: as.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ - output-file.h sb.h macro.h dwarf2dbg.h dw2gencfi.h hash.h \ + output-file.h sb.h macro.h dwarf2dbg.h dw2gencfi.h \ $(INCDIR)/elf/dwarf2.h $(BFDVER_H) atof-generic.o: atof-generic.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h cond.o: cond.c $(INCDIR)/symcat.h macro.h sb.h $(INCDIR)/obstack.h @@ -3403,7 +3404,7 @@ output-file.o: output-file.c $(INCDIR)/s read.o: read.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h sb.h macro.h ecoff.h \ dw2gencfi.h $(INCDIR)/elf/dwarf2.h -sb.o: sb.c sb.h +sb.o: sb.c sb.h $(INCDIR)/symcat.h stabs.o: stabs.c $(INCDIR)/symcat.h $(INCDIR)/obstack.h \ subsegs.h ecoff.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def subsegs.o: subsegs.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h diff -uprN binutils-2.16.90.0.3/gas/po/gas.pot binutils-2.16.91.0.1/gas/po/gas.pot --- binutils-2.16.90.0.3/gas/po/gas.pot 2005-04-09 12:03:12.000000000 -0700 +++ binutils-2.16.91.0.1/gas/po/gas.pot 2005-06-22 13:53:35.101284936 -0700 @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-03-05 20:33+1030\n" +"POT-Creation-Date: 2005-06-06 14:11-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -57,31 +57,31 @@ msgstr "" msgid "end of file in comment; newline inserted" msgstr "" -#: as.c:165 +#: as.c:166 msgid "missing emulation mode name" msgstr "" -#: as.c:180 +#: as.c:181 #, c-format msgid "unrecognized emulation name `%s'" msgstr "" -#: as.c:228 +#: as.c:229 #, c-format msgid "GNU assembler version %s (%s) using BFD version %s" msgstr "" -#: as.c:231 +#: as.c:232 #, c-format msgid "GNU assembler version %s (%s)" msgstr "" -#: as.c:239 +#: as.c:240 #, c-format msgid "Usage: %s [option...] [asmfile...]\n" msgstr "" -#: as.c:241 +#: as.c:242 #, c-format msgid "" "Options:\n" @@ -97,163 +97,176 @@ msgid "" " \t =FILE list to FILE (must be last sub-option)\n" msgstr "" -#: as.c:254 +#: as.c:255 #, c-format msgid " --alternate initially turn on alternate macro syntax\n" msgstr "" -#: as.c:256 +#: as.c:257 #, c-format msgid " -D produce assembler debugging messages\n" msgstr "" -#: as.c:258 +#: as.c:259 #, c-format msgid " --defsym SYM=VAL define symbol SYM to given value\n" msgstr "" -#: as.c:274 +#: as.c:275 #, c-format msgid " emulate output (default %s)\n" msgstr "" -#: as.c:279 +#: as.c:280 #, c-format msgid " --execstack require executable stack for this object\n" msgstr "" -#: as.c:281 +#: as.c:282 #, c-format msgid "" " --noexecstack don't require executable stack for this object\n" msgstr "" -#: as.c:284 +#: as.c:285 #, c-format msgid " -f skip whitespace and comment preprocessing\n" msgstr "" -#: as.c:286 +#: as.c:287 #, c-format msgid " -g --gen-debug generate debugging information\n" msgstr "" -#: as.c:288 +#: as.c:289 #, c-format msgid " --gstabs generate STABS debugging information\n" msgstr "" -#: as.c:290 +#: as.c:291 #, c-format msgid "" " --gstabs+ generate STABS debug info with GNU extensions\n" msgstr "" -#: as.c:292 +#: as.c:293 #, c-format msgid " --gdwarf-2 generate DWARF2 debugging information\n" msgstr "" -#: as.c:294 +#: as.c:295 +#, c-format +msgid " --hash-size= set the hash table size close to \n" +msgstr "" + +#: as.c:297 #, c-format msgid " --help show this message and exit\n" msgstr "" -#: as.c:296 +#: as.c:299 #, c-format msgid " --target-help show target specific options\n" msgstr "" -#: as.c:298 +#: as.c:301 #, c-format msgid "" " -I DIR add DIR to search list for .include directives\n" msgstr "" -#: as.c:300 +#: as.c:303 #, c-format msgid " -J don't warn about signed overflow\n" msgstr "" -#: as.c:302 +#: as.c:305 #, c-format msgid "" " -K warn when differences altered for long " "displacements\n" msgstr "" -#: as.c:304 +#: as.c:307 #, c-format msgid " -L,--keep-locals keep local symbols (e.g. starting with `L')\n" msgstr "" -#: as.c:306 +#: as.c:309 #, c-format msgid " -M,--mri assemble in MRI compatibility mode\n" msgstr "" -#: as.c:308 +#: as.c:311 #, c-format msgid "" " --MD FILE write dependency information in FILE (default " "none)\n" msgstr "" -#: as.c:310 +#: as.c:313 #, c-format msgid " -nocpp ignored\n" msgstr "" -#: as.c:312 +#: as.c:315 #, c-format msgid "" " -o OBJFILE name the object-file output OBJFILE (default a." "out)\n" msgstr "" -#: as.c:314 +#: as.c:317 #, c-format msgid " -R fold data section into text section\n" msgstr "" -#: as.c:316 +#: as.c:319 +#, c-format +msgid "" +" --reduce-memory-overheads \n" +" prefer smaller memory use at the cost of longer\n" +" assembly times\n" +msgstr "" + +#: as.c:323 #, c-format msgid "" " --statistics print various measured statistics from execution\n" msgstr "" -#: as.c:318 +#: as.c:325 #, c-format msgid " --strip-local-absolute strip local absolute symbols\n" msgstr "" -#: as.c:320 +#: as.c:327 #, c-format msgid "" " --traditional-format Use same format as native assembler when possible\n" msgstr "" -#: as.c:322 +#: as.c:329 #, c-format msgid " --version print assembler version number and exit\n" msgstr "" -#: as.c:324 +#: as.c:331 #, c-format msgid " -W --no-warn suppress warnings\n" msgstr "" -#: as.c:326 +#: as.c:333 #, c-format msgid " --warn don't suppress warnings\n" msgstr "" -#: as.c:328 +#: as.c:335 #, c-format msgid " --fatal-warnings treat warnings as errors\n" msgstr "" -#: as.c:330 +#: as.c:337 #, c-format msgid "" " --itbl INSTTBL extend instruction set to include instructions\n" @@ -261,22 +274,22 @@ msgid "" "INSTTBL\n" msgstr "" -#: as.c:333 +#: as.c:340 #, c-format msgid " -w ignored\n" msgstr "" -#: as.c:335 +#: as.c:342 #, c-format msgid " -X ignored\n" msgstr "" -#: as.c:337 +#: as.c:344 #, c-format msgid " -Z generate object file even after errors\n" msgstr "" -#: as.c:339 +#: as.c:346 #, c-format msgid "" " --listing-lhs-width set the width in words of the output data column " @@ -284,7 +297,7 @@ msgid "" " the listing\n" msgstr "" -#: as.c:342 +#: as.c:349 #, c-format msgid "" " --listing-lhs-width2 set the width in words of the continuation lines\n" @@ -293,119 +306,123 @@ msgid "" " the width of the first line\n" msgstr "" -#: as.c:346 +#: as.c:353 #, c-format msgid "" " --listing-rhs-width set the max width in characters of the lines from\n" " the source file\n" msgstr "" -#: as.c:349 +#: as.c:356 #, c-format msgid "" " --listing-cont-lines set the maximum number of continuation lines used\n" " for the output data column of the listing\n" msgstr "" -#: as.c:356 +#: as.c:363 #, c-format msgid "Report bugs to %s\n" msgstr "" -#: as.c:549 +#: as.c:560 #, c-format msgid "unrecognized option -%c%s" msgstr "" -#: as.c:588 as.c:590 +#: as.c:599 as.c:601 #, c-format msgid "GNU assembler %s\n" msgstr "" -#: as.c:592 +#: as.c:603 #, c-format msgid "Copyright 2005 Free Software Foundation, Inc.\n" msgstr "" -#: as.c:593 +#: as.c:604 #, c-format msgid "" "This program is free software; you may redistribute it under the terms of\n" "the GNU General Public License. This program has absolutely no warranty.\n" msgstr "" -#: as.c:596 +#: as.c:607 #, c-format msgid "This assembler was configured for a target of `%s'.\n" msgstr "" -#: as.c:603 +#: as.c:614 msgid "multiple emulation names specified" msgstr "" -#: as.c:605 +#: as.c:616 msgid "emulations not handled in this configuration" msgstr "" -#: as.c:610 +#: as.c:621 #, c-format msgid "alias = %s\n" msgstr "" -#: as.c:611 +#: as.c:622 #, c-format msgid "canonical = %s\n" msgstr "" -#: as.c:612 +#: as.c:623 #, c-format msgid "cpu-type = %s\n" msgstr "" -#: as.c:614 +#: as.c:625 #, c-format msgid "format = %s\n" msgstr "" -#: as.c:617 +#: as.c:628 #, c-format msgid "bfd-target = %s\n" msgstr "" -#: as.c:630 +#: as.c:641 msgid "bad defsym; format is --defsym name=value" msgstr "" -#: as.c:654 +#: as.c:665 msgid "no file name following -t option" msgstr "" -#: as.c:669 +#: as.c:680 #, c-format msgid "failed to read instruction table %s\n" msgstr "" -#: as.c:830 +#: as.c:841 #, c-format msgid "invalid listing option `%c'" msgstr "" -#: as.c:890 +#: as.c:894 +msgid "--hash-size needs a numeric argument" +msgstr "" + +#: as.c:919 #, c-format msgid "%s: total time in assembly: %ld.%06ld\n" msgstr "" -#: as.c:893 +#: as.c:922 #, c-format msgid "%s: data size %ld\n" msgstr "" -#: as.c:1202 +#: as.c:1233 #, c-format msgid "%d warnings, treating warnings as errors" msgstr "" -#: as.h:199 +#: as.h:202 #, c-format msgid "Case value %ld unexpected at line %d of file \"%s\"\n" msgstr "" @@ -414,7 +431,7 @@ msgstr "" #. * We have a GROSS internal error. #. * This should never happen. #. -#: atof-generic.c:419 config/tc-m68k.c:3160 +#: atof-generic.c:419 config/tc-m68k.c:3170 msgid "failed sanity check" msgstr "" @@ -426,429 +443,437 @@ msgstr "" msgid "non-constant expression in \".if\" statement" msgstr "" -#: cond.c:242 +#: cond.c:276 msgid "bad format for ifc or ifnc" msgstr "" -#: cond.c:272 +#: cond.c:306 msgid "\".elseif\" without matching \".if\"" msgstr "" -#: cond.c:276 +#: cond.c:310 msgid "\".elseif\" after \".else\"" msgstr "" -#: cond.c:279 cond.c:385 +#: cond.c:313 cond.c:419 msgid "here is the previous \"else\"" msgstr "" -#: cond.c:282 cond.c:388 +#: cond.c:316 cond.c:422 msgid "here is the previous \"if\"" msgstr "" -#: cond.c:311 +#: cond.c:345 msgid "non-constant expression in \".elseif\" statement" msgstr "" -#: cond.c:349 +#: cond.c:383 msgid "\".endif\" without \".if\"" msgstr "" -#: cond.c:378 +#: cond.c:412 msgid "\".else\" without matching \".if\"" msgstr "" -#: cond.c:382 +#: cond.c:416 msgid "duplicate \"else\"" msgstr "" -#: cond.c:433 +#: cond.c:467 msgid ".ifeqs syntax error" msgstr "" -#: cond.c:514 +#: cond.c:548 msgid "end of macro inside conditional" msgstr "" -#: cond.c:516 +#: cond.c:550 msgid "end of file inside conditional" msgstr "" -#: cond.c:519 +#: cond.c:553 msgid "here is the start of the unterminated conditional" msgstr "" -#: cond.c:523 +#: cond.c:557 msgid "here is the \"else\" of the unterminated conditional" msgstr "" -#: config/obj-aout.c:162 +#: config/obj-aout.c:126 #, c-format msgid "Attempt to put a common symbol into set %s" msgstr "" -#: config/obj-aout.c:166 +#: config/obj-aout.c:130 #, c-format msgid "Attempt to put an undefined symbol into set %s" msgstr "" -#: config/obj-aout.c:197 config/obj-coff.c:1415 +#: config/obj-aout.c:157 config/obj-coff.c:1314 #, c-format msgid "Symbol `%s' can not be both weak and common" msgstr "" -#: config/obj-aout.c:255 config/obj-coff.c:2156 +#: config/obj-aout.c:207 config/obj-coff.c:2006 msgid "unresolved relocation" msgstr "" -#: config/obj-aout.c:257 config/obj-coff.c:2158 +#: config/obj-aout.c:209 config/obj-coff.c:2008 #, c-format msgid "bad relocation: symbol `%s' not in symbol table" msgstr "" -#: config/obj-aout.c:353 +#: config/obj-aout.c:299 #, c-format msgid "%s: bad type for weak symbol" msgstr "" -#: config/obj-aout.c:459 config/obj-coff.c:3076 write.c:1904 +#: config/obj-aout.c:401 config/obj-coff.c:2946 write.c:1903 #, c-format msgid "%s: global symbols not supported in common sections" msgstr "" -#: config/obj-aout.c:529 +#. This warning should never get triggered any more. +#. Well, maybe if you're doing twisted things with +#. register names... +#: config/obj-aout.c:470 #, c-format msgid "Local symbol %s never defined." msgstr "" -#: config/obj-bout.c:312 config/obj-vms.c:449 +#: config/obj-bout.c:276 #, c-format msgid "Local symbol %s never defined" msgstr "" -#: config/obj-coff.c:165 +#: config/obj-coff.c:133 #, c-format msgid "Inserting \"%s\" into structure table failed: %s" msgstr "" #. Zero is used as an end marker in the file. -#: config/obj-coff.c:426 +#: config/obj-coff.c:358 msgid "Line numbers must be positive integers\n" msgstr "" #. Wrong context. -#: config/obj-coff.c:460 config/obj-coff.c:2501 +#: config/obj-coff.c:390 config/obj-coff.c:2375 msgid ".ln pseudo-op inside .def/.endef: ignored." msgstr "" -#: config/obj-coff.c:503 ecoff.c:3240 +#: config/obj-coff.c:432 ecoff.c:3240 msgid ".loc outside of .text" msgstr "" -#: config/obj-coff.c:510 +#: config/obj-coff.c:439 msgid ".loc pseudo-op inside .def/.endef: ignored." msgstr "" -#: config/obj-coff.c:598 config/obj-coff.c:2553 +#: config/obj-coff.c:520 config/obj-coff.c:2425 msgid ".def pseudo-op used inside of .def/.endef: ignored." msgstr "" -#: config/obj-coff.c:644 config/obj-coff.c:2605 +#: config/obj-coff.c:559 config/obj-coff.c:2488 msgid ".endef pseudo-op used outside of .def/.endef: ignored." msgstr "" -#: config/obj-coff.c:682 +#: config/obj-coff.c:598 #, c-format msgid "`%s' symbol without preceding function" msgstr "" -#: config/obj-coff.c:769 config/obj-coff.c:2685 +#: config/obj-coff.c:685 config/obj-coff.c:2568 #, c-format msgid "unexpected storage class %d" msgstr "" -#: config/obj-coff.c:882 config/obj-coff.c:2792 +#: config/obj-coff.c:794 config/obj-coff.c:2670 msgid ".dim pseudo-op used outside of .def/.endef: ignored." msgstr "" -#: config/obj-coff.c:902 config/obj-coff.c:2812 +#: config/obj-coff.c:814 config/obj-coff.c:2690 msgid "badly formed .dim directive ignored" msgstr "" -#: config/obj-coff.c:953 config/obj-coff.c:2869 +#: config/obj-coff.c:863 config/obj-coff.c:2745 msgid ".size pseudo-op used outside of .def/.endef ignored." msgstr "" -#: config/obj-coff.c:969 config/obj-coff.c:2885 +#: config/obj-coff.c:878 config/obj-coff.c:2760 msgid ".scl pseudo-op used outside of .def/.endef ignored." msgstr "" -#: config/obj-coff.c:987 config/obj-coff.c:2903 +#: config/obj-coff.c:895 config/obj-coff.c:2777 msgid ".tag pseudo-op used outside of .def/.endef ignored." msgstr "" -#: config/obj-coff.c:1006 config/obj-coff.c:2920 +#: config/obj-coff.c:913 config/obj-coff.c:2794 #, c-format msgid "tag not found for .tag %s" msgstr "" -#: config/obj-coff.c:1021 config/obj-coff.c:2934 +#: config/obj-coff.c:926 config/obj-coff.c:2807 msgid ".type pseudo-op used outside of .def/.endef ignored." msgstr "" -#: config/obj-coff.c:1043 config/obj-coff.c:2954 +#: config/obj-coff.c:945 config/obj-coff.c:2826 msgid ".val pseudo-op used outside of .def/.endef ignored." msgstr "" -#: config/obj-coff.c:1180 +#: config/obj-coff.c:1082 msgid "badly formed .weak directive ignored" msgstr "" -#: config/obj-coff.c:1372 config/obj-coff.c:3147 +#: config/obj-coff.c:1272 config/obj-coff.c:3015 msgid "mismatched .eb" msgstr "" -#: config/obj-coff.c:1393 config/obj-coff.c:3178 -msgid "C_EFCN symbol out of scope" +#: config/obj-coff.c:1293 +#, c-format +msgid "C_EFCN symbol for %s out of scope" msgstr "" #. STYP_INFO #. STYP_LIB #. STYP_OVER -#: config/obj-coff.c:1621 +#: config/obj-coff.c:1519 #, c-format msgid "unsupported section attribute '%c'" msgstr "" -#: config/obj-coff.c:1626 config/obj-coff.c:3874 config/tc-ppc.c:4595 +#: config/obj-coff.c:1524 config/obj-coff.c:4281 config/tc-ppc.c:4605 #, c-format msgid "unknown section attribute '%c'" msgstr "" -#: config/obj-coff.c:1656 config/tc-ppc.c:4613 config/tc-tic54x.c:4306 -#: read.c:2545 +#: config/obj-coff.c:1554 config/tc-ppc.c:4623 config/tc-tic54x.c:4287 +#: read.c:2551 #, c-format msgid "error setting flags for \"%s\": %s" msgstr "" -#: config/obj-coff.c:1667 +#: config/obj-coff.c:1565 #, c-format msgid "Ignoring changed section attributes for %s" msgstr "" -#: config/obj-coff.c:1803 +#: config/obj-coff.c:1696 #, c-format msgid "0x%lx: \"%s\" type = %ld, class = %d, segment = %d\n" msgstr "" -#: config/obj-coff.c:1983 config/obj-ieee.c:69 +#: config/obj-coff.c:1840 config/obj-ieee.c:69 #, c-format msgid "Out of step\n" msgstr "" -#: config/obj-coff.c:2420 +#: config/obj-coff.c:2269 msgid "bfd_coff_swap_scnhdr_out failed" msgstr "" -#: config/obj-coff.c:2641 +#: config/obj-coff.c:2524 #, c-format msgid "`.bf' symbol without preceding function\n" msgstr "" -#: config/obj-coff.c:3581 config/obj-ieee.c:511 -#, c-format -msgid "FATAL: Can't create %s" -msgstr "" - -#: config/obj-coff.c:3784 -#, c-format -msgid "Too many new sections; can't add \"%s\"" +#: config/obj-coff.c:3047 +msgid "C_EFCN symbol out of scope" msgstr "" -#: config/obj-coff.c:4247 config/tc-i960.c:3222 +#: config/obj-coff.c:3608 config/tc-i960.c:2834 #, c-format msgid "No 'bal' entry point for leafproc %s" msgstr "" -#: config/obj-coff.c:4323 +#: config/obj-coff.c:3684 #, c-format msgid "Negative of non-absolute symbol %s" msgstr "" -#: config/obj-coff.c:4343 +#: config/obj-coff.c:3704 msgid "callj to difference of 2 symbols" msgstr "" -#: config/obj-coff.c:4383 +#: config/obj-coff.c:3744 #, c-format msgid "Can't emit reloc {- %s-seg symbol \"%s\"} @ file address %ld." msgstr "" -#: config/obj-coff.c:4469 config/tc-i960.c:2849 +#: config/obj-coff.c:3831 config/tc-i960.c:2478 msgid "can't use COBR format with external label" msgstr "" -#: config/obj-coff.c:4542 +#: config/obj-coff.c:3904 #, c-format msgid "Value of %ld too large for field of %d bytes at 0x%lx" msgstr "" -#: config/obj-coff.c:4556 +#: config/obj-coff.c:3918 #, c-format msgid "Signed .word overflow; switch may be too large; %ld at 0x%lx" msgstr "" -#: config/obj-ecoff.c:192 +#: config/obj-coff.c:3989 config/obj-ieee.c:511 +#, c-format +msgid "FATAL: Can't create %s" +msgstr "" + +#: config/obj-coff.c:4192 +#, c-format +msgid "Too many new sections; can't add \"%s\"" +msgstr "" + +#: config/obj-ecoff.c:125 msgid "Can't set GP value" msgstr "" -#: config/obj-ecoff.c:199 +#: config/obj-ecoff.c:132 msgid "Can't set register masks" msgstr "" -#: config/obj-elf.c:307 config/tc-sparc.c:3976 config/tc-v850.c:461 +#: config/obj-elf.c:310 config/tc-sparc.c:3978 config/tc-v850.c:451 #, c-format msgid "bad .common segment %s" msgstr "" -#: config/obj-elf.c:574 +#: config/obj-elf.c:577 #, c-format msgid "setting incorrect section type for %s" msgstr "" -#: config/obj-elf.c:579 +#: config/obj-elf.c:582 #, c-format msgid "ignoring incorrect section type for %s" msgstr "" -#: config/obj-elf.c:616 +#: config/obj-elf.c:619 #, c-format msgid "setting incorrect section attributes for %s" msgstr "" -#: config/obj-elf.c:668 +#: config/obj-elf.c:671 #, c-format msgid "ignoring changed section type for %s" msgstr "" -#: config/obj-elf.c:680 +#: config/obj-elf.c:683 #, c-format msgid "ignoring changed section attributes for %s" msgstr "" -#: config/obj-elf.c:682 +#: config/obj-elf.c:685 #, c-format msgid "ignoring changed section entity size for %s" msgstr "" -#: config/obj-elf.c:735 +#: config/obj-elf.c:738 msgid "unrecognized .section attribute: want a,w,x,M,S,G,T" msgstr "" -#: config/obj-elf.c:772 +#: config/obj-elf.c:775 msgid "unrecognized section attribute" msgstr "" -#: config/obj-elf.c:800 read.c:2528 +#: config/obj-elf.c:803 read.c:2534 msgid "unrecognized section type" msgstr "" -#: config/obj-elf.c:830 +#: config/obj-elf.c:833 msgid "missing name" msgstr "" -#: config/obj-elf.c:941 +#: config/obj-elf.c:944 msgid "invalid merge entity size" msgstr "" -#: config/obj-elf.c:948 +#: config/obj-elf.c:951 msgid "entity size for SHF_MERGE not specified" msgstr "" -#: config/obj-elf.c:968 +#: config/obj-elf.c:971 msgid "group name for SHF_GROUP not specified" msgstr "" -#: config/obj-elf.c:981 +#: config/obj-elf.c:984 msgid "character following name is not '#'" msgstr "" -#: config/obj-elf.c:1078 +#: config/obj-elf.c:1099 msgid ".previous without corresponding .section; ignored" msgstr "" -#: config/obj-elf.c:1104 +#: config/obj-elf.c:1125 msgid ".popsection without corresponding .pushsection; ignored" msgstr "" -#: config/obj-elf.c:1156 +#: config/obj-elf.c:1177 msgid "expected comma after name in .symver" msgstr "" -#: config/obj-elf.c:1180 +#: config/obj-elf.c:1201 #, c-format msgid "missing version name in `%s' for symbol `%s'" msgstr "" -#: config/obj-elf.c:1191 +#: config/obj-elf.c:1212 #, c-format msgid "multiple versions [`%s'|`%s'] for symbol `%s'" msgstr "" -#: config/obj-elf.c:1421 +#: config/obj-elf.c:1442 msgid "expected quoted string" msgstr "" -#: config/obj-elf.c:1441 +#: config/obj-elf.c:1462 #, c-format msgid "expected comma after name `%s' in .size directive" msgstr "" -#: config/obj-elf.c:1450 +#: config/obj-elf.c:1471 msgid "missing expression in .size directive" msgstr "" -#: config/obj-elf.c:1537 +#: config/obj-elf.c:1558 #, c-format msgid "unrecognized symbol type \"%s\"" msgstr "" -#: config/obj-elf.c:1705 +#: config/obj-elf.c:1726 msgid ".size expression too complicated to fix up" msgstr "" -#: config/obj-elf.c:1737 +#: config/obj-elf.c:1758 #, c-format msgid "" "invalid attempt to declare external version name as default in symbol `%s'" msgstr "" -#: config/obj-elf.c:1798 ecoff.c:3598 +#: config/obj-elf.c:1819 ecoff.c:3598 #, c-format msgid "symbol `%s' can not be both weak and common" msgstr "" -#: config/obj-elf.c:1905 +#: config/obj-elf.c:1926 #, c-format msgid "assuming all members of group `%s' are COMDAT" msgstr "" -#: config/obj-elf.c:1927 +#: config/obj-elf.c:1948 #, c-format msgid "can't create group: %s" msgstr "" -#: config/obj-elf.c:2036 +#: config/obj-elf.c:2057 #, c-format msgid "failed to set up debugging information: %s" msgstr "" -#: config/obj-elf.c:2056 +#: config/obj-elf.c:2077 #, c-format msgid "can't start writing .mdebug section: %s" msgstr "" -#: config/obj-elf.c:2064 +#: config/obj-elf.c:2085 #, c-format msgid "could not write .mdebug section: %s" msgstr "" @@ -862,2026 +887,1896 @@ msgstr "" msgid "too many sections" msgstr "" -#: config/obj-som.c:140 +#: config/obj-som.c:129 msgid "Only one .version pseudo-op per file!" msgstr "" -#: config/obj-som.c:157 config/obj-som.c:203 +#: config/obj-som.c:146 config/obj-som.c:191 msgid "Expected quoted string" msgstr "" -#: config/obj-som.c:166 +#: config/obj-som.c:155 #, c-format msgid "FATAL: Attaching version header %s" msgstr "" -#: config/obj-som.c:186 +#: config/obj-som.c:174 msgid "Only one .copyright pseudo-op per file!" msgstr "" -#: config/obj-som.c:212 +#: config/obj-som.c:200 #, c-format msgid "FATAL: Attaching copyright header %s" msgstr "" -#: config/obj-vms.c:367 -#, c-format -msgid "compiler emitted zero-size common symbol `%s' already defined" -msgstr "" - -#: config/obj-vms.c:375 -#, c-format -msgid "compiler redefined zero-size common symbol `%s'" -msgstr "" - -#: config/obj-vms.c:482 -#, c-format -msgid "Couldn't create VMS object file \"%s\"" -msgstr "" - -#: config/obj-vms.c:507 -msgid "I/O error writing VMS object file (length prefix)" -msgstr "" - -#: config/obj-vms.c:521 -msgid "I/O error writing VMS object file" -msgstr "" - -#: config/obj-vms.c:1057 -#, c-format -msgid "Couldn't find source file \"%s\", status=%%X%x" -msgstr "" - -#: config/obj-vms.c:1505 config/obj-vms.c:2677 -#, c-format -msgid "debugger forward reference error, dbx type %d" -msgstr "" - -#: config/obj-vms.c:1579 -#, c-format -msgid "Variable descriptor %d too complicated. Defined as `void *'." -msgstr "" - -#: config/obj-vms.c:1894 -msgid "" -"***Warning - the assembly code generated by the compiler has placed \n" -" global constant(s) in the text psect. These will not be available to \n" -" other modules, since this is not the correct way to handle this. You \n" -" have two options: 1) get a patched compiler that does not put global \n" -" constants in the text psect, or 2) remove the 'const' keyword from \n" -" definitions of global variables in your source module(s). Don't say \n" -" I didn't warn you! \n" -msgstr "" - -#: config/obj-vms.c:2199 -#, c-format -msgid "debugginer output: %d is an unknown untyped variable." -msgstr "" - -#: config/obj-vms.c:2419 -#, c-format -msgid "debugger output: structure element `%s' has undefined type" -msgstr "" - -#: config/obj-vms.c:2530 -#, c-format -msgid "debugger output: %d is an unknown type of variable." -msgstr "" - -#: config/obj-vms.c:2666 -#, c-format -msgid "debugger output: Unable to resolve %d circular references." -msgstr "" - -#: config/obj-vms.c:2854 -#, c-format -msgid "Module name truncated: %s\n" -msgstr "" - -#: config/obj-vms.c:3096 -#, c-format -msgid "Symbol %s replaced by %s\n" -msgstr "" - -#. impossible -#: config/obj-vms.c:3322 -#, c-format -msgid "Unknown VMS psect type (%ld)" -msgstr "" - -#: config/obj-vms.c:3360 -#, c-format -msgid "Globalsymbol attribute for symbol %s was unexpected." -msgstr "" - -#: config/obj-vms.c:3484 -msgid "Invalid data type for globalvalue" -msgstr "" - -#: config/obj-vms.c:3496 -#, c-format -msgid "Invalid globalvalue of %s" -msgstr "" - -#: config/obj-vms.c:3736 -msgid "Couldn't find fixup fragment when checking for indirect reference" -msgstr "" - -#: config/obj-vms.c:4014 config/obj-vms.c:4149 -msgid "Fixup data addsy and subsy don't have the same type" -msgstr "" - -#: config/obj-vms.c:4018 config/obj-vms.c:4153 -msgid "Fixup data addsy and subsy don't have an appropriate type" -msgstr "" - -#: config/obj-vms.c:4021 config/obj-vms.c:4156 -msgid "Fixup data is erroneously \"pcrel\"" -msgstr "" - -#: config/obj-vms.c:4037 config/obj-vms.c:4173 -msgid "Fixup datum is not a longword" -msgstr "" - -#: config/obj-vms.c:4041 config/obj-vms.c:4177 -msgid "Fixup datum is not \"fixP->fx_addsy\"" -msgstr "" - -#: config/obj-vms.c:4353 -msgid "Can't handle global xtors symbols yet." -msgstr "" - -#: config/obj-vms.c:4356 -#, c-format -msgid "Unknown %s" -msgstr "" - -#. -#. * Error otherwise. -#. -#: config/obj-vms.c:4441 -#, c-format -msgid "unhandled stab type %d" -msgstr "" - -#: config/tc-a29k.c:164 config/tc-sparc.c:4028 +#: config/tc-a29k.c:133 config/tc-sparc.c:4030 msgid "Unknown segment type" msgstr "" #. Probably a memory allocation problem? Give up now. -#: config/tc-a29k.c:334 config/tc-dlx.c:331 config/tc-hppa.c:1480 -#: config/tc-mips.c:1152 config/tc-mips.c:1194 config/tc-or32.c:228 +#: config/tc-a29k.c:305 config/tc-dlx.c:297 config/tc-hppa.c:1481 +#: config/tc-mips.c:1397 config/tc-mips.c:1449 config/tc-or32.c:223 #: config/tc-sparc.c:858 msgid "Broken assembler. No assembly attempted." msgstr "" -#: config/tc-a29k.c:379 config/tc-avr.c:1179 config/tc-d10v.c:545 -#: config/tc-d30v.c:552 config/tc-h8300.c:470 config/tc-h8500.c:283 -#: config/tc-mcore.c:608 config/tc-mmix.c:502 config/tc-mn10200.c:940 -#: config/tc-mn10300.c:1820 config/tc-msp430.c:407 config/tc-or32.c:334 -#: config/tc-or32.c:390 config/tc-ppc.c:2367 config/tc-s390.c:1218 -#: config/tc-sh64.c:2213 config/tc-sh.c:1240 config/tc-tic80.c:280 -#: config/tc-v850.c:2034 config/tc-w65.c:215 config/tc-z8k.c:331 +#: config/tc-a29k.c:319 config/tc-avr.c:1179 config/tc-d10v.c:498 +#: config/tc-d30v.c:490 config/tc-h8300.c:470 config/tc-h8500.c:271 +#: config/tc-mcore.c:667 config/tc-mmix.c:489 config/tc-mn10200.c:1078 +#: config/tc-mn10300.c:1820 config/tc-msp430.c:407 config/tc-or32.c:324 +#: config/tc-or32.c:376 config/tc-ppc.c:2377 config/tc-s390.c:1218 +#: config/tc-sh64.c:2213 config/tc-sh.c:1240 config/tc-tic80.c:261 +#: config/tc-v850.c:1952 config/tc-w65.c:206 config/tc-z8k.c:331 msgid "missing operand" msgstr "" -#: config/tc-a29k.c:418 config/tc-cris.c:1515 config/tc-cris.c:1523 -#: config/tc-crx.c:2028 config/tc-dlx.c:808 config/tc-hppa.c:1616 +#: config/tc-a29k.c:357 config/tc-cris.c:1493 config/tc-cris.c:1501 +#: config/tc-crx.c:2028 config/tc-dlx.c:685 config/tc-hppa.c:1617 #: config/tc-i860.c:492 config/tc-i860.c:509 config/tc-i860.c:989 -#: config/tc-sparc.c:1420 config/tc-sparc.c:1426 +#: config/tc-sparc.c:1420 config/tc-sparc.c:1428 #, c-format msgid "Unknown opcode: `%s'" msgstr "" -#: config/tc-a29k.c:423 config/tc-dlx.c:826 +#: config/tc-a29k.c:362 config/tc-dlx.c:703 #, c-format msgid "Unknown opcode `%s'." msgstr "" -#: config/tc-a29k.c:455 config/tc-dlx.c:887 +#: config/tc-a29k.c:390 config/tc-dlx.c:764 #, c-format msgid "Too many operands: %s" msgstr "" -#: config/tc-a29k.c:477 config/tc-a29k.c:508 +#: config/tc-a29k.c:409 config/tc-a29k.c:436 #, c-format msgid "Immediate value of %ld is too large" msgstr "" -#: config/tc-a29k.c:547 config/tc-i860.c:395 config/tc-i860.c:940 -#: config/tc-m68k.c:3485 config/tc-m68k.c:3517 config/tc-sparc.c:2658 +#: config/tc-a29k.c:474 config/tc-i860.c:395 config/tc-i860.c:940 +#: config/tc-m68k.c:3495 config/tc-m68k.c:3527 config/tc-sparc.c:2660 msgid "failed sanity check." msgstr "" -#: config/tc-a29k.c:891 config/tc-or32.c:1023 config/tc-or32.c:1147 +#: config/tc-a29k.c:835 config/tc-or32.c:992 config/tc-or32.c:1113 #, c-format msgid "bad relocation type: 0x%02x" msgstr "" -#: config/tc-a29k.c:918 +#: config/tc-a29k.c:855 #, c-format msgid "need %o3\n" msgstr "" -#: config/tc-a29k.c:934 +#: config/tc-a29k.c:871 msgid "a29k_convert_frag\n" msgstr "" -#: config/tc-a29k.c:943 +#: config/tc-a29k.c:880 msgid "a29k_estimate_size_before_relax\n" msgstr "" -#: config/tc-a29k.c:1037 config/tc-dlx.c:1251 config/tc-or32.c:1342 +#: config/tc-a29k.c:974 config/tc-dlx.c:1175 config/tc-or32.c:1292 #, c-format msgid "label \"$%d\" redefined" msgstr "" -#: config/tc-a29k.c:1110 config/tc-dlx.c:485 config/tc-or32.c:1435 +#: config/tc-a29k.c:1044 config/tc-dlx.c:634 config/tc-or32.c:1358 #, c-format msgid "Invalid expression after %%%%\n" msgstr "" -#: config/tc-a29k.c:1121 +#: config/tc-a29k.c:1055 msgid "Invalid register in & expression" msgstr "" -#: config/tc-alpha.c:802 -#, c-format -msgid "internal error: can't hash opcode `%s': %s" -msgstr "" - -#: config/tc-alpha.c:836 +#: config/tc-alpha.c:592 #, c-format -msgid "internal error: can't hash macro `%s': %s" -msgstr "" - -#: config/tc-alpha.c:919 config/tc-i960.c:2712 config/tc-xtensa.c:5191 -#: config/tc-xtensa.c:5260 config/tc-xtensa.c:5311 -msgid "syntax error" -msgstr "" - -#: config/tc-alpha.c:993 config/tc-h8300.c:2092 config/tc-h8500.c:1204 -#: config/tc-hppa.c:4033 config/tc-i860.c:1059 config/tc-m68hc11.c:558 -#: config/tc-m68k.c:4576 config/tc-m88k.c:991 config/tc-ns32k.c:1689 -#: config/tc-or32.c:902 config/tc-sparc.c:2945 config/tc-z8k.c:1328 -msgid "Bad call to MD_ATOF()" +msgid "No !literal!%ld was found" msgstr "" -#: config/tc-alpha.c:1043 +#: config/tc-alpha.c:599 #, c-format -msgid "Unknown CPU identifier `%s'" -msgstr "" - -#: config/tc-alpha.c:1087 -msgid "" -"Alpha options:\n" -"-32addr\t\t\ttreat addresses as 32-bit values\n" -"-F\t\t\tlack floating point instructions support\n" -"-mev4 | -mev45 | -mev5 | -mev56 | -mpca56 | -mev6 | -mev67 | -mev68 | -mall\n" -"\t\t\tspecify variant of Alpha architecture\n" -"-m21064 | -m21066 | -m21164 | -m21164a | -m21164pc | -m21264 | -m21264a | -" -"m21264b\n" -"\t\t\tthese variants include PALcode opcodes\n" -msgstr "" - -#: config/tc-alpha.c:1097 -msgid "" -"VMS options:\n" -"-+\t\t\thash encode (don't truncate) names longer than 64 characters\n" -"-H\t\t\tshow new symbol after hash truncation\n" +msgid "No !tlsgd!%ld was found" msgstr "" -#: config/tc-alpha.c:1274 +#: config/tc-alpha.c:606 #, c-format -msgid "unhandled relocation type %s" -msgstr "" - -#: config/tc-alpha.c:1287 -msgid "non-absolute expression in constant field" +msgid "No !tlsldm!%ld was found" msgstr "" -#: config/tc-alpha.c:1301 +#: config/tc-alpha.c:615 #, c-format -msgid "type %d reloc done?\n" -msgstr "" - -#: config/tc-alpha.c:1349 config/tc-alpha.c:1356 config/tc-mips.c:8442 -msgid "Used $at without \".set noat\"" +msgid "No ldah !gpdisp!%ld was found" msgstr "" -#: config/tc-alpha.c:1518 +#: config/tc-alpha.c:665 #, c-format -msgid "!samegp reloc against symbol without .prologue: %s" +msgid "too many !literal!%ld for %s" msgstr "" -#: config/tc-alpha.c:1557 config/tc-xtensa.c:5831 +#: config/tc-alpha.c:695 #, c-format -msgid "cannot represent `%s' relocation in object file" +msgid "No lda !gpdisp!%ld was found" msgstr "" -#: config/tc-alpha.c:1564 config/tc-xtensa.c:5839 -#, c-format -msgid "internal error? cannot generate `%s' relocation" +#. Only support one relocation op per insn. +#: config/tc-alpha.c:852 +msgid "More than one relocation op per insn" msgstr "" -#: config/tc-alpha.c:1618 -#, c-format -msgid "frame reg expected, using $%d." +#: config/tc-alpha.c:868 +msgid "No relocation operand" msgstr "" -#: config/tc-alpha.c:1719 +#: config/tc-alpha.c:878 #, c-format -msgid "No !literal!%ld was found" +msgid "Unknown relocation operand: !%s" msgstr "" -#: config/tc-alpha.c:1726 +#: config/tc-alpha.c:888 #, c-format -msgid "No !tlsgd!%ld was found" +msgid "no sequence number after !%s" msgstr "" -#: config/tc-alpha.c:1733 +#: config/tc-alpha.c:898 #, c-format -msgid "No !tlsldm!%ld was found" +msgid "!%s does not use a sequence number" msgstr "" -#: config/tc-alpha.c:1742 +#: config/tc-alpha.c:908 #, c-format -msgid "No ldah !gpdisp!%ld was found" +msgid "Bad sequence number: !%s!%s" msgstr "" -#: config/tc-alpha.c:1792 +#: config/tc-alpha.c:1123 config/tc-alpha.c:3139 #, c-format -msgid "too many !literal!%ld for %s" +msgid "inappropriate arguments for opcode `%s'" msgstr "" -#: config/tc-alpha.c:1822 +#: config/tc-alpha.c:1125 config/tc-alpha.c:3141 #, c-format -msgid "No lda !gpdisp!%ld was found" -msgstr "" - -#. Only support one relocation op per insn. -#: config/tc-alpha.c:1970 -msgid "More than one relocation op per insn" -msgstr "" - -#: config/tc-alpha.c:1986 -msgid "No relocation operand" +msgid "opcode `%s' not supported for target %s" msgstr "" -#: config/tc-alpha.c:1996 +#: config/tc-alpha.c:1129 config/tc-alpha.c:3145 config/tc-avr.c:1145 +#: config/tc-msp430.c:1777 #, c-format -msgid "Unknown relocation operand: !%s" +msgid "unknown opcode `%s'" msgstr "" -#: config/tc-alpha.c:2006 -#, c-format -msgid "no sequence number after !%s" +#: config/tc-alpha.c:1209 config/tc-alpha.c:1384 +msgid "overflow in literal (.lita) table" msgstr "" -#: config/tc-alpha.c:2016 -#, c-format -msgid "!%s does not use a sequence number" +#: config/tc-alpha.c:1216 config/tc-alpha.c:1240 config/tc-alpha.c:1397 +#: config/tc-alpha.c:2049 config/tc-alpha.c:2093 config/tc-alpha.c:2162 +#: config/tc-alpha.c:2245 config/tc-alpha.c:2470 config/tc-alpha.c:2568 +msgid "macro requires $at register while noat in effect" msgstr "" -#: config/tc-alpha.c:2026 -#, c-format -msgid "Bad sequence number: !%s!%s" +#: config/tc-alpha.c:1218 config/tc-alpha.c:1242 config/tc-alpha.c:1399 +msgid "macro requires $at while $at in use" msgstr "" -#: config/tc-alpha.c:2352 config/tc-arc.c:331 config/tc-mn10200.c:1344 -#: config/tc-mn10300.c:2601 config/tc-ppc.c:1461 config/tc-s390.c:612 -#: config/tc-v850.c:1644 -msgid "operand" +#: config/tc-alpha.c:1346 +msgid "bignum invalid; zero assumed" msgstr "" -#: config/tc-alpha.c:2456 config/tc-alpha.c:2480 config/tc-d10v.c:634 -#: config/tc-d30v.c:640 config/tc-mn10200.c:995 config/tc-mn10300.c:1893 -#: config/tc-ppc.c:2333 config/tc-ppc.c:2550 config/tc-ppc.c:2562 -#: config/tc-s390.c:1228 config/tc-s390.c:1328 config/tc-s390.c:1424 -#: config/tc-v850.c:1821 config/tc-v850.c:1844 config/tc-v850.c:2057 -msgid "too many fixups" +#: config/tc-alpha.c:1348 +msgid "floating point number invalid; zero assumed" msgstr "" -#: config/tc-alpha.c:2492 -msgid "invalid relocation for instruction" +#: config/tc-alpha.c:1353 +msgid "can't handle expression" msgstr "" -#: config/tc-alpha.c:2503 -msgid "invalid relocation for field" +#: config/tc-alpha.c:1390 +msgid "overflow in literal (.lit8) table" msgstr "" -#: config/tc-alpha.c:2608 +#: config/tc-alpha.c:1674 #, c-format msgid "too many ldah insns for !gpdisp!%ld" msgstr "" -#: config/tc-alpha.c:2610 config/tc-alpha.c:2622 +#: config/tc-alpha.c:1676 config/tc-alpha.c:1688 #, c-format msgid "both insns for !gpdisp!%ld must be in the same section" msgstr "" -#: config/tc-alpha.c:2620 +#: config/tc-alpha.c:1686 #, c-format msgid "too many lda insns for !gpdisp!%ld" msgstr "" -#: config/tc-alpha.c:2673 +#: config/tc-alpha.c:1742 #, c-format msgid "too many lituse insns for !lituse_tlsgd!%ld" msgstr "" -#: config/tc-alpha.c:2676 +#: config/tc-alpha.c:1745 #, c-format msgid "too many lituse insns for !lituse_tlsldm!%ld" msgstr "" -#: config/tc-alpha.c:2693 +#: config/tc-alpha.c:1762 #, c-format msgid "duplicate !tlsgd!%ld" msgstr "" -#: config/tc-alpha.c:2695 +#: config/tc-alpha.c:1764 #, c-format msgid "sequence number in use for !tlsldm!%ld" msgstr "" -#: config/tc-alpha.c:2709 +#: config/tc-alpha.c:1778 #, c-format msgid "duplicate !tlsldm!%ld" msgstr "" -#: config/tc-alpha.c:2711 +#: config/tc-alpha.c:1780 #, c-format msgid "sequence number in use for !tlsgd!%ld" msgstr "" -#: config/tc-alpha.c:2756 config/tc-alpha.c:2829 -#, c-format -msgid "inappropriate arguments for opcode `%s'" -msgstr "" - -#: config/tc-alpha.c:2758 config/tc-alpha.c:2831 -#, c-format -msgid "opcode `%s' not supported for target %s" -msgstr "" - -#: config/tc-alpha.c:2762 config/tc-alpha.c:2835 config/tc-avr.c:1145 -#: config/tc-msp430.c:1777 -#, c-format -msgid "unknown opcode `%s'" -msgstr "" - -#: config/tc-alpha.c:2882 -msgid "can not resolve expression" -msgstr "" - -#: config/tc-alpha.c:3026 config/tc-alpha.c:3205 -msgid "overflow in literal (.lita) table" -msgstr "" - -#: config/tc-alpha.c:3033 config/tc-alpha.c:3056 config/tc-alpha.c:3218 -#: config/tc-alpha.c:3433 config/tc-alpha.c:3478 config/tc-alpha.c:3552 -#: config/tc-alpha.c:3644 config/tc-alpha.c:3892 config/tc-alpha.c:3991 -msgid "macro requires $at register while noat in effect" -msgstr "" - -#: config/tc-alpha.c:3035 config/tc-alpha.c:3058 config/tc-alpha.c:3220 -msgid "macro requires $at while $at in use" +#: config/tc-alpha.c:1823 config/tc-arc.c:294 config/tc-mn10200.c:889 +#: config/tc-mn10300.c:2601 config/tc-ppc.c:1471 config/tc-s390.c:612 +#: config/tc-v850.c:1573 +msgid "operand" msgstr "" -#: config/tc-alpha.c:3166 -msgid "bignum invalid; zero assumed" +#: config/tc-alpha.c:1926 config/tc-alpha.c:1950 config/tc-d10v.c:585 +#: config/tc-d30v.c:573 config/tc-mn10200.c:1133 config/tc-mn10300.c:1893 +#: config/tc-ppc.c:2343 config/tc-ppc.c:2560 config/tc-ppc.c:2572 +#: config/tc-s390.c:1228 config/tc-s390.c:1328 config/tc-s390.c:1424 +#: config/tc-v850.c:1747 config/tc-v850.c:1770 config/tc-v850.c:1973 +msgid "too many fixups" msgstr "" -#: config/tc-alpha.c:3168 -msgid "floating point number invalid; zero assumed" +#: config/tc-alpha.c:1962 +msgid "invalid relocation for instruction" msgstr "" -#: config/tc-alpha.c:3173 -msgid "can't handle expression" +#: config/tc-alpha.c:1973 +msgid "invalid relocation for field" msgstr "" -#: config/tc-alpha.c:3211 -msgid "overflow in literal (.lit8) table" +#: config/tc-alpha.c:2760 +msgid "can not resolve expression" msgstr "" -#: config/tc-alpha.c:4228 config/tc-ppc.c:1766 config/tc-ppc.c:4358 +#: config/tc-alpha.c:3275 config/tc-ppc.c:1776 config/tc-ppc.c:4368 #, c-format msgid ".COMMon length (%ld.) <0! Ignored." msgstr "" -#: config/tc-alpha.c:4257 config/tc-sparc.c:3844 config/tc-v850.c:256 +#: config/tc-alpha.c:3304 config/tc-sparc.c:3846 config/tc-v850.c:246 msgid "Ignoring attempt to re-define symbol" msgstr "" -#: config/tc-alpha.c:4266 config/tc-alpha.c:4275 config/tc-ppc.c:4395 -#: config/tc-sparc.c:3852 +#: config/tc-alpha.c:3313 config/tc-alpha.c:3322 config/tc-ppc.c:4405 +#: config/tc-sparc.c:3854 #, c-format msgid "Length of .comm \"%s\" is already %ld. Not changed to %ld." msgstr "" -#: config/tc-alpha.c:4396 ecoff.c:3054 +#: config/tc-alpha.c:3439 ecoff.c:3054 msgid ".ent directive has no name" msgstr "" -#: config/tc-alpha.c:4404 +#: config/tc-alpha.c:3447 msgid "nested .ent directives" msgstr "" -#: config/tc-alpha.c:4449 ecoff.c:3005 +#: config/tc-alpha.c:3491 ecoff.c:3005 msgid ".end directive has no name" msgstr "" -#: config/tc-alpha.c:4458 +#: config/tc-alpha.c:3500 msgid ".end directive without matching .ent" msgstr "" -#: config/tc-alpha.c:4460 +#: config/tc-alpha.c:3502 msgid ".end directive names different symbol than .ent" msgstr "" -#: config/tc-alpha.c:4504 ecoff.c:3140 +#: config/tc-alpha.c:3545 ecoff.c:3140 msgid ".fmask outside of .ent" msgstr "" -#: config/tc-alpha.c:4506 ecoff.c:3204 +#: config/tc-alpha.c:3547 ecoff.c:3204 msgid ".mask outside of .ent" msgstr "" -#: config/tc-alpha.c:4514 ecoff.c:3147 +#: config/tc-alpha.c:3555 ecoff.c:3147 msgid "bad .fmask directive" msgstr "" -#: config/tc-alpha.c:4516 ecoff.c:3211 +#: config/tc-alpha.c:3557 ecoff.c:3211 msgid "bad .mask directive" msgstr "" -#: config/tc-alpha.c:4550 config/tc-mips.c:13757 ecoff.c:3168 +#: config/tc-alpha.c:3590 config/tc-mips.c:13645 ecoff.c:3168 msgid ".frame outside of .ent" msgstr "" -#: config/tc-alpha.c:4561 ecoff.c:3179 +#: config/tc-alpha.c:3601 ecoff.c:3179 msgid "bad .frame directive" msgstr "" -#: config/tc-alpha.c:4594 +#: config/tc-alpha.c:3633 msgid ".prologue directive without a preceding .ent directive" msgstr "" -#: config/tc-alpha.c:4612 +#: config/tc-alpha.c:3651 #, c-format msgid "Invalid argument %d to .prologue." msgstr "" -#: config/tc-alpha.c:4707 +#: config/tc-alpha.c:3742 msgid "ECOFF debugging is disabled." msgstr "" -#: config/tc-alpha.c:4721 +#: config/tc-alpha.c:3756 msgid ".ent directive without matching .end" msgstr "" -#: config/tc-alpha.c:4806 +#: config/tc-alpha.c:3841 msgid ".usepv directive has no name" msgstr "" -#: config/tc-alpha.c:4817 +#: config/tc-alpha.c:3852 msgid ".usepv directive has no type" msgstr "" -#: config/tc-alpha.c:4832 +#: config/tc-alpha.c:3867 msgid "unknown argument for .usepv" msgstr "" -#: config/tc-alpha.c:4866 +#: config/tc-alpha.c:3900 msgid "Unknown section directive" msgstr "" -#: config/tc-alpha.c:4902 +#: config/tc-alpha.c:3935 msgid ".ent directive has no symbol" msgstr "" -#: config/tc-alpha.c:4928 +#: config/tc-alpha.c:3960 msgid "Bad .frame directive 1./2. param" msgstr "" -#: config/tc-alpha.c:4940 +#: config/tc-alpha.c:3972 msgid "Bad .frame directive 3./4. param" msgstr "" -#: config/tc-alpha.c:4963 +#: config/tc-alpha.c:3994 msgid ".pdesc directive not in link (.link) section" msgstr "" -#: config/tc-alpha.c:4971 +#: config/tc-alpha.c:4002 msgid ".pdesc has no matching .ent" msgstr "" -#: config/tc-alpha.c:4982 +#: config/tc-alpha.c:4013 msgid ".pdesc directive has no entry symbol" msgstr "" -#: config/tc-alpha.c:4995 +#: config/tc-alpha.c:4026 msgid "No comma after .pdesc " msgstr "" -#: config/tc-alpha.c:5018 +#: config/tc-alpha.c:4046 msgid "unknown procedure kind" msgstr "" -#: config/tc-alpha.c:5109 +#: config/tc-alpha.c:4136 msgid ".name directive not in link (.link) section" msgstr "" -#: config/tc-alpha.c:5117 +#: config/tc-alpha.c:4144 msgid ".name directive has no symbol" msgstr "" -#: config/tc-alpha.c:5149 +#: config/tc-alpha.c:4175 msgid "No symbol after .linkage" msgstr "" -#: config/tc-alpha.c:5175 +#: config/tc-alpha.c:4199 msgid "No symbol after .code_address" msgstr "" -#: config/tc-alpha.c:5205 +#: config/tc-alpha.c:4226 msgid "Bad .mask directive" msgstr "" -#: config/tc-alpha.c:5224 +#: config/tc-alpha.c:4244 msgid "Bad .fmask directive" msgstr "" -#: config/tc-alpha.c:5386 +#: config/tc-alpha.c:4401 #, c-format msgid "Expected comma after name \"%s\"" msgstr "" #. *symbol_get_obj (symbolP) = (signed char) temp; -#: config/tc-alpha.c:5397 +#: config/tc-alpha.c:4412 #, c-format msgid "unhandled: .proc %s,%d" msgstr "" -#: config/tc-alpha.c:5432 +#: config/tc-alpha.c:4446 #, c-format msgid "Tried to .set unrecognized mode `%s'" msgstr "" -#: config/tc-alpha.c:5457 +#: config/tc-alpha.c:4472 #, c-format msgid "Bad base register, using $%d." msgstr "" -#: config/tc-alpha.c:5479 +#: config/tc-alpha.c:4493 #, c-format msgid "Alignment too large: %d. assumed" msgstr "" -#: config/tc-alpha.c:5483 config/tc-d30v.c:2183 +#: config/tc-alpha.c:4497 config/tc-d30v.c:2083 msgid "Alignment negative: 0 assumed" msgstr "" -#: config/tc-alpha.c:5790 +#: config/tc-alpha.c:4775 #, c-format msgid "Chose GP value of %lx\n" msgstr "" -#: config/tc-alpha.c:5806 +#: config/tc-alpha.c:4789 msgid "Bad .section directive: want a,s,w,x,M,S,G,T in string" msgstr "" -#: config/tc-arc.c:1574 config/tc-arm.c:12232 config/tc-ip2k.c:219 -msgid "md_estimate_size_before_relax\n" +#: config/tc-alpha.c:4878 +#, c-format +msgid "internal error: can't hash opcode `%s': %s" msgstr "" -#: config/tc-arc.c:1586 -msgid "md_convert_frag\n" +#: config/tc-alpha.c:4914 +#, c-format +msgid "internal error: can't hash macro `%s': %s" msgstr "" -#. We can't actually support subtracting a symbol. -#: config/tc-arc.c:1856 config/tc-arm.c:6622 config/tc-arm.c:9378 -#: config/tc-arm.c:9470 config/tc-avr.c:891 config/tc-cris.c:3999 -#: config/tc-d10v.c:1708 config/tc-d30v.c:1836 config/tc-mips.c:3835 -#: config/tc-mips.c:4949 config/tc-mips.c:5881 config/tc-mips.c:6469 -#: config/tc-msp430.c:1871 config/tc-ppc.c:5542 config/tc-v850.c:2367 -#: config/tc-xstormy16.c:499 +#: config/tc-alpha.c:4998 config/tc-i960.c:718 config/tc-xtensa.c:5127 +#: config/tc-xtensa.c:5196 config/tc-xtensa.c:5242 +msgid "syntax error" +msgstr "" + +#: config/tc-alpha.c:5067 config/tc-h8300.c:2092 config/tc-h8500.c:1115 +#: config/tc-hppa.c:4032 config/tc-i860.c:1059 config/tc-m68hc11.c:558 +#: config/tc-m68k.c:4586 config/tc-m88k.c:916 config/tc-ns32k.c:1955 +#: config/tc-or32.c:877 config/tc-sparc.c:2947 config/tc-z8k.c:1328 +msgid "Bad call to MD_ATOF()" +msgstr "" + +#: config/tc-alpha.c:5116 +#, c-format +msgid "Unknown CPU identifier `%s'" +msgstr "" + +#: config/tc-alpha.c:5159 +msgid "" +"Alpha options:\n" +"-32addr\t\t\ttreat addresses as 32-bit values\n" +"-F\t\t\tlack floating point instructions support\n" +"-mev4 | -mev45 | -mev5 | -mev56 | -mpca56 | -mev6 | -mev67 | -mev68 | -mall\n" +"\t\t\tspecify variant of Alpha architecture\n" +"-m21064 | -m21066 | -m21164 | -m21164a | -m21164pc | -m21264 | -m21264a | -" +"m21264b\n" +"\t\t\tthese variants include PALcode opcodes\n" +msgstr "" + +#: config/tc-alpha.c:5169 +msgid "" +"VMS options:\n" +"-+\t\t\thash encode (don't truncate) names longer than 64 characters\n" +"-H\t\t\tshow new symbol after hash truncation\n" +msgstr "" + +#: config/tc-alpha.c:5346 +#, c-format +msgid "unhandled relocation type %s" +msgstr "" + +#: config/tc-alpha.c:5359 +msgid "non-absolute expression in constant field" +msgstr "" + +#: config/tc-alpha.c:5373 +#, c-format +msgid "type %d reloc done?\n" +msgstr "" + +#: config/tc-alpha.c:5420 config/tc-alpha.c:5427 config/tc-mips.c:8348 +msgid "Used $at without \".set noat\"" +msgstr "" + +#: config/tc-alpha.c:5586 +#, c-format +msgid "!samegp reloc against symbol without .prologue: %s" +msgstr "" + +#: config/tc-alpha.c:5623 config/tc-xtensa.c:5750 +#, c-format +msgid "cannot represent `%s' relocation in object file" +msgstr "" + +#: config/tc-alpha.c:5629 config/tc-xtensa.c:5758 +#, c-format +msgid "internal error? cannot generate `%s' relocation" +msgstr "" + +#: config/tc-alpha.c:5680 +#, c-format +msgid "frame reg expected, using $%d." +msgstr "" + +#: config/tc-arc.c:1077 config/tc-arm.c:9363 config/tc-ip2k.c:249 +msgid "md_estimate_size_before_relax\n" +msgstr "" + +#: config/tc-arc.c:1088 +msgid "md_convert_frag\n" +msgstr "" + +#. We can't actually support subtracting a symbol. +#: config/tc-arc.c:1288 config/tc-arm.c:1011 config/tc-arm.c:5598 +#: config/tc-arm.c:5649 config/tc-arm.c:6313 config/tc-arm.c:6867 +#: config/tc-arm.c:6893 config/tc-arm.c:7120 config/tc-arm.c:7137 +#: config/tc-arm.c:7243 config/tc-avr.c:891 config/tc-cris.c:3928 +#: config/tc-d10v.c:1539 config/tc-d30v.c:1938 config/tc-mips.c:3758 +#: config/tc-mips.c:4866 config/tc-mips.c:5798 config/tc-mips.c:6392 +#: config/tc-msp430.c:1871 config/tc-ppc.c:5553 config/tc-v850.c:2274 +#: config/tc-xstormy16.c:484 msgid "expression too complex" msgstr "" -#: config/tc-arm.c:758 config/tc-arm.c:14522 +#: config/tc-arm.c:347 msgid "ARM register expected" msgstr "" -#: config/tc-arm.c:759 +#: config/tc-arm.c:348 msgid "bad or missing co-processor number" msgstr "" -#: config/tc-arm.c:760 +#: config/tc-arm.c:349 msgid "co-processor register expected" msgstr "" -#: config/tc-arm.c:761 +#: config/tc-arm.c:350 msgid "FPA register expected" msgstr "" -#: config/tc-arm.c:762 +#: config/tc-arm.c:351 msgid "VFP single precision register expected" msgstr "" -#: config/tc-arm.c:763 +#: config/tc-arm.c:352 msgid "VFP double precision register expected" msgstr "" -#: config/tc-arm.c:764 +#: config/tc-arm.c:353 +msgid "VFP system register expected" +msgstr "" + +#: config/tc-arm.c:354 msgid "Maverick MVF register expected" msgstr "" -#: config/tc-arm.c:765 +#: config/tc-arm.c:355 msgid "Maverick MVD register expected" msgstr "" -#: config/tc-arm.c:766 +#: config/tc-arm.c:356 msgid "Maverick MVFX register expected" msgstr "" -#: config/tc-arm.c:767 +#: config/tc-arm.c:357 msgid "Maverick MVDX register expected" msgstr "" -#: config/tc-arm.c:768 +#: config/tc-arm.c:358 msgid "Maverick MVAX register expected" msgstr "" -#: config/tc-arm.c:769 +#: config/tc-arm.c:359 msgid "Maverick DSPSC register expected" msgstr "" -#: config/tc-arm.c:770 -msgid "Intel Wireless MMX technology register expected" +#: config/tc-arm.c:360 +msgid "iWMMXt data register expected" +msgstr "" + +#: config/tc-arm.c:361 +msgid "iWMMXt control register expected" +msgstr "" + +#: config/tc-arm.c:362 +msgid "iWMMXt scalar register expected" +msgstr "" + +#: config/tc-arm.c:363 +msgid "XScale accumulator register expected" msgstr "" -#: config/tc-arm.c:964 +#: config/tc-arm.c:494 msgid "bad arguments to instruction" msgstr "" -#: config/tc-arm.c:965 +#: config/tc-arm.c:495 msgid "r15 not allowed here" msgstr "" -#: config/tc-arm.c:966 -msgid "instruction is not conditional" +#: config/tc-arm.c:496 +msgid "instruction cannot be conditional" msgstr "" -#: config/tc-arm.c:967 -msgid "acc0 expected" +#: config/tc-arm.c:497 +msgid "registers may not be the same" msgstr "" -#: config/tc-arm.c:1100 -msgid "literal pool overflow" +#: config/tc-arm.c:498 +msgid "lo register required" msgstr "" -#: config/tc-arm.c:1475 -msgid "selected processor does not support THUMB opcodes" +#: config/tc-arm.c:499 +msgid "instruction not supported in Thumb16 mode" msgstr "" -#: config/tc-arm.c:1489 -msgid "selected processor does not support ARM opcodes" +#: config/tc-arm.c:630 +msgid "immediate expression requires a # prefix" msgstr "" -#: config/tc-arm.c:1502 -#, c-format -msgid "invalid instruction size selected (%d)" +#: config/tc-arm.c:656 expr.c:1299 read.c:2226 +msgid "bad expression" msgstr "" -#: config/tc-arm.c:1509 -msgid "invalid syntax for .req directive" +#: config/tc-arm.c:667 config/tc-i860.c:1005 config/tc-sparc.c:2847 +msgid "bad segment" msgstr "" -#: config/tc-arm.c:1552 -#, c-format -msgid "unreq: missing hash entry for \"%s\"" +#: config/tc-arm.c:683 config/tc-arm.c:3121 config/tc-i960.c:1310 +msgid "invalid constant" +msgstr "" + +#: config/tc-arm.c:744 +msgid "bad call to MD_ATOF()" +msgstr "" + +#: config/tc-arm.c:811 +msgid "expected #constant" +msgstr "" + +#: config/tc-arm.c:943 +msgid "bad range in register list" msgstr "" -#: config/tc-arm.c:1571 config/tc-arm.c:1574 +#: config/tc-arm.c:951 config/tc-arm.c:960 config/tc-arm.c:1001 #, c-format -msgid ".unreq: unrecognized symbol \"%s\"" +msgid "Warning: duplicated register (r%d) in register list" msgstr "" -#: config/tc-arm.c:1577 -msgid "invalid syntax for .unreq directive" +#: config/tc-arm.c:963 +msgid "Warning: register range not in ascending order" +msgstr "" + +#: config/tc-arm.c:974 +msgid "missing `}'" +msgstr "" + +#: config/tc-arm.c:990 +msgid "invalid register mask" +msgstr "" + +#: config/tc-arm.c:1081 config/tc-arm.c:1116 config/tc-h8300.c:1010 +#: config/tc-mips.c:9481 config/tc-mips.c:9511 +msgid "invalid register list" +msgstr "" + +#: config/tc-arm.c:1087 config/tc-arm.c:2387 config/tc-arm.c:2520 +msgid "register list not in ascending order" +msgstr "" + +#: config/tc-arm.c:1108 +msgid "register range not in ascending order" +msgstr "" + +#: config/tc-arm.c:1141 +msgid "non-contiguous register range" msgstr "" -#: config/tc-arm.c:1659 +#: config/tc-arm.c:1189 #, c-format -msgid "alignment too large: %d assumed" +msgid "ignoring attempt to redefine built-in register '%s'" msgstr "" -#: config/tc-arm.c:1662 -msgid "alignment negative. 0 assumed." +#: config/tc-arm.c:1194 +#, c-format +msgid "ignoring redefinition of register alias '%s'" msgstr "" -#: config/tc-arm.c:1743 +#: config/tc-arm.c:1238 #, c-format -msgid "expected comma after name \"%s\"" +msgid "unknown register '%s' -- .req ignored" msgstr "" -#: config/tc-arm.c:1793 config/tc-m32r.c:617 +#: config/tc-arm.c:1281 +msgid "invalid syntax for .req directive" +msgstr "" + +#: config/tc-arm.c:1307 +msgid "invalid syntax for .unreq directive" +msgstr "" + +#: config/tc-arm.c:1313 #, c-format -msgid "symbol `%s' already defined" +msgid "unknown register alias '%s'" msgstr "" -#: config/tc-arm.c:1836 +#: config/tc-arm.c:1315 #, c-format -msgid "invalid operand to .code directive (%d) (expecting 16 or 32)" +msgid "ignoring attempt to undefine built-in register '%s'" msgstr "" -#: config/tc-arm.c:1846 -msgid "garbage following instruction" +#: config/tc-arm.c:1448 +msgid "selected processor does not support THUMB opcodes" msgstr "" -#: config/tc-arm.c:1916 -msgid "bad_segment" +#: config/tc-arm.c:1462 +msgid "selected processor does not support ARM opcodes" msgstr "" -#: config/tc-arm.c:1932 config/tc-arm.c:2699 config/tc-arm.c:3889 -#: config/tc-arm.c:5841 config/tc-arm.c:5861 config/tc-i960.c:1940 -msgid "invalid constant" +#: config/tc-arm.c:1475 +#, c-format +msgid "invalid instruction size selected (%d)" msgstr "" -#. In the few cases where we might be able to accept something else -#. this error can be overridden. -#: config/tc-arm.c:1967 +#: config/tc-arm.c:1507 #, c-format -msgid "register expected, not '%.100s'" +msgid "invalid operand to .code directive (%d) (expecting 16 or 32)" msgstr "" -#. In the few cases where we might be able to accept -#. something else this error can be overridden. -#: config/tc-arm.c:2017 +#: config/tc-arm.c:1563 #, c-format -msgid "Intel Wireless MMX technology register expected, not '%.100s'" +msgid "expected comma after name \"%s\"" msgstr "" -#. In the few cases where we might be able to accept -#. something else this error can be overridden. -#: config/tc-arm.c:2087 -msgid "flag for {c}psr instruction expected" +#: config/tc-arm.c:1613 config/tc-m32r.c:589 +#, c-format +msgid "symbol `%s' already defined" msgstr "" -#: config/tc-arm.c:2120 -msgid "illegal co-processor number" +#: config/tc-arm.c:1647 +#, c-format +msgid "unrecognized syntax mode \"%s\"" msgstr "" -#: config/tc-arm.c:2149 config/tc-arm.c:5101 -msgid "bad or missing expression" +#: config/tc-arm.c:1667 +#, c-format +msgid "alignment too large: %d assumed" msgstr "" -#: config/tc-arm.c:2155 -msgid "immediate co-processor expression too large" +#: config/tc-arm.c:1670 +msgid "alignment negative. 0 assumed." msgstr "" -#: config/tc-arm.c:2214 config/tc-arm.c:2427 config/tc-arm.c:3718 -#: config/tc-arm.c:3804 config/tc-arm.c:3868 config/tc-arm.c:4106 -#: config/tc-arm.c:4208 -msgid "immediate expression expected" +#: config/tc-arm.c:1808 +msgid "literal pool overflow" msgstr "" -#: config/tc-arm.c:2229 -msgid "co-processor address must be word aligned" +#: config/tc-arm.c:1964 config/tc-arm.c:3729 +msgid "unrecognized relocation suffix" msgstr "" -#: config/tc-arm.c:2235 config/tc-arm.c:2442 config/tc-mips.c:5037 -msgid "offset too large" +#: config/tc-arm.c:2024 +msgid "expected 0 or 1" msgstr "" -#: config/tc-arm.c:2290 -msgid "comma expected after closing square bracket" +#: config/tc-arm.c:2028 +msgid "missing comma" msgstr "" -#: config/tc-arm.c:2305 config/tc-arm.c:2489 -msgid "pc may not be used in post-increment" +#: config/tc-arm.c:2083 +msgid "dupicate .handlerdata directive" msgstr "" -#: config/tc-arm.c:2333 -msgid "'option' field too large" +#: config/tc-arm.c:2154 +msgid "personality routine specified for cantunwind frame" msgstr "" -#: config/tc-arm.c:2341 -msgid "'}' expected at end of 'option' field" +#: config/tc-arm.c:2168 +msgid "duplicate .personalityindex directive" msgstr "" -#: config/tc-arm.c:2353 -msgid "non-constant expressions for 'option' field not supported" +#: config/tc-arm.c:2175 +msgid "bad personality routine number" msgstr "" -#: config/tc-arm.c:2359 -msgid "# or { expected after comma" +#: config/tc-arm.c:2194 +msgid "duplicate .personality directive" msgstr "" -#: config/tc-arm.c:2369 config/tc-arm.c:2505 config/tc-arm.c:3020 -#: config/tc-arm.c:5530 config/tc-arm.c:6134 config/tc-arm.c:6405 -msgid "pre-indexed expression expected" +#: config/tc-arm.c:2217 config/tc-arm.c:2339 +msgid "expected register list" msgstr "" -#: config/tc-arm.c:2382 config/tc-arm.c:2518 config/tc-arm.c:3033 -#: config/tc-arm.c:5541 config/tc-arm.c:6146 config/tc-arm.c:6417 -#: config/tc-arm.c:6800 config/tc-arm.c:9110 config/tc-arm.c:9125 -msgid "missing ]" +#: config/tc-arm.c:2295 +msgid "expected , " msgstr "" -#: config/tc-arm.c:2392 config/tc-arm.c:2528 -msgid "pc may not be used with write-back" +#: config/tc-arm.c:2304 +msgid "number of registers must be in the range [1:4]" msgstr "" -#: config/tc-arm.c:2577 -msgid "Invalid NOP hint" +#: config/tc-arm.c:2401 config/tc-arm.c:2534 +msgid "bad register range" msgstr "" -#: config/tc-arm.c:2612 -msgid "comma expected after register name" +#: config/tc-arm.c:2587 +msgid "register expected" msgstr "" -#: config/tc-arm.c:2631 -msgid "CPSR or SPSR expected" +#: config/tc-arm.c:2597 +msgid "FPA .unwind_save does not take a register list" msgstr "" -#: config/tc-arm.c:2656 -msgid "comma missing after psr flags" +#: config/tc-arm.c:2610 +msgid ".unwind_save does not support this kind of register" msgstr "" -#: config/tc-arm.c:2672 config/tc-arm.c:2682 -msgid "only a register or immediate value can follow a psr flag" +#: config/tc-arm.c:2635 +msgid "SP and PC not permitted in .unwind_movsp directive" msgstr "" -#: config/tc-arm.c:2746 -msgid "rdhi, rdlo and rm must all be different" +#: config/tc-arm.c:2640 +msgid "unexpected .unwind_movsp directive" msgstr "" -#: config/tc-arm.c:2798 -msgid "rd and rm should be different in mul" +#: config/tc-arm.c:2664 +msgid "stack increment must be multiple of 4" msgstr "" -#: config/tc-arm.c:2850 -msgid "rd and rm should be different in mla" +#: config/tc-arm.c:2693 +msgid "expected , " msgstr "" -#: config/tc-arm.c:2896 -#, c-format -msgid "acc0 expected, not '%.100s'" +#: config/tc-arm.c:2711 +msgid "register must be either sp or set by a previousunwind_movsp directive" msgstr "" -#: config/tc-arm.c:2925 config/tc-arm.c:5439 -msgid "address offset too large" +#: config/tc-arm.c:2747 +msgid "expected , " msgstr "" -#: config/tc-arm.c:3130 -msgid "rdhi and rdlo must be different" +#: config/tc-arm.c:2759 +msgid "unwind opcode too long" msgstr "" -#: config/tc-arm.c:3235 -msgid "Warning: instruction unpredictable when using r15" +#: config/tc-arm.c:2764 +msgid "invalid unwind opcode" msgstr "" -#: config/tc-arm.c:3444 -msgid "use of r15 in bx in ARM mode is not really useful" +#: config/tc-arm.c:2848 +msgid "constant expression required" msgstr "" -#: config/tc-arm.c:3466 -msgid "use of r15 in bxj is not really useful" +#: config/tc-arm.c:2854 config/tc-arm.c:6176 config/tc-arm.c:11041 +#: config/tc-arm.c:11066 config/tc-arm.c:11074 config/tc-z8k.c:1125 +#: config/tc-z8k.c:1137 +msgid "immediate value out of range" msgstr "" -#: config/tc-arm.c:3524 config/tc-arm.c:3548 -msgid "Rd equal to Rm or Rn yields unpredictable results" +#: config/tc-arm.c:2949 +msgid "invalid FPA immediate expression" msgstr "" -#: config/tc-arm.c:3577 config/tc-arm.c:3588 +#: config/tc-arm.c:2999 config/tc-arm.c:3007 msgid "shift expression expected" msgstr "" -#: config/tc-arm.c:3598 +#: config/tc-arm.c:3021 msgid "'LSL' or 'ASR' required" msgstr "" -#: config/tc-arm.c:3604 +#: config/tc-arm.c:3029 msgid "'LSL' required" msgstr "" -#: config/tc-arm.c:3610 +#: config/tc-arm.c:3037 msgid "'ASR' required" msgstr "" -#: config/tc-arm.c:3632 -msgid "shift requires register or #expression" +#: config/tc-arm.c:3109 config/tc-arm.c:4190 config/tc-v850.c:1844 +#: config/tc-v850.c:1865 +msgid "constant expression expected" msgstr "" -#: config/tc-arm.c:3633 -msgid "shift requires #expression" +#: config/tc-arm.c:3116 +msgid "invalid rotation" msgstr "" -#: config/tc-arm.c:3663 -msgid "shift of 0 ignored." +#: config/tc-arm.c:3231 +msgid "']' expected" msgstr "" -#: config/tc-arm.c:3669 -msgid "invalid immediate shift" +#: config/tc-arm.c:3249 +msgid "'}' expected at end of 'option' field" msgstr "" -#: config/tc-arm.c:3723 config/tc-arm.c:3809 config/tc-arm.c:3875 -#: config/tc-arm.c:4112 config/tc-arm.c:4214 config/tc-arm.c:4536 -#: config/tc-arm.c:4760 config/tc-arm.c:5698 expr.c:1332 read.c:2198 -msgid "bad expression" +#: config/tc-arm.c:3254 +msgid "cannot combine index with option" msgstr "" -#: config/tc-arm.c:3728 config/tc-arm.c:3814 config/tc-arm.c:3881 -#: config/tc-arm.c:4118 config/tc-arm.c:4220 config/tc-arm.c:5832 -#: config/tc-arm.c:6182 config/tc-arm.c:6454 config/tc-arm.c:7063 -#: config/tc-v850.c:1924 config/tc-v850.c:1945 -msgid "constant expression expected" +#: config/tc-arm.c:3267 +msgid "cannot combine pre- and post-indexing" msgstr "" -#: config/tc-arm.c:3734 config/tc-arm.c:3820 config/tc-arm.c:4545 -#: config/tc-arm.c:4769 config/tc-arm.c:5109 config/tc-arm.c:8198 -#: config/tc-arm.c:8233 config/tc-arm.c:8243 config/tc-z8k.c:1125 -#: config/tc-z8k.c:1137 -msgid "immediate value out of range" +#: config/tc-arm.c:3363 +msgid "flag for {c}psr instruction expected" +msgstr "" + +#: config/tc-arm.c:3388 +msgid "unrecognized CPS flag" msgstr "" -#: config/tc-arm.c:4020 -msgid "missing endian specifier" +#: config/tc-arm.c:3395 +msgid "missing CPS flags" msgstr "" -#: config/tc-arm.c:4029 +#: config/tc-arm.c:3418 config/tc-arm.c:3424 msgid "valid endian specifiers are be or le" msgstr "" -#: config/tc-arm.c:4096 config/tc-arm.c:4198 +#: config/tc-arm.c:3446 msgid "missing rotation field after comma" msgstr "" -#: config/tc-arm.c:4140 config/tc-arm.c:4243 -msgid "rotation can be 8, 16, 24 or 0 when field is ommited" +#: config/tc-arm.c:3461 +msgid "rotation can only be 0, 8, 16, or 24" msgstr "" -#: config/tc-arm.c:4492 -msgid "unrecognized flag" +#: config/tc-arm.c:3481 +msgid "condition required" msgstr "" -#: config/tc-arm.c:4499 -msgid "no 'a', 'i', or 'f' flags for 'cps'" +#: config/tc-arm.c:3770 +msgid "iWMMXt data or control register expected" msgstr "" -#: config/tc-arm.c:4810 -msgid "lo register required" +#: config/tc-arm.c:3888 +msgid "garbage following instruction" msgstr "" -#: config/tc-arm.c:4818 -msgid "hi register required" +#: config/tc-arm.c:4022 +msgid "instruction does not accept preindexed addressing" msgstr "" -#: config/tc-arm.c:4886 -msgid "only lo regs allowed with immediate" +#. unindexed - only for coprocessor +#: config/tc-arm.c:4038 config/tc-arm.c:5691 +msgid "instruction does not accept unindexed addressing" msgstr "" -#: config/tc-arm.c:4905 config/tc-xtensa.c:4123 -msgid "invalid immediate" +#: config/tc-arm.c:4046 +msgid "destination register same as write-back base" msgstr "" -#: config/tc-arm.c:5141 config/tc-arm.c:5285 -msgid "non-word size not supported with control register" +#: config/tc-arm.c:4047 +msgid "source register same as write-back base" msgstr "" -#: config/tc-arm.c:5155 -msgid "only r15 allowed here" +#: config/tc-arm.c:4095 +msgid "instruction does not accept scaled register index" msgstr "" -#: config/tc-arm.c:5283 -msgid "conditional execution not supported with control register" +#: config/tc-arm.c:4136 +msgid "instruction does not support unindexed addressing" msgstr "" -#: config/tc-arm.c:5493 -msgid "'[' expected after PLD mnemonic" +#: config/tc-arm.c:4151 +msgid "pc may not be used with write-back" msgstr "" -#: config/tc-arm.c:5515 -msgid "post-indexed expression used in preload instruction" +#: config/tc-arm.c:4156 +msgid "instruction does not support writeback" msgstr "" -#: config/tc-arm.c:5520 config/tc-arm.c:5550 -msgid "writeback used in preload instruction" +#: config/tc-arm.c:4185 +msgid "invalid pseudo operation" +msgstr "" + +#: config/tc-arm.c:4231 +msgid "literal pool insertion failed" msgstr "" -#: config/tc-arm.c:5591 -msgid "destination register must be even" +#: config/tc-arm.c:4374 config/tc-arm.c:4393 config/tc-arm.c:4406 +#: config/tc-arm.c:6072 config/tc-arm.c:6092 config/tc-arm.c:6106 +msgid "bit-field extends past end of register" +msgstr "" + +#: config/tc-arm.c:4435 +msgid "the only suffix valid here is '(plt)'" +msgstr "" + +#: config/tc-arm.c:4468 +msgid "use of r15 in blx in ARM mode is not really useful" +msgstr "" + +#: config/tc-arm.c:4486 +msgid "use of r15 in bx in ARM mode is not really useful" +msgstr "" + +#: config/tc-arm.c:4498 config/tc-arm.c:6212 +msgid "use of r15 in bxj is not really useful" msgstr "" -#: config/tc-arm.c:5597 +#: config/tc-arm.c:4602 config/tc-arm.c:4611 +msgid "writeback of base register is UNPREDICTABLE" +msgstr "" + +#: config/tc-arm.c:4605 +msgid "writeback of base register when in register list is UNPREDICTABLE" +msgstr "" + +#: config/tc-arm.c:4615 +msgid "if writeback register is in list, it must be the lowest reg in the list" +msgstr "" + +#: config/tc-arm.c:4630 +msgid "first destination register must be even" +msgstr "" + +#: config/tc-arm.c:4633 config/tc-arm.c:4690 +msgid "can only load two consecutive registers" +msgstr "" + +#. If op 1 were present and equal to PC, this function wouldn't +#. have been called in the first place. +#. If op 2 were present and equal to PC, this function wouldn't +#. have been called in the first place. +#: config/tc-arm.c:4634 config/tc-arm.c:4693 config/tc-arm.c:5140 +#: config/tc-arm.c:6539 msgid "r14 not allowed here" msgstr "" -#: config/tc-arm.c:5604 -msgid "pre/post-indexing used when modified address register is destination" +#: config/tc-arm.c:4635 +msgid "'[' expected" msgstr "" -#: config/tc-arm.c:5614 -msgid "ldrd destination registers must not overlap index register" +#: config/tc-arm.c:4648 +msgid "base register written back, and overlaps second destination register" msgstr "" -#: config/tc-arm.c:5874 -msgid "register or shift expression expected" +#: config/tc-arm.c:4656 +msgid "index register overlaps destination register" msgstr "" -#: config/tc-arm.c:5926 -msgid "invalid floating point immediate expression" +#: config/tc-arm.c:4670 config/tc-arm.c:5113 config/tc-arm.c:6405 +#: config/tc-arm.c:7165 +msgid "instruction does not accept this addressing mode" msgstr "" -#: config/tc-arm.c:5930 -msgid "floating point register or immediate expression expected" +#: config/tc-arm.c:4676 config/tc-arm.c:5122 +msgid "offset must be zero in ARM encoding" msgstr "" -#: config/tc-arm.c:6076 config/tc-arm.c:6264 config/tc-arm.c:6345 -msgid "address expected" +#: config/tc-arm.c:4687 config/tc-arm.c:5134 +msgid "even register required" msgstr "" -#: config/tc-arm.c:6106 config/tc-arm.c:6118 config/tc-arm.c:6155 -#: config/tc-arm.c:6282 config/tc-arm.c:6375 config/tc-arm.c:6389 -#: config/tc-arm.c:6426 -#, c-format -msgid "%s register same as write-back base" +#: config/tc-arm.c:4718 config/tc-arm.c:4749 +msgid "this instruction requires a post-indexed address" msgstr "" -#: config/tc-arm.c:6108 config/tc-arm.c:6120 config/tc-arm.c:6157 -#: config/tc-arm.c:6284 config/tc-arm.c:6377 config/tc-arm.c:6391 -#: config/tc-arm.c:6428 -msgid "destination" +#: config/tc-arm.c:4776 +msgid "rd and rm should be different in mla" msgstr "" -#: config/tc-arm.c:6108 config/tc-arm.c:6120 config/tc-arm.c:6157 -#: config/tc-arm.c:6284 config/tc-arm.c:6377 config/tc-arm.c:6391 -#: config/tc-arm.c:6428 -msgid "source" +#: config/tc-arm.c:4808 config/tc-arm.c:6741 +msgid "'CPSR' or 'SPSR' expected" msgstr "" -#: config/tc-arm.c:6167 config/tc-arm.c:6438 config/tc-arm.c:8411 -msgid "invalid pseudo operation" +#: config/tc-arm.c:4841 +msgid "rd and rm should be different in mul" msgstr "" -#: config/tc-arm.c:6219 config/tc-arm.c:6489 -msgid "literal pool insertion failed" +#: config/tc-arm.c:4862 +msgid "rdhi, rdlo and rm must all be different" msgstr "" -#: config/tc-arm.c:6312 config/tc-arm.c:6318 -msgid "post-indexed expression expected" +#: config/tc-arm.c:4924 +msgid "'[' expected after PLD mnemonic" msgstr "" -#: config/tc-arm.c:6553 -msgid "bad range in register list" +#: config/tc-arm.c:4926 +msgid "post-indexed expression used in preload instruction" msgstr "" -#: config/tc-arm.c:6561 config/tc-arm.c:6570 config/tc-arm.c:6612 -#, c-format -msgid "Warning: duplicated register (r%d) in register list" +#: config/tc-arm.c:4928 +msgid "writeback used in preload instruction" msgstr "" -#: config/tc-arm.c:6573 -msgid "Warning: register range not in ascending order" +#: config/tc-arm.c:4930 +msgid "unindexed addressing used in preload instruction" msgstr "" -#: config/tc-arm.c:6585 -msgid "missing `}'" +#: config/tc-arm.c:5029 config/tc-arm.c:7076 +msgid "source1 and dest must be same register" msgstr "" -#: config/tc-arm.c:6601 -msgid "invalid register mask" +#: config/tc-arm.c:5079 config/tc-arm.c:6798 +msgid "rdhi and rdlo must be different" msgstr "" -#: config/tc-arm.c:6659 -msgid "r15 not allowed as base register" +#: config/tc-arm.c:5137 +msgid "can only store two consecutive registers" msgstr "" -#: config/tc-arm.c:6693 config/tc-arm.c:6702 -msgid "writeback of base register is UNPREDICTABLE" +#: config/tc-arm.c:5232 config/tc-arm.c:5249 +msgid "only two consecutive VFP SP registers allowed here" msgstr "" -#: config/tc-arm.c:6696 -msgid "writeback of base register when in register list is UNPREDICTABLE" +#: config/tc-arm.c:5277 config/tc-arm.c:5292 +msgid "this addressing mode requires base-register writeback" msgstr "" -#: config/tc-arm.c:6706 -msgid "if writeback register is in list, it must be the lowest reg in the list" +#: config/tc-arm.c:5370 +msgid "this instruction does not support indexing" msgstr "" -#: config/tc-arm.c:6760 config/tc-arm.c:6774 -msgid "r15 not allowed in swap" +#: config/tc-arm.c:5393 +msgid "only r15 allowed here" msgstr "" -#: config/tc-arm.c:7069 -msgid "constant value required for number of registers" +#: config/tc-arm.c:5603 config/tc-arm.c:10418 +msgid "shift expression is too large" msgstr "" -#: config/tc-arm.c:7077 config/tc-arm.c:14226 -msgid "number of registers must be in the range [1:4]" +#: config/tc-arm.c:5629 +msgid "Thumb does not support the ldr =N pseudo-operation" msgstr "" -#: config/tc-arm.c:7138 -msgid "r15 not allowed as base register with write-back" +#: config/tc-arm.c:5634 +msgid "cannot use register index with PC-relative addressing" msgstr "" -#: config/tc-arm.c:7533 config/tc-arm.c:7572 config/tc-h8300.c:1010 -#: config/tc-mips.c:9585 config/tc-mips.c:9615 -msgid "invalid register list" +#: config/tc-arm.c:5635 +msgid "cannot use register index with this instruction" msgstr "" -#: config/tc-arm.c:7539 config/tc-arm.c:14310 config/tc-arm.c:14317 -msgid "register list not in ascending order" +#: config/tc-arm.c:5637 +msgid "Thumb does not support negative register indexing" msgstr "" -#: config/tc-arm.c:7564 -msgid "register range not in ascending order" +#: config/tc-arm.c:5639 +msgid "Thumb does not support register post-indexing" msgstr "" -#: config/tc-arm.c:7597 -msgid "non-contiguous register range" +#: config/tc-arm.c:5641 +msgid "Thumb does not support register indexing with writeback" msgstr "" -#: config/tc-arm.c:7626 config/tc-arm.c:7663 -msgid "only two consecutive VFP SP registers allowed here" +#: config/tc-arm.c:5643 +msgid "Thumb supports only LSL in shifted register indexing" msgstr "" -#: config/tc-arm.c:7810 -msgid "VFP system register expected" +#: config/tc-arm.c:5651 +msgid "shift out of range" msgstr "" -#: config/tc-arm.c:7921 config/tc-arm.c:7958 -msgid "this addressing mode requires base-register writeback" +#: config/tc-arm.c:5659 +msgid "cannot use writeback with PC-relative addressing" msgstr "" -#: config/tc-arm.c:8140 config/tc-arm.c:9219 -msgid "dest and source1 must be the same register" +#: config/tc-arm.c:5661 +msgid "cannot use writeback with this instruction" msgstr "" -#: config/tc-arm.c:8147 -msgid "subtract valid only on lo regs" +#: config/tc-arm.c:5681 +msgid "cannot use post-indexing with PC-relative addressing" msgstr "" -#: config/tc-arm.c:8171 -msgid "invalid Hi register with immediate" +#: config/tc-arm.c:5682 +msgid "cannot use post-indexing with this instruction" msgstr "" -#: config/tc-arm.c:8211 -msgid "invalid immediate value for stack adjust" +#: config/tc-arm.c:5849 config/tc-arm.c:5958 config/tc-arm.c:6038 +#: config/tc-arm.c:6712 +msgid "shift must be constant" msgstr "" -#: config/tc-arm.c:8222 -msgid "invalid immediate for address calculation" +#: config/tc-arm.c:5876 config/tc-arm.c:5973 config/tc-arm.c:6053 +#: config/tc-arm.c:6725 +msgid "unshifted register required" msgstr "" -#: config/tc-arm.c:8307 -msgid "source1 and dest must be same register" +#: config/tc-arm.c:5891 config/tc-arm.c:6064 config/tc-arm.c:6785 +msgid "dest must overlap one source register" msgstr "" -#: config/tc-arm.c:8341 -msgid "invalid immediate for shift" +#: config/tc-arm.c:5976 +msgid "dest and source1 must be the same register" msgstr "" -#: config/tc-arm.c:8402 -msgid "expected ']'" +#: config/tc-arm.c:6241 +msgid "Thumb does not support the 2-argument form of this instruction" msgstr "" -#: config/tc-arm.c:8475 -msgid "byte or halfword not valid for base register" +#: config/tc-arm.c:6315 +msgid "Thumb load/store multiple does not support {reglist}^" msgstr "" -#: config/tc-arm.c:8480 -msgid "r15 based store not allowed" +#: config/tc-arm.c:6332 config/tc-arm.c:6348 config/tc-arm.c:6379 +#, c-format +msgid "value stored for r%d is UNPREDICTABLE" msgstr "" -#: config/tc-arm.c:8485 -msgid "invalid base register for register offset" +#: config/tc-arm.c:6342 config/tc-arm.c:6909 +msgid "SP should not be in register list" msgstr "" -#: config/tc-arm.c:8503 config/tc-arm.c:8538 -msgid "invalid offset" +#: config/tc-arm.c:6346 config/tc-arm.c:6913 +msgid "PC should not be in register list" msgstr "" -#: config/tc-arm.c:8514 -msgid "invalid base register in load/store" +#: config/tc-arm.c:6355 config/tc-arm.c:6919 +msgid "LR and PC should not both be in register list" msgstr "" -#: config/tc-arm.c:8990 -msgid "expecting immediate, 7bit operand" +#: config/tc-arm.c:6358 +msgid "base register should not be in register list when written back" msgstr "" -#: config/tc-arm.c:9005 -msgid "immediate out of range" +#: config/tc-arm.c:6376 config/tc-arm.c:6386 +msgid "this instruction will write back the base register" msgstr "" -#: config/tc-arm.c:9058 -msgid "offset expected" +#: config/tc-arm.c:6389 +msgid "this instruction will not write back the base register" msgstr "" -#: config/tc-arm.c:9067 config/tc-pj.c:536 config/tc-sh.c:4107 -msgid "offset out of range" +#: config/tc-arm.c:6418 +msgid "r14 not allowed as first register when second register is omitted" msgstr "" -#: config/tc-arm.c:9072 -msgid "offset not a multiple of 4" +#: config/tc-arm.c:6462 config/tc-arm.c:6475 config/tc-arm.c:6511 +msgid "Thumb does not support this addressing mode" msgstr "" -#: config/tc-arm.c:9227 -msgid "Rs and Rd must be different in MUL" +#: config/tc-arm.c:6479 +msgid "byte or halfword not valid for base register" msgstr "" -#: config/tc-arm.c:9362 -msgid "" -"inserted missing '!': load/store multiple always writes back base register" +#: config/tc-arm.c:6482 +msgid "r15 based store not allowed" msgstr "" -#: config/tc-arm.c:9384 -msgid "only lo-regs valid in load/store multiple" +#: config/tc-arm.c:6484 +msgid "invalid base register for register offset" msgstr "" -#: config/tc-arm.c:9426 -msgid "syntax: ldrs[b] Rd, [Rb, Ro]" +#: config/tc-arm.c:6661 +msgid "only lo regs allowed with immediate" msgstr "" -#: config/tc-arm.c:9486 +#: config/tc-arm.c:6750 +msgid "Thumb encoding does not support an immediate here" +msgstr "" + +#: config/tc-arm.c:6820 +msgid "Thumb does not support NOP with hints" +msgstr "" + +#: config/tc-arm.c:6891 +msgid "push/pop do not support {reglist}^" +msgstr "" + +#: config/tc-arm.c:6926 msgid "invalid register list to push/pop instruction" msgstr "" -#: config/tc-arm.c:9589 config/tc-arm.c:10966 -msgid "virtual memory exhausted" +#: config/tc-arm.c:7097 +msgid "ror #imm not supported" msgstr "" -#: config/tc-arm.c:9613 -#, c-format -msgid "failed to create an alias for %s, reason: %s" +#: config/tc-arm.c:7222 +msgid "Thumb encoding does not support rotation" msgstr "" -#: config/tc-arm.c:9677 +#: config/tc-arm.c:7465 config/tc-arm.c:7532 +msgid "conditional infixes are deprecated in unified syntax" +msgstr "" + +#: config/tc-arm.c:7564 #, c-format -msgid "register '%s' does not exist\n" +msgid "bad instruction `%s'" msgstr "" -#: config/tc-arm.c:9681 +#: config/tc-arm.c:7574 config/tc-arm.c:7606 #, c-format -msgid "" -"ignoring redefinition of register alias '%s' to non-existant register '%s'" +msgid "selected processor does not support `%s'" +msgstr "" + +#: config/tc-arm.c:7580 +msgid "Thumb does not support conditional execution" msgstr "" -#: config/tc-arm.c:9690 +#: config/tc-arm.c:7596 #, c-format -msgid "ignoring redefinition of register alias '%s'" +msgid "cannot honor width suffix -- `%s'" msgstr "" -#: config/tc-arm.c:9696 -msgid "ignoring incomplete .req pseuso op" +#: config/tc-arm.c:7611 +#, c-format +msgid "width suffixes are invalid in ARM mode -- `%s'" msgstr "" -#: config/tc-arm.c:10990 -msgid "use of old and new-style options to set CPU type" +#: config/tc-arm.c:9454 +msgid "alignments greater than 32 bytes not supported in .text sections." msgstr "" -#: config/tc-arm.c:11000 -msgid "use of old and new-style options to set FPU type" +#: config/tc-arm.c:9748 +msgid "handerdata in cantunwind frame" msgstr "" -#: config/tc-arm.c:11062 -msgid "hard-float conflicts with specified fpu" +#: config/tc-arm.c:9765 +msgid "too many unwind opcodes for personality routine 0" msgstr "" -#: config/tc-arm.c:11246 -msgid "bad call to MD_ATOF()" +#: config/tc-arm.c:9797 +msgid "too many unwind opcodes" msgstr "" -#: config/tc-arm.c:11402 +#: config/tc-arm.c:10163 config/tc-arm.c:10442 #, c-format msgid "undefined symbol %s used as an immediate value" msgstr "" -#: config/tc-arm.c:11416 +#: config/tc-arm.c:10177 config/tc-arm.c:10457 #, c-format msgid "invalid constant (%lx) after fixup" msgstr "" -#: config/tc-arm.c:11453 +#: config/tc-arm.c:10214 #, c-format msgid "unable to compute ADRL instructions for PC offset of 0x%lx" msgstr "" -#: config/tc-arm.c:11483 -#, c-format -msgid "bad immediate value for offset (%ld)" +#: config/tc-arm.c:10246 config/tc-arm.c:10271 +msgid "invalid literal constant: pool needs to be closer" msgstr "" -#: config/tc-arm.c:11505 config/tc-arm.c:11527 -msgid "invalid literal constant: pool needs to be closer" +#: config/tc-arm.c:10249 config/tc-arm.c:10287 +#, c-format +msgid "bad immediate value for offset (%ld)" msgstr "" -#: config/tc-arm.c:11507 +#: config/tc-arm.c:10273 #, c-format msgid "bad immediate value for half-word offset (%ld)" msgstr "" -#: config/tc-arm.c:11544 -msgid "shift expression is too large" +#: config/tc-arm.c:10329 +msgid "offset not a multiple of 4" +msgstr "" + +#: config/tc-arm.c:10336 config/tc-arm.c:10351 config/tc-arm.c:10366 +#: config/tc-arm.c:10377 config/tc-arm.c:10400 config/tc-pj.c:499 +#: config/tc-sh.c:4111 +msgid "offset out of range" msgstr "" -#: config/tc-arm.c:11561 +#: config/tc-arm.c:10474 msgid "invalid smi expression" msgstr "" -#: config/tc-arm.c:11572 config/tc-arm.c:11581 +#: config/tc-arm.c:10485 config/tc-arm.c:10494 msgid "invalid swi expression" msgstr "" -#: config/tc-arm.c:11591 +#: config/tc-arm.c:10504 msgid "invalid expression in load/store multiple" msgstr "" -#: config/tc-arm.c:11641 +#: config/tc-arm.c:10554 msgid "GAS can't handle same-section branch dest >= 0x04000000" msgstr "" -#: config/tc-arm.c:11650 +#: config/tc-arm.c:10563 msgid "out of range branch" msgstr "" -#: config/tc-arm.c:11707 config/tc-arm.c:11732 +#: config/tc-arm.c:10619 config/tc-arm.c:10645 config/tc-arm.c:10670 +#: config/tc-arm.c:10817 msgid "branch out of range" msgstr "" -#: config/tc-arm.c:11765 -msgid "branch with link out of range" +#: config/tc-arm.c:10705 +msgid "conditional branch out of range" msgstr "" -#: config/tc-arm.c:11858 -msgid "rel31 relocation overflow" +#: config/tc-arm.c:10751 +msgid "branch with link out of range" msgstr "" -#: config/tc-arm.c:11874 -msgid "illegal value for co-processor offset" +#: config/tc-arm.c:10906 +msgid "rel31 relocation overflow" msgstr "" -#: config/tc-arm.c:11886 -msgid "Illegal value for co-processor offset" +#: config/tc-arm.c:10921 config/tc-arm.c:10936 +msgid "co-processor offset out of range" msgstr "" -#: config/tc-arm.c:11910 +#: config/tc-arm.c:10952 #, c-format -msgid "invalid offset, target not word aligned (0x%08X)" +msgid "invalid offset, target not word aligned (0x%08lX)" msgstr "" -#: config/tc-arm.c:11916 config/tc-arm.c:11926 config/tc-arm.c:11934 -#: config/tc-arm.c:11942 config/tc-arm.c:11950 +#: config/tc-arm.c:10958 config/tc-arm.c:10967 config/tc-arm.c:10975 +#: config/tc-arm.c:10983 config/tc-arm.c:10991 #, c-format msgid "invalid offset, value too big (0x%08lX)" msgstr "" -#: config/tc-arm.c:11990 +#: config/tc-arm.c:11032 +msgid "invalid Hi register with immediate" +msgstr "" + +#: config/tc-arm.c:11048 msgid "invalid immediate for stack address calculation" msgstr "" -#: config/tc-arm.c:11999 +#: config/tc-arm.c:11056 #, c-format msgid "invalid immediate for address calculation (value = 0x%08lX)" msgstr "" -#: config/tc-arm.c:12009 -msgid "invalid 8bit immediate" -msgstr "" - -#: config/tc-arm.c:12017 -msgid "invalid 3bit immediate" -msgstr "" - -#: config/tc-arm.c:12033 +#: config/tc-arm.c:11086 #, c-format msgid "invalid immediate: %ld is too large" msgstr "" -#: config/tc-arm.c:12048 +#: config/tc-arm.c:11098 #, c-format -msgid "illegal Thumb shift value: %ld" +msgid "invalid shift value: %ld" msgstr "" -#: config/tc-arm.c:12062 +#: config/tc-arm.c:11117 #, c-format msgid "bad relocation fixup type (%d)" msgstr "" -#: config/tc-arm.c:12133 +#: config/tc-arm.c:11191 msgid "literal referenced across section boundary" msgstr "" -#: config/tc-arm.c:12151 +#: config/tc-arm.c:11221 msgid "internal relocation (type: IMMEDIATE) not fixed up" msgstr "" -#: config/tc-arm.c:12156 +#: config/tc-arm.c:11226 msgid "ADRL used for a symbol not defined in the same file" msgstr "" -#: config/tc-arm.c:12165 +#: config/tc-arm.c:11235 #, c-format msgid "undefined local label `%s'" msgstr "" -#: config/tc-arm.c:12171 +#: config/tc-arm.c:11241 msgid "internal_relocation (type: OFFSET_IMM) not fixed up" msgstr "" -#: config/tc-arm.c:12191 config/tc-cris.c:3936 config/tc-mcore.c:2053 -#: config/tc-mmix.c:2930 config/tc-ns32k.c:2393 +#: config/tc-arm.c:11261 config/tc-cris.c:3869 config/tc-mcore.c:1997 +#: config/tc-mmix.c:2888 config/tc-ns32k.c:2304 msgid "" msgstr "" -#: config/tc-arm.c:12194 config/tc-arm.c:12215 +#: config/tc-arm.c:11264 config/tc-arm.c:11285 #, c-format msgid "cannot represent %s relocation in this object file format" msgstr "" -#: config/tc-arm.c:12342 +#: config/tc-arm.c:11505 #, c-format -msgid "no operator -- statement `%s'\n" +msgid "%s: unexpected function type: %d" msgstr "" -#: config/tc-arm.c:12360 config/tc-arm.c:12386 -#, c-format -msgid "selected processor does not support `%s'" +#: config/tc-arm.c:11582 +msgid "virtual memory exhausted" msgstr "" -#: config/tc-arm.c:12404 -#, c-format -msgid "bad instruction `%s'" +#: config/tc-arm.c:11608 +msgid "use of old and new-style options to set CPU type" +msgstr "" + +#: config/tc-arm.c:11618 +msgid "use of old and new-style options to set FPU type" +msgstr "" + +#: config/tc-arm.c:11680 +msgid "hard-float conflicts with specified fpu" msgstr "" -#: config/tc-arm.c:12505 +#: config/tc-arm.c:11872 msgid "generate PIC code" msgstr "" -#: config/tc-arm.c:12506 +#: config/tc-arm.c:11873 msgid "assemble Thumb code" msgstr "" -#: config/tc-arm.c:12507 +#: config/tc-arm.c:11874 msgid "support ARM/Thumb interworking" msgstr "" -#: config/tc-arm.c:12509 +#: config/tc-arm.c:11876 msgid "code uses 32-bit program counter" msgstr "" -#: config/tc-arm.c:12510 +#: config/tc-arm.c:11877 msgid "code uses 26-bit program counter" msgstr "" -#: config/tc-arm.c:12511 +#: config/tc-arm.c:11878 msgid "floating point args are in fp regs" msgstr "" -#: config/tc-arm.c:12513 +#: config/tc-arm.c:11880 msgid "re-entrant code" msgstr "" -#: config/tc-arm.c:12514 +#: config/tc-arm.c:11881 msgid "code is ATPCS conformant" msgstr "" -#: config/tc-arm.c:12515 +#: config/tc-arm.c:11882 msgid "assemble for big-endian" msgstr "" -#: config/tc-arm.c:12516 +#: config/tc-arm.c:11883 msgid "assemble for little-endian" msgstr "" #. These are recognized by the assembler, but have no affect on code. -#: config/tc-arm.c:12520 +#: config/tc-arm.c:11887 msgid "use frame pointer" msgstr "" -#: config/tc-arm.c:12521 +#: config/tc-arm.c:11888 msgid "use stack size checking" msgstr "" #. DON'T add any new processors to this list -- we want the whole list #. to go away... Add them to the processors table instead. -#: config/tc-arm.c:12525 config/tc-arm.c:12526 +#: config/tc-arm.c:11892 config/tc-arm.c:11893 msgid "use -mcpu=arm1" msgstr "" -#: config/tc-arm.c:12527 config/tc-arm.c:12528 +#: config/tc-arm.c:11894 config/tc-arm.c:11895 msgid "use -mcpu=arm2" msgstr "" -#: config/tc-arm.c:12529 config/tc-arm.c:12530 +#: config/tc-arm.c:11896 config/tc-arm.c:11897 msgid "use -mcpu=arm250" msgstr "" -#: config/tc-arm.c:12531 config/tc-arm.c:12532 +#: config/tc-arm.c:11898 config/tc-arm.c:11899 msgid "use -mcpu=arm3" msgstr "" -#: config/tc-arm.c:12533 config/tc-arm.c:12534 +#: config/tc-arm.c:11900 config/tc-arm.c:11901 msgid "use -mcpu=arm6" msgstr "" -#: config/tc-arm.c:12535 config/tc-arm.c:12536 +#: config/tc-arm.c:11902 config/tc-arm.c:11903 msgid "use -mcpu=arm600" msgstr "" -#: config/tc-arm.c:12537 config/tc-arm.c:12538 +#: config/tc-arm.c:11904 config/tc-arm.c:11905 msgid "use -mcpu=arm610" msgstr "" -#: config/tc-arm.c:12539 config/tc-arm.c:12540 +#: config/tc-arm.c:11906 config/tc-arm.c:11907 msgid "use -mcpu=arm620" msgstr "" -#: config/tc-arm.c:12541 config/tc-arm.c:12542 +#: config/tc-arm.c:11908 config/tc-arm.c:11909 msgid "use -mcpu=arm7" msgstr "" -#: config/tc-arm.c:12543 config/tc-arm.c:12544 +#: config/tc-arm.c:11910 config/tc-arm.c:11911 msgid "use -mcpu=arm70" msgstr "" -#: config/tc-arm.c:12545 config/tc-arm.c:12546 +#: config/tc-arm.c:11912 config/tc-arm.c:11913 msgid "use -mcpu=arm700" msgstr "" -#: config/tc-arm.c:12547 config/tc-arm.c:12548 +#: config/tc-arm.c:11914 config/tc-arm.c:11915 msgid "use -mcpu=arm700i" msgstr "" -#: config/tc-arm.c:12549 config/tc-arm.c:12550 +#: config/tc-arm.c:11916 config/tc-arm.c:11917 msgid "use -mcpu=arm710" msgstr "" -#: config/tc-arm.c:12551 config/tc-arm.c:12552 +#: config/tc-arm.c:11918 config/tc-arm.c:11919 msgid "use -mcpu=arm710c" msgstr "" -#: config/tc-arm.c:12553 config/tc-arm.c:12554 +#: config/tc-arm.c:11920 config/tc-arm.c:11921 msgid "use -mcpu=arm720" msgstr "" -#: config/tc-arm.c:12555 config/tc-arm.c:12556 +#: config/tc-arm.c:11922 config/tc-arm.c:11923 msgid "use -mcpu=arm7d" msgstr "" -#: config/tc-arm.c:12557 config/tc-arm.c:12558 +#: config/tc-arm.c:11924 config/tc-arm.c:11925 msgid "use -mcpu=arm7di" msgstr "" -#: config/tc-arm.c:12559 config/tc-arm.c:12560 +#: config/tc-arm.c:11926 config/tc-arm.c:11927 msgid "use -mcpu=arm7m" msgstr "" -#: config/tc-arm.c:12561 config/tc-arm.c:12562 +#: config/tc-arm.c:11928 config/tc-arm.c:11929 msgid "use -mcpu=arm7dm" msgstr "" -#: config/tc-arm.c:12563 config/tc-arm.c:12564 +#: config/tc-arm.c:11930 config/tc-arm.c:11931 msgid "use -mcpu=arm7dmi" msgstr "" -#: config/tc-arm.c:12565 config/tc-arm.c:12566 +#: config/tc-arm.c:11932 config/tc-arm.c:11933 msgid "use -mcpu=arm7100" msgstr "" -#: config/tc-arm.c:12567 config/tc-arm.c:12568 +#: config/tc-arm.c:11934 config/tc-arm.c:11935 msgid "use -mcpu=arm7500" msgstr "" -#: config/tc-arm.c:12569 config/tc-arm.c:12570 +#: config/tc-arm.c:11936 config/tc-arm.c:11937 msgid "use -mcpu=arm7500fe" msgstr "" -#: config/tc-arm.c:12571 config/tc-arm.c:12572 config/tc-arm.c:12573 -#: config/tc-arm.c:12574 +#: config/tc-arm.c:11938 config/tc-arm.c:11939 config/tc-arm.c:11940 +#: config/tc-arm.c:11941 msgid "use -mcpu=arm7tdmi" msgstr "" -#: config/tc-arm.c:12575 config/tc-arm.c:12576 +#: config/tc-arm.c:11942 config/tc-arm.c:11943 msgid "use -mcpu=arm710t" msgstr "" -#: config/tc-arm.c:12577 config/tc-arm.c:12578 +#: config/tc-arm.c:11944 config/tc-arm.c:11945 msgid "use -mcpu=arm720t" msgstr "" -#: config/tc-arm.c:12579 config/tc-arm.c:12580 +#: config/tc-arm.c:11946 config/tc-arm.c:11947 msgid "use -mcpu=arm740t" msgstr "" -#: config/tc-arm.c:12581 config/tc-arm.c:12582 +#: config/tc-arm.c:11948 config/tc-arm.c:11949 msgid "use -mcpu=arm8" msgstr "" -#: config/tc-arm.c:12583 config/tc-arm.c:12584 +#: config/tc-arm.c:11950 config/tc-arm.c:11951 msgid "use -mcpu=arm810" msgstr "" -#: config/tc-arm.c:12585 config/tc-arm.c:12586 +#: config/tc-arm.c:11952 config/tc-arm.c:11953 msgid "use -mcpu=arm9" msgstr "" -#: config/tc-arm.c:12587 config/tc-arm.c:12588 +#: config/tc-arm.c:11954 config/tc-arm.c:11955 msgid "use -mcpu=arm9tdmi" msgstr "" -#: config/tc-arm.c:12589 config/tc-arm.c:12590 +#: config/tc-arm.c:11956 config/tc-arm.c:11957 msgid "use -mcpu=arm920" msgstr "" -#: config/tc-arm.c:12591 config/tc-arm.c:12592 +#: config/tc-arm.c:11958 config/tc-arm.c:11959 msgid "use -mcpu=arm940" msgstr "" -#: config/tc-arm.c:12593 +#: config/tc-arm.c:11960 msgid "use -mcpu=strongarm" msgstr "" -#: config/tc-arm.c:12595 +#: config/tc-arm.c:11962 msgid "use -mcpu=strongarm110" msgstr "" -#: config/tc-arm.c:12597 +#: config/tc-arm.c:11964 msgid "use -mcpu=strongarm1100" msgstr "" -#: config/tc-arm.c:12599 +#: config/tc-arm.c:11966 msgid "use -mcpu=strongarm1110" msgstr "" -#: config/tc-arm.c:12600 +#: config/tc-arm.c:11967 msgid "use -mcpu=xscale" msgstr "" -#: config/tc-arm.c:12601 +#: config/tc-arm.c:11968 msgid "use -mcpu=iwmmxt" msgstr "" -#: config/tc-arm.c:12602 +#: config/tc-arm.c:11969 msgid "use -mcpu=all" msgstr "" #. Architecture variants -- don't add any more to this list either. -#: config/tc-arm.c:12605 config/tc-arm.c:12606 +#: config/tc-arm.c:11972 config/tc-arm.c:11973 msgid "use -march=armv2" msgstr "" -#: config/tc-arm.c:12607 config/tc-arm.c:12608 +#: config/tc-arm.c:11974 config/tc-arm.c:11975 msgid "use -march=armv2a" msgstr "" -#: config/tc-arm.c:12609 config/tc-arm.c:12610 +#: config/tc-arm.c:11976 config/tc-arm.c:11977 msgid "use -march=armv3" msgstr "" -#: config/tc-arm.c:12611 config/tc-arm.c:12612 +#: config/tc-arm.c:11978 config/tc-arm.c:11979 msgid "use -march=armv3m" msgstr "" -#: config/tc-arm.c:12613 config/tc-arm.c:12614 +#: config/tc-arm.c:11980 config/tc-arm.c:11981 msgid "use -march=armv4" msgstr "" -#: config/tc-arm.c:12615 config/tc-arm.c:12616 +#: config/tc-arm.c:11982 config/tc-arm.c:11983 msgid "use -march=armv4t" msgstr "" -#: config/tc-arm.c:12617 config/tc-arm.c:12618 +#: config/tc-arm.c:11984 config/tc-arm.c:11985 msgid "use -march=armv5" msgstr "" -#: config/tc-arm.c:12619 config/tc-arm.c:12620 +#: config/tc-arm.c:11986 config/tc-arm.c:11987 msgid "use -march=armv5t" msgstr "" -#: config/tc-arm.c:12621 config/tc-arm.c:12622 +#: config/tc-arm.c:11988 config/tc-arm.c:11989 msgid "use -march=armv5te" msgstr "" #. Floating point variants -- don't add any more to this list either. -#: config/tc-arm.c:12625 +#: config/tc-arm.c:11992 msgid "use -mfpu=fpe" msgstr "" -#: config/tc-arm.c:12626 +#: config/tc-arm.c:11993 msgid "use -mfpu=fpa10" msgstr "" -#: config/tc-arm.c:12627 +#: config/tc-arm.c:11994 msgid "use -mfpu=fpa11" msgstr "" -#: config/tc-arm.c:12629 +#: config/tc-arm.c:11996 msgid "use either -mfpu=softfpa or -mfpu=softvfp" msgstr "" -#: config/tc-arm.c:12862 +#: config/tc-arm.c:12215 msgid "invalid architectural extension" msgstr "" -#: config/tc-arm.c:12876 +#: config/tc-arm.c:12229 msgid "missing architectural extension" msgstr "" -#: config/tc-arm.c:12889 +#: config/tc-arm.c:12242 #, c-format msgid "unknown architectural extnsion `%s'" msgstr "" -#: config/tc-arm.c:12913 +#: config/tc-arm.c:12266 #, c-format msgid "missing cpu name `%s'" msgstr "" -#: config/tc-arm.c:12929 +#: config/tc-arm.c:12282 #, c-format msgid "unknown cpu `%s'" msgstr "" -#: config/tc-arm.c:12947 +#: config/tc-arm.c:12300 #, c-format msgid "missing architecture name `%s'" msgstr "" -#: config/tc-arm.c:12964 +#: config/tc-arm.c:12317 #, c-format msgid "unknown architecture `%s'\n" msgstr "" -#: config/tc-arm.c:12980 +#: config/tc-arm.c:12333 #, c-format msgid "unknown floating point format `%s'\n" msgstr "" -#: config/tc-arm.c:12996 +#: config/tc-arm.c:12349 #, c-format msgid "unknown floating point abi `%s'\n" msgstr "" -#: config/tc-arm.c:13012 +#: config/tc-arm.c:12365 #, c-format msgid "unknown EABI `%s'\n" msgstr "" -#: config/tc-arm.c:13019 +#: config/tc-arm.c:12372 msgid "\t assemble for CPU " msgstr "" -#: config/tc-arm.c:13021 +#: config/tc-arm.c:12374 msgid "\t assemble for architecture " msgstr "" -#: config/tc-arm.c:13023 +#: config/tc-arm.c:12376 msgid "\t assemble for FPU architecture " msgstr "" -#: config/tc-arm.c:13025 +#: config/tc-arm.c:12378 msgid "\t assemble for floating point ABI " msgstr "" -#: config/tc-arm.c:13028 +#: config/tc-arm.c:12381 msgid "\t assemble for eabi version " msgstr "" -#: config/tc-arm.c:13069 config/tc-arm.c:13091 +#: config/tc-arm.c:12422 config/tc-arm.c:12444 #, c-format msgid "option `-%c%s' is deprecated: %s" msgstr "" -#: config/tc-arm.c:13112 +#: config/tc-arm.c:12465 #, c-format msgid " ARM-specific assembler options:\n" msgstr "" -#: config/tc-arm.c:13123 +#: config/tc-arm.c:12476 #, c-format msgid " -EB assemble code for a big-endian cpu\n" msgstr "" -#: config/tc-arm.c:13128 +#: config/tc-arm.c:12481 #, c-format msgid " -EL assemble code for a little-endian cpu\n" msgstr "" -#: config/tc-arm.c:13270 -#, c-format -msgid "%s: unexpected function type: %d" -msgstr "" - -#: config/tc-arm.c:13540 -msgid "expected 0 or 1" -msgstr "" - -#: config/tc-arm.c:13545 -msgid "missing comma" -msgstr "" - -#: config/tc-arm.c:13838 -msgid "handerdata in cantunwind frame" -msgstr "" - -#: config/tc-arm.c:13855 -msgid "too many unwind opcodes for personality routine 0" -msgstr "" - -#: config/tc-arm.c:13887 -msgid "too many unwind opcodes" -msgstr "" - -#: config/tc-arm.c:14017 -msgid "dupicate .handlerdata directive" -msgstr "" - -#: config/tc-arm.c:14071 -msgid "personality routine specified for cantunwind frame" -msgstr "" - -#: config/tc-arm.c:14085 -msgid "duplicate .personalityindex directive" -msgstr "" - -#: config/tc-arm.c:14094 -msgid "bad personality routine number" -msgstr "" - -#: config/tc-arm.c:14113 -msgid "duplicate .personality directive" -msgstr "" - -#: config/tc-arm.c:14139 config/tc-arm.c:14261 -msgid "expected register list" -msgstr "" - -#: config/tc-arm.c:14217 -msgid "expected , " -msgstr "" - -#: config/tc-arm.c:14322 -msgid "expected wr or wcgr" -msgstr "" - -#: config/tc-arm.c:14343 -msgid "bad register range" -msgstr "" - -#: config/tc-arm.c:14358 -msgid "inconsistent register types" -msgstr "" - -#. TODO: Maverick registers. -#: config/tc-arm.c:14506 -msgid "unrecognised register" -msgstr "" - -#: config/tc-arm.c:14529 -#, c-format -msgid "r%d not permitted in .unwind_movsp directive" -msgstr "" - -#: config/tc-arm.c:14535 -msgid "unexpected .unwind_movsp directive" -msgstr "" - -#: config/tc-arm.c:14567 -msgid "expected #constant" -msgstr "" - -#: config/tc-arm.c:14587 -msgid "stack increment must be multiple of 4" -msgstr "" - -#: config/tc-arm.c:14616 -msgid "expected , " -msgstr "" - -#: config/tc-arm.c:14634 -msgid "register must be either sp or set by a previousunwind_movsp directive" -msgstr "" - -#: config/tc-arm.c:14671 -msgid "expected , " -msgstr "" - -#: config/tc-arm.c:14683 -msgid "unwind opcode too long" -msgstr "" - -#: config/tc-arm.c:14688 -msgid "invalid unwind opcode" -msgstr "" - -#: config/tc-arm.c:14783 -msgid "alignments greater than 32 bytes not supported in .text sections." -msgstr "" - #: config/tc-arm.h:84 msgid "arm convert_frag\n" msgstr "" @@ -2925,10 +2820,10 @@ msgstr "" msgid "redefinition of mcu type `%s' to `%s'" msgstr "" -#: config/tc-avr.c:402 config/tc-crx.c:490 config/tc-d10v.c:319 -#: config/tc-d30v.c:366 config/tc-mips.c:10029 config/tc-mmix.c:2297 -#: config/tc-mn10200.c:361 config/tc-msp430.c:805 config/tc-pj.c:373 -#: config/tc-ppc.c:5192 config/tc-sh.c:2972 config/tc-v850.c:1242 +#: config/tc-avr.c:402 config/tc-crx.c:490 config/tc-d10v.c:278 +#: config/tc-d30v.c:312 config/tc-mips.c:9925 config/tc-mmix.c:2264 +#: config/tc-mn10200.c:342 config/tc-msp430.c:805 config/tc-pj.c:342 +#: config/tc-ppc.c:5202 config/tc-sh.c:2972 config/tc-v850.c:1199 msgid "bad call to md_atof" msgstr "" @@ -3014,14 +2909,14 @@ msgid "odd address operand: %ld" msgstr "" #: config/tc-avr.c:926 config/tc-avr.c:945 config/tc-avr.c:967 -#: config/tc-avr.c:974 config/tc-avr.c:981 config/tc-d10v.c:586 -#: config/tc-d30v.c:656 config/tc-msp430.c:1907 config/tc-msp430.c:1922 +#: config/tc-avr.c:974 config/tc-avr.c:981 config/tc-d10v.c:538 +#: config/tc-d30v.c:589 config/tc-msp430.c:1907 config/tc-msp430.c:1922 #: config/tc-msp430.c:1932 #, c-format msgid "operand out of range: %ld" msgstr "" -#: config/tc-avr.c:1065 config/tc-d10v.c:1791 config/tc-d30v.c:1958 +#: config/tc-avr.c:1065 config/tc-d10v.c:1622 config/tc-d30v.c:2060 #: config/tc-msp430.c:1950 #, c-format msgid "line %d: unknown relocation type: 0x%x" @@ -3031,16 +2926,16 @@ msgstr "" msgid "only constant expression allowed" msgstr "" -#: config/tc-avr.c:1115 config/tc-d10v.c:1657 config/tc-d30v.c:1791 -#: config/tc-mn10200.c:1262 config/tc-mn10300.c:2308 config/tc-msp430.c:1986 -#: config/tc-or32.c:1587 config/tc-ppc.c:6013 config/tc-v850.c:2274 +#: config/tc-avr.c:1115 config/tc-d10v.c:1494 config/tc-d30v.c:1804 +#: config/tc-mn10200.c:814 config/tc-mn10300.c:2308 config/tc-msp430.c:1986 +#: config/tc-or32.c:1505 config/tc-ppc.c:6048 config/tc-v850.c:2190 #, c-format msgid "reloc %d not supported by object file format" msgstr "" -#: config/tc-avr.c:1139 config/tc-d10v.c:1248 config/tc-d10v.c:1262 -#: config/tc-h8300.c:1887 config/tc-h8500.c:1106 config/tc-mcore.c:939 -#: config/tc-msp430.c:1769 config/tc-pj.c:282 config/tc-sh.c:2425 +#: config/tc-avr.c:1139 config/tc-d10v.c:1782 config/tc-d10v.c:1796 +#: config/tc-h8300.c:1887 config/tc-h8500.c:1023 config/tc-mcore.c:886 +#: config/tc-msp430.c:1769 config/tc-pj.c:254 config/tc-sh.c:2425 #: config/tc-z8k.c:1200 msgid "can't find opcode " msgstr "" @@ -3054,7 +2949,7 @@ msgstr "" msgid "garbage at end of line" msgstr "" -#: config/tc-avr.c:1228 read.c:3203 +#: config/tc-avr.c:1228 read.c:3205 msgid "illegal expression" msgstr "" @@ -3067,318 +2962,318 @@ msgstr "" msgid "illegal %srelocation size: %d" msgstr "" -#: config/tc-cris.c:540 config/tc-m68hc11.c:2794 +#: config/tc-cris.c:532 config/tc-m68hc11.c:2794 #, c-format msgid "internal inconsistency problem in %s: fr_symbol %lx" msgstr "" -#: config/tc-cris.c:544 config/tc-m68hc11.c:2798 config/tc-msp430.c:2177 +#: config/tc-cris.c:536 config/tc-m68hc11.c:2798 config/tc-msp430.c:2177 #, c-format msgid "internal inconsistency problem in %s: resolved symbol" msgstr "" -#: config/tc-cris.c:554 config/tc-m68hc11.c:2804 +#: config/tc-cris.c:546 config/tc-m68hc11.c:2804 #, c-format msgid "internal inconsistency problem in %s: fr_subtype %d" msgstr "" -#: config/tc-cris.c:885 +#: config/tc-cris.c:872 msgid "Relaxation to long branches for .arch common_v10_v32 not implemented" msgstr "" -#: config/tc-cris.c:915 +#: config/tc-cris.c:902 msgid "Complicated LAPC target operand is not a multiple of two. Use LAPC.D" msgstr "" -#: config/tc-cris.c:920 +#: config/tc-cris.c:907 #, c-format msgid "" "Internal error found in md_convert_frag: offset %ld. Please report this." msgstr "" -#: config/tc-cris.c:945 +#: config/tc-cris.c:932 #, c-format msgid "internal inconsistency in %s: bdapq no symbol" msgstr "" -#: config/tc-cris.c:958 +#: config/tc-cris.c:945 #, c-format msgid "internal inconsistency in %s: bdap.w with no symbol" msgstr "" -#: config/tc-cris.c:982 +#: config/tc-cris.c:969 msgid "section alignment must be >= 4 bytes to check MULS/MULU safeness" msgstr "" -#: config/tc-cris.c:991 +#: config/tc-cris.c:978 msgid "dangerous MULS/MULU location; give it higher alignment" msgstr "" -#: config/tc-cris.c:1103 +#: config/tc-cris.c:1083 msgid "" "Out-of-range .word offset handling is not implemented for .arch " "common_v10_v32" msgstr "" -#: config/tc-cris.c:1168 config/tc-crx.c:581 config/tc-crx.c:608 +#: config/tc-cris.c:1148 config/tc-crx.c:581 config/tc-crx.c:608 #: config/tc-crx.c:626 msgid "Virtual memory exhausted" msgstr "" -#: config/tc-cris.c:1201 config/tc-crx.c:591 +#: config/tc-cris.c:1182 config/tc-crx.c:591 #, c-format msgid "Can't hash `%s': %s\n" msgstr "" -#: config/tc-cris.c:1202 config/tc-crx.c:592 +#: config/tc-cris.c:1183 config/tc-crx.c:592 msgid "(unknown reason)" msgstr "" -#: config/tc-cris.c:1206 +#: config/tc-cris.c:1187 #, c-format msgid "Buggy opcode: `%s' \"%s\"\n" msgstr "" -#: config/tc-cris.c:1621 +#: config/tc-cris.c:1599 #, c-format msgid "Immediate value not in 5 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:1637 +#: config/tc-cris.c:1615 #, c-format msgid "Immediate value not in 4 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:1689 +#: config/tc-cris.c:1667 #, c-format msgid "Immediate value not in 6 bit range: %ld" msgstr "" -#: config/tc-cris.c:1704 +#: config/tc-cris.c:1682 #, c-format msgid "Immediate value not in 6 bit unsigned range: %ld" msgstr "" #. Others have a generic warning. -#: config/tc-cris.c:1812 +#: config/tc-cris.c:1790 #, c-format msgid "Unimplemented register `%s' specified" msgstr "" #. We've come to the end of instructions with this #. opcode, so it must be an error. -#: config/tc-cris.c:2055 +#: config/tc-cris.c:2033 msgid "Illegal operands" msgstr "" -#: config/tc-cris.c:2096 config/tc-cris.c:2136 +#: config/tc-cris.c:2074 config/tc-cris.c:2114 #, c-format msgid "Immediate value not in 8 bit range: %ld" msgstr "" -#: config/tc-cris.c:2106 config/tc-cris.c:2157 +#: config/tc-cris.c:2084 config/tc-cris.c:2135 #, c-format msgid "Immediate value not in 16 bit range: %ld" msgstr "" -#: config/tc-cris.c:2141 +#: config/tc-cris.c:2119 #, c-format msgid "Immediate value not in 8 bit signed range: %ld" msgstr "" -#: config/tc-cris.c:2146 +#: config/tc-cris.c:2124 #, c-format msgid "Immediate value not in 8 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:2162 +#: config/tc-cris.c:2140 #, c-format msgid "Immediate value not in 16 bit signed range: %ld" msgstr "" -#: config/tc-cris.c:2167 +#: config/tc-cris.c:2145 #, c-format msgid "Immediate value not in 16 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:2189 +#: config/tc-cris.c:2167 msgid "PIC relocation size does not match operand size" msgstr "" -#: config/tc-cris.c:3355 +#: config/tc-cris.c:3304 msgid "Calling gen_cond_branch_32 for .arch common_v10_v32\n" msgstr "" -#: config/tc-cris.c:3359 +#: config/tc-cris.c:3308 msgid "32-bit conditional branch generated" msgstr "" -#: config/tc-cris.c:3418 +#: config/tc-cris.c:3367 msgid "Complex expression not supported" msgstr "" #. FIXME: Is this function mentioned in the internals.texi manual? If #. not, add it. -#: config/tc-cris.c:3546 +#: config/tc-cris.c:3490 msgid "Bad call to md_atof () - floating point formats are not supported" msgstr "" -#: config/tc-cris.c:3592 +#: config/tc-cris.c:3531 msgid "PC-relative relocation must be trivially resolved" msgstr "" -#: config/tc-cris.c:3645 +#: config/tc-cris.c:3584 #, c-format msgid "Value not in 16 bit range: %ld" msgstr "" -#: config/tc-cris.c:3656 +#: config/tc-cris.c:3595 #, c-format msgid "Value not in 16 bit signed range: %ld" msgstr "" -#: config/tc-cris.c:3667 +#: config/tc-cris.c:3606 #, c-format msgid "Value not in 8 bit range: %ld" msgstr "" -#: config/tc-cris.c:3675 +#: config/tc-cris.c:3614 #, c-format msgid "Value not in 8 bit signed range: %ld" msgstr "" -#: config/tc-cris.c:3686 +#: config/tc-cris.c:3625 #, c-format msgid "Value not in 4 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:3694 +#: config/tc-cris.c:3633 #, c-format msgid "Value not in 5 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:3702 +#: config/tc-cris.c:3641 #, c-format msgid "Value not in 6 bit range: %ld" msgstr "" -#: config/tc-cris.c:3710 +#: config/tc-cris.c:3649 #, c-format msgid "Value not in 6 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:3758 +#: config/tc-cris.c:3695 #, c-format msgid "Please use --help to see usage and options for this assembler.\n" msgstr "" -#: config/tc-cris.c:3770 +#: config/tc-cris.c:3707 msgid "--no-underscore is invalid with a.out format" msgstr "" -#: config/tc-cris.c:3790 +#: config/tc-cris.c:3727 #, c-format msgid "invalid in --march=: %s" msgstr "" -#: config/tc-cris.c:3888 +#: config/tc-cris.c:3821 msgid "" "Semantics error. This type of operand can not be relocated, it must be an " "assembly-time constant" msgstr "" -#: config/tc-cris.c:3937 +#: config/tc-cris.c:3870 #, c-format msgid "Cannot generate relocation type for symbol %s, code %s" msgstr "" #. The messages are formatted to line up with the generic options. -#: config/tc-cris.c:3951 +#: config/tc-cris.c:3883 #, c-format msgid "CRIS-specific options:\n" msgstr "" -#: config/tc-cris.c:3953 +#: config/tc-cris.c:3885 msgid "" " -h, -H Don't execute, print this help text. Deprecated.\n" msgstr "" -#: config/tc-cris.c:3955 +#: config/tc-cris.c:3887 msgid " -N Warn when branches are expanded to jumps.\n" msgstr "" -#: config/tc-cris.c:3957 +#: config/tc-cris.c:3889 msgid "" " --underscore User symbols are normally prepended with " "underscore.\n" msgstr "" -#: config/tc-cris.c:3959 +#: config/tc-cris.c:3891 msgid " Registers will not need any prefix.\n" msgstr "" -#: config/tc-cris.c:3961 +#: config/tc-cris.c:3893 msgid " --no-underscore User symbols do not have any prefix.\n" msgstr "" -#: config/tc-cris.c:3963 +#: config/tc-cris.c:3895 msgid " Registers will require a `$'-prefix.\n" msgstr "" -#: config/tc-cris.c:3965 +#: config/tc-cris.c:3897 msgid " --pic\t\t\tEnable generation of position-independent code.\n" msgstr "" -#: config/tc-cris.c:3967 +#: config/tc-cris.c:3899 msgid "" " --march=\t\tGenerate code for . Valid choices for \n" "\t\t\t\tare v0_v10, v10, v32 and common_v10_v32.\n" msgstr "" -#: config/tc-cris.c:3991 +#: config/tc-cris.c:3920 msgid "Invalid relocation" msgstr "" -#: config/tc-cris.c:4029 +#: config/tc-cris.c:3957 msgid "Invalid pc-relative relocation" msgstr "" -#: config/tc-cris.c:4078 +#: config/tc-cris.c:4002 #, c-format msgid "Adjusted signed .word (%ld) overflows: `switch'-statement too large." msgstr "" -#: config/tc-cris.c:4105 +#: config/tc-cris.c:4032 #, c-format msgid ".syntax %s requires command-line option `--underscore'" msgstr "" -#: config/tc-cris.c:4114 +#: config/tc-cris.c:4041 #, c-format msgid ".syntax %s requires command-line option `--no-underscore'" msgstr "" -#: config/tc-cris.c:4152 +#: config/tc-cris.c:4078 msgid "Unknown .syntax operand" msgstr "" -#: config/tc-cris.c:4163 +#: config/tc-cris.c:4088 msgid "Pseudodirective .file is only valid when generating ELF" msgstr "" -#: config/tc-cris.c:4176 +#: config/tc-cris.c:4100 msgid "Pseudodirective .loc is only valid when generating ELF" msgstr "" -#: config/tc-cris.c:4322 +#: config/tc-cris.c:4243 msgid "unknown operand to .arch" msgstr "" -#: config/tc-cris.c:4331 +#: config/tc-cris.c:4252 msgid ".arch requires a matching --march=... option" msgstr "" -#: config/tc-crx.c:343 config/tc-mn10200.c:1249 write.c:2649 +#: config/tc-crx.c:343 config/tc-mn10200.c:801 write.c:2654 #, c-format msgid "can't resolve `%s' {%s section} - `%s' {%s section}" msgstr "" @@ -3389,13 +3284,13 @@ msgid "internal error: reloc %d (`%s') n msgstr "" #: config/tc-crx.c:618 config/tc-crx.c:636 config/tc-i386.c:938 -#: config/tc-i386.c:961 config/tc-m68k.c:4193 +#: config/tc-i386.c:961 config/tc-m68k.c:4203 #, c-format msgid "Internal Error: Can't hash %s: %s" msgstr "" #. Missing or bad expr becomes absolute 0. -#: config/tc-crx.c:664 config/tc-i386.c:4111 +#: config/tc-crx.c:664 config/tc-i386.c:4132 #, c-format msgid "missing or invalid displacement expression `%s' taken as 0" msgstr "" @@ -3555,7 +3450,7 @@ msgstr "" msgid "instruction address is not a multiple of 2" msgstr "" -#: config/tc-d10v.c:252 +#: config/tc-d10v.c:217 #, c-format msgid "" "D10V options:\n" @@ -3566,140 +3461,140 @@ msgid "" " instructions together.\n" msgstr "" -#: config/tc-d10v.c:543 config/tc-d30v.c:550 config/tc-mn10200.c:937 -#: config/tc-mn10300.c:1817 config/tc-ppc.c:2365 config/tc-s390.c:1216 -#: config/tc-tic80.c:276 config/tc-v850.c:2031 +#: config/tc-d10v.c:496 config/tc-d30v.c:488 config/tc-mn10200.c:1075 +#: config/tc-mn10300.c:1817 config/tc-ppc.c:2375 config/tc-s390.c:1216 +#: config/tc-tic80.c:259 config/tc-v850.c:1949 msgid "illegal operand" msgstr "" -#: config/tc-d10v.c:657 +#: config/tc-d10v.c:608 msgid "operand is not an immediate" msgstr "" -#: config/tc-d10v.c:675 +#: config/tc-d10v.c:626 #, c-format msgid "operand out of range: %lu" msgstr "" -#: config/tc-d10v.c:736 +#: config/tc-d10v.c:684 msgid "Instruction must be executed in parallel with another instruction." msgstr "" -#: config/tc-d10v.c:792 -msgid "Instruction must be executed in parallel" -msgstr "" - -#: config/tc-d10v.c:795 -msgid "Long instructions may not be combined." -msgstr "" - -#: config/tc-d10v.c:828 -msgid "One of these instructions may not be executed in parallel." +#: config/tc-d10v.c:738 config/tc-d10v.c:746 +#, c-format +msgid "packing conflict: %s must dispatch sequentially" msgstr "" -#: config/tc-d10v.c:832 config/tc-d30v.c:877 -msgid "Two IU instructions may not be executed in parallel" +#: config/tc-d10v.c:845 +#, c-format +msgid "resource conflict (R%d)" msgstr "" -#: config/tc-d10v.c:834 config/tc-d10v.c:842 config/tc-d10v.c:856 -#: config/tc-d10v.c:871 config/tc-d30v.c:878 config/tc-d30v.c:887 -msgid "Swapping instruction order" +#: config/tc-d10v.c:848 +#, c-format +msgid "resource conflict (A%d)" msgstr "" -#: config/tc-d10v.c:840 config/tc-d30v.c:884 -msgid "Two MU instructions may not be executed in parallel" +#: config/tc-d10v.c:850 +msgid "resource conflict (PSW)" msgstr "" -#: config/tc-d10v.c:860 config/tc-d30v.c:904 -msgid "IU instruction may not be in the left container" +#: config/tc-d10v.c:852 +msgid "resource conflict (C flag)" msgstr "" -#: config/tc-d10v.c:862 config/tc-d10v.c:877 -msgid "" -"Instruction in R container is squashed by flow control instruction in L " -"container." +#: config/tc-d10v.c:854 +msgid "resource conflict (F flag)" msgstr "" -#: config/tc-d10v.c:875 config/tc-d30v.c:915 -msgid "MU instruction may not be in the right container" +#: config/tc-d10v.c:1004 +msgid "Instruction must be executed in parallel" msgstr "" -#: config/tc-d10v.c:881 config/tc-d30v.c:927 -msgid "unknown execution type passed to write_2_short()" +#: config/tc-d10v.c:1007 +msgid "Long instructions may not be combined." msgstr "" -#: config/tc-d10v.c:1072 config/tc-d10v.c:1080 -#, c-format -msgid "packing conflict: %s must dispatch sequentially" +#: config/tc-d10v.c:1040 +msgid "One of these instructions may not be executed in parallel." msgstr "" -#: config/tc-d10v.c:1179 -#, c-format -msgid "resource conflict (R%d)" +#: config/tc-d10v.c:1044 config/tc-d30v.c:1071 +msgid "Two IU instructions may not be executed in parallel" msgstr "" -#: config/tc-d10v.c:1182 -#, c-format -msgid "resource conflict (A%d)" +#: config/tc-d10v.c:1046 config/tc-d10v.c:1054 config/tc-d10v.c:1068 +#: config/tc-d10v.c:1083 config/tc-d30v.c:1072 config/tc-d30v.c:1081 +msgid "Swapping instruction order" msgstr "" -#: config/tc-d10v.c:1184 -msgid "resource conflict (PSW)" +#: config/tc-d10v.c:1052 config/tc-d30v.c:1078 +msgid "Two MU instructions may not be executed in parallel" msgstr "" -#: config/tc-d10v.c:1186 -msgid "resource conflict (C flag)" +#: config/tc-d10v.c:1072 config/tc-d30v.c:1098 +msgid "IU instruction may not be in the left container" msgstr "" -#: config/tc-d10v.c:1188 -msgid "resource conflict (F flag)" +#: config/tc-d10v.c:1074 config/tc-d10v.c:1089 +msgid "" +"Instruction in R container is squashed by flow control instruction in L " +"container." msgstr "" -#: config/tc-d10v.c:1276 config/tc-d10v.c:1298 config/tc-d30v.c:1408 -msgid "Unable to mix instructions as specified" +#: config/tc-d10v.c:1087 config/tc-d30v.c:1109 +msgid "MU instruction may not be in the right container" msgstr "" -#: config/tc-d10v.c:1343 config/tc-d30v.c:1538 -#, c-format -msgid "unknown opcode: %s" +#: config/tc-d10v.c:1093 config/tc-d30v.c:1121 +msgid "unknown execution type passed to write_2_short()" msgstr "" -#: config/tc-d10v.c:1426 config/tc-d10v.c:1601 +#: config/tc-d10v.c:1221 config/tc-d10v.c:1394 msgid "bad opcode or operands" msgstr "" -#: config/tc-d10v.c:1501 config/tc-m68k.c:4679 +#: config/tc-d10v.c:1296 config/tc-m68k.c:4689 msgid "value out of range" msgstr "" -#: config/tc-d10v.c:1577 +#: config/tc-d10v.c:1370 msgid "illegal operand - register name found where none expected" msgstr "" -#: config/tc-d10v.c:1612 +#: config/tc-d10v.c:1405 msgid "Register number must be EVEN" msgstr "" -#: config/tc-d10v.c:1615 +#: config/tc-d10v.c:1408 msgid "Unsupported use of sp" msgstr "" -#: config/tc-d10v.c:1634 +#: config/tc-d10v.c:1427 #, c-format msgid "cr%ld is a reserved control register" msgstr "" -#: config/tc-d10v.c:1771 +#: config/tc-d10v.c:1466 config/tc-d30v.c:1430 +#, c-format +msgid "unknown opcode: %s" +msgstr "" + +#: config/tc-d10v.c:1602 #, c-format msgid "line %d: rep or repi must include at least 4 instructions" msgstr "" -#: config/tc-d30v.c:193 +#: config/tc-d10v.c:1810 config/tc-d10v.c:1832 config/tc-d30v.c:1777 +msgid "Unable to mix instructions as specified" +msgstr "" + +#: config/tc-d30v.c:150 #, c-format msgid "Register name %s conflicts with symbol of the same name" msgstr "" -#: config/tc-d30v.c:288 +#: config/tc-d30v.c:240 #, c-format msgid "" "\n" @@ -3713,192 +3608,192 @@ msgid "" "-C Opposite of -C. -c is the default.\n" msgstr "" -#: config/tc-d30v.c:462 +#: config/tc-d30v.c:402 msgid "unexpected 12-bit reloc type" msgstr "" -#: config/tc-d30v.c:469 +#: config/tc-d30v.c:409 msgid "unexpected 18-bit reloc type" msgstr "" -#: config/tc-d30v.c:720 +#: config/tc-d30v.c:659 #, c-format msgid "%s NOP inserted" msgstr "" -#: config/tc-d30v.c:721 +#: config/tc-d30v.c:660 msgid "sequential" msgstr "" -#: config/tc-d30v.c:721 +#: config/tc-d30v.c:660 msgid "parallel" msgstr "" -#: config/tc-d30v.c:873 +#: config/tc-d30v.c:1067 msgid "Instructions may not be executed in parallel" msgstr "" -#: config/tc-d30v.c:886 +#: config/tc-d30v.c:1080 #, c-format msgid "Executing %s in IU may not work" msgstr "" -#: config/tc-d30v.c:893 +#: config/tc-d30v.c:1087 #, c-format msgid "Executing %s in IU may not work in parallel execution" msgstr "" -#: config/tc-d30v.c:906 +#: config/tc-d30v.c:1100 #, c-format msgid "special left instruction `%s' kills instruction `%s' in right container" msgstr "" -#: config/tc-d30v.c:917 +#: config/tc-d30v.c:1111 #, c-format msgid "Executing %s in reverse serial with %s may not work" msgstr "" -#: config/tc-d30v.c:920 +#: config/tc-d30v.c:1114 #, c-format msgid "Executing %s in IU in reverse serial may not work" msgstr "" -#: config/tc-d30v.c:1287 config/tc-d30v.c:1304 -msgid "Cannot assemble instruction" +#: config/tc-d30v.c:1303 +msgid "Odd numbered register used as target of multi-register instruction" msgstr "" -#: config/tc-d30v.c:1289 -msgid "First opcode is long. Unable to mix instructions as specified." +#: config/tc-d30v.c:1367 config/tc-d30v.c:1402 +#, c-format +msgid "unknown condition code: %s" msgstr "" -#: config/tc-d30v.c:1358 -msgid "word of NOPs added between word multiply and load" +#: config/tc-d30v.c:1395 +#, c-format +msgid "cmpu doesn't support condition code %s" msgstr "" -#: config/tc-d30v.c:1360 -msgid "word of NOPs added between word multiply and 16-bit multiply" +#: config/tc-d30v.c:1441 +#, c-format +msgid "operands for opcode `%s' do not match any valid format" msgstr "" -#: config/tc-d30v.c:1392 -msgid "Instruction uses long version, so it cannot be mixed as specified" +#: config/tc-d30v.c:1656 config/tc-d30v.c:1673 +msgid "Cannot assemble instruction" msgstr "" -#: config/tc-d30v.c:1475 config/tc-d30v.c:1510 -#, c-format -msgid "unknown condition code: %s" +#: config/tc-d30v.c:1658 +msgid "First opcode is long. Unable to mix instructions as specified." msgstr "" -#: config/tc-d30v.c:1503 -#, c-format -msgid "cmpu doesn't support condition code %s" +#: config/tc-d30v.c:1727 +msgid "word of NOPs added between word multiply and load" msgstr "" -#: config/tc-d30v.c:1549 -#, c-format -msgid "operands for opcode `%s' do not match any valid format" +#: config/tc-d30v.c:1729 +msgid "word of NOPs added between word multiply and 16-bit multiply" msgstr "" -#: config/tc-d30v.c:1764 -msgid "Odd numbered register used as target of multi-register instruction" +#: config/tc-d30v.c:1761 +msgid "Instruction uses long version, so it cannot be mixed as specified" msgstr "" -#: config/tc-d30v.c:1847 +#: config/tc-d30v.c:1888 +#, c-format +msgid "value too large to fit in %d bits" +msgstr "" + +#: config/tc-d30v.c:1949 #, c-format msgid "line %d: unable to place address of symbol '%s' into a byte" msgstr "" -#: config/tc-d30v.c:1850 +#: config/tc-d30v.c:1952 #, c-format msgid "line %d: unable to place value %lx into a byte" msgstr "" -#: config/tc-d30v.c:1858 +#: config/tc-d30v.c:1960 #, c-format msgid "line %d: unable to place address of symbol '%s' into a short" msgstr "" -#: config/tc-d30v.c:1861 +#: config/tc-d30v.c:1963 #, c-format msgid "line %d: unable to place value %lx into a short" msgstr "" -#: config/tc-d30v.c:1869 +#: config/tc-d30v.c:1971 #, c-format msgid "line %d: unable to place address of symbol '%s' into a quad" msgstr "" -#: config/tc-d30v.c:2038 -#, c-format -msgid "value too large to fit in %d bits" -msgstr "" - -#: config/tc-d30v.c:2179 +#: config/tc-d30v.c:2079 #, c-format msgid "Alignment too large: %d assumed" msgstr "" -#: config/tc-dlx.c:245 +#: config/tc-dlx.c:211 msgid "missing .proc" msgstr "" -#: config/tc-dlx.c:262 +#: config/tc-dlx.c:228 msgid ".endfunc missing for previous .proc" msgstr "" -#: config/tc-dlx.c:472 +#: config/tc-dlx.c:327 #, c-format -msgid "Expression Error for operand modifier %%hi/%%lo\n" +msgid "Bad operand for a load instruction: <%s>" msgstr "" -#: config/tc-dlx.c:526 +#: config/tc-dlx.c:441 #, c-format -msgid "Bad operand for a load instruction: <%s>" +msgid "Bad operand for a store instruction: <%s>" msgstr "" -#: config/tc-dlx.c:641 +#: config/tc-dlx.c:621 #, c-format -msgid "Bad operand for a store instruction: <%s>" +msgid "Expression Error for operand modifier %%hi/%%lo\n" msgstr "" -#: config/tc-dlx.c:839 +#: config/tc-dlx.c:716 msgid "Can not set dlx_skip_hi16_flag" msgstr "" -#: config/tc-dlx.c:853 +#: config/tc-dlx.c:730 #, c-format msgid "Missing arguments for opcode <%s>." msgstr "" -#: config/tc-dlx.c:924 +#: config/tc-dlx.c:801 #, c-format msgid "Both the_insn.HI and the_insn.LO are set : %s" msgstr "" -#: config/tc-dlx.c:994 +#: config/tc-dlx.c:871 msgid "failed regnum sanity check." msgstr "" -#: config/tc-dlx.c:1007 +#: config/tc-dlx.c:884 msgid "failed general register sanity check." msgstr "" -#: config/tc-dlx.c:1292 +#: config/tc-dlx.c:1213 msgid "Invalid expression after # number\n" msgstr "" -#: config/tc-fr30.c:85 +#: config/tc-fr30.c:83 #, c-format msgid " FR30 specific command line options:\n" msgstr "" -#: config/tc-fr30.c:139 +#: config/tc-fr30.c:136 #, c-format msgid "Instruction %s not allowed in a delay slot." msgstr "" -#: config/tc-fr30.c:378 config/tc-frv.c:1600 config/tc-i960.c:798 -#: config/tc-ip2k.c:350 config/tc-m32r.c:2205 config/tc-openrisc.c:401 -#: config/tc-xstormy16.c:654 +#: config/tc-fr30.c:358 config/tc-frv.c:1600 config/tc-i960.c:1764 +#: config/tc-ip2k.c:371 config/tc-m32r.c:2143 config/tc-openrisc.c:376 +#: config/tc-xstormy16.c:631 msgid "Bad call to md_atof()" msgstr "" @@ -4036,8 +3931,8 @@ msgstr "" #: config/tc-h8300.c:82 config/tc-h8300.c:93 config/tc-h8300.c:105 #: config/tc-h8300.c:117 config/tc-h8300.c:129 config/tc-h8300.c:142 -#: config/tc-h8300.c:213 config/tc-hppa.c:1440 config/tc-hppa.c:6925 -#: config/tc-hppa.c:6931 config/tc-hppa.c:6937 config/tc-hppa.c:6943 +#: config/tc-h8300.c:213 config/tc-hppa.c:1441 config/tc-hppa.c:6930 +#: config/tc-hppa.c:6936 config/tc-hppa.c:6942 config/tc-hppa.c:6948 #: config/tc-mn10300.c:1223 config/tc-mn10300.c:1228 config/tc-mn10300.c:2726 msgid "could not set architecture and machine" msgstr "" @@ -4160,9 +4055,9 @@ msgstr "" #. This seems more sane than saying "too many operands". We'll #. get here only if the trailing trash starts with a comma. #. Types or values of args don't match. -#: config/tc-h8300.c:1777 config/tc-mmix.c:486 config/tc-mmix.c:498 -#: config/tc-mmix.c:2564 config/tc-mmix.c:2588 config/tc-mmix.c:2865 -#: config/tc-or32.c:636 config/tc-or32.c:846 +#: config/tc-h8300.c:1777 config/tc-mmix.c:473 config/tc-mmix.c:485 +#: config/tc-mmix.c:2526 config/tc-mmix.c:2550 config/tc-mmix.c:2823 +#: config/tc-or32.c:617 config/tc-or32.c:824 msgid "invalid operands" msgstr "" @@ -4170,8 +4065,8 @@ msgstr "" msgid "operand/size mis-match" msgstr "" -#: config/tc-h8300.c:1904 config/tc-h8500.c:1112 config/tc-mips.c:9141 -#: config/tc-sh64.c:2795 config/tc-sh.c:2806 config/tc-w65.c:688 +#: config/tc-h8300.c:1904 config/tc-h8500.c:1029 config/tc-mips.c:9042 +#: config/tc-sh64.c:2795 config/tc-sh.c:2806 config/tc-w65.c:665 #: config/tc-z8k.c:1210 msgid "unknown opcode" msgstr "" @@ -4184,13 +4079,13 @@ msgstr "" msgid "invalid operand in stm" msgstr "" -#: config/tc-h8300.c:2029 config/tc-h8500.c:1139 config/tc-sh.c:2931 +#: config/tc-h8300.c:2029 config/tc-h8500.c:1055 config/tc-sh.c:2931 #: config/tc-z8k.c:1266 #, c-format msgid "call to tc_crawl_symbol_chain \n" msgstr "" -#: config/tc-h8300.c:2043 config/tc-h8500.c:1153 config/tc-sh.c:2937 +#: config/tc-h8300.c:2043 config/tc-h8500.c:1067 config/tc-sh.c:2937 #: config/tc-z8k.c:1280 #, c-format msgid "call to tc_headers_hook \n" @@ -4211,474 +4106,478 @@ msgstr "" msgid "call tomd_estimate_size_before_relax \n" msgstr "" -#: config/tc-h8300.c:2309 config/tc-mcore.c:2356 config/tc-pj.c:580 -#: config/tc-sh.c:4455 +#: config/tc-h8300.c:2309 config/tc-mcore.c:2284 config/tc-pj.c:538 +#: config/tc-sh.c:4459 #, c-format msgid "Cannot represent relocation type %s" msgstr "" -#: config/tc-h8500.c:325 +#: config/tc-h8500.c:309 msgid ":24 not valid for this opcode" msgstr "" -#: config/tc-h8500.c:332 +#: config/tc-h8500.c:316 msgid "expect :8,:16 or :24" msgstr "" -#: config/tc-h8500.c:391 +#: config/tc-h8500.c:365 msgid "syntax error in reg list" msgstr "" -#: config/tc-h8500.c:409 +#: config/tc-h8500.c:383 msgid "missing final register in range" msgstr "" -#: config/tc-h8500.c:498 config/tc-h8500.c:505 config/tc-h8500.c:511 +#: config/tc-h8500.c:467 config/tc-h8500.c:474 config/tc-h8500.c:480 msgid "expected @(exp, Rn)" msgstr "" -#: config/tc-h8500.c:527 +#: config/tc-h8500.c:496 msgid "@Rn+ needs word register" msgstr "" -#: config/tc-h8500.c:537 +#: config/tc-h8500.c:506 msgid "@Rn needs word register" msgstr "" -#: config/tc-h8500.c:838 config/tc-sh.c:2083 +#: config/tc-h8500.c:790 config/tc-sh.c:2083 #, c-format msgid "unhandled %d\n" msgstr "" -#: config/tc-h8500.c:868 +#: config/tc-h8500.c:816 #, c-format msgid "operand must be absolute in range %d..%d" msgstr "" -#: config/tc-h8500.c:963 config/tc-sh.c:2353 +#: config/tc-h8500.c:886 config/tc-sh.c:2353 #, c-format msgid "failed for %d\n" msgstr "" -#: config/tc-h8500.c:1128 config/tc-sh.c:2466 config/tc-sh.c:2862 -#: config/tc-w65.c:707 +#: config/tc-h8500.c:1045 config/tc-sh.c:2466 config/tc-sh.c:2862 +#: config/tc-w65.c:684 msgid "invalid operands for opcode" msgstr "" #. Simple range checking for FIELD against HIGH and LOW bounds. #. IGNORE is used to suppress the error message. -#. Variant of CHECK_FIELD for use in md_apply_fix3 and other places where +#. Variant of CHECK_FIELD for use in md_apply_fix and other places where #. the current file and line number are not valid. -#: config/tc-hppa.c:1171 config/tc-hppa.c:1185 +#: config/tc-hppa.c:1172 config/tc-hppa.c:1186 #, c-format msgid "Field out of range [%d..%d] (%d)." msgstr "" #. Simple alignment checking for FIELD against ALIGN (a power of two). #. IGNORE is used to suppress the error message. -#: config/tc-hppa.c:1199 +#: config/tc-hppa.c:1200 #, c-format msgid "Field not properly aligned [%d] (%d)." msgstr "" -#: config/tc-hppa.c:1228 +#: config/tc-hppa.c:1229 msgid "Missing .exit\n" msgstr "" -#: config/tc-hppa.c:1231 +#: config/tc-hppa.c:1232 msgid "Missing .procend\n" msgstr "" -#: config/tc-hppa.c:1413 +#: config/tc-hppa.c:1414 #, c-format msgid "Invalid field selector. Assuming F%%." msgstr "" -#: config/tc-hppa.c:1446 +#: config/tc-hppa.c:1447 msgid "-R option not supported on this target." msgstr "" -#: config/tc-hppa.c:1462 config/tc-sparc.c:814 config/tc-sparc.c:850 +#: config/tc-hppa.c:1463 config/tc-sparc.c:814 config/tc-sparc.c:850 #, c-format msgid "Internal error: can't hash `%s': %s\n" msgstr "" -#: config/tc-hppa.c:1470 config/tc-i860.c:238 +#: config/tc-hppa.c:1471 config/tc-i860.c:238 #, c-format msgid "internal error: losing opcode: `%s' \"%s\"\n" msgstr "" -#: config/tc-hppa.c:1541 config/tc-hppa.c:7064 config/tc-hppa.c:7121 +#: config/tc-hppa.c:1542 config/tc-hppa.c:7069 config/tc-hppa.c:7126 msgid "Missing function name for .PROC (corrupted label chain)" msgstr "" -#: config/tc-hppa.c:1544 config/tc-hppa.c:7124 +#: config/tc-hppa.c:1545 config/tc-hppa.c:7129 msgid "Missing function name for .PROC" msgstr "" -#: config/tc-hppa.c:1651 config/tc-hppa.c:4920 -msgid "could not update architecture and machine" -msgstr "" - -#: config/tc-hppa.c:1859 +#: config/tc-hppa.c:1848 msgid "Invalid Indexed Load Completer." msgstr "" -#: config/tc-hppa.c:1864 +#: config/tc-hppa.c:1853 msgid "Invalid Indexed Load Completer Syntax." msgstr "" -#: config/tc-hppa.c:1901 +#: config/tc-hppa.c:1890 msgid "Invalid Short Load/Store Completer." msgstr "" -#: config/tc-hppa.c:1961 config/tc-hppa.c:1966 +#: config/tc-hppa.c:1950 config/tc-hppa.c:1955 msgid "Invalid Store Bytes Short Completer" msgstr "" -#: config/tc-hppa.c:2277 config/tc-hppa.c:2283 +#: config/tc-hppa.c:2266 config/tc-hppa.c:2272 msgid "Invalid left/right combination completer" msgstr "" -#: config/tc-hppa.c:2332 config/tc-hppa.c:2339 +#: config/tc-hppa.c:2321 config/tc-hppa.c:2328 msgid "Invalid permutation completer" msgstr "" -#: config/tc-hppa.c:2439 +#: config/tc-hppa.c:2428 #, c-format msgid "Invalid Add Condition: %s" msgstr "" -#: config/tc-hppa.c:2450 config/tc-hppa.c:2460 +#: config/tc-hppa.c:2439 config/tc-hppa.c:2449 msgid "Invalid Add and Branch Condition" msgstr "" -#: config/tc-hppa.c:2481 config/tc-hppa.c:2618 +#: config/tc-hppa.c:2470 config/tc-hppa.c:2607 msgid "Invalid Compare/Subtract Condition" msgstr "" -#: config/tc-hppa.c:2521 +#: config/tc-hppa.c:2510 #, c-format msgid "Invalid Bit Branch Condition: %c" msgstr "" -#: config/tc-hppa.c:2606 +#: config/tc-hppa.c:2595 #, c-format msgid "Invalid Compare/Subtract Condition: %s" msgstr "" -#: config/tc-hppa.c:2633 +#: config/tc-hppa.c:2622 msgid "Invalid Compare and Branch Condition" msgstr "" -#: config/tc-hppa.c:2729 +#: config/tc-hppa.c:2718 msgid "Invalid Logical Instruction Condition." msgstr "" -#: config/tc-hppa.c:2784 +#: config/tc-hppa.c:2773 msgid "Invalid Shift/Extract/Deposit Condition." msgstr "" -#: config/tc-hppa.c:2896 +#: config/tc-hppa.c:2885 msgid "Invalid Unit Instruction Condition." msgstr "" -#: config/tc-hppa.c:3273 config/tc-hppa.c:3305 config/tc-hppa.c:3336 -#: config/tc-hppa.c:3366 +#: config/tc-hppa.c:3262 config/tc-hppa.c:3294 config/tc-hppa.c:3325 +#: config/tc-hppa.c:3355 msgid "Branch to unaligned address" msgstr "" -#: config/tc-hppa.c:3544 +#: config/tc-hppa.c:3533 msgid "Invalid SFU identifier" msgstr "" -#: config/tc-hppa.c:3594 +#: config/tc-hppa.c:3583 msgid "Invalid COPR identifier" msgstr "" -#: config/tc-hppa.c:3723 +#: config/tc-hppa.c:3712 msgid "Invalid Floating Point Operand Format." msgstr "" -#: config/tc-hppa.c:3840 config/tc-hppa.c:3860 config/tc-hppa.c:3880 -#: config/tc-hppa.c:3900 config/tc-hppa.c:3920 +#: config/tc-hppa.c:3829 config/tc-hppa.c:3849 config/tc-hppa.c:3869 +#: config/tc-hppa.c:3889 config/tc-hppa.c:3909 msgid "Invalid register for single precision fmpyadd or fmpysub" msgstr "" -#: config/tc-hppa.c:3977 +#: config/tc-hppa.c:3960 config/tc-hppa.c:4919 +msgid "could not update architecture and machine" +msgstr "" + +#: config/tc-hppa.c:3976 #, c-format msgid "Invalid operands %s" msgstr "" -#: config/tc-hppa.c:4095 +#: config/tc-hppa.c:4094 msgid "Cannot handle fixup" msgstr "" -#: config/tc-hppa.c:4396 +#: config/tc-hppa.c:4395 #, c-format msgid " -Q ignored\n" msgstr "" -#: config/tc-hppa.c:4400 +#: config/tc-hppa.c:4399 #, c-format msgid " -c print a warning if a comment is found\n" msgstr "" -#: config/tc-hppa.c:4471 +#: config/tc-hppa.c:4470 #, c-format msgid "no hppa_fixup entry for fixup type 0x%x" msgstr "" -#: config/tc-hppa.c:4642 +#: config/tc-hppa.c:4641 msgid "Unknown relocation encountered in md_apply_fix." msgstr "" -#: config/tc-hppa.c:4784 config/tc-hppa.c:4809 +#: config/tc-hppa.c:4783 config/tc-hppa.c:4808 #, c-format msgid "Undefined register: '%s'." msgstr "" -#: config/tc-hppa.c:4843 +#: config/tc-hppa.c:4842 #, c-format msgid "Non-absolute symbol: '%s'." msgstr "" -#: config/tc-hppa.c:4858 +#: config/tc-hppa.c:4857 #, c-format msgid "Undefined absolute constant: '%s'." msgstr "" -#: config/tc-hppa.c:4959 +#: config/tc-hppa.c:4958 #, c-format msgid "Invalid FP Compare Condition: %s" msgstr "" -#: config/tc-hppa.c:5015 +#: config/tc-hppa.c:5014 #, c-format msgid "Invalid FTEST completer: %s" msgstr "" -#: config/tc-hppa.c:5082 config/tc-hppa.c:5120 +#: config/tc-hppa.c:5081 config/tc-hppa.c:5119 #, c-format msgid "Invalid FP Operand Format: %3s" msgstr "" -#: config/tc-hppa.c:5199 +#: config/tc-hppa.c:5198 msgid "Bad segment in expression." msgstr "" -#: config/tc-hppa.c:5258 +#: config/tc-hppa.c:5257 msgid "Bad segment (should be absolute)." msgstr "" -#: config/tc-hppa.c:5301 +#: config/tc-hppa.c:5300 #, c-format msgid "Invalid argument location: %s\n" msgstr "" -#: config/tc-hppa.c:5332 +#: config/tc-hppa.c:5331 #, c-format msgid "Invalid argument description: %d" msgstr "" -#: config/tc-hppa.c:5355 +#: config/tc-hppa.c:5354 #, c-format msgid "Invalid Nullification: (%c)" msgstr "" -#: config/tc-hppa.c:6075 +#: config/tc-hppa.c:5954 +msgid "Argument to .BLOCK/.BLOCKZ must be between 0 and 0x3fffffff" +msgstr "" + +#: config/tc-hppa.c:6080 #, c-format msgid "Invalid .CALL argument: %s" msgstr "" -#: config/tc-hppa.c:6197 +#: config/tc-hppa.c:6202 msgid ".callinfo is not within a procedure definition" msgstr "" -#: config/tc-hppa.c:6217 +#: config/tc-hppa.c:6222 #, c-format msgid "FRAME parameter must be a multiple of 8: %d\n" msgstr "" -#: config/tc-hppa.c:6236 +#: config/tc-hppa.c:6241 msgid "Value for ENTRY_GR must be in the range 3..18\n" msgstr "" -#: config/tc-hppa.c:6248 +#: config/tc-hppa.c:6253 msgid "Value for ENTRY_FR must be in the range 12..21\n" msgstr "" -#: config/tc-hppa.c:6258 +#: config/tc-hppa.c:6263 msgid "Value for ENTRY_SR must be 3\n" msgstr "" -#: config/tc-hppa.c:6314 +#: config/tc-hppa.c:6319 #, c-format msgid "Invalid .CALLINFO argument: %s" msgstr "" -#: config/tc-hppa.c:6426 +#: config/tc-hppa.c:6431 msgid "The .ENTER pseudo-op is not supported" msgstr "" -#: config/tc-hppa.c:6442 +#: config/tc-hppa.c:6447 msgid "Misplaced .entry. Ignored." msgstr "" -#: config/tc-hppa.c:6446 +#: config/tc-hppa.c:6451 msgid "Missing .callinfo." msgstr "" -#: config/tc-hppa.c:6512 +#: config/tc-hppa.c:6517 msgid ".REG expression must be a register" msgstr "" -#: config/tc-hppa.c:6528 +#: config/tc-hppa.c:6533 msgid "bad or irreducible absolute expression; zero assumed" msgstr "" -#: config/tc-hppa.c:6539 +#: config/tc-hppa.c:6544 msgid ".REG must use a label" msgstr "" -#: config/tc-hppa.c:6541 +#: config/tc-hppa.c:6546 msgid ".EQU must use a label" msgstr "" -#: config/tc-hppa.c:6594 +#: config/tc-hppa.c:6599 msgid ".EXIT must appear within a procedure" msgstr "" -#: config/tc-hppa.c:6598 +#: config/tc-hppa.c:6603 msgid "Missing .callinfo" msgstr "" -#: config/tc-hppa.c:6602 +#: config/tc-hppa.c:6607 msgid "No .ENTRY for this .EXIT" msgstr "" -#: config/tc-hppa.c:6629 +#: config/tc-hppa.c:6634 #, c-format msgid "Cannot define export symbol: %s\n" msgstr "" -#: config/tc-hppa.c:6687 +#: config/tc-hppa.c:6692 #, c-format msgid "Using ENTRY rather than CODE in export directive for %s" msgstr "" -#: config/tc-hppa.c:6804 +#: config/tc-hppa.c:6809 #, c-format msgid "Undefined .EXPORT/.IMPORT argument (ignored): %s" msgstr "" -#: config/tc-hppa.c:6886 +#: config/tc-hppa.c:6891 msgid "Missing label name on .LABEL" msgstr "" -#: config/tc-hppa.c:6891 +#: config/tc-hppa.c:6896 msgid "extra .LABEL arguments ignored." msgstr "" -#: config/tc-hppa.c:6908 +#: config/tc-hppa.c:6913 msgid "The .LEAVE pseudo-op is not supported" msgstr "" -#: config/tc-hppa.c:6947 +#: config/tc-hppa.c:6952 msgid "Unrecognized .LEVEL argument\n" msgstr "" -#: config/tc-hppa.c:6983 +#: config/tc-hppa.c:6988 #, c-format msgid "Cannot define static symbol: %s\n" msgstr "" -#: config/tc-hppa.c:7018 +#: config/tc-hppa.c:7023 msgid "Nested procedures" msgstr "" -#: config/tc-hppa.c:7028 +#: config/tc-hppa.c:7033 msgid "Cannot allocate unwind descriptor\n" msgstr "" -#: config/tc-hppa.c:7128 +#: config/tc-hppa.c:7133 msgid "misplaced .procend" msgstr "" -#: config/tc-hppa.c:7131 +#: config/tc-hppa.c:7136 msgid "Missing .callinfo for this procedure" msgstr "" -#: config/tc-hppa.c:7134 +#: config/tc-hppa.c:7139 msgid "Missing .EXIT for a .ENTRY" msgstr "" -#: config/tc-hppa.c:7172 +#: config/tc-hppa.c:7177 msgid "Not in a space.\n" msgstr "" -#: config/tc-hppa.c:7175 +#: config/tc-hppa.c:7180 msgid "Not in a subspace.\n" msgstr "" -#: config/tc-hppa.c:7266 +#: config/tc-hppa.c:7271 msgid "Invalid .SPACE argument" msgstr "" -#: config/tc-hppa.c:7313 +#: config/tc-hppa.c:7318 msgid "Can't change spaces within a procedure definition. Ignored" msgstr "" -#: config/tc-hppa.c:7442 +#: config/tc-hppa.c:7447 #, c-format msgid "Undefined space: '%s' Assuming space number = 0." msgstr "" -#: config/tc-hppa.c:7466 +#: config/tc-hppa.c:7471 msgid "Must be in a space before changing or declaring subspaces.\n" msgstr "" -#: config/tc-hppa.c:7470 +#: config/tc-hppa.c:7475 msgid "Can't change subspaces within a procedure definition. Ignored" msgstr "" -#: config/tc-hppa.c:7506 +#: config/tc-hppa.c:7511 msgid "Parameters of an existing subspace can't be modified" msgstr "" -#: config/tc-hppa.c:7558 +#: config/tc-hppa.c:7563 msgid "Alignment must be a power of 2" msgstr "" -#: config/tc-hppa.c:7605 +#: config/tc-hppa.c:7610 msgid "FIRST not supported as a .SUBSPACE argument" msgstr "" -#: config/tc-hppa.c:7607 +#: config/tc-hppa.c:7612 msgid "Invalid .SUBSPACE argument" msgstr "" -#: config/tc-hppa.c:7796 +#: config/tc-hppa.c:7801 #, c-format msgid "Internal error: Unable to find containing space for %s." msgstr "" -#: config/tc-hppa.c:7836 +#: config/tc-hppa.c:7841 #, c-format msgid "Out of memory: could not allocate new space chain entry: %s\n" msgstr "" -#: config/tc-hppa.c:7925 +#: config/tc-hppa.c:7930 #, c-format msgid "Out of memory: could not allocate new subspace chain entry: %s\n" msgstr "" -#: config/tc-hppa.c:8661 +#: config/tc-hppa.c:8666 #, c-format msgid "Symbol '%s' could not be created." msgstr "" -#: config/tc-hppa.c:8665 +#: config/tc-hppa.c:8670 msgid "No memory for symbol name." msgstr "" @@ -4717,149 +4616,149 @@ msgstr "" msgid "no such architecture modifier: `%s'" msgstr "" -#: config/tc-i386.c:904 config/tc-i386.c:5169 +#: config/tc-i386.c:904 config/tc-i386.c:5191 msgid "Unknown architecture" msgstr "" -#: config/tc-i386.c:1218 +#: config/tc-i386.c:1219 msgid "There are no unsigned pc-relative relocations" msgstr "" -#: config/tc-i386.c:1225 config/tc-i386.c:5379 +#: config/tc-i386.c:1226 config/tc-i386.c:5411 #, c-format msgid "can not do %d byte pc-relative relocation" msgstr "" -#: config/tc-i386.c:1242 +#: config/tc-i386.c:1243 #, c-format msgid "can not do %s %d byte relocation" msgstr "" -#: config/tc-i386.c:1438 config/tc-i386.c:2416 +#: config/tc-i386.c:1439 config/tc-i386.c:2436 #, c-format msgid "ambiguous operand size for `%s'" msgstr "" -#: config/tc-i386.c:1486 +#: config/tc-i386.c:1487 #, c-format msgid "can't use register '%%%s' as operand %d in '%s'." msgstr "" #. UnixWare fsub no args is alias for fsubp, fadd -> faddp, etc. -#: config/tc-i386.c:1515 +#: config/tc-i386.c:1516 #, c-format msgid "translating to `%sp'" msgstr "" -#: config/tc-i386.c:1560 +#: config/tc-i386.c:1561 #, c-format msgid "can't encode register '%%%s' in an instruction requiring REX prefix." msgstr "" -#: config/tc-i386.c:1601 config/tc-i386.c:1699 +#: config/tc-i386.c:1602 config/tc-i386.c:1701 #, c-format msgid "no such instruction: `%s'" msgstr "" -#: config/tc-i386.c:1611 config/tc-i386.c:1731 +#: config/tc-i386.c:1613 config/tc-i386.c:1733 #, c-format msgid "invalid character %s in mnemonic" msgstr "" -#: config/tc-i386.c:1618 +#: config/tc-i386.c:1620 msgid "expecting prefix; got nothing" msgstr "" -#: config/tc-i386.c:1620 +#: config/tc-i386.c:1622 msgid "expecting mnemonic; got nothing" msgstr "" -#: config/tc-i386.c:1639 +#: config/tc-i386.c:1641 #, c-format msgid "redundant %s prefix" msgstr "" -#: config/tc-i386.c:1749 +#: config/tc-i386.c:1751 #, c-format msgid "`%s' is not supported in 64-bit mode" msgstr "" -#: config/tc-i386.c:1750 +#: config/tc-i386.c:1752 #, c-format msgid "`%s' is only supported in 64-bit mode" msgstr "" -#: config/tc-i386.c:1756 +#: config/tc-i386.c:1758 #, c-format msgid "`%s' is not supported on `%s%s'" msgstr "" -#: config/tc-i386.c:1763 +#: config/tc-i386.c:1765 msgid "use .code16 to ensure correct addressing mode" msgstr "" -#: config/tc-i386.c:1770 +#: config/tc-i386.c:1778 #, c-format msgid "expecting string instruction after `%s'" msgstr "" -#: config/tc-i386.c:1798 +#: config/tc-i386.c:1812 #, c-format msgid "invalid character %s before operand %d" msgstr "" -#: config/tc-i386.c:1812 +#: config/tc-i386.c:1826 #, c-format msgid "unbalanced parenthesis in operand %d." msgstr "" -#: config/tc-i386.c:1815 +#: config/tc-i386.c:1829 #, c-format msgid "unbalanced brackets in operand %d." msgstr "" -#: config/tc-i386.c:1824 +#: config/tc-i386.c:1838 #, c-format msgid "invalid character %s in operand %d" msgstr "" -#: config/tc-i386.c:1851 +#: config/tc-i386.c:1865 #, c-format msgid "spurious operands; (%d operands/instruction max)" msgstr "" -#: config/tc-i386.c:1874 +#: config/tc-i386.c:1888 msgid "expecting operand after ','; got nothing" msgstr "" -#: config/tc-i386.c:1879 +#: config/tc-i386.c:1893 msgid "expecting operand before ','; got nothing" msgstr "" #. We found no match. -#: config/tc-i386.c:2225 +#: config/tc-i386.c:2245 #, c-format msgid "suffix or operands invalid for `%s'" msgstr "" -#: config/tc-i386.c:2236 +#: config/tc-i386.c:2256 #, c-format msgid "indirect %s without `*'" msgstr "" #. Warn them that a data or address size prefix doesn't #. affect assembly of the next line of code. -#: config/tc-i386.c:2244 +#: config/tc-i386.c:2264 #, c-format msgid "stand-alone `%s' prefix" msgstr "" -#: config/tc-i386.c:2273 config/tc-i386.c:2288 +#: config/tc-i386.c:2293 config/tc-i386.c:2308 #, c-format msgid "`%s' operand %d must use `%%es' segment" msgstr "" -#: config/tc-i386.c:2398 +#: config/tc-i386.c:2418 msgid "" "no instruction mnemonic suffix given and no register operands; can't size " "instruction" @@ -4867,181 +4766,181 @@ msgstr "" #. Prohibit these changes in the 64bit mode, since the #. lowering is more complicated. -#: config/tc-i386.c:2499 config/tc-i386.c:2558 config/tc-i386.c:2575 -#: config/tc-i386.c:2607 config/tc-i386.c:2640 +#: config/tc-i386.c:2519 config/tc-i386.c:2578 config/tc-i386.c:2595 +#: config/tc-i386.c:2627 config/tc-i386.c:2660 #, c-format msgid "Incorrect register `%%%s' used with `%c' suffix" msgstr "" -#: config/tc-i386.c:2507 config/tc-i386.c:2565 config/tc-i386.c:2647 +#: config/tc-i386.c:2527 config/tc-i386.c:2585 config/tc-i386.c:2667 #, c-format msgid "using `%%%s' instead of `%%%s' due to `%c' suffix" msgstr "" -#: config/tc-i386.c:2522 config/tc-i386.c:2543 config/tc-i386.c:2594 -#: config/tc-i386.c:2625 +#: config/tc-i386.c:2542 config/tc-i386.c:2563 config/tc-i386.c:2614 +#: config/tc-i386.c:2645 #, c-format msgid "`%%%s' not allowed with `%s%c'" msgstr "" -#: config/tc-i386.c:2688 +#: config/tc-i386.c:2708 msgid "no instruction mnemonic suffix given; can't determine immediate size" msgstr "" -#: config/tc-i386.c:2721 +#: config/tc-i386.c:2741 #, c-format msgid "" "no instruction mnemonic suffix given; can't determine immediate size %x %c" msgstr "" #. Reversed arguments on faddp, fsubp, etc. -#: config/tc-i386.c:2770 +#: config/tc-i386.c:2790 #, c-format msgid "translating to `%s %%%s,%%%s'" msgstr "" #. Extraneous `l' suffix on fp insn. -#: config/tc-i386.c:2777 +#: config/tc-i386.c:2797 #, c-format msgid "translating to `%s %%%s'" msgstr "" -#: config/tc-i386.c:2795 +#: config/tc-i386.c:2815 #, c-format msgid "you can't `pop %%cs'" msgstr "" #. lea -#: config/tc-i386.c:2814 +#: config/tc-i386.c:2834 msgid "segment override on `lea' is ineffectual" msgstr "" -#: config/tc-i386.c:3123 config/tc-i386.c:3217 config/tc-i386.c:3262 +#: config/tc-i386.c:3143 config/tc-i386.c:3237 config/tc-i386.c:3282 msgid "skipping prefixes on this instruction" msgstr "" -#: config/tc-i386.c:3282 +#: config/tc-i386.c:3302 msgid "16-bit jump out of range" msgstr "" -#: config/tc-i386.c:3291 +#: config/tc-i386.c:3311 #, c-format msgid "can't handle non absolute segment in `%s'" msgstr "" -#: config/tc-i386.c:3749 +#: config/tc-i386.c:3764 #, c-format msgid "@%s reloc is not supported in %s bit mode" msgstr "" -#: config/tc-i386.c:3867 +#: config/tc-i386.c:3882 msgid "only 1 or 2 immediate operands are allowed" msgstr "" -#: config/tc-i386.c:3890 config/tc-i386.c:4071 +#: config/tc-i386.c:3905 config/tc-i386.c:4092 #, c-format msgid "junk `%s' after expression" msgstr "" #. Missing or bad expr becomes absolute 0. -#: config/tc-i386.c:3901 +#: config/tc-i386.c:3916 #, c-format msgid "missing or invalid immediate expression `%s' taken as 0" msgstr "" -#: config/tc-i386.c:3926 config/tc-i386.c:4129 +#: config/tc-i386.c:3941 config/tc-i386.c:4150 #, c-format msgid "unimplemented segment %s in operand" msgstr "" -#: config/tc-i386.c:3968 config/tc-i386.c:6264 +#: config/tc-i386.c:3987 #, c-format msgid "expecting scale factor of 1, 2, 4, or 8: got `%s'" msgstr "" -#: config/tc-i386.c:3975 +#: config/tc-i386.c:3996 #, c-format msgid "scale factor of %d without an index register" msgstr "" -#: config/tc-i386.c:4090 +#: config/tc-i386.c:4111 #, c-format msgid "bad expression used with @%s" msgstr "" -#: config/tc-i386.c:4213 +#: config/tc-i386.c:4234 #, c-format msgid "`%s' is not a valid base/index expression" msgstr "" -#: config/tc-i386.c:4217 +#: config/tc-i386.c:4238 #, c-format msgid "`%s' is not a valid %s bit base/index expression" msgstr "" -#: config/tc-i386.c:4291 +#: config/tc-i386.c:4312 #, c-format msgid "bad memory operand `%s'" msgstr "" -#: config/tc-i386.c:4306 +#: config/tc-i386.c:4327 #, c-format msgid "junk `%s' after register" msgstr "" -#: config/tc-i386.c:4315 config/tc-i386.c:4430 config/tc-i386.c:4468 +#: config/tc-i386.c:4336 config/tc-i386.c:4451 config/tc-i386.c:4489 #, c-format msgid "bad register name `%s'" msgstr "" -#: config/tc-i386.c:4323 +#: config/tc-i386.c:4344 msgid "immediate operand illegal with absolute jump" msgstr "" -#: config/tc-i386.c:4345 +#: config/tc-i386.c:4366 #, c-format msgid "too many memory references for `%s'" msgstr "" -#: config/tc-i386.c:4423 +#: config/tc-i386.c:4444 #, c-format msgid "expecting `,' or `)' after index register in `%s'" msgstr "" -#: config/tc-i386.c:4447 +#: config/tc-i386.c:4468 #, c-format msgid "expecting `)' after scale factor in `%s'" msgstr "" -#: config/tc-i386.c:4454 +#: config/tc-i386.c:4475 #, c-format msgid "expecting index register or scale factor after `,'; got '%c'" msgstr "" -#: config/tc-i386.c:4461 +#: config/tc-i386.c:4482 #, c-format msgid "expecting `,' or `)' after base register in `%s'" msgstr "" #. It's not a memory operand; argh! -#: config/tc-i386.c:4502 +#: config/tc-i386.c:4523 #, c-format msgid "invalid char %s beginning operand %d `%s'" msgstr "" -#: config/tc-i386.c:4677 +#: config/tc-i386.c:4698 msgid "long jump required" msgstr "" -#: config/tc-i386.c:4954 +#: config/tc-i386.c:4976 msgid "Bad call to md_atof ()" msgstr "" -#: config/tc-i386.c:5121 +#: config/tc-i386.c:5143 msgid "No compiled in support for x86_64" msgstr "" -#: config/tc-i386.c:5142 +#: config/tc-i386.c:5164 #, c-format msgid "" " -Q ignored\n" @@ -5052,75 +4951,106 @@ msgid "" " -s ignored\n" msgstr "" -#: config/tc-i386.c:5150 +#: config/tc-i386.c:5172 #, c-format msgid "" " -n Do not optimize code alignment\n" " -q quieten some warnings\n" msgstr "" -#: config/tc-i386.c:5250 config/tc-s390.c:1826 +#: config/tc-i386.c:5272 config/tc-s390.c:1826 msgid "GOT already in symbol table" msgstr "" -#: config/tc-i386.c:5394 +#: config/tc-i386.c:5426 #, c-format msgid "can not do %d byte relocation" msgstr "" -#: config/tc-i386.c:5463 config/tc-s390.c:2272 +#: config/tc-i386.c:5495 config/tc-s390.c:2272 #, c-format msgid "cannot represent relocation type %s" msgstr "" -#: config/tc-i386.c:5709 +#: config/tc-i386.c:5750 #, c-format msgid "invalid operand for '%s' ('%s' unexpected)" msgstr "" -#: config/tc-i386.c:5721 +#: config/tc-i386.c:5762 #, c-format msgid "too many memory references for '%s'" msgstr "" -#: config/tc-i386.c:5996 +#. See the comments in intel_bracket_expr. +#: config/tc-i386.c:5773 +#, c-format +msgid "Treating `%s' as memory reference" +msgstr "" + +#: config/tc-i386.c:6085 #, c-format msgid "Unknown operand modifier `%s'" msgstr "" -#: config/tc-i386.c:6006 +#: config/tc-i386.c:6095 msgid "Conflicting operand modifiers" msgstr "" -#: config/tc-i386.c:6236 +#: config/tc-i386.c:6144 +msgid "Invalid operand to `OFFSET'" +msgstr "" + +#: config/tc-i386.c:6212 +#, c-format +msgid "`[%.*s]' taken to mean just `%.*s'" +msgstr "" + +#: config/tc-i386.c:6309 #, c-format msgid "`%s' is not a valid segment register" msgstr "" -#: config/tc-i386.c:6246 config/tc-i386.c:6373 -msgid "Register scaling only allowed in memory operands." +#: config/tc-i386.c:6313 +msgid "Extra segment override ignored" msgstr "" -#: config/tc-i386.c:6277 -msgid "Too many register references in memory operand." +#: config/tc-i386.c:6347 config/tc-i386.c:6516 +msgid "Register scaling only allowed in memory operands" msgstr "" -#: config/tc-i386.c:6352 +#: config/tc-i386.c:6369 config/tc-i386.c:6493 #, c-format -msgid "Syntax error. Expecting a constant. Got `%s'." +msgid "Syntax error: Expecting a constant, got `%s'" +msgstr "" + +#: config/tc-i386.c:6397 +msgid "Too many register references in memory operand" +msgstr "" + +#: config/tc-i386.c:6408 +msgid "Using register names in OFFSET expressions is deprecated" msgstr "" -#: config/tc-i386.c:6422 +#: config/tc-i386.c:6421 +msgid "Invalid use of register" +msgstr "" + +#: config/tc-i386.c:6566 #, c-format msgid "Unrecognized token '%s'" msgstr "" -#: config/tc-i386.c:6439 +#: config/tc-i386.c:6583 #, c-format msgid "Unexpected token `%s'" msgstr "" -#: config/tc-i386.c:6622 +#: config/tc-i386.c:6745 +msgid "`:' expected" +msgstr "" + +#: config/tc-i386.c:6770 #, c-format msgid "Unrecognized token `%s'" msgstr "" @@ -5141,7 +5071,7 @@ msgstr "" msgid "Unknown temporary pseudo register" msgstr "" -#: config/tc-i860.c:229 config/tc-mips.c:1149 +#: config/tc-i860.c:229 config/tc-mips.c:1394 #, c-format msgid "internal error: can't hash `%s': %s\n" msgstr "" @@ -5188,10 +5118,6 @@ msgstr "" msgid "Prefix 'd.' invalid for instruction `%s'" msgstr "" -#: config/tc-i860.c:1005 config/tc-sparc.c:2845 -msgid "bad segment" -msgstr "" - #: config/tc-i860.c:1088 msgid "i860_estimate_size_before_relax\n" msgstr "" @@ -5251,42 +5177,95 @@ msgstr "" msgid "i860_convert_frag\n" msgstr "" -#: config/tc-i960.c:574 -#, c-format -msgid "Hashing returned \"%s\"." +#: config/tc-i960.c:496 +#, c-format +msgid "Hashing returned \"%s\"." +msgstr "" + +#: config/tc-i960.c:592 config/tc-i960.c:1122 +msgid "expression syntax error" +msgstr "" + +#: config/tc-i960.c:628 +msgid "attempt to branch into different segment" +msgstr "" + +#: config/tc-i960.c:632 +#, c-format +msgid "target of %s instruction must be a label" +msgstr "" + +#: config/tc-i960.c:742 +msgid "unaligned register" +msgstr "" + +#: config/tc-i960.c:764 +msgid "no such sfr in this architecture" +msgstr "" + +#: config/tc-i960.c:802 +msgid "illegal literal" +msgstr "" + +#: config/tc-i960.c:845 +msgid "unmatched '['" +msgstr "" + +#: config/tc-i960.c:852 +msgid "garbage after index spec ignored" +msgstr "" + +#: config/tc-i960.c:952 +msgid "invalid index register" +msgstr "" + +#: config/tc-i960.c:975 +msgid "invalid scale factor" +msgstr "" + +#: config/tc-i960.c:1199 +msgid "architecture of opcode conflicts with that of earlier instruction(s)" +msgstr "" + +#: config/tc-i960.c:1433 config/tc-xtensa.c:11298 +msgid "too many operands" +msgstr "" + +#. We never moved: there was no opcode either! +#: config/tc-i960.c:1481 +msgid "missing opcode" msgstr "" -#. Offset of last character in opcode mnemonic -#: config/tc-i960.c:608 +#: config/tc-i960.c:1621 msgid "branch prediction invalid on this opcode" msgstr "" -#: config/tc-i960.c:648 +#: config/tc-i960.c:1659 #, c-format msgid "invalid opcode, \"%s\"." msgstr "" -#: config/tc-i960.c:653 +#: config/tc-i960.c:1661 #, c-format msgid "improper number of operands. expecting %d, got %d" msgstr "" -#: config/tc-i960.c:877 +#: config/tc-i960.c:1818 #, c-format msgid "Fixup of %ld too large for field width of %d" msgstr "" -#: config/tc-i960.c:994 +#: config/tc-i960.c:1928 #, c-format msgid "invalid architecture %s" msgstr "" -#: config/tc-i960.c:1014 +#: config/tc-i960.c:1948 #, c-format msgid "I960 options:\n" msgstr "" -#: config/tc-i960.c:1017 +#: config/tc-i960.c:1951 #, c-format msgid "" "\n" @@ -5298,208 +5277,154 @@ msgid "" "\t\t\tlong displacements\n" msgstr "" -#: config/tc-i960.c:1424 config/tc-xtensa.c:11516 -msgid "too many operands" -msgstr "" - -#: config/tc-i960.c:1482 config/tc-i960.c:1707 -msgid "expression syntax error" -msgstr "" - -#: config/tc-i960.c:1520 -msgid "attempt to branch into different segment" -msgstr "" - -#: config/tc-i960.c:1524 -#, c-format -msgid "target of %s instruction must be a label" -msgstr "" - -#: config/tc-i960.c:1562 -msgid "unmatched '['" -msgstr "" - -#: config/tc-i960.c:1573 -msgid "garbage after index spec ignored" -msgstr "" - -#. We never moved: there was no opcode either! -#: config/tc-i960.c:1638 -msgid "missing opcode" -msgstr "" - -#: config/tc-i960.c:2051 -msgid "invalid index register" -msgstr "" - -#: config/tc-i960.c:2074 -msgid "invalid scale factor" -msgstr "" - -#: config/tc-i960.c:2255 -msgid "unaligned register" -msgstr "" - -#: config/tc-i960.c:2278 -msgid "no such sfr in this architecture" -msgstr "" - -#: config/tc-i960.c:2316 -msgid "illegal literal" -msgstr "" - -#. Should not happen: see block comment above -#: config/tc-i960.c:2544 -#, c-format -msgid "Trying to 'bal' to %s" -msgstr "" - -#: config/tc-i960.c:2555 -msgid "Looks like a proc, but can't tell what kind.\n" -msgstr "" - -#: config/tc-i960.c:2587 +#: config/tc-i960.c:2222 msgid "should have 1 or 2 operands" msgstr "" -#: config/tc-i960.c:2596 config/tc-i960.c:2615 +#: config/tc-i960.c:2230 config/tc-i960.c:2245 #, c-format msgid "Redefining leafproc %s" msgstr "" -#: config/tc-i960.c:2646 +#: config/tc-i960.c:2275 msgid "should have two operands" msgstr "" -#: config/tc-i960.c:2656 +#: config/tc-i960.c:2285 msgid "'entry_num' must be absolute number in [0,31]" msgstr "" -#: config/tc-i960.c:2665 +#: config/tc-i960.c:2293 #, c-format msgid "Redefining entrynum for sysproc %s" msgstr "" -#: config/tc-i960.c:2769 -msgid "architecture of opcode conflicts with that of earlier instruction(s)" +#. Should not happen: see block comment above. +#: config/tc-i960.c:2393 +#, c-format +msgid "Trying to 'bal' to %s" msgstr "" -#: config/tc-i960.c:2790 +#: config/tc-i960.c:2403 +msgid "Looks like a proc, but can't tell what kind.\n" +msgstr "" + +#: config/tc-i960.c:2422 msgid "big endian mode is not supported" msgstr "" -#: config/tc-i960.c:2792 +#: config/tc-i960.c:2424 #, c-format msgid "ignoring unrecognized .endian type `%s'" msgstr "" -#: config/tc-i960.c:3076 +#: config/tc-i960.c:2698 #, c-format msgid "leafproc symbol '%s' undefined" msgstr "" -#: config/tc-i960.c:3086 +#: config/tc-i960.c:2708 #, c-format msgid "Warning: making leafproc entries %s and %s both global\n" msgstr "" -#: config/tc-i960.c:3191 +#: config/tc-i960.c:2807 msgid "option --link-relax is only supported in b.out format" msgstr "" -#: config/tc-ia64.c:982 +#: config/tc-ia64.c:1011 msgid "Bad .section directive: want a,o,s,w,x,M,S,G,T in string" msgstr "" -#: config/tc-ia64.c:1119 +#: config/tc-ia64.c:1148 msgid "Unwind directive not followed by an instruction." msgstr "" -#: config/tc-ia64.c:4930 +#: config/tc-ia64.c:4962 msgid "Register name expected" msgstr "" -#: config/tc-ia64.c:4935 config/tc-ia64.c:5251 +#: config/tc-ia64.c:4967 config/tc-ia64.c:5283 msgid "Comma expected" msgstr "" -#: config/tc-ia64.c:4943 +#: config/tc-ia64.c:4975 msgid "Register value annotation ignored" msgstr "" -#: config/tc-ia64.c:4984 +#: config/tc-ia64.c:5016 msgid "Directive invalid within a bundle" msgstr "" -#: config/tc-ia64.c:5077 +#: config/tc-ia64.c:5109 msgid "Missing predicate relation type" msgstr "" -#: config/tc-ia64.c:5083 +#: config/tc-ia64.c:5115 msgid "Unrecognized predicate relation type" msgstr "" -#: config/tc-ia64.c:5130 +#: config/tc-ia64.c:5162 msgid "Bad register range" msgstr "" -#: config/tc-ia64.c:5139 +#: config/tc-ia64.c:5171 msgid "Predicate register expected" msgstr "" -#: config/tc-ia64.c:5144 +#: config/tc-ia64.c:5176 msgid "Duplicate predicate register ignored" msgstr "" -#: config/tc-ia64.c:5162 +#: config/tc-ia64.c:5194 msgid "Predicate source and target required" msgstr "" -#: config/tc-ia64.c:5164 config/tc-ia64.c:5176 +#: config/tc-ia64.c:5196 config/tc-ia64.c:5208 msgid "Use of p0 is not valid in this context" msgstr "" -#: config/tc-ia64.c:5171 +#: config/tc-ia64.c:5203 msgid "At least two PR arguments expected" msgstr "" -#: config/tc-ia64.c:5185 +#: config/tc-ia64.c:5217 msgid "At least one PR argument expected" msgstr "" -#: config/tc-ia64.c:5221 +#: config/tc-ia64.c:5253 #, c-format msgid "Inserting \"%s\" into entry hint table failed: %s" msgstr "" #. FIXME -- need 62-bit relocation type -#: config/tc-ia64.c:5697 +#: config/tc-ia64.c:5729 msgid "62-bit relocation not yet implemented" msgstr "" #. XXX technically, this is wrong: we should not be issuing warning #. messages until we're sure this instruction pattern is going to #. be used! -#: config/tc-ia64.c:5770 +#: config/tc-ia64.c:5802 msgid "lower 16 bits of mask ignored" msgstr "" -#: config/tc-ia64.c:6389 +#: config/tc-ia64.c:6421 msgid "Value truncated to 62 bits" msgstr "" #. Give an error if a frag containing code is not aligned to a 16 byte #. boundary. -#: config/tc-ia64.c:6527 config/tc-ia64.h:171 +#: config/tc-ia64.c:6558 config/tc-ia64.h:171 msgid "instruction address is not a multiple of 16" msgstr "" -#: config/tc-ia64.c:7049 +#: config/tc-ia64.c:7094 #, c-format msgid "Unrecognized option '-x%s'" msgstr "" -#: config/tc-ia64.c:7077 +#: config/tc-ia64.c:7122 msgid "" "IA-64 options:\n" " --mconstant-gp\t mark output file as using the constant-GP model\n" @@ -5509,6 +5434,8 @@ msgid "" "\t\t\t EF_IA_64_NOFUNCDESC_CONS_GP)\n" " -milp32|-milp64|-mlp64|-mp64\tselect data model (default -mlp64)\n" " -mle | -mbe\t\t select little- or big-endian byte order (default -mle)\n" +" -mtune=[itanium1|itanium2]\n" +"\t\t\t tune for a specific CPU (default -mtune=itanium2)\n" " -munwind-check=[warning|error]\n" "\t\t\t unwind directive check (default -munwind-check=warning)\n" " -mhint.b=[ok|warning|error]\n" @@ -5523,359 +5450,359 @@ msgid "" "\t\t\t dependency violation checking\n" msgstr "" -#: config/tc-ia64.c:7105 +#: config/tc-ia64.c:7152 msgid "--gstabs is not supported for ia64" msgstr "" -#: config/tc-ia64.c:7408 config/tc-mips.c:1138 +#: config/tc-ia64.c:7496 config/tc-mips.c:1383 msgid "Could not set architecture and machine" msgstr "" -#: config/tc-ia64.c:7524 +#: config/tc-ia64.c:7613 msgid "Explicit stops are ignored in auto mode" msgstr "" -#: config/tc-ia64.c:7576 +#: config/tc-ia64.c:7665 msgid "Found '{' after explicit switch to automatic mode" msgstr "" -#: config/tc-ia64.c:8142 +#: config/tc-ia64.c:8235 #, c-format msgid "Unhandled dependency %s for %s (%s), note %d" msgstr "" -#: config/tc-ia64.c:9417 +#: config/tc-ia64.c:9510 #, c-format msgid "Unrecognized dependency specifier %d\n" msgstr "" -#: config/tc-ia64.c:10311 +#: config/tc-ia64.c:10404 msgid "Only the first path encountering the conflict is reported" msgstr "" -#: config/tc-ia64.c:10314 +#: config/tc-ia64.c:10407 msgid "This is the location of the conflicting usage" msgstr "" -#: config/tc-ia64.c:11528 +#: config/tc-ia64.c:11614 msgid "Can't add stop bit to mark end of instruction group" msgstr "" -#: config/tc-ia64.c:11628 read.c:1411 read.c:2176 read.c:2772 +#: config/tc-ia64.c:11714 read.c:1438 read.c:2204 read.c:2828 msgid "expected symbol name" msgstr "" -#: config/tc-ia64.c:11638 read.c:2186 read.c:2782 stabs.c:471 +#: config/tc-ia64.c:11724 read.c:2214 read.c:2838 stabs.c:470 #, c-format msgid "expected comma after \"%s\"" msgstr "" -#: config/tc-ia64.c:11680 +#: config/tc-ia64.c:11766 #, c-format msgid "`%s' is already the alias of %s `%s'" msgstr "" -#: config/tc-ia64.c:11690 +#: config/tc-ia64.c:11776 #, c-format msgid "%s `%s' already has an alias `%s'" msgstr "" -#: config/tc-ia64.c:11701 +#: config/tc-ia64.c:11787 #, c-format msgid "inserting \"%s\" into %s alias hash table failed: %s" msgstr "" -#: config/tc-ia64.c:11709 +#: config/tc-ia64.c:11795 #, c-format msgid "inserting \"%s\" into %s name hash table failed: %s" msgstr "" -#: config/tc-ia64.c:11728 +#: config/tc-ia64.c:11814 #, c-format msgid "symbol `%s' aliased to `%s' is not used" msgstr "" -#: config/tc-ia64.c:11750 +#: config/tc-ia64.c:11836 #, c-format msgid "section `%s' aliased to `%s' is not used" msgstr "" -#: config/tc-ip2k.c:123 +#: config/tc-ip2k.c:158 #, c-format msgid "IP2K specific command line options:\n" msgstr "" -#: config/tc-ip2k.c:124 +#: config/tc-ip2k.c:159 #, c-format msgid " -mip2022 restrict to IP2022 insns \n" msgstr "" -#: config/tc-ip2k.c:125 +#: config/tc-ip2k.c:160 #, c-format msgid " -mip2022ext permit extended IP2022 insn\n" msgstr "" -#: config/tc-ip2k.c:246 +#: config/tc-ip2k.c:274 msgid "md_pcrel_from\n" msgstr "" #. Pretend that we do not recognise this option. -#: config/tc-m32r.c:334 +#: config/tc-m32r.c:332 msgid "Unrecognised option: -hidden" msgstr "" -#: config/tc-m32r.c:361 config/tc-sparc.c:596 +#: config/tc-m32r.c:359 config/tc-sparc.c:596 msgid "Unrecognized option following -K" msgstr "" -#: config/tc-m32r.c:377 +#: config/tc-m32r.c:374 #, c-format msgid " M32R specific command line options:\n" msgstr "" -#: config/tc-m32r.c:379 +#: config/tc-m32r.c:376 #, c-format msgid "" " -m32r disable support for the m32rx instruction set\n" msgstr "" -#: config/tc-m32r.c:381 +#: config/tc-m32r.c:378 #, c-format msgid " -m32rx support the extended m32rx instruction set\n" msgstr "" -#: config/tc-m32r.c:383 +#: config/tc-m32r.c:380 #, c-format msgid " -m32r2 support the extended m32r2 instruction set\n" msgstr "" -#: config/tc-m32r.c:385 +#: config/tc-m32r.c:382 #, c-format msgid " -EL,-little produce little endian code and data\n" msgstr "" -#: config/tc-m32r.c:387 +#: config/tc-m32r.c:384 #, c-format msgid " -EB,-big produce big endian code and data\n" msgstr "" -#: config/tc-m32r.c:389 +#: config/tc-m32r.c:386 #, c-format msgid " -parallel try to combine instructions in parallel\n" msgstr "" -#: config/tc-m32r.c:391 +#: config/tc-m32r.c:388 #, c-format msgid " -no-parallel disable -parallel\n" msgstr "" -#: config/tc-m32r.c:393 +#: config/tc-m32r.c:390 #, c-format msgid "" " -no-bitinst disallow the M32R2's extended bit-field " "instructions\n" msgstr "" -#: config/tc-m32r.c:395 +#: config/tc-m32r.c:392 #, c-format msgid " -O try to optimize code. Implies -parallel\n" msgstr "" -#: config/tc-m32r.c:398 +#: config/tc-m32r.c:395 #, c-format msgid "" " -warn-explicit-parallel-conflicts warn when parallel instructions\n" msgstr "" -#: config/tc-m32r.c:400 +#: config/tc-m32r.c:397 #, c-format msgid " might violate contraints\n" msgstr "" -#: config/tc-m32r.c:402 +#: config/tc-m32r.c:399 #, c-format msgid " -no-warn-explicit-parallel-conflicts do not warn when parallel\n" msgstr "" -#: config/tc-m32r.c:404 +#: config/tc-m32r.c:401 #, c-format msgid "" " instructions might violate " "contraints\n" msgstr "" -#: config/tc-m32r.c:406 +#: config/tc-m32r.c:403 #, c-format msgid "" " -Wp synonym for -warn-explicit-parallel-conflicts\n" msgstr "" -#: config/tc-m32r.c:408 +#: config/tc-m32r.c:405 #, c-format msgid "" " -Wnp synonym for -no-warn-explicit-parallel-conflicts\n" msgstr "" -#: config/tc-m32r.c:410 +#: config/tc-m32r.c:407 #, c-format msgid "" " -ignore-parallel-conflicts do not check parallel instructions\n" msgstr "" -#: config/tc-m32r.c:412 +#: config/tc-m32r.c:409 #, c-format msgid " fo contraint violations\n" msgstr "" -#: config/tc-m32r.c:414 +#: config/tc-m32r.c:411 #, c-format msgid "" " -no-ignore-parallel-conflicts check parallel instructions for\n" msgstr "" -#: config/tc-m32r.c:416 +#: config/tc-m32r.c:413 #, c-format msgid " contraint violations\n" msgstr "" -#: config/tc-m32r.c:418 +#: config/tc-m32r.c:415 #, c-format msgid " -Ip synonym for -ignore-parallel-conflicts\n" msgstr "" -#: config/tc-m32r.c:420 +#: config/tc-m32r.c:417 #, c-format msgid " -nIp synonym for -no-ignore-parallel-conflicts\n" msgstr "" -#: config/tc-m32r.c:423 +#: config/tc-m32r.c:420 #, c-format msgid "" " -warn-unmatched-high warn when an (s)high reloc has no matching low " "reloc\n" msgstr "" -#: config/tc-m32r.c:425 +#: config/tc-m32r.c:422 #, c-format msgid " -no-warn-unmatched-high do not warn about missing low relocs\n" msgstr "" -#: config/tc-m32r.c:427 +#: config/tc-m32r.c:424 #, c-format msgid " -Wuh synonym for -warn-unmatched-high\n" msgstr "" -#: config/tc-m32r.c:429 +#: config/tc-m32r.c:426 #, c-format msgid " -Wnuh synonym for -no-warn-unmatched-high\n" msgstr "" -#: config/tc-m32r.c:432 +#: config/tc-m32r.c:429 #, c-format msgid " -KPIC generate PIC\n" msgstr "" -#: config/tc-m32r.c:892 +#: config/tc-m32r.c:850 msgid "instructions write to the same destination register." msgstr "" -#: config/tc-m32r.c:900 +#: config/tc-m32r.c:858 msgid "Instructions do not use parallel execution pipelines." msgstr "" -#: config/tc-m32r.c:908 +#: config/tc-m32r.c:866 msgid "Instructions share the same execution pipeline" msgstr "" -#: config/tc-m32r.c:984 config/tc-m32r.c:1098 +#: config/tc-m32r.c:931 config/tc-m32r.c:1045 #, c-format msgid "not a 16 bit instruction '%s'" msgstr "" -#: config/tc-m32r.c:996 config/tc-m32r.c:1110 config/tc-m32r.c:1295 +#: config/tc-m32r.c:943 config/tc-m32r.c:1057 config/tc-m32r.c:1241 #, c-format msgid "instruction '%s' is for the M32R2 only" msgstr "" -#: config/tc-m32r.c:1009 config/tc-m32r.c:1123 config/tc-m32r.c:1308 +#: config/tc-m32r.c:956 config/tc-m32r.c:1070 config/tc-m32r.c:1254 #, c-format msgid "unknown instruction '%s'" msgstr "" -#: config/tc-m32r.c:1018 config/tc-m32r.c:1130 config/tc-m32r.c:1315 +#: config/tc-m32r.c:965 config/tc-m32r.c:1077 config/tc-m32r.c:1261 #, c-format msgid "instruction '%s' is for the M32RX only" msgstr "" -#: config/tc-m32r.c:1027 config/tc-m32r.c:1139 +#: config/tc-m32r.c:974 config/tc-m32r.c:1086 #, c-format msgid "instruction '%s' cannot be executed in parallel." msgstr "" -#: config/tc-m32r.c:1082 config/tc-m32r.c:1164 config/tc-m32r.c:1372 +#: config/tc-m32r.c:1029 config/tc-m32r.c:1111 config/tc-m32r.c:1318 msgid "internal error: lookup/get operands failed" msgstr "" -#: config/tc-m32r.c:1149 +#: config/tc-m32r.c:1096 #, c-format msgid "'%s': only the NOP instruction can be issued in parallel on the m32r" msgstr "" -#: config/tc-m32r.c:1178 +#: config/tc-m32r.c:1125 #, c-format msgid "" "%s: output of 1st instruction is the same as an input to 2nd instruction - " "is this intentional ?" msgstr "" -#: config/tc-m32r.c:1182 +#: config/tc-m32r.c:1129 #, c-format msgid "" "%s: output of 2nd instruction is the same as an input to 1st instruction - " "is this intentional ?" msgstr "" -#: config/tc-m32r.c:1551 config/tc-ppc.c:1758 config/tc-ppc.c:4350 +#: config/tc-m32r.c:1493 config/tc-ppc.c:1768 config/tc-ppc.c:4360 msgid "Expected comma after symbol-name: rest of line ignored." msgstr "" -#: config/tc-m32r.c:1561 +#: config/tc-m32r.c:1503 #, c-format msgid ".SCOMMon length (%ld.) <0! Ignored." msgstr "" -#: config/tc-m32r.c:1575 config/tc-ppc.c:1780 config/tc-ppc.c:2937 -#: config/tc-ppc.c:4374 +#: config/tc-m32r.c:1517 config/tc-ppc.c:1790 config/tc-ppc.c:2947 +#: config/tc-ppc.c:4384 msgid "ignoring bad alignment" msgstr "" -#: config/tc-m32r.c:1587 config/tc-ppc.c:1817 config/tc-v850.c:335 +#: config/tc-m32r.c:1529 config/tc-ppc.c:1827 config/tc-v850.c:323 msgid "Common alignment not a power of 2" msgstr "" -#: config/tc-m32r.c:1602 config/tc-ppc.c:1791 config/tc-ppc.c:4386 +#: config/tc-m32r.c:1544 config/tc-ppc.c:1801 config/tc-ppc.c:4396 #, c-format msgid "Ignoring attempt to re-define symbol `%s'." msgstr "" -#: config/tc-m32r.c:1611 +#: config/tc-m32r.c:1553 #, c-format msgid "Length of .scomm \"%s\" is already %ld. Not changed to %ld." msgstr "" -#: config/tc-m32r.c:1839 +#: config/tc-m32r.c:1789 msgid "Addend to unresolved symbol not on word boundary." msgstr "" -#: config/tc-m32r.c:1988 config/tc-m32r.c:2038 config/tc-sh.c:747 +#: config/tc-m32r.c:1930 config/tc-m32r.c:1983 config/tc-sh.c:747 msgid "Invalid PIC expression." msgstr "" -#: config/tc-m32r.c:2129 +#: config/tc-m32r.c:2074 msgid "Unmatched high/shigh reloc" msgstr "" -#: config/tc-m32r.c:2380 config/tc-sparc.c:3525 +#: config/tc-m32r.c:2323 config/tc-sparc.c:3527 #, c-format msgid "internal error: can't export reloc type %d (`%s')" msgstr "" @@ -6213,406 +6140,406 @@ msgstr "" msgid "Line %d: unknown relocation type: 0x%x." msgstr "" -#: config/tc-m68k.c:693 +#: config/tc-m68k.c:698 msgid "no matching ColdFire architectures found" msgstr "" -#: config/tc-m68k.c:707 +#: config/tc-m68k.c:712 msgid " or " msgstr "" -#: config/tc-m68k.c:712 +#: config/tc-m68k.c:717 msgid ", or " msgstr "" -#: config/tc-m68k.c:729 +#: config/tc-m68k.c:734 msgid ", or aliases" msgstr "" -#: config/tc-m68k.c:753 config/tc-m68k.c:4765 config/tc-m68k.c:5156 +#: config/tc-m68k.c:758 config/tc-m68k.c:4775 config/tc-m68k.c:5166 msgid "Tried to convert PC relative branch to absolute jump" msgstr "" -#: config/tc-m68k.c:760 config/tc-m68k.c:4755 +#: config/tc-m68k.c:765 config/tc-m68k.c:4765 msgid "Tried to convert PC relative BSR to absolute JSR" msgstr "" -#: config/tc-m68k.c:765 +#: config/tc-m68k.c:770 msgid "Unknown PC relative instruction" msgstr "" -#: config/tc-m68k.c:897 +#: config/tc-m68k.c:902 #, c-format msgid "Can not do %d byte pc-relative relocation" msgstr "" -#: config/tc-m68k.c:899 +#: config/tc-m68k.c:904 #, c-format msgid "Can not do %d byte pc-relative pic relocation" msgstr "" -#: config/tc-m68k.c:904 +#: config/tc-m68k.c:909 #, c-format msgid "Can not do %d byte relocation" msgstr "" -#: config/tc-m68k.c:906 +#: config/tc-m68k.c:911 #, c-format msgid "Can not do %d byte pic relocation" msgstr "" -#: config/tc-m68k.c:971 +#: config/tc-m68k.c:976 #, c-format msgid "Unable to produce reloc against symbol '%s'" msgstr "" -#: config/tc-m68k.c:1015 config/tc-vax.c:3456 +#: config/tc-m68k.c:1020 config/tc-vax.c:3513 #, c-format msgid "Cannot make %s relocation PC relative" msgstr "" -#: config/tc-m68k.c:1107 config/tc-tahoe.c:1495 config/tc-vax.c:1895 +#: config/tc-m68k.c:1112 config/tc-tahoe.c:1398 config/tc-vax.c:1952 msgid "No operator" msgstr "" -#: config/tc-m68k.c:1137 config/tc-tahoe.c:1512 config/tc-vax.c:1912 +#: config/tc-m68k.c:1142 config/tc-tahoe.c:1415 config/tc-vax.c:1969 msgid "Unknown operator" msgstr "" -#: config/tc-m68k.c:1990 +#: config/tc-m68k.c:1992 msgid "invalid instruction for this architecture; needs " msgstr "" -#: config/tc-m68k.c:1996 +#: config/tc-m68k.c:1998 msgid "ColdFire ISA_A" msgstr "" -#: config/tc-m68k.c:2004 +#: config/tc-m68k.c:2006 msgid "ColdFire hardware divide" msgstr "" -#: config/tc-m68k.c:2012 +#: config/tc-m68k.c:2014 msgid "ColdFire ISA_A+" msgstr "" -#: config/tc-m68k.c:2020 +#: config/tc-m68k.c:2022 msgid "ColdFire ISA_B" msgstr "" -#: config/tc-m68k.c:2028 +#: config/tc-m68k.c:2030 msgid "ColdFire fpu" msgstr "" -#: config/tc-m68k.c:2035 +#: config/tc-m68k.c:2037 msgid "fpu (68040, 68060 or 68881/68882)" msgstr "" -#: config/tc-m68k.c:2038 +#: config/tc-m68k.c:2040 msgid "mmu (68030 or 68851)" msgstr "" -#: config/tc-m68k.c:2041 +#: config/tc-m68k.c:2043 msgid "68020 or higher" msgstr "" -#: config/tc-m68k.c:2044 +#: config/tc-m68k.c:2046 msgid "68000 or higher" msgstr "" -#: config/tc-m68k.c:2047 +#: config/tc-m68k.c:2049 msgid "68010 or higher" msgstr "" -#: config/tc-m68k.c:2075 +#: config/tc-m68k.c:2077 msgid "operands mismatch" msgstr "" -#: config/tc-m68k.c:2136 config/tc-m68k.c:2142 config/tc-m68k.c:2148 -#: config/tc-mmix.c:2526 config/tc-mmix.c:2550 +#: config/tc-m68k.c:2138 config/tc-m68k.c:2144 config/tc-m68k.c:2150 +#: config/tc-mmix.c:2488 config/tc-mmix.c:2512 msgid "operand out of range" msgstr "" -#: config/tc-m68k.c:2205 +#: config/tc-m68k.c:2207 #, c-format msgid "Bignum too big for %c format; truncated" msgstr "" -#: config/tc-m68k.c:2286 +#: config/tc-m68k.c:2288 msgid "displacement too large for this architecture; needs 68020 or higher" msgstr "" -#: config/tc-m68k.c:2397 +#: config/tc-m68k.c:2399 msgid "" "scale factor invalid on this architecture; needs cpu32 or 68020 or higher" msgstr "" -#: config/tc-m68k.c:2402 +#: config/tc-m68k.c:2404 msgid "invalid index size for coldfire" msgstr "" -#: config/tc-m68k.c:2455 +#: config/tc-m68k.c:2457 msgid "Forcing byte displacement" msgstr "" -#: config/tc-m68k.c:2457 +#: config/tc-m68k.c:2459 msgid "byte displacement out of range" msgstr "" -#: config/tc-m68k.c:2504 config/tc-m68k.c:2542 +#: config/tc-m68k.c:2507 config/tc-m68k.c:2545 msgid "invalid operand mode for this architecture; needs 68020 or higher" msgstr "" -#: config/tc-m68k.c:2528 config/tc-m68k.c:2562 +#: config/tc-m68k.c:2531 config/tc-m68k.c:2565 msgid ":b not permitted; defaulting to :w" msgstr "" -#: config/tc-m68k.c:2639 +#: config/tc-m68k.c:2642 msgid "unsupported byte value; use a different suffix" msgstr "" -#: config/tc-m68k.c:2654 +#: config/tc-m68k.c:2657 msgid "unknown/incorrect operand" msgstr "" -#: config/tc-m68k.c:2697 config/tc-m68k.c:2705 config/tc-m68k.c:2712 -#: config/tc-m68k.c:2719 +#: config/tc-m68k.c:2700 config/tc-m68k.c:2708 config/tc-m68k.c:2715 +#: config/tc-m68k.c:2722 msgid "out of range" msgstr "" -#: config/tc-m68k.c:2765 +#: config/tc-m68k.c:2768 msgid "Can't use long branches on 68000/68010/5200" msgstr "" -#: config/tc-m68k.c:2875 +#: config/tc-m68k.c:2885 msgid "Expression out of range, using 0" msgstr "" -#: config/tc-m68k.c:3056 config/tc-m68k.c:3072 +#: config/tc-m68k.c:3066 config/tc-m68k.c:3082 msgid "Floating point register in register list" msgstr "" -#: config/tc-m68k.c:3062 +#: config/tc-m68k.c:3072 msgid "Wrong register in floating-point reglist" msgstr "" -#: config/tc-m68k.c:3078 +#: config/tc-m68k.c:3088 msgid "incorrect register in reglist" msgstr "" -#: config/tc-m68k.c:3084 +#: config/tc-m68k.c:3094 msgid "wrong register in floating-point reglist" msgstr "" #. ERROR. -#: config/tc-m68k.c:3547 +#: config/tc-m68k.c:3557 msgid "Extra )" msgstr "" #. ERROR. -#: config/tc-m68k.c:3558 +#: config/tc-m68k.c:3568 msgid "Missing )" msgstr "" -#: config/tc-m68k.c:3575 +#: config/tc-m68k.c:3585 msgid "Missing operand" msgstr "" -#: config/tc-m68k.c:3937 +#: config/tc-m68k.c:3947 #, c-format msgid "%s -- statement `%s' ignored" msgstr "" -#: config/tc-m68k.c:3986 +#: config/tc-m68k.c:3996 #, c-format msgid "Don't know how to figure width of %c in md_assemble()" msgstr "" -#: config/tc-m68k.c:4152 +#: config/tc-m68k.c:4162 #, c-format msgid "Internal Error: Can't allocate m68k_sorted_opcodes of size %d" msgstr "" -#: config/tc-m68k.c:4203 config/tc-m68k.c:4242 +#: config/tc-m68k.c:4213 config/tc-m68k.c:4252 #, c-format msgid "Internal Error: Can't find %s in hash table" msgstr "" -#: config/tc-m68k.c:4206 config/tc-m68k.c:4245 +#: config/tc-m68k.c:4216 config/tc-m68k.c:4255 #, c-format msgid "Internal Error: Can't hash %s: %s" msgstr "" -#: config/tc-m68k.c:4326 +#: config/tc-m68k.c:4336 msgid "architecture not yet selected: defaulting to 68020" msgstr "" -#: config/tc-m68k.c:4386 +#: config/tc-m68k.c:4396 #, c-format msgid "unrecognized default cpu `%s' ???" msgstr "" -#: config/tc-m68k.c:4397 +#: config/tc-m68k.c:4407 msgid "68040 and 68851 specified; mmu instructions may assemble incorrectly" msgstr "" -#: config/tc-m68k.c:4414 +#: config/tc-m68k.c:4424 msgid "options for 68881 and no-68881 both given" msgstr "" -#: config/tc-m68k.c:4417 +#: config/tc-m68k.c:4427 msgid "options for 68851 and no-68851 both given" msgstr "" -#: config/tc-m68k.c:4486 +#: config/tc-m68k.c:4496 #, c-format msgid "text label `%s' aligned to odd boundary" msgstr "" -#: config/tc-m68k.c:4695 +#: config/tc-m68k.c:4705 msgid "invalid byte branch offset" msgstr "" -#: config/tc-m68k.c:4731 +#: config/tc-m68k.c:4741 msgid "short branch with zero offset: use :w" msgstr "" -#: config/tc-m68k.c:4781 config/tc-m68k.c:4840 config/tc-m68k.c:4904 +#: config/tc-m68k.c:4791 config/tc-m68k.c:4850 config/tc-m68k.c:4914 msgid "Tried to convert PC relative conditional branch to absolute jump" msgstr "" -#: config/tc-m68k.c:4821 +#: config/tc-m68k.c:4831 msgid "Tried to convert DBcc to absolute jump" msgstr "" -#: config/tc-m68k.c:5200 config/tc-m68k.c:5211 config/tc-m68k.c:5252 +#: config/tc-m68k.c:5210 config/tc-m68k.c:5221 config/tc-m68k.c:5261 msgid "expression out of range: defaulting to 1" msgstr "" -#: config/tc-m68k.c:5243 +#: config/tc-m68k.c:5253 msgid "expression out of range: defaulting to 0" msgstr "" -#: config/tc-m68k.c:5285 config/tc-m68k.c:5297 +#: config/tc-m68k.c:5294 config/tc-m68k.c:5306 #, c-format msgid "Can't deal with expression; defaulting to %ld" msgstr "" -#: config/tc-m68k.c:5311 +#: config/tc-m68k.c:5320 msgid "expression doesn't fit in BYTE" msgstr "" -#: config/tc-m68k.c:5315 +#: config/tc-m68k.c:5324 msgid "expression doesn't fit in WORD" msgstr "" -#: config/tc-m68k.c:5402 +#: config/tc-m68k.c:5411 #, c-format msgid "%s: unrecognized processor name" msgstr "" -#: config/tc-m68k.c:5466 +#: config/tc-m68k.c:5475 msgid "bad coprocessor id" msgstr "" -#: config/tc-m68k.c:5472 +#: config/tc-m68k.c:5481 msgid "unrecognized fopt option" msgstr "" -#: config/tc-m68k.c:5605 +#: config/tc-m68k.c:5614 #, c-format msgid "option `%s' may not be negated" msgstr "" -#: config/tc-m68k.c:5616 +#: config/tc-m68k.c:5625 #, c-format msgid "option `%s' not recognized" msgstr "" -#: config/tc-m68k.c:5645 +#: config/tc-m68k.c:5654 msgid "bad format of OPT NEST=depth" msgstr "" -#: config/tc-m68k.c:5701 +#: config/tc-m68k.c:5710 msgid "missing label" msgstr "" -#: config/tc-m68k.c:5725 config/tc-m68k.c:5754 +#: config/tc-m68k.c:5734 config/tc-m68k.c:5763 msgid "bad register list" msgstr "" -#: config/tc-m68k.c:5727 +#: config/tc-m68k.c:5736 #, c-format msgid "bad register list: %s" msgstr "" -#: config/tc-m68k.c:5825 +#: config/tc-m68k.c:5834 msgid "restore without save" msgstr "" -#: config/tc-m68k.c:5979 config/tc-m68k.c:6349 +#: config/tc-m68k.c:5988 config/tc-m68k.c:6358 msgid "syntax error in structured control directive" msgstr "" -#: config/tc-m68k.c:6024 +#: config/tc-m68k.c:6033 msgid "missing condition code in structured control directive" msgstr "" -#: config/tc-m68k.c:6095 +#: config/tc-m68k.c:6104 #, c-format msgid "" "Condition <%c%c> in structured control directive can not be encoded correctly" msgstr "" -#: config/tc-m68k.c:6391 +#: config/tc-m68k.c:6400 msgid "missing then" msgstr "" -#: config/tc-m68k.c:6472 +#: config/tc-m68k.c:6481 msgid "else without matching if" msgstr "" -#: config/tc-m68k.c:6505 +#: config/tc-m68k.c:6514 msgid "endi without matching if" msgstr "" -#: config/tc-m68k.c:6545 +#: config/tc-m68k.c:6554 msgid "break outside of structured loop" msgstr "" -#: config/tc-m68k.c:6583 +#: config/tc-m68k.c:6592 msgid "next outside of structured loop" msgstr "" -#: config/tc-m68k.c:6634 +#: config/tc-m68k.c:6643 msgid "missing =" msgstr "" -#: config/tc-m68k.c:6672 +#: config/tc-m68k.c:6681 msgid "missing to or downto" msgstr "" -#: config/tc-m68k.c:6708 config/tc-m68k.c:6742 config/tc-m68k.c:6956 +#: config/tc-m68k.c:6717 config/tc-m68k.c:6751 config/tc-m68k.c:6965 msgid "missing do" msgstr "" -#: config/tc-m68k.c:6843 +#: config/tc-m68k.c:6852 msgid "endf without for" msgstr "" -#: config/tc-m68k.c:6897 +#: config/tc-m68k.c:6906 msgid "until without repeat" msgstr "" -#: config/tc-m68k.c:6991 +#: config/tc-m68k.c:7000 msgid "endw without while" msgstr "" -#: config/tc-m68k.c:7153 +#: config/tc-m68k.c:7162 #, c-format msgid "unrecognized architecture specification `%s'" msgstr "" -#: config/tc-m68k.c:7246 +#: config/tc-m68k.c:7255 #, c-format msgid "" "680X0 options:\n" @@ -6627,7 +6554,7 @@ msgid "" "\t\t\t[default yes for 68020, 68030, and cpu32]\n" msgstr "" -#: config/tc-m68k.c:7258 +#: config/tc-m68k.c:7267 #, c-format msgid "" "-m68851 | -mno-68851\n" @@ -6641,7 +6568,7 @@ msgid "" "--bitwise-or\t\tdo not treat `|' as a comment character\n" msgstr "" -#: config/tc-m68k.c:7268 +#: config/tc-m68k.c:7277 #, c-format msgid "" "--base-size-default-16\tbase reg without size is 16 bits\n" @@ -6650,57 +6577,57 @@ msgid "" "--disp-size-default-32\tdisplacement with unknown size is 32 bits (default)\n" msgstr "" -#: config/tc-m68k.c:7303 +#: config/tc-m68k.c:7312 #, c-format msgid "Error %s in %s\n" msgstr "" -#: config/tc-m68k.c:7307 +#: config/tc-m68k.c:7316 #, c-format msgid "Opcode(%d.%s): " msgstr "" -#: config/tc-m88k.c:201 +#: config/tc-m88k.c:165 #, c-format msgid "Can't hash instruction '%s':%s" msgstr "" -#: config/tc-m88k.c:250 -#, c-format -msgid "Invalid mnemonic '%s'" +#: config/tc-m88k.c:205 +msgid "Removed lower 2 bits of expression" msgstr "" -#: config/tc-m88k.c:268 -msgid "Parameter syntax error" +#: config/tc-m88k.c:225 +msgid "Expression truncated to 9 bits" msgstr "" -#: config/tc-m88k.c:321 -msgid "Unknown relocation type" +#: config/tc-m88k.c:487 config/tc-m88k.c:651 +msgid "Expression truncated to 5 bits" +msgstr "" + +#: config/tc-m88k.c:590 +msgid "Expression truncated to 16 bits" msgstr "" #. Having this here repeats the warning somtimes. #. But can't we stand that? -#: config/tc-m88k.c:434 +#: config/tc-m88k.c:767 msgid "Use of obsolete instruction" msgstr "" -#: config/tc-m88k.c:551 -msgid "Expression truncated to 16 bits" -msgstr "" - -#: config/tc-m88k.c:617 config/tc-m88k.c:639 -msgid "Expression truncated to 5 bits" +#: config/tc-m88k.c:792 +#, c-format +msgid "Invalid mnemonic '%s'" msgstr "" -#: config/tc-m88k.c:856 -msgid "Expression truncated to 9 bits" +#: config/tc-m88k.c:810 +msgid "Parameter syntax error" msgstr "" -#: config/tc-m88k.c:878 -msgid "Removed lower 2 bits of expression" +#: config/tc-m88k.c:863 +msgid "Unknown relocation type" msgstr "" -#: config/tc-m88k.c:1057 +#: config/tc-m88k.c:979 msgid "Relaxation should never occur" msgstr "" @@ -6708,164 +6635,164 @@ msgstr "" msgid "m88k convert_frag\n" msgstr "" -#: config/tc-mcore.c:461 +#: config/tc-mcore.c:526 #, c-format msgid "register expected, but saw '%.6s'" msgstr "" -#: config/tc-mcore.c:545 +#: config/tc-mcore.c:608 #, c-format msgid "control register expected, but saw '%.6s'" msgstr "" -#: config/tc-mcore.c:583 +#: config/tc-mcore.c:644 msgid "bad/missing psr specifier" msgstr "" -#: config/tc-mcore.c:744 +#: config/tc-mcore.c:694 msgid "more than 65K literal pools" msgstr "" -#: config/tc-mcore.c:798 +#: config/tc-mcore.c:748 msgid "missing ']'" msgstr "" -#: config/tc-mcore.c:838 +#: config/tc-mcore.c:787 msgid "operand must be a constant" msgstr "" -#: config/tc-mcore.c:840 +#: config/tc-mcore.c:789 #, c-format msgid "operand must be absolute in range %u..%u, not %ld" msgstr "" -#: config/tc-mcore.c:876 +#: config/tc-mcore.c:824 msgid "operand must be a multiple of 4" msgstr "" -#: config/tc-mcore.c:883 +#: config/tc-mcore.c:831 msgid "operand must be a multiple of 2" msgstr "" -#: config/tc-mcore.c:897 config/tc-mcore.c:1411 config/tc-mcore.c:1465 +#: config/tc-mcore.c:845 config/tc-mcore.c:1361 config/tc-mcore.c:1415 msgid "base register expected" msgstr "" -#: config/tc-mcore.c:946 +#: config/tc-mcore.c:893 #, c-format msgid "unknown opcode \"%s\"" msgstr "" -#: config/tc-mcore.c:989 +#: config/tc-mcore.c:936 msgid "invalid register: r15 illegal" msgstr "" -#: config/tc-mcore.c:1037 config/tc-mcore.c:1615 +#: config/tc-mcore.c:985 config/tc-mcore.c:1566 msgid "M340 specific opcode used when assembling for M210" msgstr "" -#: config/tc-mcore.c:1055 config/tc-mcore.c:1094 config/tc-mcore.c:1113 -#: config/tc-mcore.c:1132 config/tc-mcore.c:1159 config/tc-mcore.c:1188 -#: config/tc-mcore.c:1225 config/tc-mcore.c:1260 config/tc-mcore.c:1279 -#: config/tc-mcore.c:1298 config/tc-mcore.c:1332 config/tc-mcore.c:1357 -#: config/tc-mcore.c:1414 config/tc-mcore.c:1468 config/tc-mcore.c:1504 -#: config/tc-mcore.c:1562 config/tc-mcore.c:1584 config/tc-mcore.c:1607 +#: config/tc-mcore.c:1003 config/tc-mcore.c:1043 config/tc-mcore.c:1062 +#: config/tc-mcore.c:1081 config/tc-mcore.c:1109 config/tc-mcore.c:1138 +#: config/tc-mcore.c:1175 config/tc-mcore.c:1210 config/tc-mcore.c:1229 +#: config/tc-mcore.c:1248 config/tc-mcore.c:1282 config/tc-mcore.c:1307 +#: config/tc-mcore.c:1364 config/tc-mcore.c:1418 config/tc-mcore.c:1454 +#: config/tc-mcore.c:1513 config/tc-mcore.c:1535 config/tc-mcore.c:1558 msgid "second operand missing" msgstr "" -#: config/tc-mcore.c:1070 +#: config/tc-mcore.c:1019 msgid "destination register must be r1" msgstr "" -#: config/tc-mcore.c:1091 +#: config/tc-mcore.c:1040 msgid "source register must be r1" msgstr "" -#: config/tc-mcore.c:1154 config/tc-mcore.c:1211 +#: config/tc-mcore.c:1104 config/tc-mcore.c:1161 msgid "immediate is not a power of two" msgstr "" -#: config/tc-mcore.c:1182 +#: config/tc-mcore.c:1132 msgid "translating bgeni to movi" msgstr "" -#: config/tc-mcore.c:1219 +#: config/tc-mcore.c:1169 msgid "translating mgeni to movi" msgstr "" -#: config/tc-mcore.c:1251 +#: config/tc-mcore.c:1201 msgid "translating bmaski to movi" msgstr "" -#: config/tc-mcore.c:1327 +#: config/tc-mcore.c:1277 #, c-format msgid "displacement too large (%d)" msgstr "" -#: config/tc-mcore.c:1341 +#: config/tc-mcore.c:1291 msgid "Invalid register: r0 and r15 illegal" msgstr "" -#: config/tc-mcore.c:1372 +#: config/tc-mcore.c:1322 msgid "bad starting register: r0 and r15 invalid" msgstr "" -#: config/tc-mcore.c:1385 +#: config/tc-mcore.c:1335 msgid "ending register must be r15" msgstr "" -#: config/tc-mcore.c:1405 +#: config/tc-mcore.c:1355 msgid "bad base register: must be r0" msgstr "" -#: config/tc-mcore.c:1423 +#: config/tc-mcore.c:1373 msgid "first register must be r4" msgstr "" -#: config/tc-mcore.c:1434 +#: config/tc-mcore.c:1384 msgid "last register must be r7" msgstr "" -#: config/tc-mcore.c:1471 +#: config/tc-mcore.c:1421 msgid "reg-reg expected" msgstr "" -#: config/tc-mcore.c:1581 +#: config/tc-mcore.c:1532 msgid "second operand must be 1" msgstr "" -#: config/tc-mcore.c:1602 +#: config/tc-mcore.c:1553 msgid "zero used as immediate value" msgstr "" -#: config/tc-mcore.c:1629 +#: config/tc-mcore.c:1580 msgid "duplicated psr bit specifier" msgstr "" -#: config/tc-mcore.c:1635 +#: config/tc-mcore.c:1586 msgid "`af' must appear alone" msgstr "" -#: config/tc-mcore.c:1642 +#: config/tc-mcore.c:1593 #, c-format msgid "unimplemented opcode \"%s\"" msgstr "" -#: config/tc-mcore.c:1651 +#: config/tc-mcore.c:1602 #, c-format msgid "ignoring operands: %s " msgstr "" -#: config/tc-mcore.c:1719 config/tc-w65.c:769 +#: config/tc-mcore.c:1667 config/tc-w65.c:742 msgid "Bad call to MD_NTOF()" msgstr "" -#: config/tc-mcore.c:1789 +#: config/tc-mcore.c:1738 #, c-format msgid "unrecognised cpu type '%s'" msgstr "" -#: config/tc-mcore.c:1808 +#: config/tc-mcore.c:1756 #, c-format msgid "" "MCORE specific options:\n" @@ -6876,643 +6803,643 @@ msgid "" " -EL assemble for a little endian system\n" msgstr "" -#: config/tc-mcore.c:1827 +#: config/tc-mcore.c:1774 msgid "failed sanity check: short_jump" msgstr "" -#: config/tc-mcore.c:1838 +#: config/tc-mcore.c:1784 msgid "failed sanity check: long_jump" msgstr "" -#: config/tc-mcore.c:1864 +#: config/tc-mcore.c:1810 #, c-format msgid "odd displacement at %x" msgstr "" -#: config/tc-mcore.c:2048 +#: config/tc-mcore.c:1992 msgid "unknown" msgstr "" -#: config/tc-mcore.c:2074 +#: config/tc-mcore.c:2019 #, c-format msgid "odd distance branch (0x%lx bytes)" msgstr "" -#: config/tc-mcore.c:2078 +#: config/tc-mcore.c:2023 #, c-format msgid "pcrel for branch to %s too far (0x%lx)" msgstr "" -#: config/tc-mcore.c:2097 +#: config/tc-mcore.c:2043 #, c-format msgid "pcrel for lrw/jmpi/jsri to %s too far (0x%lx)" msgstr "" -#: config/tc-mcore.c:2108 +#: config/tc-mcore.c:2055 #, c-format msgid "pcrel for loopt too far (0x%lx)" msgstr "" -#: config/tc-mcore.c:2337 +#: config/tc-mcore.c:2265 #, c-format msgid "Can not do %d byte %srelocation" msgstr "" -#: config/tc-mcore.c:2339 +#: config/tc-mcore.c:2267 msgid "pc-relative" msgstr "" #. Prototypes for static functions. -#: config/tc-mips.c:862 +#: config/tc-mips.c:939 #, c-format msgid "internal Error, line %d, %s" msgstr "" -#: config/tc-mips.c:1175 +#: config/tc-mips.c:1425 #, c-format msgid "internal: can't hash `%s': %s" msgstr "" -#: config/tc-mips.c:1183 +#: config/tc-mips.c:1433 #, c-format msgid "internal error: bad mips16 opcode: %s %s\n" msgstr "" -#: config/tc-mips.c:1376 +#: config/tc-mips.c:1634 #, c-format msgid "returned from mips_ip(%s) insn_opcode = 0x%x\n" msgstr "" -#: config/tc-mips.c:2085 config/tc-mips.c:13223 +#: config/tc-mips.c:2308 config/tc-mips.c:13111 msgid "extended instruction in delay slot" msgstr "" -#: config/tc-mips.c:2145 config/tc-mips.c:2155 +#: config/tc-mips.c:2372 config/tc-mips.c:2382 #, c-format msgid "jump to misaligned address (0x%lx)" msgstr "" -#: config/tc-mips.c:2148 config/tc-mips.c:2158 +#: config/tc-mips.c:2375 config/tc-mips.c:2385 #, c-format msgid "jump address range overflow (0x%lx)" msgstr "" -#: config/tc-mips.c:2937 +#: config/tc-mips.c:2857 msgid "" "Macro instruction expanded into multiple instructions in a branch delay slot" msgstr "" -#: config/tc-mips.c:2940 +#: config/tc-mips.c:2860 msgid "Macro instruction expanded into multiple instructions" msgstr "" -#: config/tc-mips.c:3436 config/tc-mips.c:3602 config/tc-mips.c:5891 -msgid "constant too large" -msgstr "" - -#: config/tc-mips.c:3444 config/tc-mips.c:7375 config/tc-mips.c:7399 -#: config/tc-mips.c:7472 config/tc-mips.c:7495 +#: config/tc-mips.c:3378 config/tc-mips.c:7302 config/tc-mips.c:7326 +#: config/tc-mips.c:7399 config/tc-mips.c:7422 msgid "operand overflow" msgstr "" -#: config/tc-mips.c:3463 config/tc-mips.c:4074 config/tc-mips.c:6765 -#: config/tc-mips.c:7562 +#: config/tc-mips.c:3397 config/tc-mips.c:3997 config/tc-mips.c:6698 +#: config/tc-mips.c:7489 msgid "Macro used $at after \".set noat\"" msgstr "" -#: config/tc-mips.c:3500 +#: config/tc-mips.c:3426 msgid "unsupported large constant" msgstr "" -#: config/tc-mips.c:3502 +#: config/tc-mips.c:3428 #, c-format msgid "Instruction %s requires absolute expression" msgstr "" -#: config/tc-mips.c:3637 +#: config/tc-mips.c:3561 config/tc-mips.c:5808 config/tc-mips.c:6402 #, c-format -msgid "Number (0x%lx) larger than 32 bits" +msgid "Number (0x%s) larger than 32 bits" msgstr "" -#: config/tc-mips.c:3658 +#: config/tc-mips.c:3581 msgid "Number larger than 64 bits" msgstr "" -#: config/tc-mips.c:3952 config/tc-mips.c:3980 config/tc-mips.c:4018 -#: config/tc-mips.c:4063 config/tc-mips.c:6094 config/tc-mips.c:6133 -#: config/tc-mips.c:6172 config/tc-mips.c:6584 config/tc-mips.c:6636 +#: config/tc-mips.c:3875 config/tc-mips.c:3903 config/tc-mips.c:3941 +#: config/tc-mips.c:3986 config/tc-mips.c:6017 config/tc-mips.c:6056 +#: config/tc-mips.c:6095 config/tc-mips.c:6517 config/tc-mips.c:6569 msgid "PIC code offset overflow (max 16 signed bits)" msgstr "" -#: config/tc-mips.c:4371 config/tc-mips.c:4437 config/tc-mips.c:4525 -#: config/tc-mips.c:4572 config/tc-mips.c:4633 config/tc-mips.c:4681 -#: config/tc-mips.c:7660 config/tc-mips.c:7667 config/tc-mips.c:7674 -#: config/tc-mips.c:7781 +#: config/tc-mips.c:4292 config/tc-mips.c:4358 config/tc-mips.c:4446 +#: config/tc-mips.c:4493 config/tc-mips.c:4554 config/tc-mips.c:4602 +#: config/tc-mips.c:7583 config/tc-mips.c:7590 config/tc-mips.c:7597 +#: config/tc-mips.c:7704 msgid "Unsupported large constant" msgstr "" #. result is always true -#: config/tc-mips.c:4403 +#: config/tc-mips.c:4324 #, c-format msgid "Branch %s is always true" msgstr "" -#: config/tc-mips.c:4644 config/tc-mips.c:4692 config/tc-mips.c:8106 +#: config/tc-mips.c:4565 config/tc-mips.c:4613 config/tc-mips.c:8028 #, c-format msgid "Improper position (%lu)" msgstr "" -#: config/tc-mips.c:4650 config/tc-mips.c:8174 +#: config/tc-mips.c:4571 config/tc-mips.c:8095 #, c-format msgid "Improper extract size (%lu, position %lu)" msgstr "" -#: config/tc-mips.c:4698 config/tc-mips.c:8138 +#: config/tc-mips.c:4619 config/tc-mips.c:8059 #, c-format msgid "Improper insert size (%lu, position %lu)" msgstr "" -#: config/tc-mips.c:4735 config/tc-mips.c:4834 +#: config/tc-mips.c:4656 config/tc-mips.c:4753 msgid "Divide by zero." msgstr "" -#: config/tc-mips.c:4922 +#: config/tc-mips.c:4839 msgid "dla used to load 32-bit register" msgstr "" -#: config/tc-mips.c:4925 +#: config/tc-mips.c:4842 msgid "la used to load 64-bit address" msgstr "" -#: config/tc-mips.c:5209 config/tc-mips.c:5488 +#: config/tc-mips.c:4954 +msgid "offset too large" +msgstr "" + +#: config/tc-mips.c:5126 config/tc-mips.c:5405 msgid "PIC code offset overflow (max 32 signed bits)" msgstr "" -#: config/tc-mips.c:5534 +#: config/tc-mips.c:5451 msgid "MIPS PIC call to register other than $25" msgstr "" -#: config/tc-mips.c:5540 config/tc-mips.c:5551 config/tc-mips.c:5675 -#: config/tc-mips.c:5686 +#: config/tc-mips.c:5457 config/tc-mips.c:5468 config/tc-mips.c:5592 +#: config/tc-mips.c:5603 msgid "No .cprestore pseudo-op used in PIC code" msgstr "" -#: config/tc-mips.c:5545 config/tc-mips.c:5680 +#: config/tc-mips.c:5462 config/tc-mips.c:5597 msgid "No .frame pseudo-op used in PIC code" msgstr "" -#: config/tc-mips.c:5751 config/tc-mips.c:5839 config/tc-mips.c:6379 -#: config/tc-mips.c:6410 config/tc-mips.c:6428 config/tc-mips.c:7072 +#: config/tc-mips.c:5668 config/tc-mips.c:5756 config/tc-mips.c:6302 +#: config/tc-mips.c:6333 config/tc-mips.c:6351 config/tc-mips.c:7001 msgid "opcode not supported on this processor" msgstr "" -#: config/tc-mips.c:6938 config/tc-mips.c:6969 config/tc-mips.c:7020 -#: config/tc-mips.c:7050 +#: config/tc-mips.c:6867 config/tc-mips.c:6898 config/tc-mips.c:6949 +#: config/tc-mips.c:6979 msgid "Improper rotate count" msgstr "" -#: config/tc-mips.c:7105 +#: config/tc-mips.c:7034 #, c-format msgid "Instruction %s: result is always false" msgstr "" -#: config/tc-mips.c:7251 +#: config/tc-mips.c:7180 #, c-format msgid "Instruction %s: result is always true" msgstr "" #. FIXME: Check if this is one of the itbl macros, since they #. are added dynamically. -#: config/tc-mips.c:7558 +#: config/tc-mips.c:7485 #, c-format msgid "Macro %s not implemented yet" msgstr "" -#: config/tc-mips.c:7812 +#: config/tc-mips.c:7735 #, c-format msgid "internal: bad mips opcode (mask error): %s %s" msgstr "" -#: config/tc-mips.c:7837 config/tc-mips.c:8200 +#: config/tc-mips.c:7760 config/tc-mips.c:8121 #, c-format msgid "internal: bad mips opcode (unknown extension operand type `+%c'): %s %s" msgstr "" -#: config/tc-mips.c:7898 +#: config/tc-mips.c:7821 #, c-format msgid "internal: bad mips opcode (unknown operand type `%c'): %s %s" msgstr "" -#: config/tc-mips.c:7905 +#: config/tc-mips.c:7828 #, c-format msgid "internal: bad mips opcode (bits 0x%lx undefined): %s %s" msgstr "" -#: config/tc-mips.c:8019 +#: config/tc-mips.c:7942 #, c-format msgid "opcode not supported on this processor: %s (%s)" msgstr "" -#: config/tc-mips.c:8194 config/tc-mips.c:8684 +#: config/tc-mips.c:8114 config/tc-mips.c:8583 msgid "absolute expression required" msgstr "" -#: config/tc-mips.c:8218 +#: config/tc-mips.c:8138 #, c-format msgid "Improper shift amount (%lu)" msgstr "" -#: config/tc-mips.c:8244 config/tc-mips.c:9517 config/tc-mips.c:9632 +#: config/tc-mips.c:8161 config/tc-mips.c:9415 config/tc-mips.c:9528 #, c-format msgid "Invalid value for `%s' (%lu)" msgstr "" -#: config/tc-mips.c:8262 +#: config/tc-mips.c:8176 #, c-format msgid "Illegal break code (%lu)" msgstr "" -#: config/tc-mips.c:8276 +#: config/tc-mips.c:8187 #, c-format msgid "Illegal lower break code (%lu)" msgstr "" -#: config/tc-mips.c:8289 +#: config/tc-mips.c:8198 #, c-format msgid "Illegal 20-bit code (%lu)" msgstr "" -#: config/tc-mips.c:8301 +#: config/tc-mips.c:8210 #, c-format msgid "Coproccesor code > 25 bits (%lu)" msgstr "" -#: config/tc-mips.c:8314 +#: config/tc-mips.c:8223 #, c-format msgid "Illegal 19-bit code (%lu)" msgstr "" -#: config/tc-mips.c:8326 +#: config/tc-mips.c:8234 #, c-format msgid "Invalid performance register (%lu)" msgstr "" -#: config/tc-mips.c:8364 +#: config/tc-mips.c:8270 #, c-format msgid "Invalid register number (%d)" msgstr "" -#: config/tc-mips.c:8542 +#: config/tc-mips.c:8444 #, c-format msgid "Invalid MDMX Immediate (%ld)" msgstr "" -#: config/tc-mips.c:8585 +#: config/tc-mips.c:8484 #, c-format msgid "Invalid float register number (%d)" msgstr "" -#: config/tc-mips.c:8595 +#: config/tc-mips.c:8494 #, c-format msgid "Float register should be even, was %d" msgstr "" -#: config/tc-mips.c:8634 +#: config/tc-mips.c:8533 #, c-format msgid "Bad element selector %ld" msgstr "" -#: config/tc-mips.c:8642 +#: config/tc-mips.c:8541 #, c-format msgid "Expecting ']' found '%s'" msgstr "" -#: config/tc-mips.c:8746 +#: config/tc-mips.c:8647 #, c-format msgid "Bad floating point constant: %s" msgstr "" -#: config/tc-mips.c:8867 +#: config/tc-mips.c:8768 msgid "Can't use floating point insn in this section" msgstr "" -#: config/tc-mips.c:8928 +#: config/tc-mips.c:8829 msgid "expression out of range" msgstr "" -#: config/tc-mips.c:8968 +#: config/tc-mips.c:8869 msgid "lui expression not in range 0..65535" msgstr "" -#: config/tc-mips.c:8992 +#: config/tc-mips.c:8893 #, c-format msgid "Invalid condition code register $fcc%d" msgstr "" -#: config/tc-mips.c:8997 +#: config/tc-mips.c:8898 #, c-format msgid "Condition code register should be even for %s, was %d" msgstr "" -#: config/tc-mips.c:9002 +#: config/tc-mips.c:8903 #, c-format msgid "Condition code register should be 0 or 4 for %s, was %d" msgstr "" -#: config/tc-mips.c:9028 +#: config/tc-mips.c:8929 msgid "invalid coprocessor sub-selection value (0-7)" msgstr "" -#: config/tc-mips.c:9040 config/tc-mips.c:9057 +#: config/tc-mips.c:8941 config/tc-mips.c:8958 #, c-format msgid "bad byte vector index (%ld)" msgstr "" -#: config/tc-mips.c:9068 +#: config/tc-mips.c:8969 #, c-format msgid "bad char = '%c'\n" msgstr "" -#: config/tc-mips.c:9079 config/tc-mips.c:9084 config/tc-mips.c:9657 +#: config/tc-mips.c:8980 config/tc-mips.c:8985 config/tc-mips.c:9553 msgid "illegal operands" msgstr "" -#: config/tc-mips.c:9150 +#: config/tc-mips.c:9051 msgid "unrecognized opcode" msgstr "" -#: config/tc-mips.c:9289 +#: config/tc-mips.c:9188 #, c-format msgid "invalid register number (%d)" msgstr "" -#: config/tc-mips.c:9380 +#: config/tc-mips.c:9279 msgid "used $at without \".set noat\"" msgstr "" -#: config/tc-mips.c:9551 +#: config/tc-mips.c:9447 msgid "can't parse register list" msgstr "" -#: config/tc-mips.c:9775 +#: config/tc-mips.c:9671 msgid "extended operand requested but not required" msgstr "" -#: config/tc-mips.c:9777 +#: config/tc-mips.c:9673 msgid "invalid unextended operand value" msgstr "" -#: config/tc-mips.c:9805 +#: config/tc-mips.c:9701 msgid "operand value out of range for instruction" msgstr "" -#: config/tc-mips.c:10245 +#: config/tc-mips.c:10145 #, c-format msgid "A different %s was already specified, is now %s" msgstr "" -#: config/tc-mips.c:10441 +#: config/tc-mips.c:10349 msgid "-call_shared is supported only for ELF format" msgstr "" -#: config/tc-mips.c:10448 config/tc-mips.c:10477 config/tc-mips.c:11571 -#: config/tc-mips.c:11805 +#: config/tc-mips.c:10356 config/tc-mips.c:10385 config/tc-mips.c:11473 +#: config/tc-mips.c:11691 msgid "-G may not be used with SVR4 PIC code" msgstr "" -#: config/tc-mips.c:10457 +#: config/tc-mips.c:10365 msgid "-non_shared is supported only for ELF format" msgstr "" -#: config/tc-mips.c:10488 +#: config/tc-mips.c:10396 msgid "-32 is supported for ELF format only" msgstr "" -#: config/tc-mips.c:10497 +#: config/tc-mips.c:10405 msgid "-n32 is supported for ELF format only" msgstr "" -#: config/tc-mips.c:10506 +#: config/tc-mips.c:10414 msgid "-64 is supported for ELF format only" msgstr "" -#: config/tc-mips.c:10511 config/tc-mips.c:10548 +#: config/tc-mips.c:10419 config/tc-mips.c:10456 msgid "No compiled in support for 64 bit object file format" msgstr "" -#: config/tc-mips.c:10535 +#: config/tc-mips.c:10443 msgid "-mabi is supported for ELF format only" msgstr "" -#: config/tc-mips.c:10555 +#: config/tc-mips.c:10463 #, c-format msgid "invalid abi -mabi=%s" msgstr "" -#: config/tc-mips.c:10629 +#: config/tc-mips.c:10537 msgid "-G not supported in this configuration." msgstr "" -#: config/tc-mips.c:10655 +#: config/tc-mips.c:10563 #, c-format msgid "-%s conflicts with the other architecture options, which imply -%s" msgstr "" -#: config/tc-mips.c:10686 +#: config/tc-mips.c:10594 msgid "-mgp64 used with a 32-bit processor" msgstr "" -#: config/tc-mips.c:10688 +#: config/tc-mips.c:10596 msgid "-mgp32 used with a 64-bit ABI" msgstr "" -#: config/tc-mips.c:10690 +#: config/tc-mips.c:10598 msgid "-mgp64 used with a 32-bit ABI" msgstr "" -#: config/tc-mips.c:10720 +#: config/tc-mips.c:10628 msgid "trap exception not supported at ISA 1" msgstr "" -#: config/tc-mips.c:10974 +#: config/tc-mips.c:10883 msgid "Cannot branch to undefined symbol." msgstr "" -#: config/tc-mips.c:10981 +#: config/tc-mips.c:10890 msgid "Cannot branch to symbol in another section." msgstr "" -#: config/tc-mips.c:10990 +#: config/tc-mips.c:10899 msgid "Pretending global symbol used as branch target is local." msgstr "" -#: config/tc-mips.c:11147 config/tc-sparc.c:3230 config/tc-sparc.c:3237 -#: config/tc-sparc.c:3244 config/tc-sparc.c:3251 config/tc-sparc.c:3258 -#: config/tc-sparc.c:3267 config/tc-sparc.c:3278 config/tc-sparc.c:3300 -#: config/tc-sparc.c:3324 write.c:962 write.c:1034 +#: config/tc-mips.c:11056 config/tc-sparc.c:3232 config/tc-sparc.c:3239 +#: config/tc-sparc.c:3246 config/tc-sparc.c:3253 config/tc-sparc.c:3260 +#: config/tc-sparc.c:3269 config/tc-sparc.c:3280 config/tc-sparc.c:3302 +#: config/tc-sparc.c:3326 write.c:970 write.c:1042 msgid "relocation overflow" msgstr "" -#: config/tc-mips.c:11157 +#: config/tc-mips.c:11066 #, c-format msgid "Branch to odd address (%lx)" msgstr "" -#: config/tc-mips.c:11206 +#: config/tc-mips.c:11115 msgid "Branch out of range" msgstr "" -#: config/tc-mips.c:11285 +#: config/tc-mips.c:11194 #, c-format msgid "Alignment too large: %d. assumed." msgstr "" -#: config/tc-mips.c:11288 +#: config/tc-mips.c:11197 msgid "Alignment negative: 0 assumed." msgstr "" -#: config/tc-mips.c:11527 +#: config/tc-mips.c:11429 #, c-format msgid "%s: no such section" msgstr "" -#: config/tc-mips.c:11566 +#: config/tc-mips.c:11468 #, c-format msgid ".option pic%d not supported" msgstr "" -#: config/tc-mips.c:11577 +#: config/tc-mips.c:11479 #, c-format msgid "Unrecognized option \"%s\"" msgstr "" -#: config/tc-mips.c:11639 +#: config/tc-mips.c:11532 msgid "`noreorder' must be set before `nomacro'" msgstr "" -#: config/tc-mips.c:11690 +#: config/tc-mips.c:11583 #, c-format msgid "unknown architecture %s" msgstr "" -#: config/tc-mips.c:11703 config/tc-mips.c:11733 +#: config/tc-mips.c:11596 config/tc-mips.c:11626 #, c-format msgid "unknown ISA level %s" msgstr "" -#: config/tc-mips.c:11711 +#: config/tc-mips.c:11604 #, c-format msgid "unknown ISA or architecture %s" msgstr "" -#: config/tc-mips.c:11761 +#: config/tc-mips.c:11654 msgid ".set pop with no .set push" msgstr "" -#: config/tc-mips.c:11789 +#: config/tc-mips.c:11675 #, c-format msgid "Tried to set unrecognized symbol: %s\n" msgstr "" -#: config/tc-mips.c:11847 +#: config/tc-mips.c:11733 msgid ".cpload not in noreorder section" msgstr "" -#: config/tc-mips.c:11916 config/tc-mips.c:11935 +#: config/tc-mips.c:11802 config/tc-mips.c:11821 msgid "missing argument separator ',' for .cpsetup" msgstr "" -#: config/tc-mips.c:12125 +#: config/tc-mips.c:12011 msgid "Unsupported use of .gpword" msgstr "" -#: config/tc-mips.c:12161 +#: config/tc-mips.c:12047 msgid "Unsupported use of .gpdword" msgstr "" -#: config/tc-mips.c:12293 +#: config/tc-mips.c:12179 msgid "expected `$'" msgstr "" -#: config/tc-mips.c:12301 +#: config/tc-mips.c:12187 msgid "Bad register number" msgstr "" -#: config/tc-mips.c:12349 +#: config/tc-mips.c:12235 msgid "Unrecognized register name" msgstr "" -#: config/tc-mips.c:12582 +#: config/tc-mips.c:12468 msgid "unsupported PC relative reference to different section" msgstr "" -#: config/tc-mips.c:12695 config/tc-xtensa.c:1624 config/tc-xtensa.c:1835 +#: config/tc-mips.c:12581 config/tc-xtensa.c:1618 config/tc-xtensa.c:1829 msgid "unsupported relocation" msgstr "" -#: config/tc-mips.c:12901 config/tc-sh.c:4302 +#: config/tc-mips.c:12789 config/tc-sh.c:4306 #, c-format msgid "Can not represent %s relocation in this object file format" msgstr "" -#: config/tc-mips.c:12987 +#: config/tc-mips.c:12875 msgid "relaxed out-of-range branch into a jump" msgstr "" -#: config/tc-mips.c:13501 +#: config/tc-mips.c:13389 msgid "missing .end at end of assembly" msgstr "" -#: config/tc-mips.c:13516 +#: config/tc-mips.c:13404 msgid "expected simple number" msgstr "" -#: config/tc-mips.c:13542 +#: config/tc-mips.c:13430 #, c-format msgid " *input_line_pointer == '%c' 0x%02x\n" msgstr "" -#: config/tc-mips.c:13544 +#: config/tc-mips.c:13432 msgid "invalid number" msgstr "" -#: config/tc-mips.c:13617 +#: config/tc-mips.c:13505 msgid ".end not in text section" msgstr "" -#: config/tc-mips.c:13621 +#: config/tc-mips.c:13509 msgid ".end directive without a preceding .ent directive." msgstr "" -#: config/tc-mips.c:13630 +#: config/tc-mips.c:13518 msgid ".end symbol does not match .ent symbol." msgstr "" -#: config/tc-mips.c:13637 +#: config/tc-mips.c:13525 msgid ".end directive missing or unknown symbol" msgstr "" -#: config/tc-mips.c:13713 +#: config/tc-mips.c:13601 msgid ".ent or .aent not in text section." msgstr "" -#: config/tc-mips.c:13716 +#: config/tc-mips.c:13604 msgid "missing .end" msgstr "" -#: config/tc-mips.c:13768 +#: config/tc-mips.c:13656 msgid "Bad .frame directive" msgstr "" -#: config/tc-mips.c:13800 +#: config/tc-mips.c:13688 msgid ".mask/.fmask outside of .ent" msgstr "" -#: config/tc-mips.c:13807 +#: config/tc-mips.c:13695 msgid "Bad .mask/.fmask directive" msgstr "" -#: config/tc-mips.c:14064 +#: config/tc-mips.c:13952 #, c-format msgid "" "MIPS options:\n" @@ -7523,7 +7450,7 @@ msgid "" "\t\t\timplicitly with the gp register [default 8]\n" msgstr "" -#: config/tc-mips.c:14071 +#: config/tc-mips.c:13959 #, c-format msgid "" "-mips1\t\t\tgenerate MIPS ISA I instructions\n" @@ -7538,7 +7465,7 @@ msgid "" "-march=CPU/-mtune=CPU\tgenerate code/schedule for CPU, where CPU is one of:\n" msgstr "" -#: config/tc-mips.c:14090 +#: config/tc-mips.c:13978 #, c-format msgid "" "-mCPU\t\t\tequivalent to -march=CPU -mtune=CPU. Deprecated.\n" @@ -7546,17 +7473,18 @@ msgid "" "\t\t\tFor -mCPU and -no-mCPU, CPU must be one of:\n" msgstr "" -#: config/tc-mips.c:14103 +#: config/tc-mips.c:13991 #, c-format msgid "" "-mips16\t\t\tgenerate mips16 instructions\n" "-no-mips16\t\tdo not generate mips16 instructions\n" msgstr "" -#: config/tc-mips.c:14106 +#: config/tc-mips.c:13994 #, c-format msgid "" "-mfix-vr4120\t\twork around certain VR4120 errata\n" +"-mfix-vr4130\t\twork around VR4130 mflo/mfhi errata\n" "-mgp32\t\t\tuse 32-bit GPRs, regardless of the chosen ISA\n" "-mfp32\t\t\tuse 32-bit FPRs, regardless of the chosen ISA\n" "-mno-shared\t\toptimize output for executables\n" @@ -7568,7 +7496,7 @@ msgid "" "--break, --no-trap\tbreak exception on div by 0 and mult overflow\n" msgstr "" -#: config/tc-mips.c:14118 +#: config/tc-mips.c:14007 #, c-format msgid "" "-KPIC, -call_shared\tgenerate SVR4 position independent code\n" @@ -7580,7 +7508,7 @@ msgid "" "-mabi=ABI\t\tcreate ABI conformant object file for:\n" msgstr "" -#: config/tc-mips.c:14137 +#: config/tc-mips.c:14026 #, c-format msgid "" "-32\t\t\tcreate o32 ABI object file (default)\n" @@ -7588,54 +7516,54 @@ msgid "" "-64\t\t\tcreate 64 ABI object file\n" msgstr "" -#: config/tc-mmix.c:713 +#: config/tc-mmix.c:694 #, c-format msgid " MMIX-specific command line options:\n" msgstr "" -#: config/tc-mmix.c:714 +#: config/tc-mmix.c:695 #, c-format msgid "" " -fixed-special-register-names\n" " Allow only the original special register names.\n" msgstr "" -#: config/tc-mmix.c:717 +#: config/tc-mmix.c:698 #, c-format msgid " -globalize-symbols Make all symbols global.\n" msgstr "" -#: config/tc-mmix.c:719 +#: config/tc-mmix.c:700 #, c-format msgid " -gnu-syntax Turn off mmixal syntax compatibility.\n" msgstr "" -#: config/tc-mmix.c:721 +#: config/tc-mmix.c:702 #, c-format msgid " -relax Create linker relaxable code.\n" msgstr "" -#: config/tc-mmix.c:723 +#: config/tc-mmix.c:704 #, c-format msgid "" " -no-predefined-syms Do not provide mmixal built-in constants.\n" " Implies -fixed-special-register-names.\n" msgstr "" -#: config/tc-mmix.c:726 +#: config/tc-mmix.c:707 #, c-format msgid "" " -no-expand Do not expand GETA, branches, PUSHJ or JUMP\n" " into multiple instructions.\n" msgstr "" -#: config/tc-mmix.c:729 +#: config/tc-mmix.c:710 #, c-format msgid "" " -no-merge-gregs Do not merge GREG definitions with nearby values.\n" msgstr "" -#: config/tc-mmix.c:731 +#: config/tc-mmix.c:712 #, c-format msgid "" " -linker-allocated-gregs If there's no suitable GREG definition for " @@ -7643,7 +7571,7 @@ msgid "" "resolve.\n" msgstr "" -#: config/tc-mmix.c:734 +#: config/tc-mmix.c:715 #, c-format msgid "" " -x Do not warn when an operand to GETA, a branch,\n" @@ -7652,185 +7580,185 @@ msgid "" " -linker-allocated-gregs." msgstr "" -#: config/tc-mmix.c:861 +#: config/tc-mmix.c:841 #, c-format msgid "unknown opcode: `%s'" msgstr "" -#: config/tc-mmix.c:983 config/tc-mmix.c:998 +#: config/tc-mmix.c:963 config/tc-mmix.c:978 msgid "specified location wasn't TETRA-aligned" msgstr "" -#: config/tc-mmix.c:985 config/tc-mmix.c:1000 config/tc-mmix.c:4186 -#: config/tc-mmix.c:4202 +#: config/tc-mmix.c:965 config/tc-mmix.c:980 config/tc-mmix.c:4124 +#: config/tc-mmix.c:4140 msgid "unaligned data at an absolute location is not supported" msgstr "" -#: config/tc-mmix.c:1110 +#: config/tc-mmix.c:1090 #, c-format msgid "invalid operand to opcode %s: `%s'" msgstr "" -#: config/tc-mmix.c:1132 config/tc-mmix.c:1159 config/tc-mmix.c:1192 -#: config/tc-mmix.c:1200 config/tc-mmix.c:1217 config/tc-mmix.c:1245 -#: config/tc-mmix.c:1266 config/tc-mmix.c:1291 config/tc-mmix.c:1339 -#: config/tc-mmix.c:1437 config/tc-mmix.c:1462 config/tc-mmix.c:1494 -#: config/tc-mmix.c:1526 config/tc-mmix.c:1556 config/tc-mmix.c:1609 -#: config/tc-mmix.c:1626 config/tc-mmix.c:1653 config/tc-mmix.c:1681 -#: config/tc-mmix.c:1708 config/tc-mmix.c:1734 config/tc-mmix.c:1750 -#: config/tc-mmix.c:1776 config/tc-mmix.c:1792 config/tc-mmix.c:1808 -#: config/tc-mmix.c:1871 config/tc-mmix.c:1887 +#: config/tc-mmix.c:1112 config/tc-mmix.c:1139 config/tc-mmix.c:1172 +#: config/tc-mmix.c:1180 config/tc-mmix.c:1197 config/tc-mmix.c:1225 +#: config/tc-mmix.c:1246 config/tc-mmix.c:1271 config/tc-mmix.c:1319 +#: config/tc-mmix.c:1417 config/tc-mmix.c:1442 config/tc-mmix.c:1474 +#: config/tc-mmix.c:1506 config/tc-mmix.c:1536 config/tc-mmix.c:1589 +#: config/tc-mmix.c:1606 config/tc-mmix.c:1633 config/tc-mmix.c:1661 +#: config/tc-mmix.c:1688 config/tc-mmix.c:1714 config/tc-mmix.c:1730 +#: config/tc-mmix.c:1756 config/tc-mmix.c:1772 config/tc-mmix.c:1788 +#: config/tc-mmix.c:1851 config/tc-mmix.c:1867 #, c-format msgid "invalid operands to opcode %s: `%s'" msgstr "" -#: config/tc-mmix.c:1864 +#: config/tc-mmix.c:1844 #, c-format msgid "unsupported operands to %s: `%s'" msgstr "" -#: config/tc-mmix.c:1992 +#: config/tc-mmix.c:1969 msgid "internal: mmix_prefix_name but empty prefix" msgstr "" -#: config/tc-mmix.c:2037 +#: config/tc-mmix.c:2013 #, c-format msgid "too many GREG registers allocated (max %d)" msgstr "" -#: config/tc-mmix.c:2097 +#: config/tc-mmix.c:2071 msgid "BSPEC already active. Nesting is not supported." msgstr "" -#: config/tc-mmix.c:2106 +#: config/tc-mmix.c:2080 msgid "invalid BSPEC expression" msgstr "" -#: config/tc-mmix.c:2122 +#: config/tc-mmix.c:2096 #, c-format msgid "can't create section %s" msgstr "" -#: config/tc-mmix.c:2127 +#: config/tc-mmix.c:2101 #, c-format msgid "can't set section flags for section %s" msgstr "" -#: config/tc-mmix.c:2149 +#: config/tc-mmix.c:2122 msgid "ESPEC without preceding BSPEC" msgstr "" -#: config/tc-mmix.c:2179 +#: config/tc-mmix.c:2151 msgid "missing local expression" msgstr "" -#: config/tc-mmix.c:2424 +#: config/tc-mmix.c:2389 msgid "operand out of range, instruction expanded" msgstr "" #. The BFD_RELOC_MMIX_LOCAL-specific message is supposed to be #. user-friendly, though a little bit non-substantial. -#: config/tc-mmix.c:2682 +#: config/tc-mmix.c:2640 msgid "directive LOCAL must be placed in code or data" msgstr "" -#: config/tc-mmix.c:2683 +#: config/tc-mmix.c:2641 msgid "internal confusion: relocation in a section without contents" msgstr "" -#: config/tc-mmix.c:2797 +#: config/tc-mmix.c:2755 msgid "internal: BFD_RELOC_MMIX_BASE_PLUS_OFFSET not resolved to section" msgstr "" -#: config/tc-mmix.c:2845 +#: config/tc-mmix.c:2803 msgid "no suitable GREG definition for operands" msgstr "" -#: config/tc-mmix.c:2904 +#: config/tc-mmix.c:2862 msgid "operands were not reducible at assembly-time" msgstr "" -#: config/tc-mmix.c:2931 +#: config/tc-mmix.c:2889 #, c-format msgid "cannot generate relocation type for symbol %s, code %s" msgstr "" -#: config/tc-mmix.c:2951 +#: config/tc-mmix.c:2909 #, c-format msgid "internal: unhandled label %s" msgstr "" -#: config/tc-mmix.c:3005 +#: config/tc-mmix.c:2939 msgid "[0-9]H labels may not appear alone on a line" msgstr "" -#: config/tc-mmix.c:3014 +#: config/tc-mmix.c:2948 msgid "[0-9]H labels do not mix with dot-pseudos" msgstr "" -#: config/tc-mmix.c:3078 +#: config/tc-mmix.c:3036 msgid "invalid characters in input" msgstr "" -#: config/tc-mmix.c:3182 +#: config/tc-mmix.c:3140 msgid "empty label field for IS" msgstr "" -#: config/tc-mmix.c:3515 +#: config/tc-mmix.c:3466 #, c-format msgid "internal: unexpected relax type %d:%d" msgstr "" -#: config/tc-mmix.c:3537 +#: config/tc-mmix.c:3488 msgid "BSPEC without ESPEC." msgstr "" -#: config/tc-mmix.c:3739 +#: config/tc-mmix.c:3688 msgid "GREG expression too complicated" msgstr "" -#: config/tc-mmix.c:3754 +#: config/tc-mmix.c:3703 msgid "internal: GREG expression not resolved to section" msgstr "" -#: config/tc-mmix.c:3805 +#: config/tc-mmix.c:3752 msgid "register section has contents\n" msgstr "" -#: config/tc-mmix.c:3939 +#: config/tc-mmix.c:3879 msgid "section change from within a BSPEC/ESPEC pair is not supported" msgstr "" -#: config/tc-mmix.c:3961 +#: config/tc-mmix.c:3900 msgid "directive LOC from within a BSPEC/ESPEC pair is not supported" msgstr "" -#: config/tc-mmix.c:3972 +#: config/tc-mmix.c:3911 msgid "invalid LOC expression" msgstr "" -#: config/tc-mmix.c:3997 config/tc-mmix.c:4023 +#: config/tc-mmix.c:3936 config/tc-mmix.c:3962 msgid "LOC expression stepping backwards is not supported" msgstr "" #. We will only get here in rare cases involving #NO_APP, #. where the unterminated string is not recognized by the #. preformatting pass. -#: config/tc-mmix.c:4107 config/tc-mmix.c:4268 +#: config/tc-mmix.c:4046 config/tc-mmix.c:4206 msgid "unterminated string" msgstr "" -#: config/tc-mmix.c:4124 +#: config/tc-mmix.c:4063 msgid "BYTE expression not a pure number" msgstr "" #. Note that mmixal does not allow negative numbers in #. BYTE sequences, so neither should we. -#: config/tc-mmix.c:4133 +#: config/tc-mmix.c:4072 msgid "BYTE expression not in the range 0..255" msgstr "" -#: config/tc-mmix.c:4184 config/tc-mmix.c:4200 +#: config/tc-mmix.c:4122 config/tc-mmix.c:4138 msgid "data item with alignment larger than location" msgstr "" @@ -7840,21 +7768,21 @@ msgstr "" msgid "`&' serial number operator is not supported" msgstr "" -#: config/tc-mn10200.c:319 +#: config/tc-mn10200.c:305 #, c-format msgid "" "MN10200 options:\n" "none yet\n" msgstr "" -#: config/tc-mn10200.c:793 config/tc-mn10300.c:1392 config/tc-ppc.c:2120 -#: config/tc-s390.c:1522 config/tc-v850.c:1693 +#: config/tc-mn10200.c:931 config/tc-mn10300.c:1392 config/tc-ppc.c:2130 +#: config/tc-s390.c:1522 config/tc-v850.c:1621 #, c-format msgid "Unrecognized opcode: `%s'" msgstr "" -#: config/tc-mn10200.c:1036 config/tc-mn10300.c:1965 config/tc-ppc.c:2599 -#: config/tc-s390.c:1437 config/tc-v850.c:2110 +#: config/tc-mn10200.c:1174 config/tc-mn10300.c:1965 config/tc-ppc.c:2609 +#: config/tc-s390.c:1437 config/tc-v850.c:2026 #, c-format msgid "junk at end of line: `%s'" msgstr "" @@ -7866,7 +7794,7 @@ msgid "" "none yet\n" msgstr "" -#: config/tc-mn10300.c:1361 config/tc-sh.c:776 read.c:3729 +#: config/tc-mn10300.c:1361 config/tc-sh.c:776 read.c:3746 #, c-format msgid "unsupported BFD relocation size %u" msgstr "" @@ -8082,31 +8010,31 @@ msgstr "" msgid "internal inconsistency problem in %s: %lx" msgstr "" -#: config/tc-ns32k.c:449 +#: config/tc-ns32k.c:441 msgid "Invalid syntax in PC-relative addressing mode" msgstr "" -#: config/tc-ns32k.c:473 +#: config/tc-ns32k.c:465 msgid "Invalid syntax in External addressing mode" msgstr "" -#: config/tc-ns32k.c:554 +#: config/tc-ns32k.c:546 msgid "Invalid syntax in Memory Relative addressing mode" msgstr "" -#: config/tc-ns32k.c:621 +#: config/tc-ns32k.c:613 msgid "Invalid scaled-indexed mode, use (b,w,d,q)" msgstr "" -#: config/tc-ns32k.c:626 +#: config/tc-ns32k.c:618 msgid "Syntax in scaled-indexed mode, use [Rn:m] where n=[0..7] m={b,w,d,q}" msgstr "" -#: config/tc-ns32k.c:631 +#: config/tc-ns32k.c:623 msgid "Scaled-indexed addressing mode combined with scaled-index" msgstr "" -#: config/tc-ns32k.c:642 +#: config/tc-ns32k.c:634 msgid "Invalid or illegal addressing mode combined with scaled-index" msgstr "" @@ -8118,35 +8046,35 @@ msgstr "" msgid "Bad suffix after ':' use {b|w|d} Defaulting to d" msgstr "" -#: config/tc-ns32k.c:817 +#: config/tc-ns32k.c:815 msgid "Very short instr to option, ie you can't do it on a NULLstr" msgstr "" -#: config/tc-ns32k.c:870 +#: config/tc-ns32k.c:865 msgid "No such entry in list. (cpu/mmu register)" msgstr "" -#: config/tc-ns32k.c:915 +#: config/tc-ns32k.c:922 msgid "Internal consistency error. check ns32k-opcode.h" msgstr "" -#: config/tc-ns32k.c:939 +#: config/tc-ns32k.c:946 msgid "Address of immediate operand" msgstr "" -#: config/tc-ns32k.c:940 +#: config/tc-ns32k.c:947 msgid "Invalid immediate write operand." msgstr "" -#: config/tc-ns32k.c:1070 +#: config/tc-ns32k.c:1077 msgid "Bad opcode-table-option, check in file ns32k-opcode.h" msgstr "" -#: config/tc-ns32k.c:1107 +#: config/tc-ns32k.c:1110 msgid "No such opcode" msgstr "" -#: config/tc-ns32k.c:1184 +#: config/tc-ns32k.c:1185 msgid "Bad suffix, defaulting to d" msgstr "" @@ -8155,99 +8083,99 @@ msgid "Too many operands passed to instr msgstr "" #. Check error in default. -#: config/tc-ns32k.c:1225 +#: config/tc-ns32k.c:1224 msgid "Wrong numbers of operands in default, check ns32k-opcodes.h" msgstr "" -#: config/tc-ns32k.c:1229 +#: config/tc-ns32k.c:1227 msgid "Wrong number of operands" msgstr "" -#: config/tc-ns32k.c:1355 -msgid "iif convert internal pcrel/binary" +#: config/tc-ns32k.c:1301 +#, c-format +msgid "Can not do %d byte pc-relative relocation for storage type %d" msgstr "" -#: config/tc-ns32k.c:1372 -msgid "Bignum too big for long" +#: config/tc-ns32k.c:1304 +#, c-format +msgid "Can not do %d byte relocation for storage type %d" msgstr "" -#: config/tc-ns32k.c:1451 -msgid "iif convert internal pcrel/pointer" +#: config/tc-ns32k.c:1405 +#, c-format +msgid "value of %ld out of byte displacement range." msgstr "" -#: config/tc-ns32k.c:1456 -msgid "Internal logic error in iif.iifP[n].type" +#: config/tc-ns32k.c:1415 +#, c-format +msgid "value of %ld out of word displacement range." msgstr "" -#. We cant relax this case. -#: config/tc-ns32k.c:1493 -msgid "Can't relax difference" +#: config/tc-ns32k.c:1430 +#, c-format +msgid "value of %ld out of double word displacement range." msgstr "" -#: config/tc-ns32k.c:1541 -msgid "Displacement to large for :d" +#: config/tc-ns32k.c:1451 +#, c-format +msgid "Internal logic error. line %d, file \"%s\"" msgstr "" -#: config/tc-ns32k.c:1554 -msgid "Internal logic error in iif.iifP[].type" +#: config/tc-ns32k.c:1499 +#, c-format +msgid "Internal logic error. line %d, file \"%s\"" msgstr "" -#: config/tc-ns32k.c:1614 -#, c-format -msgid "Can not do %d byte pc-relative relocation for storage type %d" +#: config/tc-ns32k.c:1600 +msgid "Bit field out of range" msgstr "" -#: config/tc-ns32k.c:1617 -#, c-format -msgid "Can not do %d byte relocation for storage type %d" +#: config/tc-ns32k.c:1700 +msgid "iif convert internal pcrel/binary" msgstr "" -#. Fatal. -#: config/tc-ns32k.c:1652 -#, c-format -msgid "Can't hash %s: %s" +#: config/tc-ns32k.c:1717 +msgid "Bignum too big for long" msgstr "" -#: config/tc-ns32k.c:1740 -#, c-format -msgid "value of %ld out of byte displacement range." +#: config/tc-ns32k.c:1794 +msgid "iif convert internal pcrel/pointer" msgstr "" -#: config/tc-ns32k.c:1749 -#, c-format -msgid "value of %ld out of word displacement range." +#: config/tc-ns32k.c:1799 +msgid "Internal logic error in iif.iifP[n].type" msgstr "" -#: config/tc-ns32k.c:1763 -#, c-format -msgid "value of %ld out of double word displacement range." +#. We cant relax this case. +#: config/tc-ns32k.c:1835 +msgid "Can't relax difference" msgstr "" -#: config/tc-ns32k.c:1783 -#, c-format -msgid "Internal logic error. line %d, file \"%s\"" +#: config/tc-ns32k.c:1876 +msgid "Displacement to large for :d" msgstr "" -#: config/tc-ns32k.c:1831 -#, c-format -msgid "Internal logic error. line %d, file \"%s\"" +#: config/tc-ns32k.c:1889 +msgid "Internal logic error in iif.iifP[].type" msgstr "" -#: config/tc-ns32k.c:1936 -msgid "Bit field out of range" +#. Fatal. +#: config/tc-ns32k.c:1921 +#, c-format +msgid "Can't hash %s: %s" msgstr "" -#: config/tc-ns32k.c:2180 +#: config/tc-ns32k.c:2199 #, c-format msgid "invalid architecture option -m%s, ignored" msgstr "" -#: config/tc-ns32k.c:2193 +#: config/tc-ns32k.c:2212 #, c-format msgid "invalid default displacement size \"%s\". Defaulting to %d." msgstr "" -#: config/tc-ns32k.c:2210 +#: config/tc-ns32k.c:2228 #, c-format msgid "" "NS32K options:\n" @@ -8255,70 +8183,70 @@ msgid "" "--disp-size-default=<1|2|4>\n" msgstr "" -#: config/tc-ns32k.c:2394 +#: config/tc-ns32k.c:2305 #, c-format msgid "Cannot find relocation type for symbol %s, code %d" msgstr "" -#: config/tc-or32.c:465 config/tc-or32.c:676 +#: config/tc-or32.c:450 config/tc-or32.c:656 #, c-format msgid "unknown opcode1: `%s'" msgstr "" -#: config/tc-or32.c:471 config/tc-or32.c:682 +#: config/tc-or32.c:456 config/tc-or32.c:662 #, c-format msgid "unknown opcode2 `%s'." msgstr "" -#: config/tc-or32.c:510 config/tc-or32.c:721 +#: config/tc-or32.c:493 config/tc-or32.c:701 #, c-format msgid "instruction not allowed: %s" msgstr "" -#: config/tc-or32.c:513 config/tc-or32.c:724 +#: config/tc-or32.c:496 config/tc-or32.c:704 #, c-format msgid "too many operands: %s" msgstr "" -#: config/tc-or32.c:599 config/tc-or32.c:811 +#: config/tc-or32.c:580 config/tc-or32.c:789 msgid "call/jmp target out of range (1)" msgstr "" -#: config/tc-or32.c:1004 config/tc-or32.c:1112 +#: config/tc-or32.c:973 config/tc-or32.c:1078 msgid "call/jmp target out of range (2)" msgstr "" -#: config/tc-or32.c:1402 +#: config/tc-or32.c:1326 msgid "register out of range" msgstr "" -#: config/tc-or32.c:1447 +#: config/tc-or32.c:1370 msgid "invalid register in & expression" msgstr "" -#: config/tc-pdp11.c:431 +#: config/tc-pdp11.c:490 msgid "Low order bits truncated in immediate float operand" msgstr "" -#: config/tc-pdp11.c:620 +#: config/tc-pdp11.c:679 #, c-format msgid "Unknown instruction '%s'" msgstr "" -#: config/tc-pj.c:83 config/tc-pj.c:91 +#: config/tc-pj.c:66 config/tc-pj.c:75 msgid "confusing relocation expressions" msgstr "" -#: config/tc-pj.c:182 +#: config/tc-pj.c:158 msgid "can't have relocation for ipush" msgstr "" -#: config/tc-pj.c:289 +#: config/tc-pj.c:261 #, c-format msgid "unknown opcode %s" msgstr "" -#: config/tc-pj.c:438 +#: config/tc-pj.c:404 #, c-format msgid "" "PJ options:\n" @@ -8326,8 +8254,8 @@ msgid "" "-big\t\t\tgenerate big endian code\n" msgstr "" -#: config/tc-pj.c:468 config/tc-sh.c:3978 config/tc-sh.c:3985 -#: config/tc-sh.c:3992 config/tc-sh.c:3999 +#: config/tc-pj.c:431 config/tc-sh.c:3982 config/tc-sh.c:3989 +#: config/tc-sh.c:3996 config/tc-sh.c:4003 msgid "pcrel too far" msgstr "" @@ -8339,17 +8267,17 @@ msgstr "" msgid "estimate size\n" msgstr "" -#: config/tc-ppc.c:980 +#: config/tc-ppc.c:986 #, c-format msgid "%s unsupported" msgstr "" -#: config/tc-ppc.c:1046 config/tc-s390.c:415 config/tc-s390.c:422 +#: config/tc-ppc.c:1052 config/tc-s390.c:415 config/tc-s390.c:422 #, c-format msgid "invalid switch -m%s" msgstr "" -#: config/tc-ppc.c:1083 +#: config/tc-ppc.c:1089 #, c-format msgid "" "PowerPC options:\n" @@ -8367,7 +8295,7 @@ msgid "" "\t\t\tgenerate code For PowerPC 7400/7410/7450/7455\n" msgstr "" -#: config/tc-ppc.c:1097 +#: config/tc-ppc.c:1103 #, c-format msgid "" "-mppc64, -m620\t\tgenerate code for PowerPC 620/625/630\n" @@ -8375,11 +8303,12 @@ msgid "" "-mbooke64\t\tgenerate code for 64-bit PowerPC BookE\n" "-mbooke, mbooke32\tgenerate code for 32-bit PowerPC BookE\n" "-mpower4\t\tgenerate code for Power4 architecture\n" +"-mpower5\t\tgenerate code for Power5 architecture\n" "-mcom\t\t\tgenerate code Power/PowerPC common instructions\n" "-many\t\t\tgenerate code for any architecture (PWR/PWRX/PPC)\n" msgstr "" -#: config/tc-ppc.c:1105 +#: config/tc-ppc.c:1112 #, c-format msgid "" "-maltivec\t\tgenerate code for AltiVec\n" @@ -8389,7 +8318,7 @@ msgid "" "-mno-regnames\t\tDo not allow symbolic names for registers\n" msgstr "" -#: config/tc-ppc.c:1112 +#: config/tc-ppc.c:1119 #, c-format msgid "" "-mrelocatable\t\tsupport for GCC's -mrelocatble option\n" @@ -8405,246 +8334,246 @@ msgid "" "-Qy, -Qn\t\tignored\n" msgstr "" -#: config/tc-ppc.c:1154 +#: config/tc-ppc.c:1161 #, c-format msgid "Unknown default cpu = %s, os = %s" msgstr "" -#: config/tc-ppc.c:1180 +#: config/tc-ppc.c:1187 msgid "Neither Power nor PowerPC opcodes were selected." msgstr "" -#: config/tc-ppc.c:1270 config/tc-s390.c:517 +#: config/tc-ppc.c:1280 config/tc-s390.c:517 #, c-format msgid "Internal assembler error for instruction %s" msgstr "" -#: config/tc-ppc.c:1294 +#: config/tc-ppc.c:1304 #, c-format msgid "Internal assembler error for macro %s" msgstr "" -#: config/tc-ppc.c:1625 +#: config/tc-ppc.c:1635 msgid "identifier+constant@got means identifier@got+constant" msgstr "" -#: config/tc-ppc.c:1692 +#: config/tc-ppc.c:1702 #, c-format msgid "%s relocations do not fit in %d bytes\n" msgstr "" -#: config/tc-ppc.c:1799 +#: config/tc-ppc.c:1809 #, c-format msgid "Length of .lcomm \"%s\" is already %ld. Not changed to %ld." msgstr "" -#: config/tc-ppc.c:1881 +#: config/tc-ppc.c:1891 msgid "Relocation cannot be done when using -mrelocatable" msgstr "" -#: config/tc-ppc.c:1930 +#: config/tc-ppc.c:1940 msgid "TOC section size exceeds 64k" msgstr "" -#: config/tc-ppc.c:2012 +#: config/tc-ppc.c:2022 #, c-format msgid "syntax error: invalid toc specifier `%s'" msgstr "" -#: config/tc-ppc.c:2026 +#: config/tc-ppc.c:2036 #, c-format msgid "syntax error: expected `]', found `%c'" msgstr "" -#: config/tc-ppc.c:2305 +#: config/tc-ppc.c:2315 msgid "[tocv] symbol is not a toc symbol" msgstr "" -#: config/tc-ppc.c:2316 +#: config/tc-ppc.c:2326 msgid "Unimplemented toc32 expression modifier" msgstr "" -#: config/tc-ppc.c:2321 +#: config/tc-ppc.c:2331 msgid "Unimplemented toc64 expression modifier" msgstr "" -#: config/tc-ppc.c:2325 +#: config/tc-ppc.c:2335 #, c-format msgid "Unexpected return value [%d] from parse_toc_entry!\n" msgstr "" -#: config/tc-ppc.c:2543 +#: config/tc-ppc.c:2553 msgid "unsupported relocation for DS offset field" msgstr "" -#: config/tc-ppc.c:2587 +#: config/tc-ppc.c:2597 #, c-format msgid "syntax error; found `%c' but expected `%c'" msgstr "" -#: config/tc-ppc.c:2630 config/tc-ppc.h:117 +#: config/tc-ppc.c:2640 config/tc-ppc.h:117 msgid "instruction address is not a multiple of 4" msgstr "" -#: config/tc-ppc.c:2741 +#: config/tc-ppc.c:2751 msgid "wrong number of operands" msgstr "" -#: config/tc-ppc.c:2797 +#: config/tc-ppc.c:2807 msgid "Bad .section directive: want a,e,w,x,M,S,G,T in string" msgstr "" -#: config/tc-ppc.c:2912 +#: config/tc-ppc.c:2922 msgid "missing size" msgstr "" -#: config/tc-ppc.c:2921 +#: config/tc-ppc.c:2931 msgid "negative size" msgstr "" -#: config/tc-ppc.c:2958 +#: config/tc-ppc.c:2968 msgid "missing real symbol name" msgstr "" -#: config/tc-ppc.c:2979 +#: config/tc-ppc.c:2989 msgid "attempt to redefine symbol" msgstr "" -#: config/tc-ppc.c:3226 +#: config/tc-ppc.c:3236 msgid "The XCOFF file format does not support arbitrary sections" msgstr "" -#: config/tc-ppc.c:3303 +#: config/tc-ppc.c:3313 msgid "missing rename string" msgstr "" -#: config/tc-ppc.c:3334 config/tc-ppc.c:3889 read.c:3035 +#: config/tc-ppc.c:3344 config/tc-ppc.c:3899 read.c:3042 msgid "missing value" msgstr "" -#: config/tc-ppc.c:3352 +#: config/tc-ppc.c:3362 msgid "illegal .stabx expression; zero assumed" msgstr "" -#: config/tc-ppc.c:3384 +#: config/tc-ppc.c:3394 msgid "missing class" msgstr "" -#: config/tc-ppc.c:3393 +#: config/tc-ppc.c:3403 msgid "missing type" msgstr "" -#: config/tc-ppc.c:3474 +#: config/tc-ppc.c:3484 msgid "missing symbol name" msgstr "" -#: config/tc-ppc.c:3668 +#: config/tc-ppc.c:3678 msgid "nested .bs blocks" msgstr "" -#: config/tc-ppc.c:3701 +#: config/tc-ppc.c:3711 msgid ".es without preceding .bs" msgstr "" -#: config/tc-ppc.c:3881 +#: config/tc-ppc.c:3891 msgid "non-constant byte count" msgstr "" -#: config/tc-ppc.c:3929 +#: config/tc-ppc.c:3939 msgid ".tc not in .toc section" msgstr "" -#: config/tc-ppc.c:3948 +#: config/tc-ppc.c:3958 msgid ".tc with no label" msgstr "" -#: config/tc-ppc.c:4040 +#: config/tc-ppc.c:4050 msgid ".machine stack overflow" msgstr "" -#: config/tc-ppc.c:4047 +#: config/tc-ppc.c:4057 msgid ".machine stack underflow" msgstr "" -#: config/tc-ppc.c:4054 +#: config/tc-ppc.c:4064 #, c-format msgid "invalid machine `%s'" msgstr "" -#: config/tc-ppc.c:4108 +#: config/tc-ppc.c:4118 msgid "No previous section to return to. Directive ignored." msgstr "" #. Section Contents #. unknown -#: config/tc-ppc.c:4525 +#: config/tc-ppc.c:4535 msgid "Unsupported section attribute -- 'a'" msgstr "" -#: config/tc-ppc.c:4714 +#: config/tc-ppc.c:4724 msgid "bad symbol suffix" msgstr "" -#: config/tc-ppc.c:4807 +#: config/tc-ppc.c:4817 msgid "Unrecognized symbol suffix" msgstr "" -#: config/tc-ppc.c:4893 +#: config/tc-ppc.c:4903 msgid "two .function pseudo-ops with no intervening .ef" msgstr "" -#: config/tc-ppc.c:4906 +#: config/tc-ppc.c:4916 msgid ".ef with no preceding .function" msgstr "" -#: config/tc-ppc.c:5034 +#: config/tc-ppc.c:5044 #, c-format msgid "warning: symbol %s has no csect" msgstr "" -#: config/tc-ppc.c:5338 +#: config/tc-ppc.c:5348 msgid "symbol in .toc does not match any .tc" msgstr "" -#: config/tc-ppc.c:5666 config/tc-s390.c:2057 config/tc-v850.c:2408 -#: config/tc-xstormy16.c:555 +#: config/tc-ppc.c:5677 config/tc-s390.c:2057 config/tc-v850.c:2314 +#: config/tc-xstormy16.c:538 msgid "unresolved expression that must be resolved" msgstr "" -#: config/tc-ppc.c:5669 +#: config/tc-ppc.c:5680 #, c-format msgid "unsupported relocation against %s" msgstr "" -#: config/tc-ppc.c:5744 +#: config/tc-ppc.c:5753 #, c-format msgid "cannot emit PC relative %s relocation against %s" msgstr "" -#: config/tc-ppc.c:5749 +#: config/tc-ppc.c:5758 #, c-format msgid "cannot emit PC relative %s relocation" msgstr "" -#: config/tc-ppc.c:5905 +#: config/tc-ppc.c:5940 #, c-format msgid "Unable to handle reference to symbol %s" msgstr "" -#: config/tc-ppc.c:5908 +#: config/tc-ppc.c:5943 msgid "Unable to resolve expression" msgstr "" -#: config/tc-ppc.c:5935 +#: config/tc-ppc.c:5970 msgid "must branch to an address a multiple of 4" msgstr "" -#: config/tc-ppc.c:5939 +#: config/tc-ppc.c:5974 #, c-format msgid "@local or @plt branch destination is too far away, %ld bytes" msgstr "" -#: config/tc-ppc.c:5970 +#: config/tc-ppc.c:6005 #, c-format msgid "Gas failure, reloc value %d\n" msgstr "" @@ -8689,7 +8618,7 @@ msgstr "" msgid "Big number is too big" msgstr "" -#: config/tc-s390.c:1126 config/tc-s390.c:1707 config/tc-xtensa.c:1632 +#: config/tc-s390.c:1126 config/tc-s390.c:1707 config/tc-xtensa.c:1626 #, c-format msgid "%s relocations do not fit in %d bytes" msgstr "" @@ -9183,12 +9112,12 @@ msgstr "" msgid "overflow in branch to %s; converted into longer instruction sequence" msgstr "" -#: config/tc-sh.c:3633 config/tc-sh.c:3680 config/tc-sparc.c:4237 -#: config/tc-sparc.c:4262 +#: config/tc-sh.c:3633 config/tc-sh.c:3680 config/tc-sparc.c:4239 +#: config/tc-sparc.c:4264 msgid "misaligned data" msgstr "" -#: config/tc-sh.c:4099 +#: config/tc-sh.c:4103 msgid "misaligned offset" msgstr "" @@ -9319,7 +9248,7 @@ msgstr "" msgid "setx: illegal temporary register g0" msgstr "" -#: config/tc-sparc.c:1318 +#: config/tc-sparc.c:1319 msgid "FP branch in delay slot" msgstr "" @@ -9331,260 +9260,260 @@ msgstr "" msgid "failed special case insn sanity check" msgstr "" -#: config/tc-sparc.c:1462 +#: config/tc-sparc.c:1464 msgid ": invalid membar mask name" msgstr "" -#: config/tc-sparc.c:1478 +#: config/tc-sparc.c:1480 msgid ": invalid membar mask expression" msgstr "" -#: config/tc-sparc.c:1483 +#: config/tc-sparc.c:1485 msgid ": invalid membar mask number" msgstr "" -#: config/tc-sparc.c:1498 +#: config/tc-sparc.c:1500 msgid ": invalid siam mode expression" msgstr "" -#: config/tc-sparc.c:1503 +#: config/tc-sparc.c:1505 msgid ": invalid siam mode number" msgstr "" -#: config/tc-sparc.c:1519 +#: config/tc-sparc.c:1521 msgid ": invalid prefetch function name" msgstr "" -#: config/tc-sparc.c:1527 +#: config/tc-sparc.c:1529 msgid ": invalid prefetch function expression" msgstr "" -#: config/tc-sparc.c:1532 +#: config/tc-sparc.c:1534 msgid ": invalid prefetch function number" msgstr "" -#: config/tc-sparc.c:1560 config/tc-sparc.c:1572 +#: config/tc-sparc.c:1562 config/tc-sparc.c:1574 msgid ": unrecognizable privileged register" msgstr "" -#: config/tc-sparc.c:1596 config/tc-sparc.c:1621 +#: config/tc-sparc.c:1598 config/tc-sparc.c:1623 msgid ": unrecognizable v9a or v9b ancillary state register" msgstr "" -#: config/tc-sparc.c:1601 +#: config/tc-sparc.c:1603 msgid ": rd on write only ancillary state register" msgstr "" #. %sys_tick and %sys_tick_cmpr are v9bnotv9a -#: config/tc-sparc.c:1609 +#: config/tc-sparc.c:1611 msgid ": unrecognizable v9a ancillary state register" msgstr "" -#: config/tc-sparc.c:1645 +#: config/tc-sparc.c:1647 msgid ": asr number must be between 16 and 31" msgstr "" -#: config/tc-sparc.c:1653 +#: config/tc-sparc.c:1655 msgid ": asr number must be between 0 and 31" msgstr "" -#: config/tc-sparc.c:1663 +#: config/tc-sparc.c:1665 #, c-format msgid ": expecting %asrN" msgstr "" -#: config/tc-sparc.c:1845 config/tc-sparc.c:1883 config/tc-sparc.c:2290 -#: config/tc-sparc.c:2326 +#: config/tc-sparc.c:1847 config/tc-sparc.c:1885 config/tc-sparc.c:2292 +#: config/tc-sparc.c:2328 #, c-format msgid "Illegal operands: %%%s requires arguments in ()" msgstr "" -#: config/tc-sparc.c:1851 +#: config/tc-sparc.c:1853 #, c-format msgid "" "Illegal operands: %%%s cannot be used together with other relocs in the insn " "()" msgstr "" -#: config/tc-sparc.c:1862 +#: config/tc-sparc.c:1864 #, c-format msgid "Illegal operands: %%%s can be only used with call __tls_get_addr" msgstr "" -#: config/tc-sparc.c:2069 +#: config/tc-sparc.c:2071 msgid "detected global register use not covered by .register pseudo-op" msgstr "" -#: config/tc-sparc.c:2140 +#: config/tc-sparc.c:2142 msgid ": There are only 64 f registers; [0-63]" msgstr "" -#: config/tc-sparc.c:2142 config/tc-sparc.c:2160 +#: config/tc-sparc.c:2144 config/tc-sparc.c:2162 msgid ": There are only 32 f registers; [0-31]" msgstr "" -#: config/tc-sparc.c:2152 +#: config/tc-sparc.c:2154 msgid ": There are only 32 single precision f registers; [0-31]" msgstr "" -#: config/tc-sparc.c:2338 +#: config/tc-sparc.c:2340 #, c-format msgid "" "Illegal operands: Can't do arithmetics other than + and - involving %%%s()" msgstr "" -#: config/tc-sparc.c:2448 +#: config/tc-sparc.c:2450 #, c-format msgid "Illegal operands: Can't add non-constant expression to %%%s()" msgstr "" -#: config/tc-sparc.c:2458 +#: config/tc-sparc.c:2460 #, c-format msgid "" "Illegal operands: Can't do arithmetics involving %%%s() of a relocatable " "symbol" msgstr "" -#: config/tc-sparc.c:2476 +#: config/tc-sparc.c:2478 msgid ": PC-relative operand can't be a constant" msgstr "" -#: config/tc-sparc.c:2483 +#: config/tc-sparc.c:2485 msgid ": TLS operand can't be a constant" msgstr "" -#: config/tc-sparc.c:2516 +#: config/tc-sparc.c:2518 msgid ": invalid ASI name" msgstr "" -#: config/tc-sparc.c:2524 +#: config/tc-sparc.c:2526 msgid ": invalid ASI expression" msgstr "" -#: config/tc-sparc.c:2529 +#: config/tc-sparc.c:2531 msgid ": invalid ASI number" msgstr "" -#: config/tc-sparc.c:2626 +#: config/tc-sparc.c:2628 msgid "OPF immediate operand out of range (0-0x1ff)" msgstr "" -#: config/tc-sparc.c:2631 +#: config/tc-sparc.c:2633 msgid "non-immediate OPF operand, ignored" msgstr "" -#: config/tc-sparc.c:2650 +#: config/tc-sparc.c:2652 msgid ": invalid cpreg name" msgstr "" -#: config/tc-sparc.c:2679 +#: config/tc-sparc.c:2681 #, c-format msgid "Illegal operands%s" msgstr "" -#: config/tc-sparc.c:2713 +#: config/tc-sparc.c:2715 #, c-format msgid "architecture bumped from \"%s\" to \"%s\" on \"%s\"" msgstr "" -#: config/tc-sparc.c:2749 +#: config/tc-sparc.c:2751 #, c-format msgid "Architecture mismatch on \"%s\"." msgstr "" -#: config/tc-sparc.c:2750 +#: config/tc-sparc.c:2752 #, c-format msgid " (Requires %s; requested architecture is %s.)" msgstr "" -#: config/tc-sparc.c:3370 +#: config/tc-sparc.c:3372 #, c-format msgid "bad or unhandled relocation type: 0x%02x" msgstr "" -#: config/tc-sparc.c:3680 +#: config/tc-sparc.c:3682 msgid "Expected comma after name" msgstr "" -#: config/tc-sparc.c:3689 +#: config/tc-sparc.c:3691 #, c-format msgid "BSS length (%d.) <0! Ignored." msgstr "" -#: config/tc-sparc.c:3701 +#: config/tc-sparc.c:3703 msgid "bad .reserve segment -- expected BSS segment" msgstr "" -#: config/tc-sparc.c:3718 +#: config/tc-sparc.c:3720 msgid "missing alignment" msgstr "" -#: config/tc-sparc.c:3729 +#: config/tc-sparc.c:3731 #, c-format msgid "alignment too large; assuming %d" msgstr "" -#: config/tc-sparc.c:3735 config/tc-sparc.c:3886 +#: config/tc-sparc.c:3737 config/tc-sparc.c:3888 msgid "negative alignment" msgstr "" -#: config/tc-sparc.c:3745 config/tc-sparc.c:3909 read.c:1284 read.c:2113 +#: config/tc-sparc.c:3747 config/tc-sparc.c:3911 read.c:1311 read.c:2141 msgid "alignment not a power of 2" msgstr "" -#: config/tc-sparc.c:3823 config/tc-v850.c:233 +#: config/tc-sparc.c:3825 config/tc-v850.c:223 msgid "Expected comma after symbol-name" msgstr "" -#: config/tc-sparc.c:3833 +#: config/tc-sparc.c:3835 #, c-format msgid ".COMMon length (%lu) out of range ignored" msgstr "" -#: config/tc-sparc.c:3866 +#: config/tc-sparc.c:3868 msgid "Expected comma after common length" msgstr "" -#: config/tc-sparc.c:3880 +#: config/tc-sparc.c:3882 #, c-format msgid "alignment too large; assuming %ld" msgstr "" -#: config/tc-sparc.c:4107 config/tc-sparc.c:4117 +#: config/tc-sparc.c:4109 config/tc-sparc.c:4119 #, c-format msgid "register syntax is .register %%g[2367],{#scratch|symbolname|#ignore}" msgstr "" -#: config/tc-sparc.c:4135 +#: config/tc-sparc.c:4137 msgid "redefinition of global register" msgstr "" -#: config/tc-sparc.c:4146 +#: config/tc-sparc.c:4148 #, c-format msgid "Register symbol %s already defined." msgstr "" -#: config/tc-sparc.c:4355 +#: config/tc-sparc.c:4357 #, c-format msgid "Illegal operands: %%r_plt in %d-byte data field" msgstr "" -#: config/tc-sparc.c:4365 +#: config/tc-sparc.c:4367 #, c-format msgid "Illegal operands: %%r_tls_dtpoff in %d-byte data field" msgstr "" -#: config/tc-sparc.c:4402 +#: config/tc-sparc.c:4404 #, c-format msgid "Illegal operands: Only %%r_%s%d allowed in %d-byte data fields" msgstr "" -#: config/tc-sparc.c:4410 config/tc-sparc.c:4441 config/tc-sparc.c:4450 +#: config/tc-sparc.c:4412 config/tc-sparc.c:4443 config/tc-sparc.c:4452 #, c-format msgid "Illegal operands: %%r_%s%d requires arguments in ()" msgstr "" -#: config/tc-sparc.c:4459 +#: config/tc-sparc.c:4461 #, c-format msgid "Illegal operands: garbage after %%r_%s%d()" msgstr "" @@ -9597,33 +9526,33 @@ msgstr "" msgid "estimate_size_before_relax called" msgstr "" -#: config/tc-tahoe.c:403 +#: config/tc-tahoe.c:402 msgid "The -a option doesn't exist. (Despite what the man page says!" msgstr "" -#: config/tc-tahoe.c:407 config/tc-vax.c:3295 +#: config/tc-tahoe.c:406 config/tc-vax.c:3352 #, c-format msgid "Displacement length %s ignored!" msgstr "" -#: config/tc-tahoe.c:411 config/tc-vax.c:3287 +#: config/tc-tahoe.c:410 config/tc-vax.c:3344 msgid "SYMBOL TABLE not implemented" msgstr "" -#: config/tc-tahoe.c:415 config/tc-vax.c:3291 +#: config/tc-tahoe.c:414 config/tc-vax.c:3348 msgid "TOKEN TRACE not implemented" msgstr "" -#: config/tc-tahoe.c:419 config/tc-vax.c:3299 +#: config/tc-tahoe.c:418 config/tc-vax.c:3356 #, c-format msgid "I don't need or use temp. file \"%s\"." msgstr "" -#: config/tc-tahoe.c:423 config/tc-vax.c:3303 +#: config/tc-tahoe.c:422 config/tc-vax.c:3360 msgid "I don't use an interpass file! -V ignored" msgstr "" -#: config/tc-tahoe.c:437 +#: config/tc-tahoe.c:435 #, c-format msgid "" "Tahoe options:\n" @@ -9636,186 +9565,186 @@ msgid "" "-V\t\t\tignored\n" msgstr "" -#: config/tc-tahoe.c:1066 +#: config/tc-tahoe.c:998 msgid "Casting a branch displacement is bad form, and is ignored." msgstr "" -#: config/tc-tahoe.c:1122 +#: config/tc-tahoe.c:1051 msgid "Couldn't parse the [index] in this operand." msgstr "" -#: config/tc-tahoe.c:1128 +#: config/tc-tahoe.c:1057 msgid "Couldn't find the opening '[' for the index of this operand." msgstr "" -#: config/tc-tahoe.c:1168 +#: config/tc-tahoe.c:1097 msgid "Couldn't find the opening '(' for the deref of this operand." msgstr "" -#: config/tc-tahoe.c:1178 +#: config/tc-tahoe.c:1108 msgid "Operand can't be both pre-inc and post-dec." msgstr "" -#: config/tc-tahoe.c:1208 +#: config/tc-tahoe.c:1134 msgid "I parsed 2 registers in this operand." msgstr "" -#: config/tc-tahoe.c:1258 +#: config/tc-tahoe.c:1179 msgid "Can't relocate expression error." msgstr "" #. This is an error. Tahoe doesn't allow any expressions #. bigger that a 32 bit long word. Any bigger has to be referenced #. by address. -#: config/tc-tahoe.c:1265 +#: config/tc-tahoe.c:1186 msgid "Expression is too large for a 32 bits." msgstr "" -#: config/tc-tahoe.c:1270 +#: config/tc-tahoe.c:1191 msgid "Junk at end of expression." msgstr "" -#: config/tc-tahoe.c:1309 +#: config/tc-tahoe.c:1230 msgid "Syntax error in direct register mode." msgstr "" -#: config/tc-tahoe.c:1311 +#: config/tc-tahoe.c:1232 msgid "You can't index a register in direct register mode." msgstr "" -#: config/tc-tahoe.c:1314 +#: config/tc-tahoe.c:1235 msgid "SP can't be the source operand with direct register addressing." msgstr "" -#: config/tc-tahoe.c:1316 +#: config/tc-tahoe.c:1237 msgid "Can't take the address of a register." msgstr "" -#: config/tc-tahoe.c:1318 +#: config/tc-tahoe.c:1239 msgid "Direct Register can't be used in a branch." msgstr "" -#: config/tc-tahoe.c:1320 +#: config/tc-tahoe.c:1241 msgid "For quad access, the register must be even and < 14." msgstr "" -#: config/tc-tahoe.c:1322 +#: config/tc-tahoe.c:1243 msgid "You can't cast a direct register." msgstr "" -#: config/tc-tahoe.c:1328 +#: config/tc-tahoe.c:1249 msgid "Using reg 14 for quadwords can tromp the FP register." msgstr "" -#: config/tc-tahoe.c:1340 +#: config/tc-tahoe.c:1261 msgid "Syntax error in auto-dec mode." msgstr "" -#: config/tc-tahoe.c:1342 +#: config/tc-tahoe.c:1263 msgid "You can't have an index auto dec mode." msgstr "" -#: config/tc-tahoe.c:1344 +#: config/tc-tahoe.c:1265 msgid "Auto dec mode cant be used for reading." msgstr "" -#: config/tc-tahoe.c:1346 +#: config/tc-tahoe.c:1267 msgid "Auto dec only works of the SP register." msgstr "" -#: config/tc-tahoe.c:1348 +#: config/tc-tahoe.c:1269 msgid "Auto dec can't be used in a branch." msgstr "" -#: config/tc-tahoe.c:1350 +#: config/tc-tahoe.c:1271 msgid "Auto dec won't work with quadwords." msgstr "" -#: config/tc-tahoe.c:1357 +#: config/tc-tahoe.c:1278 msgid "Syntax error in one of the auto-inc modes." msgstr "" -#: config/tc-tahoe.c:1363 +#: config/tc-tahoe.c:1284 msgid "Auto inc deferred only works of the SP register." msgstr "" -#: config/tc-tahoe.c:1365 +#: config/tc-tahoe.c:1286 msgid "You can't have an index auto inc deferred mode." msgstr "" -#: config/tc-tahoe.c:1367 config/tc-tahoe.c:1378 +#: config/tc-tahoe.c:1288 config/tc-tahoe.c:1299 msgid "Auto inc can't be used in a branch." msgstr "" -#: config/tc-tahoe.c:1374 +#: config/tc-tahoe.c:1295 msgid "You can't write to an auto inc register." msgstr "" -#: config/tc-tahoe.c:1376 +#: config/tc-tahoe.c:1297 msgid "Auto inc only works of the SP register." msgstr "" -#: config/tc-tahoe.c:1380 +#: config/tc-tahoe.c:1301 msgid "Auto inc won't work with quadwords." msgstr "" -#: config/tc-tahoe.c:1382 +#: config/tc-tahoe.c:1303 msgid "You can't have an index in auto inc mode." msgstr "" -#: config/tc-tahoe.c:1390 +#: config/tc-tahoe.c:1311 msgid "You can't index the sp register." msgstr "" -#: config/tc-tahoe.c:1396 +#: config/tc-tahoe.c:1317 msgid "Syntax error in register displaced mode." msgstr "" -#: config/tc-tahoe.c:1415 +#: config/tc-tahoe.c:1331 msgid "An offest is needed for this operand." msgstr "" -#: config/tc-tahoe.c:1427 +#: config/tc-tahoe.c:1343 msgid "You can't index a register in immediate mode." msgstr "" -#: config/tc-tahoe.c:1429 +#: config/tc-tahoe.c:1345 msgid "Immediate access can't be used as an address." msgstr "" -#: config/tc-tahoe.c:1540 +#: config/tc-tahoe.c:1442 #, c-format msgid "Compiler bug: ODD number of bytes in arg structure %s." msgstr "" -#: config/tc-tahoe.c:1567 config/tc-vax.c:1968 +#: config/tc-tahoe.c:1470 config/tc-vax.c:2025 msgid "Not enough operands" msgstr "" -#: config/tc-tahoe.c:1577 config/tc-vax.c:1975 +#: config/tc-tahoe.c:1482 config/tc-vax.c:2032 msgid "Too many operands" msgstr "" -#: config/tc-tahoe.c:1628 config/tc-vax.c:408 +#: config/tc-tahoe.c:1518 config/tc-vax.c:466 #, c-format msgid "Ignoring statement due to \"%s\"" msgstr "" -#: config/tc-tahoe.c:1723 +#: config/tc-tahoe.c:1610 #, c-format msgid "Compliler bug: Got a case (%d) I wasn't expecting." msgstr "" -#: config/tc-tahoe.c:1817 +#: config/tc-tahoe.c:1702 msgid "Real branch displacements must be expressions." msgstr "" -#: config/tc-tahoe.c:1820 +#: config/tc-tahoe.c:1705 #, c-format msgid "Complier error: I got an unknown synthetic branch :%c" msgstr "" -#: config/tc-tahoe.c:1961 +#: config/tc-tahoe.c:1842 #, c-format msgid "Barf, bad mode %x\n" msgstr "" @@ -10021,263 +9950,263 @@ msgstr "" msgid "Can't redirect stderr to the file '%s'" msgstr "" -#: config/tc-tic54x.c:2828 +#: config/tc-tic54x.c:2809 #, c-format msgid "Undefined substitution symbol '%s'" msgstr "" -#: config/tc-tic54x.c:3485 +#: config/tc-tic54x.c:3466 msgid "Badly formed address expression" msgstr "" -#: config/tc-tic54x.c:3749 +#: config/tc-tic54x.c:3730 #, c-format msgid "Invalid dmad syntax '%s'" msgstr "" -#: config/tc-tic54x.c:3815 +#: config/tc-tic54x.c:3796 #, c-format msgid "" "Use the .mmregs directive to use memory-mapped register names such as '%s'" msgstr "" -#: config/tc-tic54x.c:3868 +#: config/tc-tic54x.c:3849 msgid "Address mode *+ARx is write-only. Results of reading are undefined." msgstr "" -#: config/tc-tic54x.c:3888 +#: config/tc-tic54x.c:3869 #, c-format msgid "Unrecognized indirect address format \"%s\"" msgstr "" -#: config/tc-tic54x.c:3927 +#: config/tc-tic54x.c:3908 #, c-format msgid "Operand '%s' out of range (%d <= x <= %d)" msgstr "" -#: config/tc-tic54x.c:3947 +#: config/tc-tic54x.c:3928 msgid "Error in relocation handling" msgstr "" -#: config/tc-tic54x.c:3968 config/tc-tic54x.c:4032 config/tc-tic54x.c:4064 +#: config/tc-tic54x.c:3949 config/tc-tic54x.c:4013 config/tc-tic54x.c:4045 #, c-format msgid "Unrecognized condition code \"%s\"" msgstr "" -#: config/tc-tic54x.c:3985 +#: config/tc-tic54x.c:3966 #, c-format msgid "Condition \"%s\" does not match preceding group" msgstr "" -#: config/tc-tic54x.c:3993 +#: config/tc-tic54x.c:3974 #, c-format msgid "" "Condition \"%s\" uses a different accumulator from a preceding condition" msgstr "" -#: config/tc-tic54x.c:4000 +#: config/tc-tic54x.c:3981 msgid "Only one comparison conditional allowed" msgstr "" -#: config/tc-tic54x.c:4005 +#: config/tc-tic54x.c:3986 msgid "Only one overflow conditional allowed" msgstr "" -#: config/tc-tic54x.c:4013 +#: config/tc-tic54x.c:3994 #, c-format msgid "Duplicate %s conditional" msgstr "" -#: config/tc-tic54x.c:4048 +#: config/tc-tic54x.c:4029 msgid "Invalid auxiliary register (use AR0-AR7)" msgstr "" -#: config/tc-tic54x.c:4084 +#: config/tc-tic54x.c:4065 msgid "lk addressing modes are invalid for memory-mapped register addressing" msgstr "" -#: config/tc-tic54x.c:4092 +#: config/tc-tic54x.c:4073 msgid "" "Address mode *+ARx is not allowed in memory-mapped register addressing. " "Resulting behavior is undefined." msgstr "" -#: config/tc-tic54x.c:4118 +#: config/tc-tic54x.c:4099 msgid "" "Destination accumulator for each part of this parallel instruction must be " "different" msgstr "" -#: config/tc-tic54x.c:4167 +#: config/tc-tic54x.c:4148 #, c-format msgid "Memory mapped register \"%s\" out of range" msgstr "" -#: config/tc-tic54x.c:4206 +#: config/tc-tic54x.c:4187 msgid "Invalid operand (use 1, 2, or 3)" msgstr "" -#: config/tc-tic54x.c:4231 +#: config/tc-tic54x.c:4212 msgid "A status register or status bit name is required" msgstr "" -#: config/tc-tic54x.c:4241 +#: config/tc-tic54x.c:4222 #, c-format msgid "Unrecognized status bit \"%s\"" msgstr "" -#: config/tc-tic54x.c:4264 +#: config/tc-tic54x.c:4245 #, c-format msgid "Invalid status register \"%s\"" msgstr "" -#: config/tc-tic54x.c:4276 +#: config/tc-tic54x.c:4257 #, c-format msgid "Operand \"%s\" out of range (use 1 or 2)" msgstr "" -#: config/tc-tic54x.c:4484 +#: config/tc-tic54x.c:4465 #, c-format msgid "Unrecognized instruction \"%s\"" msgstr "" -#: config/tc-tic54x.c:4513 +#: config/tc-tic54x.c:4494 #, c-format msgid "Unrecognized operand list '%s' for instruction '%s'" msgstr "" -#: config/tc-tic54x.c:4545 +#: config/tc-tic54x.c:4526 #, c-format msgid "Unrecognized parallel instruction \"%s\"" msgstr "" -#: config/tc-tic54x.c:4596 +#: config/tc-tic54x.c:4577 #, c-format msgid "Invalid operand (s) for parallel instruction \"%s\"" msgstr "" -#: config/tc-tic54x.c:4599 +#: config/tc-tic54x.c:4580 #, c-format msgid "Unrecognized parallel instruction combination \"%s || %s\"" msgstr "" -#: config/tc-tic54x.c:4836 +#: config/tc-tic54x.c:4817 #, c-format msgid "%s symbol recursion stopped at second appearance of '%s'" msgstr "" -#: config/tc-tic54x.c:4876 +#: config/tc-tic54x.c:4857 msgid "Unrecognized substitution symbol function" msgstr "" -#: config/tc-tic54x.c:4881 +#: config/tc-tic54x.c:4862 msgid "Missing '(' after substitution symbol function" msgstr "" -#: config/tc-tic54x.c:4895 +#: config/tc-tic54x.c:4876 msgid "Expecting second argument" msgstr "" -#: config/tc-tic54x.c:4908 config/tc-tic54x.c:4958 +#: config/tc-tic54x.c:4889 config/tc-tic54x.c:4939 msgid "Extra junk in function call, expecting ')'" msgstr "" -#: config/tc-tic54x.c:4934 +#: config/tc-tic54x.c:4915 msgid "Function expects two arguments" msgstr "" -#: config/tc-tic54x.c:4947 +#: config/tc-tic54x.c:4928 msgid "Expecting character constant argument" msgstr "" -#: config/tc-tic54x.c:4953 +#: config/tc-tic54x.c:4934 msgid "Both arguments must be substitution symbols" msgstr "" -#: config/tc-tic54x.c:5006 +#: config/tc-tic54x.c:4987 #, c-format msgid "Invalid subscript (use 1 to %d)" msgstr "" -#: config/tc-tic54x.c:5016 +#: config/tc-tic54x.c:4997 #, c-format msgid "Invalid length (use 0 to %d" msgstr "" -#: config/tc-tic54x.c:5026 +#: config/tc-tic54x.c:5007 msgid "Missing ')' in subscripted substitution symbol expression" msgstr "" -#: config/tc-tic54x.c:5046 +#: config/tc-tic54x.c:5027 msgid "Missing forced substitution terminator ':'" msgstr "" -#: config/tc-tic54x.c:5201 +#: config/tc-tic54x.c:5182 #, c-format msgid "" "Instruction does not fit in available delay slots (%d-word insn, %d slots " "left)" msgstr "" -#: config/tc-tic54x.c:5242 +#: config/tc-tic54x.c:5223 #, c-format msgid "Unrecognized parallel instruction '%s'" msgstr "" -#: config/tc-tic54x.c:5254 +#: config/tc-tic54x.c:5235 #, c-format msgid "Instruction '%s' requires an LP cpu version" msgstr "" -#: config/tc-tic54x.c:5261 +#: config/tc-tic54x.c:5242 #, c-format msgid "Instruction '%s' requires far mode addressing" msgstr "" -#: config/tc-tic54x.c:5273 +#: config/tc-tic54x.c:5254 #, c-format msgid "" "Instruction does not fit in available delay slots (%d-word insn, %d slots " "left). Resulting behavior is undefined." msgstr "" -#: config/tc-tic54x.c:5283 +#: config/tc-tic54x.c:5264 msgid "" "Instructions which cause PC discontinuity are not allowed in a delay slot. " "Resulting behavior is undefined." msgstr "" -#: config/tc-tic54x.c:5294 +#: config/tc-tic54x.c:5275 #, c-format msgid "'%s' is not repeatable. Resulting behavior is undefined." msgstr "" -#: config/tc-tic54x.c:5298 +#: config/tc-tic54x.c:5279 msgid "" "Instructions using long offset modifiers or absolute addresses are not " "repeatable. Resulting behavior is undefined." msgstr "" -#: config/tc-tic54x.c:5478 +#: config/tc-tic54x.c:5459 #, c-format msgid "Unsupported relocation size %d" msgstr "" -#: config/tc-tic54x.c:5632 +#: config/tc-tic54x.c:5613 msgid "non-absolute value used with .space/.bes" msgstr "" -#: config/tc-tic54x.c:5636 +#: config/tc-tic54x.c:5617 #, c-format msgid "negative value ignored in %s" msgstr "" -#: config/tc-tic54x.c:5725 +#: config/tc-tic54x.c:5706 #, c-format msgid "attempt to .space/.bes backwards? (%ld)" msgstr "" -#: config/tc-tic54x.c:5759 +#: config/tc-tic54x.c:5740 #, c-format msgid "Invalid label '%s'" msgstr "" @@ -10292,422 +10221,422 @@ msgstr "" msgid "internal error:%s:%d: %s %ld\n" msgstr "" -#: config/tc-tic80.c:90 +#: config/tc-tic80.c:85 msgid "Relaxation is a luxury we can't afford" msgstr "" -#: config/tc-tic80.c:139 +#: config/tc-tic80.c:130 msgid "bad call to md_atof ()" msgstr "" -#: config/tc-tic80.c:236 +#: config/tc-tic80.c:221 msgid "':' not followed by 'm' or 's'" msgstr "" -#: config/tc-tic80.c:249 +#: config/tc-tic80.c:234 msgid "paren nesting" msgstr "" -#: config/tc-tic80.c:263 +#: config/tc-tic80.c:248 msgid "mismatched parenthesis" msgstr "" -#: config/tc-tic80.c:461 +#: config/tc-tic80.c:428 msgid "unhandled expression type" msgstr "" -#: config/tc-tic80.c:592 +#: config/tc-tic80.c:535 msgid "symbol reloc that is not PC relative or 32 bits" msgstr "" -#: config/tc-tic80.c:621 +#: config/tc-tic80.c:556 msgid "unhandled operand modifier" msgstr "" -#: config/tc-tic80.c:663 +#: config/tc-tic80.c:601 msgid "unhandled expression" msgstr "" -#: config/tc-tic80.c:711 +#: config/tc-tic80.c:646 #, c-format msgid "Invalid mnemonic: '%s'" msgstr "" -#: config/tc-tic80.c:724 +#: config/tc-tic80.c:659 #, c-format msgid "Invalid operands: '%s'" msgstr "" -#: config/tc-tic80.c:802 +#: config/tc-tic80.c:737 msgid "unhandled predefined symbol bits" msgstr "" -#: config/tc-tic80.c:897 +#: config/tc-tic80.c:825 #, c-format msgid "PC offset 0x%lx outside range 0x%lx-0x%lx" msgstr "" -#: config/tc-tic80.c:912 +#: config/tc-tic80.c:841 msgid "unhandled relocation type in fixup" msgstr "" -#: config/tc-tic80.c:951 +#: config/tc-tic80.c:877 msgid "md_convert_frag() not implemented yet" msgstr "" -#: config/tc-v850.c:244 +#: config/tc-v850.c:234 #, c-format msgid ".COMMon length (%d.) < 0! Ignored." msgstr "" -#: config/tc-v850.c:266 +#: config/tc-v850.c:255 #, c-format msgid "Length of .comm \"%s\" is already %ld. Not changed to %d." msgstr "" -#: config/tc-v850.c:293 +#: config/tc-v850.c:281 msgid "Common alignment negative; 0 assumed" msgstr "" -#: config/tc-v850.c:976 +#: config/tc-v850.c:939 #, c-format msgid "unknown operand shift: %x\n" msgstr "" -#: config/tc-v850.c:977 +#: config/tc-v850.c:940 msgid "internal failure in parse_register_list" msgstr "" -#: config/tc-v850.c:993 +#: config/tc-v850.c:956 msgid "constant expression or register list expected" msgstr "" -#: config/tc-v850.c:998 config/tc-v850.c:1011 config/tc-v850.c:1030 +#: config/tc-v850.c:961 config/tc-v850.c:974 config/tc-v850.c:993 msgid "high bits set in register list expression" msgstr "" -#: config/tc-v850.c:1069 config/tc-v850.c:1132 +#: config/tc-v850.c:1032 config/tc-v850.c:1095 msgid "illegal register included in list" msgstr "" -#: config/tc-v850.c:1075 +#: config/tc-v850.c:1038 msgid "system registers cannot be included in list" msgstr "" -#: config/tc-v850.c:1080 +#: config/tc-v850.c:1043 msgid "PSW cannot be included in list" msgstr "" -#: config/tc-v850.c:1087 +#: config/tc-v850.c:1050 msgid "High value system registers cannot be included in list" msgstr "" -#: config/tc-v850.c:1111 +#: config/tc-v850.c:1074 msgid "second register should follow dash in register list" msgstr "" -#: config/tc-v850.c:1156 +#: config/tc-v850.c:1119 #, c-format msgid " V850 options:\n" msgstr "" -#: config/tc-v850.c:1157 +#: config/tc-v850.c:1120 #, c-format msgid " -mwarn-signed-overflow Warn if signed immediate values overflow\n" msgstr "" -#: config/tc-v850.c:1158 +#: config/tc-v850.c:1121 #, c-format msgid "" " -mwarn-unsigned-overflow Warn if unsigned immediate values overflow\n" msgstr "" -#: config/tc-v850.c:1159 +#: config/tc-v850.c:1122 #, c-format msgid " -mv850 The code is targeted at the v850\n" msgstr "" -#: config/tc-v850.c:1160 +#: config/tc-v850.c:1123 #, c-format msgid " -mv850e The code is targeted at the v850e\n" msgstr "" -#: config/tc-v850.c:1161 +#: config/tc-v850.c:1124 #, c-format msgid " -mv850e1 The code is targeted at the v850e1\n" msgstr "" -#: config/tc-v850.c:1162 +#: config/tc-v850.c:1125 #, c-format msgid "" " -mv850any The code is generic, despite any processor " "specific instructions\n" msgstr "" -#: config/tc-v850.c:1163 +#: config/tc-v850.c:1126 #, c-format msgid " -mrelax Enable relaxation\n" msgstr "" -#: config/tc-v850.c:1354 +#: config/tc-v850.c:1308 #, c-format msgid "Unable to determine default target processor from string: %s" msgstr "" -#: config/tc-v850.c:1389 +#: config/tc-v850.c:1343 msgid "lo() relocation used on an instruction which does not support it" msgstr "" -#: config/tc-v850.c:1410 +#: config/tc-v850.c:1360 msgid "ctoff() relocation used on an instruction which does not support it" msgstr "" -#: config/tc-v850.c:1436 +#: config/tc-v850.c:1382 msgid "sdaoff() relocation used on an instruction which does not support it" msgstr "" -#: config/tc-v850.c:1462 +#: config/tc-v850.c:1404 msgid "zdaoff() relocation used on an instruction which does not support it" msgstr "" -#: config/tc-v850.c:1499 +#: config/tc-v850.c:1437 msgid "tdaoff() relocation used on an instruction which does not support it" msgstr "" -#: config/tc-v850.c:1714 +#: config/tc-v850.c:1642 msgid "Target processor does not support this instruction." msgstr "" -#: config/tc-v850.c:1805 config/tc-v850.c:1834 config/tc-v850.c:2022 +#: config/tc-v850.c:1731 config/tc-v850.c:1760 config/tc-v850.c:1940 msgid "immediate operand is too large" msgstr "" -#: config/tc-v850.c:1816 +#: config/tc-v850.c:1742 msgid "AAARG -> unhandled constant reloc" msgstr "" -#: config/tc-v850.c:1860 +#: config/tc-v850.c:1785 msgid "invalid register name" msgstr "" -#: config/tc-v850.c:1865 +#: config/tc-v850.c:1789 msgid "register r0 cannot be used here" msgstr "" -#: config/tc-v850.c:1877 +#: config/tc-v850.c:1800 msgid "invalid system register name" msgstr "" -#: config/tc-v850.c:1890 +#: config/tc-v850.c:1812 msgid "expected EP register" msgstr "" -#: config/tc-v850.c:1907 +#: config/tc-v850.c:1828 msgid "invalid condition code name" msgstr "" -#: config/tc-v850.c:1928 config/tc-v850.c:1932 +#: config/tc-v850.c:1848 config/tc-v850.c:1852 msgid "constant too big to fit into instruction" msgstr "" -#: config/tc-v850.c:1985 +#: config/tc-v850.c:1905 msgid "syntax error: value is missing before the register name" msgstr "" -#: config/tc-v850.c:1987 +#: config/tc-v850.c:1907 msgid "syntax error: register not expected" msgstr "" -#: config/tc-v850.c:2001 +#: config/tc-v850.c:1920 msgid "syntax error: system register not expected" msgstr "" -#: config/tc-v850.c:2006 +#: config/tc-v850.c:1924 msgid "syntax error: condition code not expected" msgstr "" -#: config/tc-v850.c:2040 +#: config/tc-v850.c:1958 msgid "invalid operand" msgstr "" -#: config/tc-vax.c:290 +#: config/tc-vax.c:294 #, c-format msgid "VIP_BEGIN error:%s" msgstr "" -#: config/tc-vax.c:427 +#: config/tc-vax.c:485 #, c-format msgid "Aborting because statement has \"%s\"" msgstr "" -#: config/tc-vax.c:474 +#: config/tc-vax.c:532 msgid "Can't relocate expression" msgstr "" -#: config/tc-vax.c:577 +#: config/tc-vax.c:635 msgid "Bignum not permitted in short literal. Immediate mode assumed." msgstr "" -#: config/tc-vax.c:586 +#: config/tc-vax.c:644 msgid "Can't do flonum short literal: immediate mode used." msgstr "" -#: config/tc-vax.c:631 +#: config/tc-vax.c:689 #, c-format msgid "A bignum/flonum may not be a displacement: 0x%lx used" msgstr "" -#: config/tc-vax.c:967 +#: config/tc-vax.c:1025 #, c-format msgid "Short literal overflow(%ld.), immediate mode assumed." msgstr "" -#: config/tc-vax.c:976 +#: config/tc-vax.c:1034 #, c-format msgid "Forced short literal to immediate mode. now_seg=%s to_seg=%s" msgstr "" -#: config/tc-vax.c:1041 +#: config/tc-vax.c:1099 msgid "Length specification ignored. Address mode 9F used" msgstr "" -#: config/tc-vax.c:1102 +#: config/tc-vax.c:1160 msgid "Invalid operand: immediate value used as base address." msgstr "" -#: config/tc-vax.c:1104 +#: config/tc-vax.c:1162 msgid "Invalid operand: immediate value used as address." msgstr "" -#: config/tc-vax.c:1129 +#: config/tc-vax.c:1187 msgid "Symbol used as immediate operand in PIC mode." msgstr "" -#: config/tc-vax.c:1947 +#: config/tc-vax.c:2004 msgid "odd number of bytes in operand description" msgstr "" -#: config/tc-vax.c:1963 +#: config/tc-vax.c:2020 msgid "Bad operand" msgstr "" -#: config/tc-vax.c:2538 +#: config/tc-vax.c:2595 msgid "no '[' to match ']'" msgstr "" -#: config/tc-vax.c:2558 +#: config/tc-vax.c:2615 msgid "bad register in []" msgstr "" -#: config/tc-vax.c:2560 +#: config/tc-vax.c:2617 msgid "[PC] index banned" msgstr "" -#: config/tc-vax.c:2595 +#: config/tc-vax.c:2652 msgid "no '(' to match ')'" msgstr "" -#: config/tc-vax.c:2735 +#: config/tc-vax.c:2792 msgid "invalid branch operand" msgstr "" -#: config/tc-vax.c:2764 +#: config/tc-vax.c:2821 msgid "address prohibits @" msgstr "" -#: config/tc-vax.c:2766 +#: config/tc-vax.c:2823 msgid "address prohibits #" msgstr "" -#: config/tc-vax.c:2770 +#: config/tc-vax.c:2827 msgid "address prohibits -()" msgstr "" -#: config/tc-vax.c:2772 +#: config/tc-vax.c:2829 msgid "address prohibits ()+" msgstr "" -#: config/tc-vax.c:2775 +#: config/tc-vax.c:2832 msgid "address prohibits ()" msgstr "" -#: config/tc-vax.c:2777 +#: config/tc-vax.c:2834 msgid "address prohibits []" msgstr "" -#: config/tc-vax.c:2779 +#: config/tc-vax.c:2836 msgid "address prohibits register" msgstr "" -#: config/tc-vax.c:2781 +#: config/tc-vax.c:2838 msgid "address prohibits displacement length specifier" msgstr "" -#: config/tc-vax.c:2811 +#: config/tc-vax.c:2868 msgid "invalid operand of S^#" msgstr "" -#: config/tc-vax.c:2828 +#: config/tc-vax.c:2885 msgid "S^# needs expression" msgstr "" -#: config/tc-vax.c:2835 +#: config/tc-vax.c:2892 msgid "S^# may only read-access" msgstr "" -#: config/tc-vax.c:2860 +#: config/tc-vax.c:2917 msgid "invalid operand of -()" msgstr "" -#: config/tc-vax.c:2866 +#: config/tc-vax.c:2923 msgid "-(PC) unpredictable" msgstr "" -#: config/tc-vax.c:2868 +#: config/tc-vax.c:2925 msgid "[]index same as -()register: unpredictable" msgstr "" -#: config/tc-vax.c:2904 +#: config/tc-vax.c:2961 msgid "invalid operand of ()+" msgstr "" -#: config/tc-vax.c:2910 +#: config/tc-vax.c:2967 msgid "(PC)+ unpredictable" msgstr "" -#: config/tc-vax.c:2912 +#: config/tc-vax.c:2969 msgid "[]index same as ()+register: unpredictable" msgstr "" -#: config/tc-vax.c:2937 +#: config/tc-vax.c:2994 msgid "# conflicts length" msgstr "" -#: config/tc-vax.c:2939 +#: config/tc-vax.c:2996 msgid "# bars register" msgstr "" -#: config/tc-vax.c:2961 +#: config/tc-vax.c:3018 msgid "writing or modifying # is unpredictable" msgstr "" -#: config/tc-vax.c:2991 +#: config/tc-vax.c:3048 msgid "length not needed" msgstr "" -#: config/tc-vax.c:2998 +#: config/tc-vax.c:3055 msgid "can't []index a register, because it has no address" msgstr "" -#: config/tc-vax.c:3000 +#: config/tc-vax.c:3057 msgid "a register has no address" msgstr "" -#: config/tc-vax.c:3011 +#: config/tc-vax.c:3068 msgid "PC part of operand unpredictable" msgstr "" -#: config/tc-vax.c:3360 +#: config/tc-vax.c:3417 #, c-format msgid "" "VAX options:\n" @@ -10719,7 +10648,7 @@ msgid "" "-V\t\t\tignored\n" msgstr "" -#: config/tc-vax.c:3369 +#: config/tc-vax.c:3426 #, c-format msgid "" "VMS options:\n" @@ -10731,630 +10660,621 @@ msgid "" "-v\"VERSION\"\t\tcode being assembled was produced by compiler \"VERSION\"\n" msgstr "" -#: config/tc-w65.c:142 +#: config/tc-w65.c:78 msgid "need on or off." msgstr "" -#: config/tc-w65.c:278 config/tc-w65.c:321 +#: config/tc-w65.c:266 config/tc-w65.c:307 msgid "syntax error after " msgstr "" #. To be compatible with BSD 4.2 as: give the luser a linefeed!! -#: read.c:4629 read.c:4715 +#: read.c:4646 read.c:4732 msgid "unterminated string; newline inserted" msgstr "" -#: read.c:4723 +#: read.c:4740 msgid "bad escaped character in string" msgstr "" -#: read.c:4748 +#: read.c:4765 msgid "expected address expression" msgstr "" -#: read.c:4767 +#: read.c:4784 #, c-format msgid "symbol \"%s\" undefined; zero assumed" msgstr "" -#: read.c:4770 +#: read.c:4787 msgid "some symbol undefined; zero assumed" msgstr "" -#: read.c:4786 -msgid "bad or irreducible absolute expression" -msgstr "" - -#: read.c:4827 +#: read.c:4823 msgid "this string may not contain '\\0'" msgstr "" -#: read.c:4863 +#: read.c:4859 msgid "missing string" msgstr "" -#: read.c:4983 +#: read.c:4944 #, c-format msgid ".incbin count zero, ignoring `%s'" msgstr "" -#: read.c:5009 +#: read.c:4970 #, c-format msgid "file not found: %s" msgstr "" -#: read.c:5023 +#: read.c:4984 #, c-format msgid "seek to end of .incbin file failed `%s'" msgstr "" -#: read.c:5034 +#: read.c:4995 #, c-format msgid "skip (%ld) or count (%ld) invalid for file size (%ld)" msgstr "" -#: read.c:5041 +#: read.c:5002 #, c-format msgid "could not skip to %ld in file `%s'" msgstr "" -#: read.c:5050 +#: read.c:5011 #, c-format msgid "truncated file `%s', %ld of %ld bytes read" msgstr "" -#: read.c:5208 +#: read.c:5169 msgid "missing .func" msgstr "" -#: read.c:5225 +#: read.c:5186 msgid ".endfunc missing for previous .func" msgstr "" -#: stabs.c:215 stabs.c:223 stabs.c:231 stabs.c:250 +#: read.c:5312 +#, c-format +msgid "missing closing `%c'" +msgstr "" + +#: read.c:5314 +msgid "stray `\\'" +msgstr "" + +#: stabs.c:214 stabs.c:222 stabs.c:230 stabs.c:249 #, c-format msgid ".stab%c: missing comma" msgstr "" @@ -12435,12 +12419,12 @@ msgstr "" #. This could happen for example with a source file with a huge #. number of lines. The only cure is to use a different debug #. format, probably DWARF. -#: stabs.c:243 +#: stabs.c:242 #, c-format msgid ".stab%c: description field '%x' too big, try a different debug format" msgstr "" -#: stabs.c:426 +#: stabs.c:425 msgid "comma missing in .xstabs" msgstr "" @@ -12449,174 +12433,179 @@ msgstr "" msgid "attempt to switch to nonexistent segment \"%s\"" msgstr "" -#: symbols.c:309 +#: symbols.c:304 #, c-format msgid "cannot define symbol `%s' in absolute section" msgstr "" -#: symbols.c:443 +#: symbols.c:438 #, c-format msgid "symbol `%s' is already defined as \"%s\"/%s%ld" msgstr "" -#: symbols.c:519 symbols.c:526 +#: symbols.c:514 symbols.c:521 #, c-format msgid "inserting \"%s\" into symbol table failed: %s" msgstr "" -#: symbols.c:840 symbols.c:844 +#: symbols.c:809 symbols.c:813 #, c-format msgid "undefined symbol `%s' in operation" msgstr "" -#: symbols.c:851 +#: symbols.c:820 #, c-format msgid "invalid sections for operation on `%s' and `%s'" msgstr "" -#: symbols.c:855 +#: symbols.c:824 #, c-format msgid "invalid section for operation on `%s'" msgstr "" -#: symbols.c:863 symbols.c:866 +#: symbols.c:832 symbols.c:835 #, c-format msgid "undefined symbol `%s' in operation setting `%s'" msgstr "" -#: symbols.c:873 +#: symbols.c:842 #, c-format msgid "invalid sections for operation on `%s' and `%s' setting `%s'" msgstr "" -#: symbols.c:877 +#: symbols.c:846 #, c-format msgid "invalid section for operation on `%s' setting `%s'" msgstr "" -#: symbols.c:929 +#: symbols.c:898 #, c-format msgid "symbol definition loop encountered at `%s'" msgstr "" -#: symbols.c:1162 +#: symbols.c:1141 #, c-format msgid "division by zero when setting `%s'" msgstr "" -#: symbols.c:1249 write.c:1977 +#: symbols.c:1228 write.c:1982 #, c-format msgid "can't resolve value for symbol `%s'" msgstr "" -#: symbols.c:1637 +#: symbols.c:1616 #, c-format msgid "\"%d\" (instance number %d of a %s label)" msgstr "" -#: symbols.c:1673 +#: symbols.c:1652 #, c-format msgid "attempt to get value of unresolved symbol `%s'" msgstr "" -#: symbols.c:1916 +#: symbols.c:1889 msgid "section symbols are already global" msgstr "" -#: symbols.c:1961 +#: symbols.c:1934 #, c-format msgid "Accessing function `%s' as thread-local object" msgstr "" -#: symbols.c:1965 +#: symbols.c:1938 #, c-format msgid "Accessing `%s' as thread-local object" msgstr "" -#: write.c:208 +#: write.c:212 #, c-format msgid "field fx_size too small to hold %d" msgstr "" -#: write.c:340 +#: write.c:344 msgid "rva not supported" msgstr "" -#: write.c:540 +#: write.c:544 #, c-format msgid "attempt to .org/.space backwards? (%ld)" msgstr "" -#: write.c:966 write.c:1038 +#: write.c:800 +#, c-format +msgid "Local symbol `%s' can't be equated to undefined symbol `%s'" +msgstr "" + +#: write.c:974 write.c:1046 msgid "relocation out of range" msgstr "" -#: write.c:969 write.c:1041 +#: write.c:977 write.c:1049 #, c-format msgid "%s:%u: bad return from bfd_install_relocation: %x" msgstr "" -#: write.c:1021 +#: write.c:1029 msgid "internal error: fixup not contained within frag" msgstr "" -#: write.c:1127 write.c:1151 +#: write.c:1135 write.c:1159 #, c-format msgid "FATAL: Can't write %s" msgstr "" -#: write.c:1183 +#: write.c:1191 msgid "cannot write to output file" msgstr "" -#: write.c:1440 +#: write.c:1448 #, c-format msgid "%d error%s, %d warning%s, generating bad object file" msgstr "" -#: write.c:1447 +#: write.c:1455 #, c-format msgid "%d error%s, %d warning%s, no object file generated" msgstr "" -#: write.c:1918 +#: write.c:1917 #, c-format msgid "local label `%s' is not defined" msgstr "" -#: write.c:1931 +#: write.c:1935 #, c-format -msgid "`%s' can't be equated to common symbol" +msgid "Local symbol `%s' can't be equated to common symbol `%s'" msgstr "" -#: write.c:2209 +#: write.c:2214 #, c-format msgid "alignment padding (%lu bytes) not a multiple of %ld" msgstr "" -#: write.c:2326 +#: write.c:2331 #, c-format msgid ".word %s-%s+%s didn't fit" msgstr "" -#: write.c:2413 +#: write.c:2418 msgid "attempt to move .org backwards" msgstr "" -#: write.c:2441 +#: write.c:2446 msgid ".space specifies non-absolute value" msgstr "" -#: write.c:2448 +#: write.c:2453 msgid ".space or .fill with negative value, ignored" msgstr "" -#: write.c:2731 +#: write.c:2736 #, c-format msgid "value of %s too large for field of %d bytes at %s" msgstr "" -#: write.c:2743 +#: write.c:2748 #, c-format msgid "signed .word overflow; switch may be too large; %ld at 0x%lx" msgstr "" diff -uprN binutils-2.16.90.0.3/gas/po/POTFILES.in binutils-2.16.91.0.1/gas/po/POTFILES.in --- binutils-2.16.90.0.3/gas/po/POTFILES.in 2005-04-09 12:03:11.000000000 -0700 +++ binutils-2.16.91.0.1/gas/po/POTFILES.in 2005-06-22 13:53:35.081288240 -0700 @@ -1,18 +1,12 @@ app.c -app.c -as.c as.c as.h asintl.h atof-generic.c -atof-generic.c -bignum-copy.c -bignum-copy.c bignum.h bit_fix.h cgen.h cond.c -cond.c config/e-crisaout.c config/e-criself.c config/e-i386aout.c @@ -141,74 +135,50 @@ config/tc-xtensa.h config/tc-z8k.c config/tc-z8k.h depend.c -depend.c -dw2gencfi.c dw2gencfi.c dw2gencfi.h dwarf2dbg.c -dwarf2dbg.c dwarf2dbg.h ecoff.c -ecoff.c ecoff.h ehopt.c -ehopt.c emul.h emul-target.h expr.c -expr.c expr.h flonum-copy.c -flonum-copy.c flonum.h flonum-konst.c -flonum-konst.c -flonum-mult.c flonum-mult.c frags.c -frags.c frags.h hash.c -hash.c hash.h input-file.c -input-file.c input-file.h input-scrub.c -input-scrub.c itbl-lex.h itbl-ops.c itbl-ops.h listing.c -listing.c listing.h literal.c -literal.c -macro.c macro.c macro.h messages.c -messages.c obj.h output-file.c -output-file.c output-file.h read.c -read.c read.h sb.c -sb.c sb.h stabs.c -stabs.c struc-symbol.h subsegs.c -subsegs.c subsegs.h symbols.c -symbols.c symbols.h tc.h write.c -write.c write.h diff -uprN binutils-2.16.90.0.3/gas/read.c binutils-2.16.91.0.1/gas/read.c --- binutils-2.16.90.0.3/gas/read.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/read.c 2005-06-22 13:53:34.748343251 -0700 @@ -221,6 +221,7 @@ static segT get_known_segmented_expressi static void pobegin (void); static int get_line_sb (sb *); static void generate_file_debug (void); +static char *_find_end_of_line (char *, int, int); void read_begin (void) @@ -519,9 +520,11 @@ pobegin (void) #define HANDLE_CONDITIONAL_ASSEMBLY() \ if (ignore_input ()) \ { \ - while (!is_end_of_line[(unsigned char) *input_line_pointer++]) \ - if (input_line_pointer == buffer_limit) \ - break; \ + char *eol = find_end_of_line (input_line_pointer, flag_m68k_mri); \ + input_line_pointer = (input_line_pointer <= buffer_limit \ + && eol >= buffer_limit) \ + ? buffer_limit \ + : eol + 1; \ continue; \ } @@ -719,9 +722,7 @@ read_a_source_file (char *name) int len; /* Find the end of the current expanded macro line. */ - for (s = input_line_pointer - 1; *s; ++s) - if (is_end_of_line[(unsigned char) *s]) - break; + s = find_end_of_line (input_line_pointer - 1, flag_m68k_mri); if (s != last_eol) { @@ -911,34 +912,10 @@ read_a_source_file (char *name) } else { - int inquote = 0; -#ifdef QUOTES_IN_INSN - int inescape = 0; -#endif - /* WARNING: c has char, which may be end-of-line. */ /* Also: input_line_pointer->`\0` where c was. */ *input_line_pointer = c; - while (!is_end_of_line[(unsigned char) *input_line_pointer] - || inquote -#ifdef TC_EOL_IN_INSN - || TC_EOL_IN_INSN (input_line_pointer) -#endif - ) - { - if (flag_m68k_mri && *input_line_pointer == '\'') - inquote = !inquote; -#ifdef QUOTES_IN_INSN - if (inescape) - inescape = 0; - else if (*input_line_pointer == '"') - inquote = !inquote; - else if (*input_line_pointer == '\\') - inescape = 1; -#endif - input_line_pointer++; - } - + input_line_pointer = _find_end_of_line (input_line_pointer, flag_m68k_mri, 1); c = *input_line_pointer; *input_line_pointer = '\0'; @@ -1459,7 +1436,7 @@ s_comm_internal (int param, if (name == p) { as_bad (_("expected symbol name")); - discard_rest_of_line (); + ignore_rest_of_line (); goto out; } @@ -1785,7 +1762,7 @@ s_errwarn (int err) { as_bad (_("%s argument must be a string"), err ? ".error" : ".warning"); - discard_rest_of_line (); + ignore_rest_of_line (); return; } @@ -1966,7 +1943,7 @@ s_globl (int ignore ATTRIBUTE_UNUSED) void s_irp (int irpc) { - char *file; + char *file, *eol; unsigned int line; sb s; const char *err; @@ -1975,8 +1952,9 @@ s_irp (int irpc) as_where (&file, &line); sb_new (&s); - while (!is_end_of_line[(unsigned char) *input_line_pointer]) - sb_add_char (&s, *input_line_pointer++); + eol = find_end_of_line (input_line_pointer, 0); + sb_add_buffer (&s, input_line_pointer, eol - input_line_pointer); + input_line_pointer = eol; sb_new (&out); @@ -2224,7 +2202,7 @@ s_lsym (int ignore ATTRIBUTE_UNUSED) if (name == p) { as_bad (_("expected symbol name")); - discard_rest_of_line (); + ignore_rest_of_line (); return; } @@ -2286,8 +2264,7 @@ s_lsym (int ignore ATTRIBUTE_UNUSED) static int get_line_sb (sb *line) { - char quote1, quote2, inquote; - unsigned char c; + char *eol; if (input_line_pointer[-1] == '\n') bump_line_counters (); @@ -2299,45 +2276,16 @@ get_line_sb (sb *line) return 0; } - /* If app.c sets any other characters to LEX_IS_STRINGQUOTE, this - code needs to be changed. */ - if (!flag_m68k_mri) - quote1 = '"'; - else - quote1 = '\0'; - - quote2 = '\0'; - if (flag_m68k_mri) - quote2 = '\''; -#ifdef LEX_IS_STRINGQUOTE - quote2 = '\''; -#endif - - inquote = '\0'; - - while ((c = * input_line_pointer ++) != 0 - && (!is_end_of_line[c] - || (inquote != '\0' && c != '\n'))) - { - if (inquote == c) - inquote = '\0'; - else if (inquote == '\0') - { - if (c == quote1) - inquote = quote1; - else if (c == quote2) - inquote = quote2; - } - - sb_add_char (line, c); - } + eol = find_end_of_line (input_line_pointer, flag_m68k_mri); + sb_add_buffer (line, input_line_pointer, eol - input_line_pointer); + input_line_pointer = eol; /* Don't skip multiple end-of-line characters, because that breaks support for the IA-64 stop bit (;;) which looks like two consecutive end-of-line characters but isn't. Instead just skip one end of line character and return the character skipped so that the caller can re-insert it if necessary. */ - return c; + return *input_line_pointer++; } /* Define a macro. This is an interface to macro.c. */ @@ -2345,7 +2293,7 @@ get_line_sb (sb *line) void s_macro (int ignore ATTRIBUTE_UNUSED) { - char *file; + char *file, *eol; unsigned int line; sb s; const char *err; @@ -2354,8 +2302,9 @@ s_macro (int ignore ATTRIBUTE_UNUSED) as_where (&file, &line); sb_new (&s); - while (!is_end_of_line[(unsigned char) *input_line_pointer]) - sb_add_char (&s, *input_line_pointer++); + eol = find_end_of_line (input_line_pointer, 0); + sb_add_buffer (&s, input_line_pointer, eol - input_line_pointer); + input_line_pointer = eol; if (line_label != NULL) { @@ -2877,7 +2826,7 @@ s_set (int equiv) if (name == end_name) { as_bad (_("expected symbol name")); - discard_rest_of_line (); + ignore_rest_of_line (); return; } @@ -3222,19 +3171,6 @@ ignore_rest_of_line (void) know (is_end_of_line[(unsigned char) input_line_pointer[-1]]); } -void -discard_rest_of_line (void) -{ - while (input_line_pointer < buffer_limit - && !is_end_of_line[(unsigned char) *input_line_pointer]) - input_line_pointer++; - - input_line_pointer++; - - /* Return pointing just after end-of-line. */ - know (is_end_of_line[(unsigned char) input_line_pointer[-1]]); -} - /* Sets frag for given symbol to zero_address_frag, except when the symbol frag is already set to a dummy listing frag. */ @@ -5298,11 +5234,7 @@ do_s_func (int end_p, const char *defaul void s_ignore (int arg ATTRIBUTE_UNUSED) { - while (!is_end_of_line[(unsigned char) *input_line_pointer]) - { - ++input_line_pointer; - } - ++input_line_pointer; + ignore_rest_of_line (); } void @@ -5340,3 +5272,51 @@ input_scrub_insert_file (char *path) input_scrub_include_file (path, input_line_pointer); buffer_limit = input_scrub_next_buffer (&input_line_pointer); } + +/* Find the end of a line, considering quotation and escaping of quotes. */ + +#if !defined(TC_SINGLE_QUOTE_STRINGS) && defined(SINGLE_QUOTE_STRINGS) +# define TC_SINGLE_QUOTE_STRINGS 1 +#endif + +static char * +_find_end_of_line (char *s, int mri_string, int insn ATTRIBUTE_UNUSED) +{ + char inquote = '\0'; + int inescape = 0; + + while (!is_end_of_line[(unsigned char) *s] + || (inquote && !ISCNTRL (*s)) + || (inquote == '\'' && flag_mri) +#ifdef TC_EOL_IN_INSN + || (insn && TC_EOL_IN_INSN (s)) +#endif + ) + { + if (mri_string && *s == '\'') + inquote ^= *s; + else if (inescape) + inescape = 0; + else if (*s == '\\') + inescape = 1; + else if (!inquote + ? *s == '"' +#ifdef TC_SINGLE_QUOTE_STRINGS + || (TC_SINGLE_QUOTE_STRINGS && *s == '\'') +#endif + : *s == inquote) + inquote ^= *s; + ++s; + } + if (inquote) + as_warn (_("missing closing `%c'"), inquote); + if (inescape) + as_warn (_("stray `\\'")); + return s; +} + +char * +find_end_of_line (char *s, int mri_string) +{ + return _find_end_of_line (s, mri_string, 0); +} diff -uprN binutils-2.16.90.0.3/gas/read.h binutils-2.16.91.0.1/gas/read.h --- binutils-2.16.90.0.3/gas/read.h 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/read.h 2005-06-22 13:53:34.749343086 -0700 @@ -56,6 +56,7 @@ extern char lex_type[]; extern char is_end_of_line[]; extern int is_it_end_of_statement (void); +extern char *find_end_of_line (char *, int); extern int target_big_endian; @@ -113,7 +114,7 @@ extern void emit_expr (expressionS *exp, extern void equals (char *sym_name, int reassign); extern void float_cons (int float_type); extern void ignore_rest_of_line (void); -extern void discard_rest_of_line (void); +#define discard_rest_of_line ignore_rest_of_line extern int output_leb128 (char *, valueT, int sign); extern void pseudo_set (symbolS * symbolP); extern void read_a_source_file (char *name); diff -uprN binutils-2.16.90.0.3/gas/sb.c binutils-2.16.91.0.1/gas/sb.c --- binutils-2.16.90.0.3/gas/sb.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/sb.c 2005-06-22 13:53:34.749343086 -0700 @@ -33,6 +33,7 @@ #endif #include "libiberty.h" #include "sb.h" +#include "as.h" /* These routines are about manipulating strings. @@ -115,6 +116,38 @@ sb_add_sb (sb *ptr, sb *s) ptr->len += s->len; } +/* Helper for sb_scrub_and_add_sb. */ + +static sb *sb_to_scrub; +static char *scrub_position; +static int +scrub_from_sb (char *buf, int buflen) +{ + int copy; + copy = sb_to_scrub->len - (scrub_position - sb_to_scrub->ptr); + if (copy > buflen) + copy = buflen; + memcpy (buf, scrub_position, copy); + scrub_position += copy; + return copy; +} + +/* Run the sb at s through do_scrub_chars and add the result to the sb + at ptr. */ + +void +sb_scrub_and_add_sb (sb *ptr, sb *s) +{ + sb_to_scrub = s; + scrub_position = s->ptr; + + sb_check (ptr, s->len); + ptr->len += do_scrub_chars (scrub_from_sb, ptr->ptr + ptr->len, s->len); + + sb_to_scrub = 0; + scrub_position = 0; +} + /* Make sure that the sb at ptr has room for another len characters, and grow it if it doesn't. */ diff -uprN binutils-2.16.90.0.3/gas/sb.h binutils-2.16.91.0.1/gas/sb.h --- binutils-2.16.90.0.3/gas/sb.h 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/sb.h 2005-06-22 13:53:34.749343086 -0700 @@ -81,6 +81,7 @@ sb_list_vector; extern void sb_new (sb *); extern void sb_kill (sb *); extern void sb_add_sb (sb *, sb *); +extern void sb_scrub_and_add_sb (sb *, sb *); extern void sb_reset (sb *); extern void sb_add_char (sb *, int); extern void sb_add_string (sb *, const char *); diff -uprN binutils-2.16.90.0.3/gas/symbols.c binutils-2.16.91.0.1/gas/symbols.c --- binutils-2.16.90.0.3/gas/symbols.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/symbols.c 2005-06-22 13:53:34.752342590 -0700 @@ -906,6 +906,7 @@ resolve_symbol_value (symbolS *symp) offsetT left, right; segT seg_left, seg_right; operatorT op; + int move_seg_ok; symp->sy_resolving = 1; @@ -1091,18 +1092,15 @@ resolve_symbol_value (symbolS *symp) } } + move_seg_ok = 1; /* Equality and non-equality tests are permitted on anything. Subtraction, and other comparison operators are permitted if both operands are in the same section. Otherwise, both operands must be absolute. We already handled the case of addition or subtraction of a constant above. This will probably need to be changed for an object file format which - supports arbitrary expressions, such as IEEE-695. - - Don't emit messages unless we're finalizing the symbol value, - otherwise we may get the same message multiple times. */ - if (finalize_syms - && !(seg_left == absolute_section + supports arbitrary expressions, such as IEEE-695. */ + if (!(seg_left == absolute_section && seg_right == absolute_section) && !(op == O_eq || op == O_ne) && !((op == O_subtract @@ -1110,9 +1108,21 @@ resolve_symbol_value (symbolS *symp) && seg_left == seg_right && (seg_left != undefined_section || add_symbol == op_symbol))) - report_op_error (symp, add_symbol, op_symbol); + { + /* Don't emit messages unless we're finalizing the symbol value, + otherwise we may get the same message multiple times. */ + if (finalize_syms) + report_op_error (symp, add_symbol, op_symbol); + /* However do not move the symbol into the absolute section + if it cannot currently be resolved - this would confuse + other parts of the assembler into believing that the + expression had been evaluated to zero. */ + else + move_seg_ok = 0; + } - if (final_seg == expr_section || final_seg == undefined_section) + if (move_seg_ok + && (final_seg == expr_section || final_seg == undefined_section)) final_seg = absolute_section; /* Check for division by zero. */ diff -uprN binutils-2.16.90.0.3/gas/tc.h binutils-2.16.91.0.1/gas/tc.h --- binutils-2.16.90.0.3/gas/tc.h 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/tc.h 2005-06-22 13:53:34.753342425 -0700 @@ -34,7 +34,7 @@ short tc_coff_fix2rtype (fixS *); void md_assemble (char *); void md_begin (void); void md_number_to_chars (char *, valueT, int); -void md_apply_fix3 (fixS *, valueT *, segT); +void md_apply_fix (fixS *, valueT *, segT); #ifndef WORKING_DOT_WORD extern int md_short_jump_size; diff -uprN binutils-2.16.90.0.3/gas/testsuite/ChangeLog binutils-2.16.91.0.1/gas/testsuite/ChangeLog --- binutils-2.16.90.0.3/gas/testsuite/ChangeLog 2005-05-10 15:46:46.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/ChangeLog 2005-06-22 13:53:35.124281136 -0700 @@ -1,3 +1,114 @@ +2005-06-20 H.J. Lu + + PR 1013 + * i386/x86_64.s: Add absolute 64bit addressing tests for mov. + * i386/x86_64.s: Updated. + +2005-06-17 Jan Beulich + + * gas/i386/x86-64-pcrel.s: Add insn requiring 64-bit pc-relative + relocation. Add insns for all widths of non-pc-relative relocations. + * gas/i386/x86-64-pcrel.d: Adjust. + +2005-06-13 Zack Weinberg + + * gas/arm/thumb.s: Only branch to labels defined in this file. + * gas/arm/thumb.d, gas/arm/thumb32.d: Adjust expected output. + +2005-06-01 Maciej W. Rozycki + + * gas/mips/ldstla-32-1.l: Update to handle leading zeroes. + * gas/mips/ldstla-32-mips3-1.l: Likewise. + +2005-05-27 Jan Beulich + + * gas/ia64/proc.l: Adjust. + +2005-05-25 Steve Ellcey + + * gas/ia64/global.d: Change --sym to --syms. + +2005-05-25 H.J. Lu + + * gas/ia64/group-1.d: Updated. + * gas/ia64/group-2.d: Likewise. + +2005-05-25 Jan Beulich + + * gas/ia64/radix.s: New. + * gas/ia64/radix.l: New. + * gas/ia64/ia64.exp: Run new test. + +2005-05-25 Jan Beulich + + * gas/i386/intelok.d: Account for 32-bit displacements being shown + in hex. + +2005-05-24 H.J. Lu + + * gas/elf/group0b.d: Updated. + * gas/elf/group1b.d: Likewise. + +2005-05-19 Jan Beulich + + * gas/ia64/reloc-uw.s: New. + * gas/ia64/reloc-uw.d: New. + * gas/ia64/reloc-uw-ilp32.d: New. + * gas/ia64/ia64.exp: Run new test. + +2005-05-18 Jan Beulich + + * gas/all/altmacro.s: Parenthesize operand of %. + +2005-05-17 Zack Weinberg + + * gas/arm/arm.exp: Convert all existing "gas_test" tests to + "run_dump_test" tests. Run more tests unconditionally. Run new tests. + * gas/arm/arch4t.s, gas/arm/arch6zk.s, gas/arm/arm3.s, gas/arm/arm6.s + * gas/arm/arm7dm.s, gas/arm/bignum1.s, gas/arm/float.s + * gas/arm/immed.s, gas/arm/iwmmxt.s, gas/arm/offset.s, gas/arm/thumb.s: + Adjust to work as a dump test. + * gas/arm/arch4t.d, gas/arm/arch6zk.d, gas/arm/arm3.d, gas/arm/arm6.d + * gas/arm/arm7dm.d, gas/arm/bignum1.d, gas/arm/float.d + * gas/arm/immed.d, gas/arm/iwmmxt.d, gas/arm/offset.d, gas/arm/thumb.d: + New files. + + * gas/arm/armv1-bad.l, gas/arm/armv1-bad.s: Remove tests for + diagnostics that don't happen in the first pass anymore. + + * gas/arm/iwmmxt-bad.l, gas/arm/r15-bad.l, gas/arm/req.l + * gas/arm/vfp-bad.l: + Update expected diagnostics. + * gas/arm/pic.d: Update expected reloc name. + * gas/arm/thumbv6.d: CPY no longer appears in disassembly. + * gas/arm/r15-bad.s: Avoid two-argument mul. + * gas/arm/req.s: Adjust comments. + * gas/arm/maverick.d, gas/arm/maverick.s: Avoid inappropriate + use of PC. + + * gas/arm/macro-1.d, gas/arm/macro1.s + * gas/arm/t16-bad.l, gas/arm/t16-bad.s + * gas/arm/tcompat.d, gas/arm/tcompat.s + * gas/arm/tcompat2.d, gas/arm/tcompat2.s + * gas/arm/thumb32.d, gas/arm/thumb32.s + New test pair. + +2005-05-17 Jan Beulich + + * gas/mmix/err-byte1.s: Adjust expected error text on line 10. + +2005-05-17 Nick Clifton + + * gas/v850/split-lo16.s: Add test for a lo() pseudo reloc + corrupting an ld.w instruction. + * gas/v850/split-lo16.d: Add expected, correct (ie not corrupt) + output. + +2005-05-10 Michael Matz + + * gas/hppa/parse/block1.s: Use official limit (0x3fffffff) for + .block. + 2005-05-10 Hans-Peter Nilsson * gas/mmix/relax2.s: Drop ":" off label definitions. diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/all/altmacro.s binutils-2.16.91.0.1/gas/testsuite/gas/all/altmacro.s --- binutils-2.16.90.0.3/gas/testsuite/gas/all/altmacro.s 2004-09-15 12:05:03.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/all/altmacro.s 2005-06-22 13:53:35.129280310 -0700 @@ -7,7 +7,7 @@ l2: .byte v2 .endm .macro m2 v1, v2 - m1 %v1, %(v2-v1) + m1 %(v1), %(v2-v1) .endm .macro m3 str diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/arch4t.d binutils-2.16.91.0.1/gas/testsuite/gas/arm/arch4t.d --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/arch4t.d 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/arch4t.d 2005-06-22 13:53:35.129280310 -0700 @@ -0,0 +1,36 @@ +# name: ARM architecture 4t instructions +# as: -march=armv4t +# objdump: -dr --prefix-addresses --show-raw-insn + +.*: +file format .*arm.* + +Disassembly of section .text: +0+00 <[^>]+> e12fff10 ? bx r0 +0+04 <[^>]+> 012fff11 ? bxeq r1 +0+08 <[^>]+> e15f30b8 ? ldrh r3, \[pc, #-8\] ; 0+08 <[^>]+> +0+0c <[^>]+> e1d540f0 ? ldrsh r4, \[r5\] +0+10 <[^>]+> e19140d3 ? ldrsb r4, \[r1, r3\] +0+14 <[^>]+> e1b410f4 ? ldrsh r1, \[r4, r4\]! +0+18 <[^>]+> 011510d3 ? ldreqsb r1, \[r5, -r3\] +0+1c <[^>]+> 109620b7 ? ldrneh r2, \[r6\], r7 +0+20 <[^>]+> 309720f8 ? ldrccsh r2, \[r7\], r8 +0+24 <[^>]+> e1d32fdf ? ldrsb r2, \[r3, #255\] +0+28 <[^>]+> e1541ffa ? ldrsh r1, \[r4, #-250\] +0+2c <[^>]+> e1d51fd0 ? ldrsb r1, \[r5, #240\] +0+30 <[^>]+> e1cf23b0 ? strh r2, \[pc, #48\] ; 0+68 <[^>]+> +0+34 <[^>]+> 11c330b0 ? strneh r3, \[r3\] +0+38 <[^>]+> e328f002 ? msr CPSR_f, #2 ; 0x2 +0+3c <[^>]+> e121f003 ? msr CPSR_c, r3 +0+40 <[^>]+> e122f004 ? msr CPSR_x, r4 +0+44 <[^>]+> e124f005 ? msr CPSR_s, r5 +0+48 <[^>]+> e128f006 ? msr CPSR_f, r6 +0+4c <[^>]+> e129f007 ? msr CPSR_fc, r7 +0+50 <[^>]+> e368f004 ? msr SPSR_f, #4 ; 0x4 +0+54 <[^>]+> e161f008 ? msr SPSR_c, r8 +0+58 <[^>]+> e162f009 ? msr SPSR_x, r9 +0+5c <[^>]+> e164f00a ? msr SPSR_s, sl +0+60 <[^>]+> e168f00b ? msr SPSR_f, fp +0+64 <[^>]+> e169f00c ? msr SPSR_fc, ip +0+68 <[^>]+> e1a00000 ? nop \(mov r0,r0\) +0+6c <[^>]+> e1a00000 ? nop \(mov r0,r0\) + diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/arch4t.s binutils-2.16.91.0.1/gas/testsuite/gas/arm/arch4t.s --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/arch4t.s 2000-05-18 14:21:49.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/arch4t.s 2005-06-22 13:53:35.138278823 -0700 @@ -1,6 +1,6 @@ -.text -.align 0 - + .text + .align 0 +l: bx r0 bxeq r1 @@ -33,3 +33,6 @@ foo: msr SPSR_f, r11 msr SPSR_all, r12 bar: + @ section padding for a.out's benefit + nop + nop diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/arch6zk.d binutils-2.16.91.0.1/gas/testsuite/gas/arm/arch6zk.d --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/arch6zk.d 2005-04-09 12:03:12.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/arch6zk.d 2005-06-22 13:53:35.143277997 -0700 @@ -6,21 +6,21 @@ Disassembly of section .text: 0+000 <[^>]*> f57ff01f ? clrex -0+004 <[^>]*> e1dc3f9f ? ldrexb r3, \[ip\] -0+008 <[^>]*> 11d3cf9f ? ldrexbne ip, \[r3\] -0+00c <[^>]*> e1bc3f9f ? ldrexd r3, \[ip\] -0+010 <[^>]*> 11b3cf9f ? ldrexdne ip, \[r3\] -0+014 <[^>]*> e1fc3f9f ? ldrexh r3, \[ip\] -0+018 <[^>]*> 11f3cf9f ? ldrexhne ip, \[r3\] +0+004 <[^>]*> e1dc4f9f ? ldrexb r4, \[ip\] +0+008 <[^>]*> 11d4cf9f ? ldrexbne ip, \[r4\] +0+00c <[^>]*> e1bc4f9f ? ldrexd r4, \[ip\] +0+010 <[^>]*> 11b4cf9f ? ldrexdne ip, \[r4\] +0+014 <[^>]*> e1fc4f9f ? ldrexh r4, \[ip\] +0+018 <[^>]*> 11f4cf9f ? ldrexhne ip, \[r4\] 0+01c <[^>]*> e320f080 ? nop \{128\} 0+020 <[^>]*> 1320f07f ? nopne \{127\} 0+024 <[^>]*> e320f004 ? sev -0+028 <[^>]*> e1c73f9c ? strexb r3, ip, \[r7\] -0+02c <[^>]*> 11c8cf93 ? strexbne ip, r3, \[r8\] -0+030 <[^>]*> e1a73f9c ? strexd r3, ip, \[r7\] -0+034 <[^>]*> 11a8cf93 ? strexdne ip, r3, \[r8\] -0+038 <[^>]*> e1e73f9c ? strexh r3, ip, \[r7\] -0+03c <[^>]*> 11e8cf93 ? strexhne ip, r3, \[r8\] +0+028 <[^>]*> e1c74f9c ? strexb r4, ip, \[r7\] +0+02c <[^>]*> 11c8cf94 ? strexbne ip, r4, \[r8\] +0+030 <[^>]*> e1a74f9c ? strexd r4, ip, \[r7\] +0+034 <[^>]*> 11a8cf94 ? strexdne ip, r4, \[r8\] +0+038 <[^>]*> e1e74f9c ? strexh r4, ip, \[r7\] +0+03c <[^>]*> 11e8cf94 ? strexhne ip, r4, \[r8\] 0+040 <[^>]*> e320f002 ? wfe 0+044 <[^>]*> e320f003 ? wfi 0+048 <[^>]*> e320f001 ? yield diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/arch6zk.s binutils-2.16.91.0.1/gas/testsuite/gas/arm/arch6zk.s --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/arch6zk.s 2005-04-09 12:03:12.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/arch6zk.s 2005-06-22 13:53:35.144277832 -0700 @@ -4,21 +4,21 @@ label: # ARMV6K instructions clrex - ldrexb r3, [r12] - ldrexbne r12, [r3] - ldrexd r3, [r12] - ldrexdne r12, [r3] - ldrexh r3, [r12] - ldrexhne r12, [r3] - nop {128} - nopne {127} + ldrexb r4, [r12] + ldrexbne r12, [r4] + ldrexd r4, [r12] + ldrexdne r12, [r4] + ldrexh r4, [r12] + ldrexhne r12, [r4] + nop {128} + nopne {127} sev - strexb r3, r12, [r7] - strexbne r12, r3, [r8] - strexd r3, r12, [r7] - strexdne r12, r3, [r8] - strexh r3, r12, [r7] - strexhne r12, r3, [r8] + strexb r4, r12, [r7] + strexbne r12, r4, [r8] + strexd r4, r12, [r7] + strexdne r12, r4, [r8] + strexh r4, r12, [r7] + strexhne r12, r4, [r8] wfe wfi yield diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/arm3.d binutils-2.16.91.0.1/gas/testsuite/gas/arm/arm3.d --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/arm3.d 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/arm3.d 2005-06-22 13:53:35.149277006 -0700 @@ -0,0 +1,11 @@ +# name: ARM 3 instructions +# as: -mcpu=arm3 +# objdump: -dr --prefix-addresses --show-raw-insn + +.*: +file format .*arm.* + +Disassembly of section .text: +0+0 <[^>]*> e1080091 ? swp r0, r1, \[r8\] +0+4 <[^>]*> e1432093 ? swpb r2, r3, \[r3\] +0+8 <[^>]*> a1444091 ? swpgeb r4, r1, \[r4\] +0+c <[^>]*> e1a00000 ? nop \(mov r0,r0\) diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/arm3.s binutils-2.16.91.0.1/gas/testsuite/gas/arm/arm3.s --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/arm3.s 1999-06-03 11:02:02.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/arm3.s 2005-06-22 13:53:35.149277006 -0700 @@ -1,6 +1,7 @@ -.text -.align 0 + .text + .align 0 +l: swp r0, r1, [r8] swpb r2, r3, [r3] swpgeb r4, r1, [r4] - + nop diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/arm6.d binutils-2.16.91.0.1/gas/testsuite/gas/arm/arm6.d --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/arm6.d 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/arm6.d 2005-06-22 13:53:35.150276841 -0700 @@ -0,0 +1,19 @@ +# name: ARM 6 instructions +# as: -mcpu=arm6 +# objdump: -dr --prefix-addresses --show-raw-insn + +.*: +file format .*arm.* + +Disassembly of section .text: +0+00 <[^>]+> e10f8000 ? mrs r8, CPSR +0+04 <[^>]+> e14f2000 ? mrs r2, SPSR +0+08 <[^>]+> e129f001 ? msr CPSR_fc, r1 +0+0c <[^>]+> 1328f20f ? msrne CPSR_f, #-268435456 ; 0xf0000000 +0+10 <[^>]+> e168f008 ? msr SPSR_f, r8 +0+14 <[^>]+> e169f009 ? msr SPSR_fc, r9 +0+18 <[^>]+> e10f8000 ? mrs r8, CPSR +0+1c <[^>]+> e14f2000 ? mrs r2, SPSR +0+20 <[^>]+> e129f001 ? msr CPSR_fc, r1 +0+24 <[^>]+> 1328f20f ? msrne CPSR_f, #-268435456 ; 0xf0000000 +0+28 <[^>]+> e168f008 ? msr SPSR_f, r8 +0+2c <[^>]+> e169f009 ? msr SPSR_fc, r9 diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/arm6.s binutils-2.16.91.0.1/gas/testsuite/gas/arm/arm6.s --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/arm6.s 2001-01-23 11:00:16.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/arm6.s 2005-06-22 13:53:35.168273867 -0700 @@ -1,6 +1,6 @@ -.text -.align 0 - + .text + .align 0 +l: mrs r8, cpsr mrs r2, spsr @@ -16,4 +16,3 @@ msrne CPSR_flg, #0xf0000000 msr SPSR_flg, r8 msr SPSR_all, r9 - diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/arm7dm.d binutils-2.16.91.0.1/gas/testsuite/gas/arm/arm7dm.d --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/arm7dm.d 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/arm7dm.d 2005-06-22 13:53:35.168273867 -0700 @@ -0,0 +1,19 @@ +# name: ARM 7DM instructions +# as: -mcpu=arm7dm +# objdump: -dr --prefix-addresses --show-raw-insn + +.*: +file format .*arm.* + +Disassembly of section .text: +0+00 <[^>]+> e0c10392 ? smull r0, r1, r2, r3 +0+04 <[^>]+> e0810392 ? umull r0, r1, r2, r3 +0+08 <[^>]+> e0e10392 ? smlal r0, r1, r2, r3 +0+0c <[^>]+> e0a10394 ? umlal r0, r1, r4, r3 +0+10 <[^>]+> 10c10493 ? smullne r0, r1, r3, r4 +0+14 <[^>]+> e0d01b99 ? smulls r1, r0, r9, fp +0+18 <[^>]+> 00b92994 ? umlaleqs r2, r9, r4, r9 +0+1c <[^>]+> a0eaee98 ? smlalge lr, sl, r8, lr +0+20 <[^>]+> e322f000 ? msr CPSR_x, #0 ; 0x0 +0+24 <[^>]+> e1a00000 ? nop \(mov r0,r0\) +0+28 <[^>]+> e1a00000 ? nop \(mov r0,r0\) +0+2c <[^>]+> e1a00000 ? nop \(mov r0,r0\) diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/arm7dm.s binutils-2.16.91.0.1/gas/testsuite/gas/arm/arm7dm.s --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/arm7dm.s 2001-06-23 00:05:22.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/arm7dm.s 2005-06-22 13:53:35.169273702 -0700 @@ -1,6 +1,6 @@ -.text -.align 0 - + .text + .align 0 +l: smull r0, r1, r2, r3 umull r0, r1, r2, r3 smlal r0, r1, r2, r3 @@ -11,4 +11,10 @@ umlaleqs r2, r9, r4, r9 smlalge r14, r10, r8, r14 - msr CPSR_x, #0 @ This used to be illegal, but rev 2 of the ARM ARM allows it. + @ This used to be illegal, but rev 2 of the ARM ARM allows it. + msr CPSR_x, #0 + + @ padding for a.out's sake + nop + nop + nop diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/arm.exp binutils-2.16.91.0.1/gas/testsuite/gas/arm/arm.exp --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/arm.exp 2005-04-09 12:03:12.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/arm.exp 2005-06-22 13:53:35.149277006 -0700 @@ -28,14 +28,13 @@ if {[istarget *arm*-*-*] || [istarget "x run_dump_test "copro" } - gas_test "arm3.s" "-mcpu=arm3" $stdoptlist "Arm 3 instructions" - gas_test "arm6.s" "-mcpu=arm6" $stdoptlist "Arm 6 instructions" - gas_test "arm7dm.s" "-mcpu=arm7dm" $stdoptlist "Arm 7DM instructions" - gas_test "arch4t.s" "-march=armv4t" $stdoptlist "Arm architecture 4t instructions" - gas_test "immed.s" "" $stdoptlist "immediate expressions" - gas_test "float.s" "-mcpu=arm7tdmi -mfpu=fpa" $stdoptlist "Core floating point instructions" - gas_test "offset.s" "" $stdoptlist "OFFSET_IMM regression" - + run_dump_test "arm3" + run_dump_test "arm6" + run_dump_test "arm7dm" + run_dump_test "arch4t" + run_dump_test "immed" + run_dump_test "float" + run_dump_test "offset" run_dump_test "armv1" run_dump_test "arch5tej" run_dump_test "fpa-monadic" @@ -53,12 +52,18 @@ if {[istarget *arm*-*-*] || [istarget "x run_dump_test "thumbv6" run_dump_test "thumbv6k" run_dump_test "arch6zk" + run_dump_test "tcompat" + run_dump_test "tcompat2" + run_dump_test "iwmmxt" + run_dump_test "macro1" run_errors_test "vfp-bad" "-mfpu=vfp" "VFP errors" run_errors_test "req" "-mcpu=arm7m" ".req errors" run_errors_test "armv1-bad" "-mcpu=arm7m" "ARM v1 errors" run_errors_test "r15-bad" "" "Invalid use of r15 errors" run_errors_test "archv6t2-bad" "-march=armv6t2" "Invalid V6T2 instructions" + run_errors_test "t16-bad" "-march=armv6k" "Valid ARM, invalid Thumb" + run_errors_test "iwmmxt-bad" "-mcpu=iwmmxt" "iWMMXt errors" if {[istarget *-*-*coff] || [istarget *-*-pe] || [istarget *-*-wince] || [istarget *-*-*aout*] || [istarget *-*-netbsd] || [istarget *-*-riscix*]} then { @@ -70,29 +75,20 @@ if {[istarget *arm*-*-*] || [istarget "x run_dump_test "pic" run_dump_test "mapping" - gas_test "bignum1.s" "" $stdoptlist "bignums" + run_dump_test "bignum1" run_dump_test "unwind" - run_dump_test "tls" } + # The arm-aout port does not support Thumb branch relocations. if {! [istarget arm*-*-aout] && ![istarget arm-*-pe]} then { - # The arm-aout port does not support Thumb mode. - gas_test "thumb.s" "-mcpu=arm7t" $stdoptlist "Thumb instructions" + run_dump_test "thumb" + run_dump_test "thumb32" } -} - -# Not all arm targets are bi-endian, so only run this test on ones -# we know that are. FIXME: We should probably also key off armeb/armel. -if [istarget arm-*-pe] { - run_dump_test "le-fpconst" - - # Since big-endian numbers have the normal format, this doesn't exist. - #run_dump_test "be-fpconst" -} - -if [istarget xscale-*] { - run_dump_test "iwmmxt" - run_errors_test "iwmmxt-bad" "-mcpu=iwmmxt" "iWMMXt errors" + # Not all arm targets are bi-endian, so only run this test on ones + # we know that are. FIXME: We should probably also key off armeb/armel. + if [istarget *-*-pe] { + run_dump_test "le-fpconst" + } } diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/armv1-bad.l binutils-2.16.91.0.1/gas/testsuite/gas/arm/armv1-bad.l --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/armv1-bad.l 2002-09-27 08:33:09.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/armv1-bad.l 2005-06-22 13:53:35.182271555 -0700 @@ -1,12 +1,9 @@ [^:]*: Assembler messages: [^:]*:4: Error: invalid pseudo operation -- `str r0,=0x00ff0000' [^:]*:5: Error: bad expression -- `ldr r0,{r1}' -[^:]*:6: Error: address offset too large -- `ldr r0,\[r1,#4096\]' -[^:]*:7: Error: address offset too large -- `ldr r0,\[r1,#-4096\]' -[^:]*:8: Error: invalid constant -- `mov r0,#0x1ff' -[^:]*:9: Error: bad instruction `cmpl r0,r0' -[^:]*:10: Error: selected processor does not support `strh r0,\[r1\]' -[^:]*:11: Warning: writeback of base register is UNPREDICTABLE -[^:]*:12: Warning: writeback of base register when in register list is UNPREDICTABLE -[^:]*:13: Warning: writeback of base register is UNPREDICTABLE -[^:]*:15: Warning: if writeback register is in list, it must be the lowest reg in the list +[^:]*:6: Error: bad instruction `cmpl r0,r0' +[^:]*:7: Error: selected processor does not support `strh r0,\[r1\]' +[^:]*:8: Warning: writeback of base register is UNPREDICTABLE +[^:]*:9: Warning: writeback of base register when in register list is UNPREDICTABLE +[^:]*:10: Warning: writeback of base register is UNPREDICTABLE +[^:]*:12: Warning: if writeback register is in list, it must be the lowest reg in the list diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/armv1-bad.s binutils-2.16.91.0.1/gas/testsuite/gas/arm/armv1-bad.s --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/armv1-bad.s 2002-09-27 08:33:09.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/armv1-bad.s 2005-06-22 13:53:35.183271389 -0700 @@ -3,9 +3,6 @@ entry: str r0, =0x00ff0000 ldr r0, {r1} - ldr r0, [r1, #4096] - ldr r0, [r1, #-4096] - mov r0, #0x1ff cmpl r0, r0 strh r0, [r1] ldmfa r4!, {r8, r9}^ diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/bignum1.d binutils-2.16.91.0.1/gas/testsuite/gas/arm/bignum1.d --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/bignum1.d 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/bignum1.d 2005-06-22 13:53:35.183271389 -0700 @@ -0,0 +1,8 @@ +# name: bignums +# as: +# objdump: --full-contents + +.*: +file format .*arm.* + +Contents of section .data: + 0000 [08]0000000 000000[08]0 11111111 11111111 \.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\. diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/bignum1.s binutils-2.16.91.0.1/gas/testsuite/gas/arm/bignum1.s --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/bignum1.s 2004-09-15 12:05:04.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/bignum1.s 2005-06-22 13:53:35.183271389 -0700 @@ -1 +1,3 @@ + .data .8byte -9223372036854775808 + .8byte 1229782938247303441 diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/float.d binutils-2.16.91.0.1/gas/testsuite/gas/arm/float.d --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/float.d 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/float.d 2005-06-22 13:53:35.184271224 -0700 @@ -0,0 +1,131 @@ +# name: Core floating point instructions +# as: -mcpu=arm7tdmi -mfpu=fpa +# objdump: -dr --prefix-addresses --show-raw-insn + +.*: +file format .*arm.* + +Disassembly of section .text: +0+000 <[^>]+> ee088101 ? mvfe f0, f1 +0+004 <[^>]+> 0e08b105 ? mvfeqe f3, f5 +0+008 <[^>]+> 0e00c189 ? mvfeqd f4, #1\.0 +0+00c <[^>]+> ee00c107 ? mvfs f4, f7 +0+010 <[^>]+> ee008121 ? mvfsp f0, f1 +0+014 <[^>]+> ee00b1c4 ? mvfdm f3, f4 +0+018 <[^>]+> ee08f167 ? mvfez f7, f7 +0+01c <[^>]+> ee09010a ? adfe f0, f1, #2\.0 +0+020 <[^>]+> 0e0a110e ? adfeqe f1, f2, #0\.5 +0+024 <[^>]+> ee043145 ? adfsm f3, f4, f5 +0+028 <[^>]+> ee20018a ? sufd f0, f0, #2\.0 +0+02c <[^>]+> ee22110f ? sufs f1, f2, #10\.0 +0+030 <[^>]+> 1e2c3165 ? sufneez f3, f4, f5 +0+034 <[^>]+> ee311108 ? rsfs f1, f1, #0\.0 +0+038 <[^>]+> ee3031ad ? rsfdp f3, f0, #5\.0 +0+03c <[^>]+> de367180 ? rsfled f7, f6, f0 +0+040 <[^>]+> ee100180 ? mufd f0, f0, f0 +0+044 <[^>]+> ee1a116b ? mufez f1, f2, #3\.0 +0+048 <[^>]+> ee10010c ? mufs f0, f0, #4\.0 +0+04c <[^>]+> ee400189 ? dvfd f0, f0, #1\.0 +0+050 <[^>]+> ee49016f ? dvfez f0, f1, #10\.0 +0+054 <[^>]+> 4e443145 ? dvfmism f3, f4, f5 +0+058 <[^>]+> ee59010f ? rdfe f0, f1, #10\.0 +0+05c <[^>]+> ee573109 ? rdfs f3, f7, #1\.0 +0+060 <[^>]+> 3e5441a3 ? rdfccdp f4, f4, f3 +0+064 <[^>]+> ee620183 ? powd f0, f2, f3 +0+068 <[^>]+> ee63110f ? pows f1, f3, #10\.0 +0+06c <[^>]+> 2e6f4169 ? powcsez f4, f7, #1\.0 +0+070 <[^>]+> ee767107 ? rpws f7, f6, f7 +0+074 <[^>]+> 0e710182 ? rpweqd f0, f1, f2 +0+078 <[^>]+> ee7a2143 ? rpwem f2, f2, f3 +0+07c <[^>]+> ee82118b ? rmfd f1, f2, #3\.0 +0+080 <[^>]+> 6e843104 ? rmfvss f3, f4, f4 +0+084 <[^>]+> ee8f4120 ? rmfep f4, f7, f0 +0+088 <[^>]+> ee910102 ? fmls f0, f1, f2 +0+08c <[^>]+> 0e931105 ? fmleqs f1, f3, f5 +0+090 <[^>]+> 5e964160 ? fmlplsz f4, f6, f0 +0+094 <[^>]+> eea3110f ? fdvs f1, f3, #10\.0 +0+098 <[^>]+> eea10122 ? fdvsp f0, f1, f2 +0+09c <[^>]+> 2ea44144 ? fdvcssm f4, f4, f4 +0+0a0 <[^>]+> eeb11109 ? frds f1, f1, #1\.0 +0+0a4 <[^>]+> ceb12100 ? frdgts f2, f1, f0 +0+0a8 <[^>]+> ceb44165 ? frdgtsz f4, f4, f5 +0+0ac <[^>]+> eec10182 ? pold f0, f1, f2 +0+0b0 <[^>]+> eec6416b ? polsz f4, f6, #3\.0 +0+0b4 <[^>]+> 0ece5107 ? poleqe f5, f6, f7 +0+0b8 <[^>]+> ee108101 ? mnfs f0, f1 +0+0bc <[^>]+> ee10818b ? mnfd f0, #3\.0 +0+0c0 <[^>]+> ee18816c ? mnfez f0, #4\.0 +0+0c4 <[^>]+> 0e188165 ? mnfeqez f0, f5 +0+0c8 <[^>]+> ee108124 ? mnfsp f0, f4 +0+0cc <[^>]+> ee1091c7 ? mnfdm f1, f7 +0+0d0 <[^>]+> ee208181 ? absd f0, f1 +0+0d4 <[^>]+> ee20912b ? abssp f1, #3\.0 +0+0d8 <[^>]+> 0e28c105 ? abseqe f4, f5 +0+0dc <[^>]+> ee309102 ? rnds f1, f2 +0+0e0 <[^>]+> ee30b184 ? rndd f3, f4 +0+0e4 <[^>]+> 0e38e16c ? rndeqez f6, #4\.0 +0+0e8 <[^>]+> ee40d105 ? sqts f5, f5 +0+0ec <[^>]+> ee40e1a6 ? sqtdp f6, f6 +0+0f0 <[^>]+> 5e48f166 ? sqtplez f7, f6 +0+0f4 <[^>]+> ee50810f ? logs f0, #10\.0 +0+0f8 <[^>]+> ee58810f ? loge f0, #10\.0 +0+0fc <[^>]+> 1e5081e1 ? lognedz f0, f1 +0+100 <[^>]+> ee689102 ? lgne f1, f2 +0+104 <[^>]+> ee6091e3 ? lgndz f1, f3 +0+108 <[^>]+> 7e60b104 ? lgnvcs f3, f4 +0+10c <[^>]+> ee709103 ? exps f1, f3 +0+110 <[^>]+> ee78b14f ? expem f3, #10\.0 +0+114 <[^>]+> 5e70e187 ? exppld f6, f7 +0+118 <[^>]+> ee808181 ? sind f0, f1 +0+11c <[^>]+> ee809142 ? sinsm f1, f2 +0+120 <[^>]+> ce88c10d ? singte f4, #5\.0 +0+124 <[^>]+> ee909183 ? cosd f1, f3 +0+128 <[^>]+> ee98c145 ? cosem f4, f5 +0+12c <[^>]+> 1e90e1a1 ? cosnedp f6, f1 +0+130 <[^>]+> eea89105 ? tane f1, f5 +0+134 <[^>]+> eea0c167 ? tansz f4, f7 +0+138 <[^>]+> aea091ec ? tangedz f1, #4\.0 +0+13c <[^>]+> eeb8c105 ? asne f4, f5 +0+140 <[^>]+> eeb0e12e ? asnsp f6, #0\.5 +0+144 <[^>]+> 4eb0d1e5 ? asnmidz f5, f5 +0+148 <[^>]+> eec0d106 ? acss f5, f6 +0+14c <[^>]+> eec0e180 ? acsd f6, f0 +0+150 <[^>]+> 2ec8914e ? acscsem f1, #0\.5 +0+154 <[^>]+> eed88105 ? atne f0, f5 +0+158 <[^>]+> eed0916d ? atnsz f1, #5\.0 +0+15c <[^>]+> bed0b182 ? atnltd f3, f2 +0+160 <[^>]+> eee8d104 ? urde f5, f4 +0+164 <[^>]+> eef8e105 ? nrme f6, f5 +0+168 <[^>]+> 5ef0f1e5 ? nrmpldz f7, f5 +0+16c <[^>]+> ee008130 ? fltsp f0, r8 +0+170 <[^>]+> ee090110 ? flte f1, r0 +0+174 <[^>]+> 0e0571f0 ? flteqdz f5, r7 +0+178 <[^>]+> ee100111 ? fix r0, f1 +0+17c <[^>]+> ee101177 ? fixz r1, f7 +0+180 <[^>]+> 2e105155 ? fixcsm r5, f5 +0+184 <[^>]+> ee400110 ? wfc r0 +0+188 <[^>]+> ee201110 ? wfs r1 +0+18c <[^>]+> 0e302110 ? rfseq r2 +0+190 <[^>]+> ee504110 ? rfc r4 +0+194 <[^>]+> ee90f119 ? cmf f0, #1\.0 +0+198 <[^>]+> ee91f112 ? cmf f1, f2 +0+19c <[^>]+> 0e90f111 ? cmfeq f0, f1 +0+1a0 <[^>]+> eeb0f11b ? cnf f0, #3\.0 +0+1a4 <[^>]+> eeb1f11e ? cnf f1, #0\.5 +0+1a8 <[^>]+> 6eb3f114 ? cnfvs f3, f4 +0+1ac <[^>]+> eed0f111 ? cmfe f0, f1 +0+1b0 <[^>]+> 0ed1f112 ? cmfeeq f1, f2 +0+1b4 <[^>]+> 0ed3f11d ? cmfeeq f3, #5\.0 +0+1b8 <[^>]+> eef1f113 ? cnfe f1, f3 +0+1bc <[^>]+> 0ef3f114 ? cnfeeq f3, f4 +0+1c0 <[^>]+> 0ef4f117 ? cnfeeq f4, f7 +0+1c4 <[^>]+> eef4f11d ? cnfe f4, #5\.0 +0+1c8 <[^>]+> ed900200 ? lfm f0, 4, \[r0\] +0+1cc <[^>]+> ed900200 ? lfm f0, 4, \[r0\] +0+1d0 <[^>]+> ed911210 ? lfm f1, 4, \[r1, #64\] +0+1d4 <[^>]+> edae22ff ? sfm f2, 4, \[lr, #1020\]! +0+1d8 <[^>]+> 0c68f2ff ? sfmeq f7, 3, \[r8\], #-1020 +0+1dc <[^>]+> eddf6200 ? lfm f6, 2, \[pc\] +0+1e0 <[^>]+> eca8f203 ? sfm f7, 1, \[r8\], #12 +0+1e4 <[^>]+> 0d16520c ? lfmeq f5, 4, \[r6, #-48\] +0+1e8 <[^>]+> 1d42c209 ? sfmne f4, 3, \[r2, #-36\] +0+1ec <[^>]+> 1d62c209 ? sfmne f4, 3, \[r2, #-36\]! diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/float.s binutils-2.16.91.0.1/gas/testsuite/gas/arm/float.s --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/float.s 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/float.s 2005-06-22 13:53:35.184271224 -0700 @@ -1,5 +1,6 @@ -.text -.align 0 + .text + .align 0 +l: mvfe f0, f1 mvfeqe f3, f5 mvfeqd f4, #1.0 diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/immed.d binutils-2.16.91.0.1/gas/testsuite/gas/arm/immed.d --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/immed.d 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/immed.d 2005-06-22 13:53:35.184271224 -0700 @@ -0,0 +1,16 @@ +# name: immediate expressions +# as: +# objdump: -dr --prefix-addresses --show-raw-insn + +.*: +file format .*arm.* + +Disassembly of section .text: +0+0000 <[^>]+> e3a00000 ? mov r0, #0 ; 0x0 +0+0004 <[^>]+> e3e00003 ? mvn r0, #3 ; 0x3 +0+0008 <[^>]+> e51f0010 ? ldr r0, \[pc, #-16\] ; 0+0 <[^>]+> +0+000c <[^>]+> e51f0014 ? ldr r0, \[pc, #-20\] ; 0+0 <[^>]+> + \.\.\. +0+1010 <[^>]+> e3a00008 ? mov r0, #8 ; 0x8 +0+1014 <[^>]+> e59f00e4 ? ldr r0, \[pc, #228\] ; 0+1100 <[^>]+> +0+1018 <[^>]+> e1a00000 ? nop \(mov r0,r0\) +0+101c <[^>]+> e1a00000 ? nop \(mov r0,r0\) diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/immed.s binutils-2.16.91.0.1/gas/testsuite/gas/arm/immed.s --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/immed.s 1999-06-03 11:02:02.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/immed.s 2005-06-22 13:53:35.185271059 -0700 @@ -9,3 +9,7 @@ bar: .space 4096 mov r0, #(. - bar - 8) & 0xff ldr r0, [pc, # (bar - . -8) & 0xff] + + @ section padding for a.out's benefit + nop + nop diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/iwmmxt-bad.l binutils-2.16.91.0.1/gas/testsuite/gas/arm/iwmmxt-bad.l --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/iwmmxt-bad.l 2004-01-14 13:07:46.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/iwmmxt-bad.l 2005-06-22 13:53:35.185271059 -0700 @@ -1,9 +1,9 @@ [^:]*: Assembler messages: -[^:]*:1: Error: conditional execution not supported with control register -[^:]*:2: Error: non-word size not supported with control register -[^:]*:3: Error: non-word size not supported with control register -[^:]*:4: Error: non-word size not supported with control register -[^:]*:5: Error: conditional execution not supported with control register -[^:]*:6: Error: non-word size not supported with control register -[^:]*:7: Error: non-word size not supported with control register -[^:]*:8: Error: non-word size not supported with control register +[^:]*:1: Error: instruction cannot be conditional -- `wldrwgt wcgr0,\[r1\]' +[^:]*:2: Error: iWMMXt data register expected -- `wldrb wcgr0,\[r1\]' +[^:]*:3: Error: iWMMXt data register expected -- `wldrh wcgr0,\[r1\]' +[^:]*:4: Error: iWMMXt data register expected -- `wldrd wcgr0,\[r1\]' +[^:]*:5: Error: instruction cannot be conditional -- `wstrwgt wcgr0,\[r1\]' +[^:]*:6: Error: iWMMXt data register expected -- `wstrb wcgr0,\[r1\]' +[^:]*:7: Error: iWMMXt data register expected -- `wstrh wcgr0,\[r1\]' +[^:]*:8: Error: iWMMXt data register expected -- `wstrd wcgr0,\[r1\]' diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/iwmmxt.d binutils-2.16.91.0.1/gas/testsuite/gas/arm/iwmmxt.d --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/iwmmxt.d 2005-04-09 12:03:12.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/iwmmxt.d 2005-06-22 13:53:35.185271059 -0700 @@ -166,3 +166,6 @@ Disassembly of section .text: 0+278 <[^>]*> 0e9540ea[ ]+wunpckilweq[ ]+wr4, wr5, wr10 0+27c <[^>]*> 1e143005[ ]+wxorne[ ]+wr3, wr4, wr5 0+280 <[^>]*> ae377007[ ]+wandnge[ ]+wr7, wr7, wr7 +0+284 <[^>]*> e1a00000[ ]+nop[ ]+\(mov r0,r0\) +0+288 <[^>]*> e1a00000[ ]+nop[ ]+\(mov r0,r0\) +0+28c <[^>]*> e1a00000[ ]+nop[ ]+\(mov r0,r0\) diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/iwmmxt.s binutils-2.16.91.0.1/gas/testsuite/gas/arm/iwmmxt.s --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/iwmmxt.s 2005-04-09 12:03:12.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/iwmmxt.s 2005-06-22 13:53:35.186270894 -0700 @@ -202,3 +202,8 @@ iwmmxt: wxorne wr3, wr4, wr5 wzeroge wr7 + + @ a.out-required section size padding + nop + nop + nop diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/macro1.d binutils-2.16.91.0.1/gas/testsuite/gas/arm/macro1.d --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/macro1.d 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/macro1.d 2005-06-22 13:53:35.186270894 -0700 @@ -0,0 +1,12 @@ +# name: Macro scrubbing +# as: +# objdump: -dr --prefix-addresses --show-raw-insn + +[^:]+: +file format .*arm.* + +Disassembly of section .text: + +0+0 <[^>]*> e8bd8030 ? ldmia sp!, {r4, r5, pc} +0+4 <[^>]*> e1a00000 ? nop \(mov r0,r0\) +0+8 <[^>]*> e1a00000 ? nop \(mov r0,r0\) +0+c <[^>]*> e1a00000 ? nop \(mov r0,r0\) diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/macro1.s binutils-2.16.91.0.1/gas/testsuite/gas/arm/macro1.s --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/macro1.s 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/macro1.s 2005-06-22 13:53:35.186270894 -0700 @@ -0,0 +1,12 @@ + @ Test that macro expansions are properly scrubbed. + .macro popret regs + ldmia sp!, {\regs, pc} + .endm + .text +l: + popret "r4, r5" + + @ section padding for a.out's sake + nop + nop + nop diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/maverick.d binutils-2.16.91.0.1/gas/testsuite/gas/arm/maverick.d --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/maverick.d 2004-05-27 11:26:04.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/maverick.d 2005-06-22 13:53:35.187270729 -0700 @@ -13,121 +13,121 @@ Disassembly of section .text: 0*8 7d ?1c ?24 ?ef ? * cfldrsvc mvf2, ?\[ip, #-956\] 0*c bd ?1a ?04 ?ff ? * cfldrslt mvf0, ?\[sl, #-1020\] 0*10 3d ?11 ?c4 ?27 ? * cfldrscc mvf12, ?\[r1, #-156\] -0*14 ed ?bf ?d4 ?68 ? * cfldrs mvf13, ?\[pc, #416\]! +0*14 ed ?b9 ?d4 ?68 ? * cfldrs mvf13, ?\[r9, #416\]! 0*18 2d ?30 ?94 ?ff ? * cfldrscs mvf9, ?\[r0, #-1020\]! 0*1c 9d ?31 ?44 ?27 ? * cfldrsls mvf4, ?\[r1, #-156\]! -0*20 dd ?bf ?74 ?68 ? * cfldrsle mvf7, ?\[pc, #416\]! +0*20 dd ?b9 ?74 ?68 ? * cfldrsle mvf7, ?\[r9, #416\]! 0*24 6d ?30 ?b4 ?ff ? * cfldrsvs mvf11, ?\[r0, #-1020\]! 0*28 3c ?31 ?c4 ?27 ? * cfldrscc mvf12, ?\[r1\], #-156 -0*2c ec ?bf ?d4 ?68 ? * cfldrs mvf13, ?\[pc\], #416 +0*2c ec ?b9 ?d4 ?68 ? * cfldrs mvf13, ?\[r9\], #416 0*30 2c ?30 ?94 ?ff ? * cfldrscs mvf9, ?\[r0\], #-1020 0*34 9c ?31 ?44 ?27 ? * cfldrsls mvf4, ?\[r1\], #-156 -0*38 dc ?bf ?74 ?68 ? * cfldrsle mvf7, ?\[pc\], #416 +0*38 dc ?b9 ?74 ?68 ? * cfldrsle mvf7, ?\[r9\], #416 0*3c 6d ?50 ?b4 ?ff ? * cfldrdvs mvd11, ?\[r0, #-1020\] 0*40 3d ?51 ?c4 ?27 ? * cfldrdcc mvd12, ?\[r1, #-156\] -0*44 ed ?df ?d4 ?68 ? * cfldrd mvd13, ?\[pc, #416\] +0*44 ed ?d9 ?d4 ?68 ? * cfldrd mvd13, ?\[r9, #416\] 0*48 2d ?50 ?94 ?ff ? * cfldrdcs mvd9, ?\[r0, #-1020\] 0*4c 9d ?51 ?44 ?27 ? * cfldrdls mvd4, ?\[r1, #-156\] -0*50 dd ?ff ?74 ?68 ? * cfldrdle mvd7, ?\[pc, #416\]! +0*50 dd ?f9 ?74 ?68 ? * cfldrdle mvd7, ?\[r9, #416\]! 0*54 6d ?70 ?b4 ?ff ? * cfldrdvs mvd11, ?\[r0, #-1020\]! 0*58 3d ?71 ?c4 ?27 ? * cfldrdcc mvd12, ?\[r1, #-156\]! -0*5c ed ?ff ?d4 ?68 ? * cfldrd mvd13, ?\[pc, #416\]! +0*5c ed ?f9 ?d4 ?68 ? * cfldrd mvd13, ?\[r9, #416\]! 0*60 2d ?70 ?94 ?ff ? * cfldrdcs mvd9, ?\[r0, #-1020\]! 0*64 9c ?71 ?44 ?27 ? * cfldrdls mvd4, ?\[r1\], #-156 -0*68 dc ?ff ?74 ?68 ? * cfldrdle mvd7, ?\[pc\], #416 +0*68 dc ?f9 ?74 ?68 ? * cfldrdle mvd7, ?\[r9\], #416 0*6c 6c ?70 ?b4 ?ff ? * cfldrdvs mvd11, ?\[r0\], #-1020 0*70 3c ?71 ?c4 ?27 ? * cfldrdcc mvd12, ?\[r1\], #-156 -0*74 ec ?ff ?d4 ?68 ? * cfldrd mvd13, ?\[pc\], #416 +0*74 ec ?f9 ?d4 ?68 ? * cfldrd mvd13, ?\[r9\], #416 0*78 2d ?10 ?95 ?ff ? * cfldr32cs mvfx9, ?\[r0, #-1020\] 0*7c 9d ?11 ?45 ?27 ? * cfldr32ls mvfx4, ?\[r1, #-156\] -0*80 dd ?9f ?75 ?68 ? * cfldr32le mvfx7, ?\[pc, #416\] +0*80 dd ?99 ?75 ?68 ? * cfldr32le mvfx7, ?\[r9, #416\] 0*84 6d ?10 ?b5 ?ff ? * cfldr32vs mvfx11, ?\[r0, #-1020\] 0*88 3d ?11 ?c5 ?27 ? * cfldr32cc mvfx12, ?\[r1, #-156\] -0*8c ed ?bf ?d5 ?68 ? * cfldr32 mvfx13, ?\[pc, #416\]! +0*8c ed ?b9 ?d5 ?68 ? * cfldr32 mvfx13, ?\[r9, #416\]! 0*90 2d ?30 ?95 ?ff ? * cfldr32cs mvfx9, ?\[r0, #-1020\]! 0*94 9d ?31 ?45 ?27 ? * cfldr32ls mvfx4, ?\[r1, #-156\]! -0*98 dd ?bf ?75 ?68 ? * cfldr32le mvfx7, ?\[pc, #416\]! +0*98 dd ?b9 ?75 ?68 ? * cfldr32le mvfx7, ?\[r9, #416\]! 0*9c 6d ?30 ?b5 ?ff ? * cfldr32vs mvfx11, ?\[r0, #-1020\]! 0*a0 3c ?31 ?c5 ?27 ? * cfldr32cc mvfx12, ?\[r1\], #-156 -0*a4 ec ?bf ?d5 ?68 ? * cfldr32 mvfx13, ?\[pc\], #416 +0*a4 ec ?b9 ?d5 ?68 ? * cfldr32 mvfx13, ?\[r9\], #416 0*a8 2c ?30 ?95 ?ff ? * cfldr32cs mvfx9, ?\[r0\], #-1020 0*ac 9c ?31 ?45 ?27 ? * cfldr32ls mvfx4, ?\[r1\], #-156 -0*b0 dc ?bf ?75 ?68 ? * cfldr32le mvfx7, ?\[pc\], #416 +0*b0 dc ?b9 ?75 ?68 ? * cfldr32le mvfx7, ?\[r9\], #416 0*b4 6d ?50 ?b5 ?ff ? * cfldr64vs mvdx11, ?\[r0, #-1020\] 0*b8 3d ?51 ?c5 ?27 ? * cfldr64cc mvdx12, ?\[r1, #-156\] -0*bc ed ?df ?d5 ?68 ? * cfldr64 mvdx13, ?\[pc, #416\] +0*bc ed ?d9 ?d5 ?68 ? * cfldr64 mvdx13, ?\[r9, #416\] 0*c0 2d ?50 ?95 ?ff ? * cfldr64cs mvdx9, ?\[r0, #-1020\] 0*c4 9d ?51 ?45 ?27 ? * cfldr64ls mvdx4, ?\[r1, #-156\] -0*c8 dd ?ff ?75 ?68 ? * cfldr64le mvdx7, ?\[pc, #416\]! +0*c8 dd ?f9 ?75 ?68 ? * cfldr64le mvdx7, ?\[r9, #416\]! 0*cc 6d ?70 ?b5 ?ff ? * cfldr64vs mvdx11, ?\[r0, #-1020\]! 0*d0 3d ?71 ?c5 ?27 ? * cfldr64cc mvdx12, ?\[r1, #-156\]! -0*d4 ed ?ff ?d5 ?68 ? * cfldr64 mvdx13, ?\[pc, #416\]! +0*d4 ed ?f9 ?d5 ?68 ? * cfldr64 mvdx13, ?\[r9, #416\]! 0*d8 2d ?70 ?95 ?ff ? * cfldr64cs mvdx9, ?\[r0, #-1020\]! 0*dc 9c ?71 ?45 ?27 ? * cfldr64ls mvdx4, ?\[r1\], #-156 -0*e0 dc ?ff ?75 ?68 ? * cfldr64le mvdx7, ?\[pc\], #416 +0*e0 dc ?f9 ?75 ?68 ? * cfldr64le mvdx7, ?\[r9\], #416 0*e4 6c ?70 ?b5 ?ff ? * cfldr64vs mvdx11, ?\[r0\], #-1020 0*e8 3c ?71 ?c5 ?27 ? * cfldr64cc mvdx12, ?\[r1\], #-156 -0*ec ec ?ff ?d5 ?68 ? * cfldr64 mvdx13, ?\[pc\], #416 +0*ec ec ?f9 ?d5 ?68 ? * cfldr64 mvdx13, ?\[r9\], #416 0*f0 2d ?00 ?94 ?ff ? * cfstrscs mvf9, ?\[r0, #-1020\] 0*f4 9d ?01 ?44 ?27 ? * cfstrsls mvf4, ?\[r1, #-156\] -0*f8 dd ?8f ?74 ?68 ? * cfstrsle mvf7, ?\[pc, #416\] +0*f8 dd ?89 ?74 ?68 ? * cfstrsle mvf7, ?\[r9, #416\] 0*fc 6d ?00 ?b4 ?ff ? * cfstrsvs mvf11, ?\[r0, #-1020\] 0*100 3d ?01 ?c4 ?27 ? * cfstrscc mvf12, ?\[r1, #-156\] -0*104 ed ?af ?d4 ?68 ? * cfstrs mvf13, ?\[pc, #416\]! +0*104 ed ?a9 ?d4 ?68 ? * cfstrs mvf13, ?\[r9, #416\]! 0*108 2d ?20 ?94 ?ff ? * cfstrscs mvf9, ?\[r0, #-1020\]! 0*10c 9d ?21 ?44 ?27 ? * cfstrsls mvf4, ?\[r1, #-156\]! -0*110 dd ?af ?74 ?68 ? * cfstrsle mvf7, ?\[pc, #416\]! +0*110 dd ?a9 ?74 ?68 ? * cfstrsle mvf7, ?\[r9, #416\]! 0*114 6d ?20 ?b4 ?ff ? * cfstrsvs mvf11, ?\[r0, #-1020\]! 0*118 3c ?21 ?c4 ?27 ? * cfstrscc mvf12, ?\[r1\], #-156 -0*11c ec ?af ?d4 ?68 ? * cfstrs mvf13, ?\[pc\], #416 +0*11c ec ?a9 ?d4 ?68 ? * cfstrs mvf13, ?\[r9\], #416 0*120 2c ?20 ?94 ?ff ? * cfstrscs mvf9, ?\[r0\], #-1020 0*124 9c ?21 ?44 ?27 ? * cfstrsls mvf4, ?\[r1\], #-156 -0*128 dc ?af ?74 ?68 ? * cfstrsle mvf7, ?\[pc\], #416 +0*128 dc ?a9 ?74 ?68 ? * cfstrsle mvf7, ?\[r9\], #416 0*12c 6d ?40 ?b4 ?ff ? * cfstrdvs mvd11, ?\[r0, #-1020\] 0*130 3d ?41 ?c4 ?27 ? * cfstrdcc mvd12, ?\[r1, #-156\] -0*134 ed ?cf ?d4 ?68 ? * cfstrd mvd13, ?\[pc, #416\] +0*134 ed ?c9 ?d4 ?68 ? * cfstrd mvd13, ?\[r9, #416\] 0*138 2d ?40 ?94 ?ff ? * cfstrdcs mvd9, ?\[r0, #-1020\] 0*13c 9d ?41 ?44 ?27 ? * cfstrdls mvd4, ?\[r1, #-156\] -0*140 dd ?ef ?74 ?68 ? * cfstrdle mvd7, ?\[pc, #416\]! +0*140 dd ?e9 ?74 ?68 ? * cfstrdle mvd7, ?\[r9, #416\]! 0*144 6d ?60 ?b4 ?ff ? * cfstrdvs mvd11, ?\[r0, #-1020\]! 0*148 3d ?61 ?c4 ?27 ? * cfstrdcc mvd12, ?\[r1, #-156\]! -0*14c ed ?ef ?d4 ?68 ? * cfstrd mvd13, ?\[pc, #416\]! +0*14c ed ?e9 ?d4 ?68 ? * cfstrd mvd13, ?\[r9, #416\]! 0*150 2d ?60 ?94 ?ff ? * cfstrdcs mvd9, ?\[r0, #-1020\]! 0*154 9c ?61 ?44 ?27 ? * cfstrdls mvd4, ?\[r1\], #-156 -0*158 dc ?ef ?74 ?68 ? * cfstrdle mvd7, ?\[pc\], #416 +0*158 dc ?e9 ?74 ?68 ? * cfstrdle mvd7, ?\[r9\], #416 0*15c 6c ?60 ?b4 ?ff ? * cfstrdvs mvd11, ?\[r0\], #-1020 0*160 3c ?61 ?c4 ?27 ? * cfstrdcc mvd12, ?\[r1\], #-156 -0*164 ec ?ef ?d4 ?68 ? * cfstrd mvd13, ?\[pc\], #416 +0*164 ec ?e9 ?d4 ?68 ? * cfstrd mvd13, ?\[r9\], #416 0*168 2d ?00 ?95 ?ff ? * cfstr32cs mvfx9, ?\[r0, #-1020\] 0*16c 9d ?01 ?45 ?27 ? * cfstr32ls mvfx4, ?\[r1, #-156\] -0*170 dd ?8f ?75 ?68 ? * cfstr32le mvfx7, ?\[pc, #416\] +0*170 dd ?89 ?75 ?68 ? * cfstr32le mvfx7, ?\[r9, #416\] 0*174 6d ?00 ?b5 ?ff ? * cfstr32vs mvfx11, ?\[r0, #-1020\] 0*178 3d ?01 ?c5 ?27 ? * cfstr32cc mvfx12, ?\[r1, #-156\] -0*17c ed ?af ?d5 ?68 ? * cfstr32 mvfx13, ?\[pc, #416\]! +0*17c ed ?a9 ?d5 ?68 ? * cfstr32 mvfx13, ?\[r9, #416\]! 0*180 2d ?20 ?95 ?ff ? * cfstr32cs mvfx9, ?\[r0, #-1020\]! 0*184 9d ?21 ?45 ?27 ? * cfstr32ls mvfx4, ?\[r1, #-156\]! -0*188 dd ?af ?75 ?68 ? * cfstr32le mvfx7, ?\[pc, #416\]! +0*188 dd ?a9 ?75 ?68 ? * cfstr32le mvfx7, ?\[r9, #416\]! 0*18c 6d ?20 ?b5 ?ff ? * cfstr32vs mvfx11, ?\[r0, #-1020\]! 0*190 3c ?21 ?c5 ?27 ? * cfstr32cc mvfx12, ?\[r1\], #-156 -0*194 ec ?af ?d5 ?68 ? * cfstr32 mvfx13, ?\[pc\], #416 +0*194 ec ?a9 ?d5 ?68 ? * cfstr32 mvfx13, ?\[r9\], #416 0*198 2c ?20 ?95 ?ff ? * cfstr32cs mvfx9, ?\[r0\], #-1020 0*19c 9c ?21 ?45 ?27 ? * cfstr32ls mvfx4, ?\[r1\], #-156 -0*1a0 dc ?af ?75 ?68 ? * cfstr32le mvfx7, ?\[pc\], #416 +0*1a0 dc ?a9 ?75 ?68 ? * cfstr32le mvfx7, ?\[r9\], #416 0*1a4 6d ?40 ?b5 ?ff ? * cfstr64vs mvdx11, ?\[r0, #-1020\] 0*1a8 3d ?41 ?c5 ?27 ? * cfstr64cc mvdx12, ?\[r1, #-156\] -0*1ac ed ?cf ?d5 ?68 ? * cfstr64 mvdx13, ?\[pc, #416\] +0*1ac ed ?c9 ?d5 ?68 ? * cfstr64 mvdx13, ?\[r9, #416\] 0*1b0 2d ?40 ?95 ?ff ? * cfstr64cs mvdx9, ?\[r0, #-1020\] 0*1b4 9d ?41 ?45 ?27 ? * cfstr64ls mvdx4, ?\[r1, #-156\] -0*1b8 dd ?ef ?75 ?68 ? * cfstr64le mvdx7, ?\[pc, #416\]! +0*1b8 dd ?e9 ?75 ?68 ? * cfstr64le mvdx7, ?\[r9, #416\]! 0*1bc 6d ?60 ?b5 ?ff ? * cfstr64vs mvdx11, ?\[r0, #-1020\]! 0*1c0 3d ?61 ?c5 ?27 ? * cfstr64cc mvdx12, ?\[r1, #-156\]! -0*1c4 ed ?ef ?d5 ?68 ? * cfstr64 mvdx13, ?\[pc, #416\]! +0*1c4 ed ?e9 ?d5 ?68 ? * cfstr64 mvdx13, ?\[r9, #416\]! 0*1c8 2d ?60 ?95 ?ff ? * cfstr64cs mvdx9, ?\[r0, #-1020\]! 0*1cc 9c ?61 ?45 ?27 ? * cfstr64ls mvdx4, ?\[r1\], #-156 -0*1d0 dc ?ef ?75 ?68 ? * cfstr64le mvdx7, ?\[pc\], #416 +0*1d0 dc ?e9 ?75 ?68 ? * cfstr64le mvdx7, ?\[r9\], #416 0*1d4 6c ?60 ?b5 ?ff ? * cfstr64vs mvdx11, ?\[r0\], #-1020 0*1d8 3c ?61 ?c5 ?27 ? * cfstr64cc mvdx12, ?\[r1\], #-156 -0*1dc ec ?ef ?d5 ?68 ? * cfstr64 mvdx13, ?\[pc\], #416 +0*1dc ec ?e9 ?d5 ?68 ? * cfstr64 mvdx13, ?\[r9\], #416 # move: 0*1e0 2e ?09 ?04 ?50 ? * cfmvsrcs mvf9, ?r0 0*1e4 5e ?0f ?74 ?50 ? * cfmvsrpl mvf15, ?r7 diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/maverick.s binutils-2.16.91.0.1/gas/testsuite/gas/arm/maverick.s --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/maverick.s 2004-05-27 11:26:04.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/maverick.s 2005-06-22 13:53:35.188270563 -0700 @@ -6,121 +6,121 @@ load_store: cfldrsvc mvf2, [r12, #-956] cfldrslt mvf0, [sl, #-1020] cfldrscc mvf12, [r1, #-156] - cfldrs mvf13, [r15, #416]! + cfldrs mvf13, [r9, #416]! cfldrscs mvf9, [r0, #-1020]! cfldrsls mvf4, [r1, #-156]! - cfldrsle mvf7, [pc, #416]! + cfldrsle mvf7, [r9, #416]! cfldrsvs mvf11, [r0, #-1020]! cfldrscc mvf12, [r1], #-156 - cfldrs mvf13, [r15], #416 + cfldrs mvf13, [r9], #416 cfldrscs mvf9, [r0], #-1020 cfldrsls mvf4, [r1], #-156 - cfldrsle mvf7, [pc], #416 + cfldrsle mvf7, [r9], #416 cfldrdvs mvd11, [r0, #-1020] cfldrdcc mvd12, [r1, #-156] - cfldrd mvd13, [r15, #416] + cfldrd mvd13, [r9, #416] cfldrdcs mvd9, [r0, #-1020] cfldrdls mvd4, [r1, #-156] - cfldrdle mvd7, [pc, #416]! + cfldrdle mvd7, [r9, #416]! cfldrdvs mvd11, [r0, #-1020]! cfldrdcc mvd12, [r1, #-156]! - cfldrd mvd13, [r15, #416]! + cfldrd mvd13, [r9, #416]! cfldrdcs mvd9, [r0, #-1020]! cfldrdls mvd4, [r1], #-156 - cfldrdle mvd7, [pc], #416 + cfldrdle mvd7, [r9], #416 cfldrdvs mvd11, [r0], #-1020 cfldrdcc mvd12, [r1], #-156 - cfldrd mvd13, [r15], #416 + cfldrd mvd13, [r9], #416 cfldr32cs mvfx9, [r0, #-1020] cfldr32ls mvfx4, [r1, #-156] - cfldr32le mvfx7, [pc, #416] + cfldr32le mvfx7, [r9, #416] cfldr32vs mvfx11, [r0, #-1020] cfldr32cc mvfx12, [r1, #-156] - cfldr32 mvfx13, [r15, #416]! + cfldr32 mvfx13, [r9, #416]! cfldr32cs mvfx9, [r0, #-1020]! cfldr32ls mvfx4, [r1, #-156]! - cfldr32le mvfx7, [pc, #416]! + cfldr32le mvfx7, [r9, #416]! cfldr32vs mvfx11, [r0, #-1020]! cfldr32cc mvfx12, [r1], #-156 - cfldr32 mvfx13, [r15], #416 + cfldr32 mvfx13, [r9], #416 cfldr32cs mvfx9, [r0], #-1020 cfldr32ls mvfx4, [r1], #-156 - cfldr32le mvfx7, [pc], #416 + cfldr32le mvfx7, [r9], #416 cfldr64vs mvdx11, [r0, #-1020] cfldr64cc mvdx12, [r1, #-156] - cfldr64 mvdx13, [r15, #416] + cfldr64 mvdx13, [r9, #416] cfldr64cs mvdx9, [r0, #-1020] cfldr64ls mvdx4, [r1, #-156] - cfldr64le mvdx7, [pc, #416]! + cfldr64le mvdx7, [r9, #416]! cfldr64vs mvdx11, [r0, #-1020]! cfldr64cc mvdx12, [r1, #-156]! - cfldr64 mvdx13, [r15, #416]! + cfldr64 mvdx13, [r9, #416]! cfldr64cs mvdx9, [r0, #-1020]! cfldr64ls mvdx4, [r1], #-156 - cfldr64le mvdx7, [pc], #416 + cfldr64le mvdx7, [r9], #416 cfldr64vs mvdx11, [r0], #-1020 cfldr64cc mvdx12, [r1], #-156 - cfldr64 mvdx13, [r15], #416 + cfldr64 mvdx13, [r9], #416 cfstrscs mvf9, [r0, #-1020] cfstrsls mvf4, [r1, #-156] - cfstrsle mvf7, [pc, #416] + cfstrsle mvf7, [r9, #416] cfstrsvs mvf11, [r0, #-1020] cfstrscc mvf12, [r1, #-156] - cfstrs mvf13, [r15, #416]! + cfstrs mvf13, [r9, #416]! cfstrscs mvf9, [r0, #-1020]! cfstrsls mvf4, [r1, #-156]! - cfstrsle mvf7, [pc, #416]! + cfstrsle mvf7, [r9, #416]! cfstrsvs mvf11, [r0, #-1020]! cfstrscc mvf12, [r1], #-156 - cfstrs mvf13, [r15], #416 + cfstrs mvf13, [r9], #416 cfstrscs mvf9, [r0], #-1020 cfstrsls mvf4, [r1], #-156 - cfstrsle mvf7, [pc], #416 + cfstrsle mvf7, [r9], #416 cfstrdvs mvd11, [r0, #-1020] cfstrdcc mvd12, [r1, #-156] - cfstrd mvd13, [r15, #416] + cfstrd mvd13, [r9, #416] cfstrdcs mvd9, [r0, #-1020] cfstrdls mvd4, [r1, #-156] - cfstrdle mvd7, [pc, #416]! + cfstrdle mvd7, [r9, #416]! cfstrdvs mvd11, [r0, #-1020]! cfstrdcc mvd12, [r1, #-156]! - cfstrd mvd13, [r15, #416]! + cfstrd mvd13, [r9, #416]! cfstrdcs mvd9, [r0, #-1020]! cfstrdls mvd4, [r1], #-156 - cfstrdle mvd7, [pc], #416 + cfstrdle mvd7, [r9], #416 cfstrdvs mvd11, [r0], #-1020 cfstrdcc mvd12, [r1], #-156 - cfstrd mvd13, [r15], #416 + cfstrd mvd13, [r9], #416 cfstr32cs mvfx9, [r0, #-1020] cfstr32ls mvfx4, [r1, #-156] - cfstr32le mvfx7, [pc, #416] + cfstr32le mvfx7, [r9, #416] cfstr32vs mvfx11, [r0, #-1020] cfstr32cc mvfx12, [r1, #-156] - cfstr32 mvfx13, [r15, #416]! + cfstr32 mvfx13, [r9, #416]! cfstr32cs mvfx9, [r0, #-1020]! cfstr32ls mvfx4, [r1, #-156]! - cfstr32le mvfx7, [pc, #416]! + cfstr32le mvfx7, [r9, #416]! cfstr32vs mvfx11, [r0, #-1020]! cfstr32cc mvfx12, [r1], #-156 - cfstr32 mvfx13, [r15], #416 + cfstr32 mvfx13, [r9], #416 cfstr32cs mvfx9, [r0], #-1020 cfstr32ls mvfx4, [r1], #-156 - cfstr32le mvfx7, [pc], #416 + cfstr32le mvfx7, [r9], #416 cfstr64vs mvdx11, [r0, #-1020] cfstr64cc mvdx12, [r1, #-156] - cfstr64 mvdx13, [r15, #416] + cfstr64 mvdx13, [r9, #416] cfstr64cs mvdx9, [r0, #-1020] cfstr64ls mvdx4, [r1, #-156] - cfstr64le mvdx7, [pc, #416]! + cfstr64le mvdx7, [r9, #416]! cfstr64vs mvdx11, [r0, #-1020]! cfstr64cc mvdx12, [r1, #-156]! - cfstr64 mvdx13, [r15, #416]! + cfstr64 mvdx13, [r9, #416]! cfstr64cs mvdx9, [r0, #-1020]! cfstr64ls mvdx4, [r1], #-156 - cfstr64le mvdx7, [pc], #416 + cfstr64le mvdx7, [r9], #416 cfstr64vs mvdx11, [r0], #-1020 cfstr64cc mvdx12, [r1], #-156 - cfstr64 mvdx13, [r15], #416 + cfstr64 mvdx13, [r9], #416 move: cfmvsrcs mvf9, r0 cfmvsrpl mvf15, r7 diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/offset.d binutils-2.16.91.0.1/gas/testsuite/gas/arm/offset.d --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/offset.d 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/offset.d 2005-06-22 13:53:35.188270563 -0700 @@ -0,0 +1,11 @@ +# name: OFFSET_IMM regression +# as: +# objdump: -dr --prefix-addresses --show-raw-insn + +.*: +file format .*arm.* + +Disassembly of section .text: +0+0 <[^>]+> e51f0004 ? ldr r0, \[pc, #-4\] ; 0+4 <[^>]+> +0+4 <[^>]+> e1a00000 ? nop \(mov r0,r0\) +0+8 <[^>]+> e1a00000 ? nop \(mov r0,r0\) +0+c <[^>]+> e1a00000 ? nop \(mov r0,r0\) diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/offset.s binutils-2.16.91.0.1/gas/testsuite/gas/arm/offset.s --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/offset.s 2003-05-05 14:46:48.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/offset.s 2005-06-22 13:53:35.189270398 -0700 @@ -1,5 +1,14 @@ -@ test for OFFSET_IMM reloc against global symbols + @ test that an OFFSET_IMM reloc against a global symbol is + @ still resolved by the assembler, as long as the symbol is in + @ the same section as the reference + .text + .globl l + .globl foo +l: + ldr r0, foo +foo: + nop -.globl foo -foo: .word 0 -ldr r0, foo + @ pad section for a.out's benefit + nop + nop diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/pic.d binutils-2.16.91.0.1/gas/testsuite/gas/arm/pic.d --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/pic.d 2005-04-09 12:03:12.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/pic.d 2005-06-22 13:53:35.189270398 -0700 @@ -13,7 +13,7 @@ Disassembly of section .text: \.\.\. 8: R_ARM_ABS32 sym c: R_ARM_GOT32 sym - 10: R_ARM_GOTOFF sym + 10: R_ARM_GOTOFF32 sym 14: R_ARM_GOTPC _GLOBAL_OFFSET_TABLE_ 18: R_ARM_TARGET1 foo2 1c: R_ARM_SBREL32 foo3 diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/r15-bad.l binutils-2.16.91.0.1/gas/testsuite/gas/arm/r15-bad.l --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/r15-bad.l 2004-01-14 13:07:46.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/r15-bad.l 2005-06-22 13:53:35.189270398 -0700 @@ -1,6 +1,6 @@ [^:]*: Assembler messages: -[^:]*:5: Error: r15 not allowed here -- `mul r15,r1' -[^:]*:6: Error: r15 not allowed here -- `mul r1,r15' +[^:]*:5: Error: r15 not allowed here -- `mul r15,r1,r2' +[^:]*:6: Error: r15 not allowed here -- `mul r1,r15,r2' [^:]*:7: Error: r15 not allowed here -- `mla r15,r2,r3,r4' [^:]*:8: Error: r15 not allowed here -- `mla r1,r15,r3,r4' [^:]*:9: Error: r15 not allowed here -- `mla r1,r2,r15,r4' @@ -59,6 +59,6 @@ [^:]*:62: Error: r15 not allowed here -- `pkhtb r1,r2,r15' [^:]*:63: Error: r15 not allowed here -- `ldrex r15,[[]r2[]]' [^:]*:64: Error: r15 not allowed here -- `ldrex r1,[[]r15[]]' -[^:]*:65: Error: r15 not allowed in swap -- `swp r15,r2,[[]r3[]]' -[^:]*:66: Error: r15 not allowed in swap -- `swp r1,r15,[[]r3[]]' +[^:]*:65: Error: r15 not allowed here -- `swp r15,r2,[[]r3[]]' +[^:]*:66: Error: r15 not allowed here -- `swp r1,r15,[[]r3[]]' [^:]*:67: Error: r15 not allowed here -- `swp r1,r2,[[]r15[]]' diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/r15-bad.s binutils-2.16.91.0.1/gas/testsuite/gas/arm/r15-bad.s --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/r15-bad.s 2004-01-14 13:07:46.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/r15-bad.s 2005-06-22 13:53:35.190270233 -0700 @@ -2,8 +2,8 @@ .align 0 label: - mul r15, r1 - mul r1, r15 + mul r15, r1, r2 + mul r1, r15, r2 mla r15, r2, r3, r4 mla r1, r15, r3, r4 mla r1, r2, r15, r4 diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/req.l binutils-2.16.91.0.1/gas/testsuite/gas/arm/req.l --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/req.l 2004-01-14 13:07:46.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/req.l 2005-06-22 13:53:35.190270233 -0700 @@ -1,3 +1,3 @@ [^:]*: Assembler messages: -[^:]*:18: Error: register expected, not 'foo,foo,foo' -- `add foo,foo,foo' -[^:]*:24: Error: register expected, not 'r0,r0,r0' -- `add r0,r0,r0' +[^:]*:18: Error: ARM register expected -- `add foo,foo,foo' +[^:]*:21: Warning: ignoring attempt to undefine built-in register 'r0' diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/req.s binutils-2.16.91.0.1/gas/testsuite/gas/arm/req.s --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/req.s 2004-01-14 13:07:46.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/req.s 2005-06-22 13:53:35.190270233 -0700 @@ -2,7 +2,7 @@ .global test_dot_req_and_unreq test_dot_req_and_unreq: - # Check that builtin register alias 'r0' works. + # Check that builtin register alias 'r0' works. add r0, r0, r0 # Create an alias for r0. @@ -17,9 +17,9 @@ test_dot_req_and_unreq: # And make sure that it no longer works. add foo, foo, foo - # Finally remove the builtin alias for r0. + # Attempt to remove the builtin alias for r0. .unreq r0 - # And make sure that this no longer works. + # That is ignored, so this should still work. add r0, r0, r0 diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/t16-bad.l binutils-2.16.91.0.1/gas/testsuite/gas/arm/t16-bad.l --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/t16-bad.l 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/t16-bad.l 2005-06-22 13:53:35.191270068 -0700 @@ -0,0 +1,186 @@ +[^:]*: Assembler messages: +[^:]*:36: Error: lo register required -- `tst r8,r0' +[^:]*:36: Error: lo register required -- `tst r0,r8' +[^:]*:36: Error: unshifted register required -- `tst r0,#12' +[^:]*:36: Error: unshifted register required -- `tst r0,r1,lsl#2' +[^:]*:36: Error: unshifted register required -- `tst r0,r1,lsl r3' +[^:]*:37: Error: lo register required -- `cmn r8,r0' +[^:]*:37: Error: lo register required -- `cmn r0,r8' +[^:]*:37: Error: unshifted register required -- `cmn r0,#12' +[^:]*:37: Error: unshifted register required -- `cmn r0,r1,lsl#2' +[^:]*:37: Error: unshifted register required -- `cmn r0,r1,lsl r3' +[^:]*:38: Error: lo register required -- `mvn r8,r0' +[^:]*:38: Error: lo register required -- `mvn r0,r8' +[^:]*:38: Error: unshifted register required -- `mvn r0,#12' +[^:]*:38: Error: unshifted register required -- `mvn r0,r1,lsl#2' +[^:]*:38: Error: unshifted register required -- `mvn r0,r1,lsl r3' +[^:]*:39: Error: lo register required -- `neg r8,r0' +[^:]*:39: Error: lo register required -- `neg r0,r8' +[^:]*:40: Error: lo register required -- `rev r8,r0' +[^:]*:40: Error: lo register required -- `rev r0,r8' +[^:]*:41: Error: lo register required -- `rev16 r8,r0' +[^:]*:41: Error: lo register required -- `rev16 r0,r8' +[^:]*:42: Error: lo register required -- `revsh r8,r0' +[^:]*:42: Error: lo register required -- `revsh r0,r8' +[^:]*:43: Error: lo register required -- `sxtb r8,r0' +[^:]*:43: Error: lo register required -- `sxtb r0,r8' +[^:]*:43: Error: Thumb encoding does not support rotation -- `sxtb r0,r1,ror#8' +[^:]*:44: Error: lo register required -- `sxth r8,r0' +[^:]*:44: Error: lo register required -- `sxth r0,r8' +[^:]*:44: Error: Thumb encoding does not support rotation -- `sxth r0,r1,ror#8' +[^:]*:45: Error: lo register required -- `uxtb r8,r0' +[^:]*:45: Error: lo register required -- `uxtb r0,r8' +[^:]*:45: Error: Thumb encoding does not support rotation -- `uxtb r0,r1,ror#8' +[^:]*:46: Error: lo register required -- `uxth r8,r0' +[^:]*:46: Error: lo register required -- `uxth r0,r8' +[^:]*:46: Error: Thumb encoding does not support rotation -- `uxth r0,r1,ror#8' +[^:]*:48: Error: dest must overlap one source register -- `adc r1,r2,r3' +[^:]*:48: Error: lo register required -- `adc r8,r0' +[^:]*:48: Error: lo register required -- `adc r0,r8' +[^:]*:48: Error: unshifted register required -- `adc r0,#12' +[^:]*:48: Error: unshifted register required -- `adc r0,r1,lsl#2' +[^:]*:48: Error: unshifted register required -- `adc r0,r1,lsl r3' +[^:]*:49: Error: dest must overlap one source register -- `and r1,r2,r3' +[^:]*:49: Error: lo register required -- `and r8,r0' +[^:]*:49: Error: lo register required -- `and r0,r8' +[^:]*:49: Error: unshifted register required -- `and r0,#12' +[^:]*:49: Error: unshifted register required -- `and r0,r1,lsl#2' +[^:]*:49: Error: unshifted register required -- `and r0,r1,lsl r3' +[^:]*:50: Error: dest and source1 must be the same register -- `bic r1,r2,r3' +[^:]*:50: Error: lo register required -- `bic r8,r0' +[^:]*:50: Error: lo register required -- `bic r0,r8' +[^:]*:50: Error: unshifted register required -- `bic r0,#12' +[^:]*:50: Error: unshifted register required -- `bic r0,r1,lsl#2' +[^:]*:50: Error: unshifted register required -- `bic r0,r1,lsl r3' +[^:]*:51: Error: dest must overlap one source register -- `eor r1,r2,r3' +[^:]*:51: Error: lo register required -- `eor r8,r0' +[^:]*:51: Error: lo register required -- `eor r0,r8' +[^:]*:51: Error: unshifted register required -- `eor r0,#12' +[^:]*:51: Error: unshifted register required -- `eor r0,r1,lsl#2' +[^:]*:51: Error: unshifted register required -- `eor r0,r1,lsl r3' +[^:]*:52: Error: dest must overlap one source register -- `orr r1,r2,r3' +[^:]*:52: Error: lo register required -- `orr r8,r0' +[^:]*:52: Error: lo register required -- `orr r0,r8' +[^:]*:52: Error: unshifted register required -- `orr r0,#12' +[^:]*:52: Error: unshifted register required -- `orr r0,r1,lsl#2' +[^:]*:52: Error: unshifted register required -- `orr r0,r1,lsl r3' +[^:]*:53: Error: dest and source1 must be the same register -- `sbc r1,r2,r3' +[^:]*:53: Error: lo register required -- `sbc r8,r0' +[^:]*:53: Error: lo register required -- `sbc r0,r8' +[^:]*:53: Error: unshifted register required -- `sbc r0,#12' +[^:]*:53: Error: unshifted register required -- `sbc r0,r1,lsl#2' +[^:]*:53: Error: unshifted register required -- `sbc r0,r1,lsl r3' +[^:]*:54: Error: dest must overlap one source register -- `mul r1,r2,r3' +[^:]*:54: Error: lo register required -- `mul r8,r0' +[^:]*:54: Error: lo register required -- `mul r0,r8' +[^:]*:62: Error: lo register required -- `asr r8,r0,#12' +[^:]*:62: Error: lo register required -- `asr r0,r8,#12' +[^:]*:62: Error: lo register required -- `asr r8,r0' +[^:]*:62: Error: lo register required -- `asr r0,r8' +[^:]*:63: Error: lo register required -- `lsl r8,r0,#12' +[^:]*:63: Error: lo register required -- `lsl r0,r8,#12' +[^:]*:63: Error: lo register required -- `lsl r8,r0' +[^:]*:63: Error: lo register required -- `lsl r0,r8' +[^:]*:64: Error: lo register required -- `lsr r8,r0,#12' +[^:]*:64: Error: lo register required -- `lsr r0,r8,#12' +[^:]*:64: Error: lo register required -- `lsr r8,r0' +[^:]*:64: Error: lo register required -- `lsr r0,r8' +[^:]*:65: Error: lo register required -- `ror r8,r0,#12' +[^:]*:65: Error: lo register required -- `ror r0,r8,#12' +[^:]*:65: Error: lo register required -- `ror r8,r0' +[^:]*:65: Error: lo register required -- `ror r0,r8' +[^:]*:66: Error: ror #imm not supported -- `ror r0,r1,#12' +[^:]*:69: Error: unshifted register required -- `add r0,r1,lsl#2' +[^:]*:70: Error: unshifted register required -- `add r0,r1,lsl r3' +[^:]*:71: Error: lo register required -- `add r8,r0,#1' +[^:]*:72: Error: lo register required -- `add r0,r8,#1' +[^:]*:73: Error: lo register required -- `add r8,#10' +[^:]*:74: Error: dest must overlap one source register -- `add r8,r1,r2' +[^:]*:75: Error: dest must overlap one source register -- `add r1,r8,r2' +[^:]*:76: Error: dest must overlap one source register -- `add r1,r2,r8' +[^:]*:77: Error: lo register required -- `add r8,pc,#4' +[^:]*:78: Error: lo register required -- `add r8,sp,#4' +[^:]*:80: Error: lo register required -- `sub r8,r0' +[^:]*:80: Error: lo register required -- `sub r0,r8' +[^:]*:80: Error: unshifted register required -- `sub r0,r1,lsl#2' +[^:]*:80: Error: unshifted register required -- `sub r0,r1,lsl r3' +[^:]*:81: Error: lo register required -- `sub r8,r0,#1' +[^:]*:82: Error: lo register required -- `sub r0,r8,#1' +[^:]*:83: Error: lo register required -- `sub r8,#10' +[^:]*:84: Error: lo register required -- `sub r8,r1,r2' +[^:]*:85: Error: lo register required -- `sub r1,r8,r2' +[^:]*:86: Error: lo register required -- `sub r1,r2,r8' +[^:]*:90: Error: only lo regs allowed with immediate -- `cmp r8,#255' +[^:]*:94: Error: only lo regs allowed with immediate -- `mov r8,#255' +[^:]*:106: Error: lo register required -- `ldr r8,\[r0\]' +[^:]*:106: Error: lo register required -- `ldr r0,\[r8\]' +[^:]*:106: Error: lo register required -- `ldr r0,\[r0,r8\]' +[^:]*:106: Error: Thumb does not support this addressing mode -- `ldr r0,\[r1,#4\]!' +[^:]*:106: Error: Thumb does not support this addressing mode -- `ldr r0,\[r1\],#4' +[^:]*:106: Error: Thumb does not support this addressing mode -- `ldr r0,\[r1,-r2\]' +[^:]*:106: Error: Thumb does not support this addressing mode -- `ldr r0,\[r1\],r2' +[^:]*:107: Error: lo register required -- `ldrb r8,\[r0\]' +[^:]*:107: Error: lo register required -- `ldrb r0,\[r8\]' +[^:]*:107: Error: lo register required -- `ldrb r0,\[r0,r8\]' +[^:]*:107: Error: Thumb does not support this addressing mode -- `ldrb r0,\[r1,#4\]!' +[^:]*:107: Error: Thumb does not support this addressing mode -- `ldrb r0,\[r1\],#4' +[^:]*:107: Error: Thumb does not support this addressing mode -- `ldrb r0,\[r1,-r2\]' +[^:]*:107: Error: Thumb does not support this addressing mode -- `ldrb r0,\[r1\],r2' +[^:]*:108: Error: lo register required -- `ldrh r8,\[r0\]' +[^:]*:108: Error: lo register required -- `ldrh r0,\[r8\]' +[^:]*:108: Error: lo register required -- `ldrh r0,\[r0,r8\]' +[^:]*:108: Error: Thumb does not support this addressing mode -- `ldrh r0,\[r1,#4\]!' +[^:]*:108: Error: Thumb does not support this addressing mode -- `ldrh r0,\[r1\],#4' +[^:]*:108: Error: Thumb does not support this addressing mode -- `ldrh r0,\[r1,-r2\]' +[^:]*:108: Error: Thumb does not support this addressing mode -- `ldrh r0,\[r1\],r2' +[^:]*:109: Error: lo register required -- `ldrsb r8,\[r0\]' +[^:]*:109: Error: lo register required -- `ldrsb r0,\[r8\]' +[^:]*:109: Error: lo register required -- `ldrsb r0,\[r0,r8\]' +[^:]*:109: Error: Thumb does not support this addressing mode -- `ldrsb r0,\[r1,#4\]!' +[^:]*:109: Error: Thumb does not support this addressing mode -- `ldrsb r0,\[r1\],#4' +[^:]*:109: Error: Thumb does not support this addressing mode -- `ldrsb r0,\[r1,-r2\]' +[^:]*:109: Error: Thumb does not support this addressing mode -- `ldrsb r0,\[r1\],r2' +[^:]*:110: Error: lo register required -- `ldrsh r8,\[r0\]' +[^:]*:110: Error: lo register required -- `ldrsh r0,\[r8\]' +[^:]*:110: Error: lo register required -- `ldrsh r0,\[r0,r8\]' +[^:]*:110: Error: Thumb does not support this addressing mode -- `ldrsh r0,\[r1,#4\]!' +[^:]*:110: Error: Thumb does not support this addressing mode -- `ldrsh r0,\[r1\],#4' +[^:]*:110: Error: Thumb does not support this addressing mode -- `ldrsh r0,\[r1,-r2\]' +[^:]*:110: Error: Thumb does not support this addressing mode -- `ldrsh r0,\[r1\],r2' +[^:]*:111: Error: lo register required -- `str r8,\[r0\]' +[^:]*:111: Error: lo register required -- `str r0,\[r8\]' +[^:]*:111: Error: lo register required -- `str r0,\[r0,r8\]' +[^:]*:111: Error: Thumb does not support this addressing mode -- `str r0,\[r1,#4\]!' +[^:]*:111: Error: Thumb does not support this addressing mode -- `str r0,\[r1\],#4' +[^:]*:111: Error: Thumb does not support this addressing mode -- `str r0,\[r1,-r2\]' +[^:]*:111: Error: Thumb does not support this addressing mode -- `str r0,\[r1\],r2' +[^:]*:112: Error: lo register required -- `strb r8,\[r0\]' +[^:]*:112: Error: lo register required -- `strb r0,\[r8\]' +[^:]*:112: Error: lo register required -- `strb r0,\[r0,r8\]' +[^:]*:112: Error: Thumb does not support this addressing mode -- `strb r0,\[r1,#4\]!' +[^:]*:112: Error: Thumb does not support this addressing mode -- `strb r0,\[r1\],#4' +[^:]*:112: Error: Thumb does not support this addressing mode -- `strb r0,\[r1,-r2\]' +[^:]*:112: Error: Thumb does not support this addressing mode -- `strb r0,\[r1\],r2' +[^:]*:113: Error: lo register required -- `strh r8,\[r0\]' +[^:]*:113: Error: lo register required -- `strh r0,\[r8\]' +[^:]*:113: Error: lo register required -- `strh r0,\[r0,r8\]' +[^:]*:113: Error: Thumb does not support this addressing mode -- `strh r0,\[r1,#4\]!' +[^:]*:113: Error: Thumb does not support this addressing mode -- `strh r0,\[r1\],#4' +[^:]*:113: Error: Thumb does not support this addressing mode -- `strh r0,\[r1,-r2\]' +[^:]*:113: Error: Thumb does not support this addressing mode -- `strh r0,\[r1\],r2' +[^:]*:115: Error: Thumb does not support this addressing mode -- `ldr r0,\[r1,r2,lsl#1\]' +[^:]*:116: Error: Thumb does not support this addressing mode -- `str r0,\[r1,r2,lsl#1\]' +[^:]*:119: Error: lo register required -- `ldmia r8!,{r1,r2}' +[^:]*:120: Error: lo register required -- `ldmia r7!,{r8}' +[^:]*:121: Warning: this instruction will write back the base register +[^:]*:122: Warning: this instruction will not write back the base register +[^:]*:124: Error: lo register required -- `stmia r8!,{r1,r2}' +[^:]*:125: Error: lo register required -- `stmia r7!,{r8}' +[^:]*:126: Warning: this instruction will write back the base register +[^:]*:127: Warning: value stored for r7 is UNPREDICTABLE +[^:]*:129: Error: invalid register list to push/pop instruction -- `push {r8,r9}' +[^:]*:130: Error: invalid register list to push/pop instruction -- `pop {r8,r9}' +[^:]*:133: Error: immediate value out of range -- `bkpt #257' +[^:]*:134: Error: Thumb does not support the 2-argument form of this instruction -- `cpsie ai,#5' +[^:]*:135: Error: Thumb does not support the 2-argument form of this instruction -- `cpsid ai,#5' +[^:]*:138: Error: Thumb does not support conditional execution diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/t16-bad.s binutils-2.16.91.0.1/gas/testsuite/gas/arm/t16-bad.s --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/t16-bad.s 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/t16-bad.s 2005-06-22 13:53:35.191270068 -0700 @@ -0,0 +1,138 @@ + @ Things you can't do with 16-bit Thumb instructions, but you can + @ do with the equivalent ARM instruction. Does not include errors + @ caught by fixup processing (e.g. out-of-range immediates). + + .text + .code 16 + .thumb_func +l: + @ Arithmetic instruction templates + .macro ar2 opc + \opc r8,r0 + \opc r0,r8 + .endm + .macro ar2sh opc + ar2 \opc + \opc r0,#12 + \opc r0,r1,lsl #2 + \opc r0,r1,lsl r3 + .endm + .macro ar2r opc + ar2 \opc + \opc r0,r1,ror #8 + .endm + .macro ar3 opc + \opc r1,r2,r3 + \opc r8,r0 + \opc r0,r8 + .endm + .macro ar3sh opc + ar3 \opc + \opc r0,#12 + \opc r0,r1,lsl #2 + \opc r0,r1,lsl r3 + .endm + + ar2sh tst + ar2sh cmn + ar2sh mvn + ar2 neg + ar2 rev + ar2 rev16 + ar2 revsh + ar2r sxtb + ar2r sxth + ar2r uxtb + ar2r uxth + + ar3sh adc + ar3sh and + ar3sh bic + ar3sh eor + ar3sh orr + ar3sh sbc + ar3 mul + + @ Shift instruction template + .macro shift opc + \opc r8,r0,#12 @ form 1 + \opc r0,r8,#12 + ar2 \opc @ form 2 + .endm + shift asr + shift lsl + shift lsr + shift ror + ror r0,r1,#12 + + @ add/sub/mov/cmp are idiosyncratic + add r0,r1,lsl #2 + add r0,r1,lsl r3 + add r8,r0,#1 @ form 1 + add r0,r8,#1 + add r8,#10 @ form 2 + add r8,r1,r2 @ form 3 + add r1,r8,r2 + add r1,r2,r8 + add r8,pc,#4 @ form 5 + add r8,sp,#4 @ form 6 + + ar3sh sub + sub r8,r0,#1 @ form 1 + sub r0,r8,#1 + sub r8,#10 @ form 2 + sub r8,r1,r2 @ form 3 + sub r1,r8,r2 + sub r1,r2,r8 + + cmp r0,r1,lsl #2 + cmp r0,r1,lsl r3 + cmp r8,#255 + + mov r0,r1,lsl #2 + mov r0,r1,lsl r3 + mov r8,#255 + + @ Load/store template + .macro ldst opc + \opc r8,[r0] + \opc r0,[r8] + \opc r0,[r0,r8] + \opc r0,[r1,#4]! + \opc r0,[r1],#4 + \opc r0,[r1,-r2] + \opc r0,[r1],r2 + .endm + ldst ldr + ldst ldrb + ldst ldrh + ldst ldrsb + ldst ldrsh + ldst str + ldst strb + ldst strh + + ldr r0,[r1,r2,lsl #1] + str r0,[r1,r2,lsl #1] + + @ Load/store multiple + ldmia r8!,{r1,r2} + ldmia r7!,{r8} + ldmia r7,{r1,r2} + ldmia r7!,{r1,r7} + + stmia r8!,{r1,r2} + stmia r7!,{r8} + stmia r7,{r1,r2} + stmia r7!,{r1,r7} + + push {r8,r9} + pop {r8,r9} + + @ Miscellaneous + bkpt #257 + cpsie ai,#5 + cpsid ai,#5 + + @ Conditional suffixes + addeq r0,r1,r2 diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/tcompat2.d binutils-2.16.91.0.1/gas/testsuite/gas/arm/tcompat2.d --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/tcompat2.d 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/tcompat2.d 2005-06-22 13:53:35.192269903 -0700 @@ -0,0 +1,26 @@ +#name: Thumb ARM-compat pseudos +#objdump: -dr --prefix-addresses --show-raw-insn -M force-thumb +#as: + +# Test the Thumb pseudo instructions that exist for ARM source compatibility + +.*: +file format .*arm.* + +Disassembly of section .text: + +0+00 <[^>]*> 4148 * adcs r0, r1 +0+02 <[^>]*> 4148 * adcs r0, r1 +0+04 <[^>]*> 4008 * ands r0, r1 +0+06 <[^>]*> 4008 * ands r0, r1 +0+08 <[^>]*> 4048 * eors r0, r1 +0+0a <[^>]*> 4048 * eors r0, r1 +0+0c <[^>]*> 4348 * muls r0, r1 +0+0e <[^>]*> 4348 * muls r0, r1 +0+10 <[^>]*> 4308 * orrs r0, r1 +0+12 <[^>]*> 4308 * orrs r0, r1 +0+14 <[^>]*> 4388 * bics r0, r1 +0+16 <[^>]*> 4188 * sbcs r0, r1 +0+18 <[^>]*> 46c0 * nop \(mov r8, r8\) +0+1a <[^>]*> 46c0 * nop \(mov r8, r8\) +0+1c <[^>]*> 46c0 * nop \(mov r8, r8\) +0+1e <[^>]*> 46c0 * nop \(mov r8, r8\) diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/tcompat2.s binutils-2.16.91.0.1/gas/testsuite/gas/arm/tcompat2.s --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/tcompat2.s 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/tcompat2.s 2005-06-22 13:53:35.192269903 -0700 @@ -0,0 +1,32 @@ + @ Three-argument forms of Thumb arithmetic instructions. + @ Commutative instructions allow either the second or third + @ operand to equal the first. + + .text + .global m + .thumb_func +m: + adc r0,r0,r1 + adc r0,r1,r0 + + and r0,r0,r1 + and r0,r1,r0 + + eor r0,r0,r1 + eor r0,r1,r0 + + mul r0,r0,r1 + mul r0,r1,r0 + + orr r0,r0,r1 + orr r0,r1,r0 + + bic r0,r0,r1 + + sbc r0,r0,r1 + + @ section padding for a.out's sake + nop + nop + nop + nop diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/tcompat.d binutils-2.16.91.0.1/gas/testsuite/gas/arm/tcompat.d --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/tcompat.d 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/tcompat.d 2005-06-22 13:53:35.191270068 -0700 @@ -0,0 +1,50 @@ +#name: ARM Thumb-compat pseudos +#objdump: -dr --prefix-addresses --show-raw-insn +#as: + +# Test the ARM pseudo instructions that exist for Thumb source compatibility + +.*: +file format .*arm.* + +Disassembly of section .text: + +0+00 <[^>]*> 91a00000 ? movls r0, r0 +0+04 <[^>]*> e1a09000 ? mov r9, r0 +0+08 <[^>]*> e1a00009 ? mov r0, r9 +0+0c <[^>]*> e1a0c00e ? mov ip, lr +0+10 <[^>]*> 91b09019 ? movlss r9, r9, lsl r0 +0+14 <[^>]*> 91a00910 ? movls r0, r0, lsl r9 +0+18 <[^>]*> e1b00880 ? movs r0, r0, lsl #17 +0+1c <[^>]*> e1a00889 ? mov r0, r9, lsl #17 +0+20 <[^>]*> 91b09039 ? movlss r9, r9, lsr r0 +0+24 <[^>]*> 91a00930 ? movls r0, r0, lsr r9 +0+28 <[^>]*> e1b008a0 ? movs r0, r0, lsr #17 +0+2c <[^>]*> e1a008a9 ? mov r0, r9, lsr #17 +0+30 <[^>]*> 91b09059 ? movlss r9, r9, asr r0 +0+34 <[^>]*> 91a00950 ? movls r0, r0, asr r9 +0+38 <[^>]*> e1b008c0 ? movs r0, r0, asr #17 +0+3c <[^>]*> e1a008c9 ? mov r0, r9, asr #17 +0+40 <[^>]*> 91b09079 ? movlss r9, r9, ror r0 +0+44 <[^>]*> 91a00970 ? movls r0, r0, ror r9 +0+48 <[^>]*> e1b008e0 ? movs r0, r0, ror #17 +0+4c <[^>]*> e1a008e9 ? mov r0, r9, ror #17 +0+50 <[^>]*> e2690000 ? rsb r0, r9, #0 ; 0x0 +0+54 <[^>]*> e2709000 ? rsbs r9, r0, #0 ; 0x0 +0+58 <[^>]*> 92600000 ? rsbls r0, r0, #0 ; 0x0 +0+5c <[^>]*> 92799000 ? rsblss r9, r9, #0 ; 0x0 +0+60 <[^>]*> e92d000e ? stmdb sp!, {r1, r2, r3} +0+64 <[^>]*> 992d8154 ? stmlsdb sp!, {r2, r4, r6, r8, pc} +0+68 <[^>]*> e8bd000e ? ldmia sp!, {r1, r2, r3} +0+6c <[^>]*> 98bd8154 ? ldmlsia sp!, {r2, r4, r6, r8, pc} +0+70 <[^>]*> e0000001 ? and r0, r0, r1 +0+74 <[^>]*> e0200001 ? eor r0, r0, r1 +0+78 <[^>]*> e0400001 ? sub r0, r0, r1 +0+7c <[^>]*> e0600001 ? rsb r0, r0, r1 +0+80 <[^>]*> e0800001 ? add r0, r0, r1 +0+84 <[^>]*> e0a00001 ? adc r0, r0, r1 +0+88 <[^>]*> e0c00001 ? sbc r0, r0, r1 +0+8c <[^>]*> e0e00001 ? rsc r0, r0, r1 +0+90 <[^>]*> e1800001 ? orr r0, r0, r1 +0+94 <[^>]*> e1c00001 ? bic r0, r0, r1 +0+98 <[^>]*> e0000091 ? mul r0, r1, r0 +0+9c <[^>]*> e1a00000 ? nop \(mov r0,r0\) diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/tcompat.s binutils-2.16.91.0.1/gas/testsuite/gas/arm/tcompat.s --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/tcompat.s 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/tcompat.s 2005-06-22 13:53:35.192269903 -0700 @@ -0,0 +1,45 @@ + @ ARM instructions defined for source compatibility with Thumb. + .macro shift op opls ops oplss + \oplss r9,r0 + \opls r0,r0,r9 + \ops r0,#17 + \op r0,r9,#17 + .endm + .text + .global l +l: + cpyls r0,r0 + cpy r9,r0 + cpy r0,r9 + cpy ip,lr + + shift lsl lslls lsls lsllss + shift lsr lsrls lsrs lsrlss + shift asr asrls asrs asrlss + shift ror rorls rors rorlss + + neg r0,r9 + negs r9,r0 + negls r0,r0 + neglss r9,r9 + + push {r1,r2,r3} + pushls {r2,r4,r6,r8,pc} + pop {r1,r2,r3} + popls {r2,r4,r6,r8,pc} + + @ Two-argument forms of ARM arithmetic instructions. + and r0,r1 + eor r0,r1 + sub r0,r1 + rsb r0,r1 + + add r0,r1 + adc r0,r1 + sbc r0,r1 + rsc r0,r1 + + orr r0,r1 + bic r0,r1 + mul r0,r1 + nop diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/thumb32.d binutils-2.16.91.0.1/gas/testsuite/gas/arm/thumb32.d --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/thumb32.d 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/thumb32.d 2005-06-22 13:53:35.194269572 -0700 @@ -0,0 +1,991 @@ +# name: 32-bit Thumb instructions +# as: -march=armv6kt2 +# objdump: -dr --prefix-addresses --show-raw-insn + +.*: +file format .*arm.* + +Disassembly of section .text: +0+000 <[^>]+> f041 0000 orr\.w r0, r1, #0 ; 0x0 +0+004 <[^>]+> f041 00a5 orr\.w r0, r1, #165 ; 0xa5 +0+008 <[^>]+> f041 10a5 orr\.w r0, r1, #10813605 ; 0xa500a5 +0+00c <[^>]+> f041 20a5 orr\.w r0, r1, #2768282880 ; 0xa500a500 +0+010 <[^>]+> f041 30a5 orr\.w r0, r1, #2779096485 ; 0xa5a5a5a5 +0+014 <[^>]+> f041 4000 orr\.w r0, r1, #2147483648 ; 0x80000000 +0+018 <[^>]+> f041 4080 orr\.w r0, r1, #1073741824 ; 0x40000000 +0+01c <[^>]+> f041 4020 orr\.w r0, r1, #2684354560 ; 0xa0000000 +0+020 <[^>]+> f041 40a0 orr\.w r0, r1, #1342177280 ; 0x50000000 +0+024 <[^>]+> f041 5020 orr\.w r0, r1, #671088640 ; 0x28000000 +0+028 <[^>]+> f041 4014 orr\.w r0, r1, #2483027968 ; 0x94000000 +0+02c <[^>]+> f041 4094 orr\.w r0, r1, #1241513984 ; 0x4a000000 +0+030 <[^>]+> f041 4025 orr\.w r0, r1, #2768240640 ; 0xa5000000 +0+034 <[^>]+> f041 40a5 orr\.w r0, r1, #1384120320 ; 0x52800000 +0+038 <[^>]+> f041 5025 orr\.w r0, r1, #692060160 ; 0x29400000 +0+03c <[^>]+> f041 50a5 orr\.w r0, r1, #346030080 ; 0x14a00000 +0+040 <[^>]+> f041 6025 orr\.w r0, r1, #173015040 ; 0xa500000 +0+044 <[^>]+> f041 60a5 orr\.w r0, r1, #86507520 ; 0x5280000 +0+048 <[^>]+> f041 7025 orr\.w r0, r1, #43253760 ; 0x2940000 +0+04c <[^>]+> f041 70a5 orr\.w r0, r1, #21626880 ; 0x14a0000 +0+050 <[^>]+> f441 0025 orr\.w r0, r1, #10813440 ; 0xa50000 +0+054 <[^>]+> f441 00a5 orr\.w r0, r1, #5406720 ; 0x528000 +0+058 <[^>]+> f441 1025 orr\.w r0, r1, #2703360 ; 0x294000 +0+05c <[^>]+> f441 10a5 orr\.w r0, r1, #1351680 ; 0x14a000 +0+060 <[^>]+> f441 2025 orr\.w r0, r1, #675840 ; 0xa5000 +0+064 <[^>]+> f441 20a5 orr\.w r0, r1, #337920 ; 0x52800 +0+068 <[^>]+> f441 3025 orr\.w r0, r1, #168960 ; 0x29400 +0+06c <[^>]+> f441 30a5 orr\.w r0, r1, #84480 ; 0x14a00 +0+070 <[^>]+> f441 4025 orr\.w r0, r1, #42240 ; 0xa500 +0+074 <[^>]+> f441 40a5 orr\.w r0, r1, #21120 ; 0x5280 +0+078 <[^>]+> f441 5025 orr\.w r0, r1, #10560 ; 0x2940 +0+07c <[^>]+> f441 50a5 orr\.w r0, r1, #5280 ; 0x14a0 +0+080 <[^>]+> f441 6025 orr\.w r0, r1, #2640 ; 0xa50 +0+084 <[^>]+> f441 60a5 orr\.w r0, r1, #1320 ; 0x528 +0+088 <[^>]+> f441 7025 orr\.w r0, r1, #660 ; 0x294 +0+08c <[^>]+> f441 70a5 orr\.w r0, r1, #330 ; 0x14a +0+090 <[^>]+> f110 0000 adds\.w r0, r0, #0 ; 0x0 +0+094 <[^>]+> f110 0500 adds\.w r5, r0, #0 ; 0x0 +0+098 <[^>]+> f115 0000 adds\.w r0, r5, #0 ; 0x0 +0+09c <[^>]+> f110 0005 adds\.w r0, r0, #5 ; 0x5 +0+0a0 <[^>]+> f110 0081 adds\.w r0, r0, #129 ; 0x81 +0+0a4 <[^>]+> f110 0081 adds\.w r0, r0, #129 ; 0x81 +0+0a8 <[^>]+> f110 057e adds\.w r5, r0, #126 ; 0x7e +0+0ac <[^>]+> 1800 adds r0, r0, r0 +0+0ae <[^>]+> 1805 adds r5, r0, r0 +0+0b0 <[^>]+> 1828 adds r0, r5, r0 +0+0b2 <[^>]+> 1940 adds r0, r0, r5 +0+0b4 <[^>]+> 18d1 adds r1, r2, r3 +0+0b6 <[^>]+> 4480 add r8, r0 +0+0b8 <[^>]+> 4440 add r0, r8 +0+0ba <[^>]+> 4440 add r0, r8 +0+0bc <[^>]+> 4440 add r0, r8 +0+0be <[^>]+> eb00 0800 add\.w r8, r0, r0 +0+0c2 <[^>]+> 4401 add r1, r0 +0+0c4 <[^>]+> 4408 add r0, r1 +0+0c6 <[^>]+> f10f 0000 add\.w r0, pc, #0 ; 0x0 +0+0ca <[^>]+> f10f 0500 add\.w r5, pc, #0 ; 0x0 +0+0ce <[^>]+> f50f 7001 add\.w r0, pc, #516 ; 0x204 +0+0d2 <[^>]+> f10d 0000 add\.w r0, sp, #0 ; 0x0 +0+0d6 <[^>]+> f10d 0500 add\.w r5, sp, #0 ; 0x0 +0+0da <[^>]+> f50d 7001 add\.w r0, sp, #516 ; 0x204 +0+0de <[^>]+> f100 0d00 add\.w sp, r0, #0 ; 0x0 +0+0e2 <[^>]+> f10d 0d00 add\.w sp, sp, #0 ; 0x0 +0+0e6 <[^>]+> f500 7d82 add\.w sp, r0, #260 ; 0x104 +0+0ea <[^>]+> f100 0000 add\.w r0, r0, #0 ; 0x0 +0+0ee <[^>]+> f110 0000 adds\.w r0, r0, #0 ; 0x0 +0+0f2 <[^>]+> f100 0900 add\.w r9, r0, #0 ; 0x0 +0+0f6 <[^>]+> f109 0000 add\.w r0, r9, #0 ; 0x0 +0+0fa <[^>]+> f100 0081 add\.w r0, r0, #129 ; 0x81 +0+0fe <[^>]+> eb00 0000 add\.w r0, r0, r0 +0+102 <[^>]+> eb10 0000 adds\.w r0, r0, r0 +0+106 <[^>]+> eb00 0900 add\.w r9, r0, r0 +0+10a <[^>]+> eb09 0000 add\.w r0, r9, r0 +0+10e <[^>]+> eb00 0009 add\.w r0, r0, r9 +0+112 <[^>]+> eb09 080a add\.w r8, r9, sl +0+116 <[^>]+> eb09 484a add\.w r8, r9, sl, lsl #17 +0+11a <[^>]+> eb08 081a add\.w r8, r8, sl, lsr #32 +0+11e <[^>]+> eb08 485a add\.w r8, r8, sl, lsr #17 +0+122 <[^>]+> eb09 082a add\.w r8, r9, sl, asr #32 +0+126 <[^>]+> eb09 486a add\.w r8, r9, sl, asr #17 +0+12a <[^>]+> eb09 083a add\.w r8, r9, sl, rrx +0+12e <[^>]+> eb09 487a add\.w r8, r9, sl, ror #17 +0+132 <[^>]+> f1b0 0000 subs\.w r0, r0, #0 ; 0x0 +0+136 <[^>]+> f1b0 0500 subs\.w r5, r0, #0 ; 0x0 +0+13a <[^>]+> f1b5 0000 subs\.w r0, r5, #0 ; 0x0 +0+13e <[^>]+> f1b0 0005 subs\.w r0, r0, #5 ; 0x5 +0+142 <[^>]+> f1b0 0081 subs\.w r0, r0, #129 ; 0x81 +0+146 <[^>]+> f1b0 0508 subs\.w r5, r0, #8 ; 0x8 +0+14a <[^>]+> 1a00 sub r0, r0, r0 +0+14c <[^>]+> 1a05 sub r5, r0, r0 +0+14e <[^>]+> 1a28 sub r0, r5, r0 +0+150 <[^>]+> 1b40 sub r0, r0, r5 +0+152 <[^>]+> f5a0 7d82 sub\.w sp, r0, #260 ; 0x104 +0+156 <[^>]+> f5ad 7d82 sub\.w sp, sp, #260 ; 0x104 +0+15a <[^>]+> ebb8 0800 subs\.w r8, r8, r0 +0+15e <[^>]+> ebb0 0008 subs\.w r0, r0, r8 +0+162 <[^>]+> f5b0 7082 subs\.w r0, r0, #260 ; 0x104 +0+166 <[^>]+> 4140 adcs r0, r0 +0+168 <[^>]+> 4145 adcs r5, r0 +0+16a <[^>]+> 4168 adcs r0, r5 +0+16c <[^>]+> 4168 adcs r0, r5 +0+16e <[^>]+> 4168 adcs r0, r5 +0+170 <[^>]+> eb45 0000 adc\.w r0, r5, r0 +0+174 <[^>]+> eb41 0002 adc\.w r0, r1, r2 +0+178 <[^>]+> eb40 0900 adc\.w r9, r0, r0 +0+17c <[^>]+> eb49 0000 adc\.w r0, r9, r0 +0+180 <[^>]+> eb40 0009 adc\.w r0, r0, r9 +0+184 <[^>]+> eb50 0000 adcs\.w r0, r0, r0 +0+188 <[^>]+> eb41 4062 adc\.w r0, r1, r2, asr #17 +0+18c <[^>]+> f141 0081 adc\.w r0, r1, #129 ; 0x81 +0+190 <[^>]+> 4000 ands r0, r0 +0+192 <[^>]+> 4005 ands r5, r0 +0+194 <[^>]+> 4028 ands r0, r5 +0+196 <[^>]+> 4028 ands r0, r5 +0+198 <[^>]+> 4028 ands r0, r5 +0+19a <[^>]+> ea05 0000 and\.w r0, r5, r0 +0+19e <[^>]+> ea01 0002 and\.w r0, r1, r2 +0+1a2 <[^>]+> ea00 0900 and\.w r9, r0, r0 +0+1a6 <[^>]+> ea09 0000 and\.w r0, r9, r0 +0+1aa <[^>]+> ea00 0009 and\.w r0, r0, r9 +0+1ae <[^>]+> ea10 0000 ands\.w r0, r0, r0 +0+1b2 <[^>]+> ea01 4062 and\.w r0, r1, r2, asr #17 +0+1b6 <[^>]+> f001 0081 and\.w r0, r1, #129 ; 0x81 +0+1ba <[^>]+> 4380 bics r0, r0 +0+1bc <[^>]+> 4385 bics r5, r0 +0+1be <[^>]+> 43a8 bics r0, r5 +0+1c0 <[^>]+> 43a8 bics r0, r5 +0+1c2 <[^>]+> ea35 0000 bics\.w r0, r5, r0 +0+1c6 <[^>]+> ea25 0000 bic\.w r0, r5, r0 +0+1ca <[^>]+> ea21 0002 bic\.w r0, r1, r2 +0+1ce <[^>]+> ea20 0900 bic\.w r9, r0, r0 +0+1d2 <[^>]+> ea29 0000 bic\.w r0, r9, r0 +0+1d6 <[^>]+> ea20 0009 bic\.w r0, r0, r9 +0+1da <[^>]+> ea30 0000 bics\.w r0, r0, r0 +0+1de <[^>]+> ea21 4062 bic\.w r0, r1, r2, asr #17 +0+1e2 <[^>]+> f021 0081 bic\.w r0, r1, #129 ; 0x81 +0+1e6 <[^>]+> 4040 eors r0, r0 +0+1e8 <[^>]+> 4045 eors r5, r0 +0+1ea <[^>]+> 4068 eors r0, r5 +0+1ec <[^>]+> 4068 eors r0, r5 +0+1ee <[^>]+> 4068 eors r0, r5 +0+1f0 <[^>]+> ea85 0000 eor\.w r0, r5, r0 +0+1f4 <[^>]+> ea81 0002 eor\.w r0, r1, r2 +0+1f8 <[^>]+> ea80 0900 eor\.w r9, r0, r0 +0+1fc <[^>]+> ea89 0000 eor\.w r0, r9, r0 +0+200 <[^>]+> ea80 0009 eor\.w r0, r0, r9 +0+204 <[^>]+> ea90 0000 eors\.w r0, r0, r0 +0+208 <[^>]+> ea81 4062 eor\.w r0, r1, r2, asr #17 +0+20c <[^>]+> f081 0081 eor\.w r0, r1, #129 ; 0x81 +0+210 <[^>]+> 4300 orrs r0, r0 +0+212 <[^>]+> 4305 orrs r5, r0 +0+214 <[^>]+> 4328 orrs r0, r5 +0+216 <[^>]+> 4328 orrs r0, r5 +0+218 <[^>]+> 4328 orrs r0, r5 +0+21a <[^>]+> ea45 0000 orr\.w r0, r5, r0 +0+21e <[^>]+> ea41 0002 orr\.w r0, r1, r2 +0+222 <[^>]+> ea40 0900 orr\.w r9, r0, r0 +0+226 <[^>]+> ea49 0000 orr\.w r0, r9, r0 +0+22a <[^>]+> ea40 0009 orr\.w r0, r0, r9 +0+22e <[^>]+> ea50 0000 orrs\.w r0, r0, r0 +0+232 <[^>]+> ea41 4062 orr\.w r0, r1, r2, asr #17 +0+236 <[^>]+> f041 0081 orr\.w r0, r1, #129 ; 0x81 +0+23a <[^>]+> ebd0 0000 rsbs r0, r0, r0 +0+23e <[^>]+> ebd5 0500 rsbs r5, r5, r0 +0+242 <[^>]+> ebd0 0005 rsbs r0, r0, r5 +0+246 <[^>]+> ebd0 0005 rsbs r0, r0, r5 +0+24a <[^>]+> ebd5 0000 rsbs r0, r5, r0 +0+24e <[^>]+> ebc5 0000 rsb r0, r5, r0 +0+252 <[^>]+> ebc1 0002 rsb r0, r1, r2 +0+256 <[^>]+> ebc0 0900 rsb r9, r0, r0 +0+25a <[^>]+> ebc9 0000 rsb r0, r9, r0 +0+25e <[^>]+> ebc0 0009 rsb r0, r0, r9 +0+262 <[^>]+> ebd0 0000 rsbs r0, r0, r0 +0+266 <[^>]+> ebc1 4062 rsb r0, r1, r2, asr #17 +0+26a <[^>]+> f1c1 0081 rsb r0, r1, #129 ; 0x81 +0+26e <[^>]+> 4180 sbcs r0, r0 +0+270 <[^>]+> 4185 sbcs r5, r0 +0+272 <[^>]+> 41a8 sbcs r0, r5 +0+274 <[^>]+> 41a8 sbcs r0, r5 +0+276 <[^>]+> eb75 0000 sbcs\.w r0, r5, r0 +0+27a <[^>]+> eb65 0000 sbc\.w r0, r5, r0 +0+27e <[^>]+> eb61 0002 sbc\.w r0, r1, r2 +0+282 <[^>]+> eb60 0900 sbc\.w r9, r0, r0 +0+286 <[^>]+> eb69 0000 sbc\.w r0, r9, r0 +0+28a <[^>]+> eb60 0009 sbc\.w r0, r0, r9 +0+28e <[^>]+> eb70 0000 sbcs\.w r0, r0, r0 +0+292 <[^>]+> eb61 4062 sbc\.w r0, r1, r2, asr #17 +0+296 <[^>]+> f161 0081 sbc\.w r0, r1, #129 ; 0x81 +0+29a <[^>]+> f36f 0000 bfc r0, #0, #1 +0+29e <[^>]+> f36f 0900 bfc r9, #0, #1 +0+2a2 <[^>]+> f36f 0900 bfc r9, #0, #1 +0+2a6 <[^>]+> f36f 5055 bfc r0, #21, #1 +0+2aa <[^>]+> f36f 0011 bfc r0, #0, #18 +0+2ae <[^>]+> f360 0000 bfi r0, r0, #0, #1 +0+2b2 <[^>]+> f360 0900 bfi r9, r0, #0, #1 +0+2b6 <[^>]+> f369 0000 bfi r0, r9, #0, #1 +0+2ba <[^>]+> f360 5055 bfi r0, r0, #21, #1 +0+2be <[^>]+> f360 0011 bfi r0, r0, #0, #18 +0+2c2 <[^>]+> f340 0000 sbfx r0, r0, #0, #1 +0+2c6 <[^>]+> f3c0 0900 ubfx r9, r0, #0, #1 +0+2ca <[^>]+> f349 0000 sbfx r0, r9, #0, #1 +0+2ce <[^>]+> f3c0 5040 ubfx r0, r0, #21, #1 +0+2d2 <[^>]+> f340 0011 sbfx r0, r0, #0, #18 +0+2d6 <[^>]+> d0fe beq\.n 0+2d6 <[^>]+> +0+2d8 <[^>]+> d02a beq\.n 0+330 <[^>]+> +0+2da <[^>]+> d1fc bne\.n 0+2d6 <[^>]+> +0+2dc <[^>]+> d128 bne\.n 0+330 <[^>]+> +0+2de <[^>]+> d2fa bcs\.n 0+2d6 <[^>]+> +0+2e0 <[^>]+> d226 bcs\.n 0+330 <[^>]+> +0+2e2 <[^>]+> d2f8 bcs\.n 0+2d6 <[^>]+> +0+2e4 <[^>]+> d224 bcs\.n 0+330 <[^>]+> +0+2e6 <[^>]+> d3f6 bcc\.n 0+2d6 <[^>]+> +0+2e8 <[^>]+> d322 bcc\.n 0+330 <[^>]+> +0+2ea <[^>]+> d3f4 bcc\.n 0+2d6 <[^>]+> +0+2ec <[^>]+> d320 bcc\.n 0+330 <[^>]+> +0+2ee <[^>]+> d3f2 bcc\.n 0+2d6 <[^>]+> +0+2f0 <[^>]+> d31e bcc\.n 0+330 <[^>]+> +0+2f2 <[^>]+> d4f0 bmi\.n 0+2d6 <[^>]+> +0+2f4 <[^>]+> d41c bmi\.n 0+330 <[^>]+> +0+2f6 <[^>]+> d5ee bpl\.n 0+2d6 <[^>]+> +0+2f8 <[^>]+> d51a bpl\.n 0+330 <[^>]+> +0+2fa <[^>]+> d6ec bvs\.n 0+2d6 <[^>]+> +0+2fc <[^>]+> d618 bvs\.n 0+330 <[^>]+> +0+2fe <[^>]+> d7ea bvc\.n 0+2d6 <[^>]+> +0+300 <[^>]+> d716 bvc\.n 0+330 <[^>]+> +0+302 <[^>]+> d8e8 bhi\.n 0+2d6 <[^>]+> +0+304 <[^>]+> d814 bhi\.n 0+330 <[^>]+> +0+306 <[^>]+> d9e6 bls\.n 0+2d6 <[^>]+> +0+308 <[^>]+> d912 bls\.n 0+330 <[^>]+> +0+30a <[^>]+> d7e4 bvc\.n 0+2d6 <[^>]+> +0+30c <[^>]+> d710 bvc\.n 0+330 <[^>]+> +0+30e <[^>]+> d8e2 bhi\.n 0+2d6 <[^>]+> +0+310 <[^>]+> d80e bhi\.n 0+330 <[^>]+> +0+312 <[^>]+> d9e0 bls\.n 0+2d6 <[^>]+> +0+314 <[^>]+> d90c bls\.n 0+330 <[^>]+> +0+316 <[^>]+> dade bge\.n 0+2d6 <[^>]+> +0+318 <[^>]+> da0a bge\.n 0+330 <[^>]+> +0+31a <[^>]+> dbdc blt\.n 0+2d6 <[^>]+> +0+31c <[^>]+> db08 blt\.n 0+330 <[^>]+> +0+31e <[^>]+> dcda bgt\.n 0+2d6 <[^>]+> +0+320 <[^>]+> dc06 bgt\.n 0+330 <[^>]+> +0+322 <[^>]+> ddd8 ble\.n 0+2d6 <[^>]+> +0+324 <[^>]+> dd04 ble\.n 0+330 <[^>]+> +0+326 <[^>]+> e7d6 b\.n 0+2d6 <[^>]+> +0+328 <[^>]+> e002 b\.n 0+330 <[^>]+> +0+32a <[^>]+> e7d4 b\.n 0+2d6 <[^>]+> +0+32c <[^>]+> e000 b\.n 0+330 <[^>]+> +0+32e <[^>]+> 46c0 nop \(mov r8, r8\) +0+330 <[^>]+> f43f affe beq\.w 0+330 <[^>]+> +0+334 <[^>]+> f000 8058 beq\.w 0+3e8 <[^>]+> +0+338 <[^>]+> f47f affa bne\.w 0+330 <[^>]+> +0+33c <[^>]+> f040 8054 bne\.w 0+3e8 <[^>]+> +0+340 <[^>]+> f4bf aff6 bcs\.w 0+330 <[^>]+> +0+344 <[^>]+> f080 8050 bcs\.w 0+3e8 <[^>]+> +0+348 <[^>]+> f4bf aff2 bcs\.w 0+330 <[^>]+> +0+34c <[^>]+> f080 804c bcs\.w 0+3e8 <[^>]+> +0+350 <[^>]+> f4ff afee bcc\.w 0+330 <[^>]+> +0+354 <[^>]+> f0c0 8048 bcc\.w 0+3e8 <[^>]+> +0+358 <[^>]+> f4ff afea bcc\.w 0+330 <[^>]+> +0+35c <[^>]+> f0c0 8044 bcc\.w 0+3e8 <[^>]+> +0+360 <[^>]+> f4ff afe6 bcc\.w 0+330 <[^>]+> +0+364 <[^>]+> f0c0 8040 bcc\.w 0+3e8 <[^>]+> +0+368 <[^>]+> f53f afe2 bmi\.w 0+330 <[^>]+> +0+36c <[^>]+> f100 803c bmi\.w 0+3e8 <[^>]+> +0+370 <[^>]+> f57f afde bpl\.w 0+330 <[^>]+> +0+374 <[^>]+> f140 8038 bpl\.w 0+3e8 <[^>]+> +0+378 <[^>]+> f5bf afda bvs\.w 0+330 <[^>]+> +0+37c <[^>]+> f180 8034 bvs\.w 0+3e8 <[^>]+> +0+380 <[^>]+> f5ff afd6 bvc\.w 0+330 <[^>]+> +0+384 <[^>]+> f1c0 8030 bvc\.w 0+3e8 <[^>]+> +0+388 <[^>]+> f63f afd2 bhi\.w 0+330 <[^>]+> +0+38c <[^>]+> f200 802c bhi\.w 0+3e8 <[^>]+> +0+390 <[^>]+> f67f afce bls\.w 0+330 <[^>]+> +0+394 <[^>]+> f240 8028 bls\.w 0+3e8 <[^>]+> +0+398 <[^>]+> f5ff afca bvc\.w 0+330 <[^>]+> +0+39c <[^>]+> f1c0 8024 bvc\.w 0+3e8 <[^>]+> +0+3a0 <[^>]+> f63f afc6 bhi\.w 0+330 <[^>]+> +0+3a4 <[^>]+> f200 8020 bhi\.w 0+3e8 <[^>]+> +0+3a8 <[^>]+> f67f afc2 bls\.w 0+330 <[^>]+> +0+3ac <[^>]+> f240 801c bls\.w 0+3e8 <[^>]+> +0+3b0 <[^>]+> f6bf afbe bge\.w 0+330 <[^>]+> +0+3b4 <[^>]+> f280 8018 bge\.w 0+3e8 <[^>]+> +0+3b8 <[^>]+> f6ff afba blt\.w 0+330 <[^>]+> +0+3bc <[^>]+> f2c0 8014 blt\.w 0+3e8 <[^>]+> +0+3c0 <[^>]+> f73f afb6 bgt\.w 0+330 <[^>]+> +0+3c4 <[^>]+> f300 8010 bgt\.w 0+3e8 <[^>]+> +0+3c8 <[^>]+> f77f afb2 ble\.w 0+330 <[^>]+> +0+3cc <[^>]+> f340 800c ble\.w 0+3e8 <[^>]+> +0+3d0 <[^>]+> f7ff bfae b\.w 0+330 <[^>]+> +0+3d4 <[^>]+> f000 b808 b\.w 0+3e8 <[^>]+> +0+3d8 <[^>]+> f7ff ffaa bl 0+330 <[^>]+> +0+3dc <[^>]+> f000 f804 bl 0+3e8 <[^>]+> +0+3e0 <[^>]+> f7ff efa6 blx 0+330 <[^>]+> +0+3e4 <[^>]+> f000 e800 blx 0+3e8 <[^>]+> +0+3e8 <[^>]+> 4748 bx r9 +0+3ea <[^>]+> 4780 blx r0 +0+3ec <[^>]+> 47c8 blx r9 +0+3ee <[^>]+> f3c0 8f00 bxj r0 +0+3f2 <[^>]+> f3c9 8f00 bxj r9 +0+3f6 <[^>]+> fab0 f080 clz r0, r0 +0+3fa <[^>]+> fab0 f980 clz r9, r0 +0+3fe <[^>]+> fab9 f089 clz r0, r9 +0+402 <[^>]+> b661 cpsie f +0+404 <[^>]+> b672 cpsid i +0+406 <[^>]+> b664 cpsie a +0+408 <[^>]+> f3af 8620 cpsid\.w f +0+40c <[^>]+> f3af 8440 cpsie\.w i +0+410 <[^>]+> f3af 8680 cpsid\.w a +0+414 <[^>]+> f3af 8540 cpsie i, #0 +0+418 <[^>]+> f3af 8751 cpsid i, #17 +0+41c <[^>]+> f3af 8100 cps #0 +0+420 <[^>]+> f3af 8111 cps #17 +0+424 <[^>]+> 4600 mov r0, r0 +0+426 <[^>]+> 4681 mov r9, r0 +0+428 <[^>]+> 4648 mov r0, r9 +0+42a <[^>]+> ea4f 0000 mov\.w r0, r0 +0+42e <[^>]+> ea4f 0900 mov\.w r9, r0 +0+432 <[^>]+> ea4f 0009 mov\.w r0, r9 +0+436 <[^>]+> b910 cbnz r0, 0+43e <[^>]+> +0+438 <[^>]+> b105 cbz r5, 0+43c <[^>]+> +0+43a <[^>]+> bf00 nop +0+43c <[^>]+> bf10 yield +0+43e <[^>]+> bf20 wfe +0+440 <[^>]+> bf30 wfi +0+442 <[^>]+> bf40 sev +0+444 <[^>]+> f3af 8000 nop\.w +0+448 <[^>]+> f3af 8001 yield\.w +0+44c <[^>]+> f3af 8002 wfe\.w +0+450 <[^>]+> f3af 8003 wfi\.w +0+454 <[^>]+> f3af 9004 sev\.w +0+458 <[^>]+> bf90 nop \{9\} +0+45a <[^>]+> f3af 8081 nop\.w \{129\} +0+45e <[^>]+> bf08 it eq +0+460 <[^>]+> bf00 nop +0+462 <[^>]+> bf18 it ne +0+464 <[^>]+> bf00 nop +0+466 <[^>]+> bf28 it cs +0+468 <[^>]+> bf00 nop +0+46a <[^>]+> bf28 it cs +0+46c <[^>]+> bf00 nop +0+46e <[^>]+> bf38 it cc +0+470 <[^>]+> bf00 nop +0+472 <[^>]+> bf38 it cc +0+474 <[^>]+> bf00 nop +0+476 <[^>]+> bf38 it cc +0+478 <[^>]+> bf00 nop +0+47a <[^>]+> bf48 it mi +0+47c <[^>]+> bf00 nop +0+47e <[^>]+> bf58 it pl +0+480 <[^>]+> bf00 nop +0+482 <[^>]+> bf68 it vs +0+484 <[^>]+> bf00 nop +0+486 <[^>]+> bf78 it vc +0+488 <[^>]+> bf00 nop +0+48a <[^>]+> bf88 it hi +0+48c <[^>]+> bf00 nop +0+48e <[^>]+> bfa8 it ge +0+490 <[^>]+> bf00 nop +0+492 <[^>]+> bfb8 it lt +0+494 <[^>]+> bf00 nop +0+496 <[^>]+> bfc8 it gt +0+498 <[^>]+> bf00 nop +0+49a <[^>]+> bfd8 it le +0+49c <[^>]+> bf00 nop +0+49e <[^>]+> bfe8 it al +0+4a0 <[^>]+> bf00 nop +0+4a2 <[^>]+> bf04 itt eq +0+4a4 <[^>]+> bf00 nop +0+4a6 <[^>]+> bf00 nop +0+4a8 <[^>]+> bf0c ite eq +0+4aa <[^>]+> bf00 nop +0+4ac <[^>]+> bf00 nop +0+4ae <[^>]+> bf02 ittt eq +0+4b0 <[^>]+> bf00 nop +0+4b2 <[^>]+> bf00 nop +0+4b4 <[^>]+> bf00 nop +0+4b6 <[^>]+> bf0a itet eq +0+4b8 <[^>]+> bf00 nop +0+4ba <[^>]+> bf00 nop +0+4bc <[^>]+> bf00 nop +0+4be <[^>]+> bf06 itte eq +0+4c0 <[^>]+> bf00 nop +0+4c2 <[^>]+> bf00 nop +0+4c4 <[^>]+> bf00 nop +0+4c6 <[^>]+> bf0e itee eq +0+4c8 <[^>]+> bf00 nop +0+4ca <[^>]+> bf00 nop +0+4cc <[^>]+> bf00 nop +0+4ce <[^>]+> bf01 itttt eq +0+4d0 <[^>]+> bf00 nop +0+4d2 <[^>]+> bf00 nop +0+4d4 <[^>]+> bf00 nop +0+4d6 <[^>]+> bf00 nop +0+4d8 <[^>]+> bf09 itett eq +0+4da <[^>]+> bf00 nop +0+4dc <[^>]+> bf00 nop +0+4de <[^>]+> bf00 nop +0+4e0 <[^>]+> bf00 nop +0+4e2 <[^>]+> bf05 ittet eq +0+4e4 <[^>]+> bf00 nop +0+4e6 <[^>]+> bf00 nop +0+4e8 <[^>]+> bf00 nop +0+4ea <[^>]+> bf00 nop +0+4ec <[^>]+> bf03 ittte eq +0+4ee <[^>]+> bf00 nop +0+4f0 <[^>]+> bf00 nop +0+4f2 <[^>]+> bf00 nop +0+4f4 <[^>]+> bf00 nop +0+4f6 <[^>]+> bf07 ittee eq +0+4f8 <[^>]+> bf00 nop +0+4fa <[^>]+> bf00 nop +0+4fc <[^>]+> bf00 nop +0+4fe <[^>]+> bf00 nop +0+500 <[^>]+> bf0b itete eq +0+502 <[^>]+> bf00 nop +0+504 <[^>]+> bf00 nop +0+506 <[^>]+> bf00 nop +0+508 <[^>]+> bf00 nop +0+50a <[^>]+> bf0d iteet eq +0+50c <[^>]+> bf00 nop +0+50e <[^>]+> bf00 nop +0+510 <[^>]+> bf00 nop +0+512 <[^>]+> bf00 nop +0+514 <[^>]+> bf0f iteee eq +0+516 <[^>]+> bf00 nop +0+518 <[^>]+> bf00 nop +0+51a <[^>]+> bf00 nop +0+51c <[^>]+> bf00 nop +0+51e <[^>]+> bf1c itt ne +0+520 <[^>]+> bf00 nop +0+522 <[^>]+> bf00 nop +0+524 <[^>]+> bf14 ite ne +0+526 <[^>]+> bf00 nop +0+528 <[^>]+> bf00 nop +0+52a <[^>]+> bf1e ittt ne +0+52c <[^>]+> bf00 nop +0+52e <[^>]+> bf00 nop +0+530 <[^>]+> bf00 nop +0+532 <[^>]+> bf16 itet ne +0+534 <[^>]+> bf00 nop +0+536 <[^>]+> bf00 nop +0+538 <[^>]+> bf00 nop +0+53a <[^>]+> bf1a itte ne +0+53c <[^>]+> bf00 nop +0+53e <[^>]+> bf00 nop +0+540 <[^>]+> bf00 nop +0+542 <[^>]+> bf12 itee ne +0+544 <[^>]+> bf00 nop +0+546 <[^>]+> bf00 nop +0+548 <[^>]+> bf00 nop +0+54a <[^>]+> bf1f itttt ne +0+54c <[^>]+> bf00 nop +0+54e <[^>]+> bf00 nop +0+550 <[^>]+> bf00 nop +0+552 <[^>]+> bf00 nop +0+554 <[^>]+> bf17 itett ne +0+556 <[^>]+> bf00 nop +0+558 <[^>]+> bf00 nop +0+55a <[^>]+> bf00 nop +0+55c <[^>]+> bf00 nop +0+55e <[^>]+> bf1b ittet ne +0+560 <[^>]+> bf00 nop +0+562 <[^>]+> bf00 nop +0+564 <[^>]+> bf00 nop +0+566 <[^>]+> bf00 nop +0+568 <[^>]+> bf1d ittte ne +0+56a <[^>]+> bf00 nop +0+56c <[^>]+> bf00 nop +0+56e <[^>]+> bf00 nop +0+570 <[^>]+> bf00 nop +0+572 <[^>]+> bf19 ittee ne +0+574 <[^>]+> bf00 nop +0+576 <[^>]+> bf00 nop +0+578 <[^>]+> bf00 nop +0+57a <[^>]+> bf00 nop +0+57c <[^>]+> bf15 itete ne +0+57e <[^>]+> bf00 nop +0+580 <[^>]+> bf00 nop +0+582 <[^>]+> bf00 nop +0+584 <[^>]+> bf00 nop +0+586 <[^>]+> bf13 iteet ne +0+588 <[^>]+> bf00 nop +0+58a <[^>]+> bf00 nop +0+58c <[^>]+> bf00 nop +0+58e <[^>]+> bf00 nop +0+590 <[^>]+> bf11 iteee ne +0+592 <[^>]+> bf00 nop +0+594 <[^>]+> bf00 nop +0+596 <[^>]+> bf00 nop +0+598 <[^>]+> bf00 nop +0+59a <[^>]+> f895 1000 ldrb\.w r1, \[r5\] +0+59e <[^>]+> f895 1330 ldrb\.w r1, \[r5, #816\] +0+5a2 <[^>]+> f815 1c30 ldrb\.w r1, \[r5, #-48\] +0+5a6 <[^>]+> f815 1b30 ldrb\.w r1, \[r5, #48\]! +0+5aa <[^>]+> f815 1930 ldrb\.w r1, \[r5, #-48\]! +0+5ae <[^>]+> f815 1f30 ldrb\.w r1, \[r5\], #48 +0+5b2 <[^>]+> f815 1d30 ldrb\.w r1, \[r5\], #-48 +0+5b6 <[^>]+> 5d29 ldrb r1, \[r5, r4\] +0+5b8 <[^>]+> f819 100c ldrb\.w r1, \[r9, ip\] +0+5bc <[^>]+> f89f 10ac ldrb\.w r1, \[pc, #172\] ; 0+66c <[^>]+> +0+5c0 <[^>]+> f81f 102a ldrb\.w r1, \[pc, #-42\] ; 0+59a <[^>]+> +0+5c4 <[^>]+> f995 1000 ldrsb\.w r1, \[r5\] +0+5c8 <[^>]+> f995 1330 ldrsb\.w r1, \[r5, #816\] +0+5cc <[^>]+> f915 1c30 ldrsb\.w r1, \[r5, #-48\] +0+5d0 <[^>]+> f915 1b30 ldrsb\.w r1, \[r5, #48\]! +0+5d4 <[^>]+> f915 1930 ldrsb\.w r1, \[r5, #-48\]! +0+5d8 <[^>]+> f915 1f30 ldrsb\.w r1, \[r5\], #48 +0+5dc <[^>]+> f915 1d30 ldrsb\.w r1, \[r5\], #-48 +0+5e0 <[^>]+> 5729 ldrsb r1, \[r5, r4\] +0+5e2 <[^>]+> f919 100c ldrsb\.w r1, \[r9, ip\] +0+5e6 <[^>]+> f99f 1084 ldrsb\.w r1, \[pc, #132\] ; 0+66c <[^>]+> +0+5ea <[^>]+> f91f 1052 ldrsb\.w r1, \[pc, #-82\] ; 0+59a <[^>]+> +0+5ee <[^>]+> f8b5 1000 ldrh\.w r1, \[r5\] +0+5f2 <[^>]+> f8b5 1330 ldrh\.w r1, \[r5, #816\] +0+5f6 <[^>]+> f835 1c30 ldrh\.w r1, \[r5, #-48\] +0+5fa <[^>]+> f835 1b30 ldrh\.w r1, \[r5, #48\]! +0+5fe <[^>]+> f835 1930 ldrh\.w r1, \[r5, #-48\]! +0+602 <[^>]+> f835 1f30 ldrh\.w r1, \[r5\], #48 +0+606 <[^>]+> f835 1d30 ldrh\.w r1, \[r5\], #-48 +0+60a <[^>]+> 5b29 ldrh r1, \[r5, r4\] +0+60c <[^>]+> f839 100c ldrh\.w r1, \[r9, ip\] +0+610 <[^>]+> f8bf 1058 ldrh\.w r1, \[pc, #88\] ; 0+66c <[^>]+> +0+614 <[^>]+> f83f 107e ldrh\.w r1, \[pc, #-126\] ; 0+59a <[^>]+> +0+618 <[^>]+> f9b5 1000 ldrsh\.w r1, \[r5\] +0+61c <[^>]+> f9b5 1330 ldrsh\.w r1, \[r5, #816\] +0+620 <[^>]+> f935 1c30 ldrsh\.w r1, \[r5, #-48\] +0+624 <[^>]+> f935 1b30 ldrsh\.w r1, \[r5, #48\]! +0+628 <[^>]+> f935 1930 ldrsh\.w r1, \[r5, #-48\]! +0+62c <[^>]+> f935 1f30 ldrsh\.w r1, \[r5\], #48 +0+630 <[^>]+> f935 1d30 ldrsh\.w r1, \[r5\], #-48 +0+634 <[^>]+> 5f29 ldrsh r1, \[r5, r4\] +0+636 <[^>]+> f939 100c ldrsh\.w r1, \[r9, ip\] +0+63a <[^>]+> f9bf 1030 ldrsh\.w r1, \[pc, #48\] ; 0+66c <[^>]+> +0+63e <[^>]+> f93f 10a6 ldrsh\.w r1, \[pc, #-166\] ; 0+59a <[^>]+> +0+642 <[^>]+> f8d5 1000 ldr\.w r1, \[r5\] +0+646 <[^>]+> f8d5 1330 ldr\.w r1, \[r5, #816\] +0+64a <[^>]+> f855 1c30 ldr\.w r1, \[r5, #-48\] +0+64e <[^>]+> f855 1b30 ldr\.w r1, \[r5, #48\]! +0+652 <[^>]+> f855 1930 ldr\.w r1, \[r5, #-48\]! +0+656 <[^>]+> f855 1f30 ldr\.w r1, \[r5\], #48 +0+65a <[^>]+> f855 1d30 ldr\.w r1, \[r5\], #-48 +0+65e <[^>]+> 5929 ldr r1, \[r5, r4\] +0+660 <[^>]+> f859 100c ldr\.w r1, \[r9, ip\] +0+664 <[^>]+> f8df 1004 ldr\.w r1, \[pc, #4\] ; 0+66c <[^>]+> +0+668 <[^>]+> f85f 10d2 ldr\.w r1, \[pc, #-210\] ; 0+59a <[^>]+> +0+66c <[^>]+> f885 1000 strb\.w r1, \[r5\] +0+670 <[^>]+> f885 1330 strb\.w r1, \[r5, #816\] +0+674 <[^>]+> f805 1c30 strb\.w r1, \[r5, #-48\] +0+678 <[^>]+> f805 1b30 strb\.w r1, \[r5, #48\]! +0+67c <[^>]+> f805 1930 strb\.w r1, \[r5, #-48\]! +0+680 <[^>]+> f805 1f30 strb\.w r1, \[r5\], #48 +0+684 <[^>]+> f805 1d30 strb\.w r1, \[r5\], #-48 +0+688 <[^>]+> 5529 strb r1, \[r5, r4\] +0+68a <[^>]+> f809 100c strb\.w r1, \[r9, ip\] +0+68e <[^>]+> f88f 1086 strb\.w r1, \[pc, #134\] ; 0+716 <[^>]+> +0+692 <[^>]+> f80f 1028 strb\.w r1, \[pc, #-40\] ; 0+66c <[^>]+> +0+696 <[^>]+> f8a5 1000 strh\.w r1, \[r5\] +0+69a <[^>]+> f8a5 1330 strh\.w r1, \[r5, #816\] +0+69e <[^>]+> f825 1c30 strh\.w r1, \[r5, #-48\] +0+6a2 <[^>]+> f825 1b30 strh\.w r1, \[r5, #48\]! +0+6a6 <[^>]+> f825 1930 strh\.w r1, \[r5, #-48\]! +0+6aa <[^>]+> f825 1f30 strh\.w r1, \[r5\], #48 +0+6ae <[^>]+> f825 1d30 strh\.w r1, \[r5\], #-48 +0+6b2 <[^>]+> 5329 strh r1, \[r5, r4\] +0+6b4 <[^>]+> f829 100c strh\.w r1, \[r9, ip\] +0+6b8 <[^>]+> f8af 105a strh\.w r1, \[pc, #90\] ; 0+716 <[^>]+> +0+6bc <[^>]+> f82f 1054 strh\.w r1, \[pc, #-84\] ; 0+66c <[^>]+> +0+6c0 <[^>]+> f8c5 1000 str\.w r1, \[r5\] +0+6c4 <[^>]+> f8c5 1330 str\.w r1, \[r5, #816\] +0+6c8 <[^>]+> f845 1c30 str\.w r1, \[r5, #-48\] +0+6cc <[^>]+> f845 1b30 str\.w r1, \[r5, #48\]! +0+6d0 <[^>]+> f845 1930 str\.w r1, \[r5, #-48\]! +0+6d4 <[^>]+> f845 1f30 str\.w r1, \[r5\], #48 +0+6d8 <[^>]+> f845 1d30 str\.w r1, \[r5\], #-48 +0+6dc <[^>]+> 5129 str r1, \[r5, r4\] +0+6de <[^>]+> f849 100c str\.w r1, \[r9, ip\] +0+6e2 <[^>]+> f8cf 1032 str\.w r1, \[pc, #50\] ; 0+716 <[^>]+> +0+6e6 <[^>]+> f84f 107c str\.w r1, \[pc, #-124\] ; 0+66c <[^>]+> +0+6ea <[^>]+> f895 f000 pld \[r5\] +0+6ee <[^>]+> f895 f330 pld \[r5, #816\] +0+6f2 <[^>]+> f815 fc30 pld \[r5, #-48\] +0+6f6 <[^>]+> f815 fb30 pld \[r5, #48\]! +0+6fa <[^>]+> f815 f930 pld \[r5, #-48\]! +0+6fe <[^>]+> f815 ff30 pld \[r5\], #48 +0+702 <[^>]+> f815 fd30 pld \[r5\], #-48 +0+706 <[^>]+> f815 f000 pld \[r5, r0\] +0+70a <[^>]+> f819 f000 pld \[r9, r0\] +0+70e <[^>]+> f89f f006 pld \[pc, #6\] ; 0+716 <[^>]+> +0+712 <[^>]+> f81f f0a8 pld \[pc, #-168\] ; 0+66c <[^>]+> +0+716 <[^>]+> e9d5 2300 ldrd r2, r3, \[r5\] +0+71a <[^>]+> e9d5 230c ldrd r2, r3, \[r5, #48\] +0+71e <[^>]+> e955 230c ldrd r2, r3, \[r5, #-48\] +0+722 <[^>]+> e9c5 2300 strd r2, r3, \[r5\] +0+726 <[^>]+> e9c5 230c strd r2, r3, \[r5, #48\] +0+72a <[^>]+> e945 230c strd r2, r3, \[r5, #-48\] +0+72e <[^>]+> f835 1e00 ldrht r1, \[r5\] +0+732 <[^>]+> f835 1e30 ldrht r1, \[r5, #48\] +0+736 <[^>]+> f915 1e00 ldrsbt r1, \[r5\] +0+73a <[^>]+> f915 1e30 ldrsbt r1, \[r5, #48\] +0+73e <[^>]+> f835 1e00 ldrht r1, \[r5\] +0+742 <[^>]+> f835 1e30 ldrht r1, \[r5, #48\] +0+746 <[^>]+> f935 1e00 ldrsht r1, \[r5\] +0+74a <[^>]+> f935 1e30 ldrsht r1, \[r5, #48\] +0+74e <[^>]+> f855 1e00 ldrt r1, \[r5\] +0+752 <[^>]+> f855 1e30 ldrt r1, \[r5, #48\] +0+756 <[^>]+> e8d4 1f4f ldrexb r1, \[r4\] +0+75a <[^>]+> e8d4 1f5f ldrexh r1, \[r4\] +0+75e <[^>]+> e854 1f00 ldrex r1, \[r4\] +0+762 <[^>]+> e8d4 127f ldrexd r1, r2, \[r4\] +0+766 <[^>]+> e8c4 2f41 strexb r1, r2, \[r4\] +0+76a <[^>]+> e8c4 2f51 strexh r1, r2, \[r4\] +0+76e <[^>]+> e844 2100 strex r1, r2, \[r4\] +0+772 <[^>]+> e8c4 2371 strexd r1, r2, r3, \[r4\] +0+776 <[^>]+> e854 1f81 ldrex r1, \[r4, #516\] +0+77a <[^>]+> e844 2181 strex r1, r2, \[r4, #516\] +0+77e <[^>]+> c80e ldmia r0!, \{r1, r2, r3\} +0+780 <[^>]+> ca07 ldmia r2!, \{r0, r1, r2\} +0+782 <[^>]+> e892 0007 ldmia\.w r2, \{r0, r1, r2\} +0+786 <[^>]+> e899 0007 ldmia\.w r9, \{r0, r1, r2\} +0+78a <[^>]+> e890 0580 ldmia\.w r0, \{r7, r8, sl\} +0+78e <[^>]+> e8b0 0580 ldmia\.w r0!, \{r7, r8, sl\} +0+792 <[^>]+> c00e stmia r0!, \{r1, r2, r3\} +0+794 <[^>]+> c20b stmia r2!, \{r0, r1, r3\} +0+796 <[^>]+> e8a2 000b stmia\.w r2!, \{r0, r1, r3\} +0+79a <[^>]+> e889 0007 stmia\.w r9, \{r0, r1, r2\} +0+79e <[^>]+> e880 0580 stmia\.w r0, \{r7, r8, sl\} +0+7a2 <[^>]+> e8a0 0580 stmia\.w r0!, \{r7, r8, sl\} +0+7a6 <[^>]+> e900 0580 stmdb r0, \{r7, r8, sl\} +0+7aa <[^>]+> e910 0580 ldmdb r0, \{r7, r8, sl\} +0+7ae <[^>]+> fb00 0000 mla r0, r0, r0, r0 +0+7b2 <[^>]+> fb00 0010 mls r0, r0, r0, r0 +0+7b6 <[^>]+> fb00 0900 mla r9, r0, r0, r0 +0+7ba <[^>]+> fb09 0000 mla r0, r9, r0, r0 +0+7be <[^>]+> fb00 0009 mla r0, r0, r9, r0 +0+7c2 <[^>]+> fb00 9000 mla r0, r0, r0, r9 +0+7c6 <[^>]+> 4200 tst r0, r0 +0+7c8 <[^>]+> 4200 tst r0, r0 +0+7ca <[^>]+> 4205 tst r5, r0 +0+7cc <[^>]+> 4228 tst r0, r5 +0+7ce <[^>]+> ea10 4f65 tst\.w r0, r5, asr #17 +0+7d2 <[^>]+> ea10 0f00 tst\.w r0, r0 +0+7d6 <[^>]+> ea19 0f00 tst\.w r9, r0 +0+7da <[^>]+> ea10 0f09 tst\.w r0, r9 +0+7de <[^>]+> f010 0f81 tst\.w r0, #129 ; 0x81 +0+7e2 <[^>]+> f015 0f81 tst\.w r5, #129 ; 0x81 +0+7e6 <[^>]+> ea90 0f00 teq r0, r0 +0+7ea <[^>]+> ea90 0f00 teq r0, r0 +0+7ee <[^>]+> ea95 0f00 teq r5, r0 +0+7f2 <[^>]+> ea90 0f05 teq r0, r5 +0+7f6 <[^>]+> ea90 4f65 teq r0, r5, asr #17 +0+7fa <[^>]+> ea90 0f00 teq r0, r0 +0+7fe <[^>]+> ea99 0f00 teq r9, r0 +0+802 <[^>]+> ea90 0f09 teq r0, r9 +0+806 <[^>]+> f090 0f81 teq r0, #129 ; 0x81 +0+80a <[^>]+> f095 0f81 teq r5, #129 ; 0x81 +0+80e <[^>]+> 4280 cmp r0, r0 +0+810 <[^>]+> 4280 cmp r0, r0 +0+812 <[^>]+> 4285 cmp r5, r0 +0+814 <[^>]+> 42a8 cmp r0, r5 +0+816 <[^>]+> ebb0 4f65 cmp\.w r0, r5, asr #17 +0+81a <[^>]+> ebb0 0f00 cmp\.w r0, r0 +0+81e <[^>]+> 4581 cmp r9, r0 +0+820 <[^>]+> ebb0 0f09 cmp\.w r0, r9 +0+824 <[^>]+> f1b0 0f81 cmp\.w r0, #129 ; 0x81 +0+828 <[^>]+> f1b5 0f81 cmp\.w r5, #129 ; 0x81 +0+82c <[^>]+> 42c0 cmn r0, r0 +0+82e <[^>]+> 42c0 cmn r0, r0 +0+830 <[^>]+> 42c5 cmn r5, r0 +0+832 <[^>]+> 42e8 cmn r0, r5 +0+834 <[^>]+> eb10 4f65 cmn\.w r0, r5, asr #17 +0+838 <[^>]+> eb10 0f00 cmn\.w r0, r0 +0+83c <[^>]+> eb19 0f00 cmn\.w r9, r0 +0+840 <[^>]+> eb10 0f09 cmn\.w r0, r9 +0+844 <[^>]+> f110 0f81 cmn\.w r0, #129 ; 0x81 +0+848 <[^>]+> f115 0f81 cmn\.w r5, #129 ; 0x81 +0+84c <[^>]+> 1c00 adds r0, r0, #0 +0+84e <[^>]+> 4600 mov r0, r0 +0+850 <[^>]+> 1c05 adds r5, r0, #0 +0+852 <[^>]+> 4628 mov r0, r5 +0+854 <[^>]+> ea4f 4065 mov\.w r0, r5, asr #17 +0+858 <[^>]+> ea4f 0000 mov\.w r0, r0 +0+85c <[^>]+> ea5f 0900 movs\.w r9, r0 +0+860 <[^>]+> ea5f 0009 movs\.w r0, r9 +0+864 <[^>]+> f04f 0081 mov\.w r0, #129 ; 0x81 +0+868 <[^>]+> f04f 0581 mov\.w r5, #129 ; 0x81 +0+86c <[^>]+> 43c0 mvns r0, r0 +0+86e <[^>]+> ea6f 0000 mvn\.w r0, r0 +0+872 <[^>]+> 43c5 mvns r5, r0 +0+874 <[^>]+> ea6f 0005 mvn\.w r0, r5 +0+878 <[^>]+> ea6f 4065 mvn\.w r0, r5, asr #17 +0+87c <[^>]+> ea6f 0000 mvn\.w r0, r0 +0+880 <[^>]+> ea7f 0900 mvns\.w r9, r0 +0+884 <[^>]+> ea7f 0009 mvns\.w r0, r9 +0+888 <[^>]+> f06f 0081 mvn\.w r0, #129 ; 0x81 +0+88c <[^>]+> f06f 0581 mvn\.w r5, #129 ; 0x81 +0+890 <[^>]+> f240 0000 movw r0, #0 ; 0x0 +0+894 <[^>]+> f2c0 0000 movt r0, #0 ; 0x0 +0+898 <[^>]+> f240 0900 movw r9, #0 ; 0x0 +0+89c <[^>]+> f249 0000 movw r0, #36864 ; 0x9000 +0+8a0 <[^>]+> f640 0000 movw r0, #2048 ; 0x800 +0+8a4 <[^>]+> f240 5000 movw r0, #1280 ; 0x500 +0+8a8 <[^>]+> f240 0081 movw r0, #129 ; 0x81 +0+8ac <[^>]+> f64f 70ff movw r0, #65535 ; 0xffff +0+8b0 <[^>]+> f3ef 8000 mrs r0, SPSR +0+8b4 <[^>]+> f3ff 8000 mrs r0, CPSR +0+8b8 <[^>]+> f3ef 8900 mrs r9, SPSR +0+8bc <[^>]+> f3ff 8900 mrs r9, CPSR +0+8c0 <[^>]+> f380 8100 msr SPSR_c, r0 +0+8c4 <[^>]+> f390 8100 msr CPSR_c, r0 +0+8c8 <[^>]+> f389 8100 msr SPSR_c, r9 +0+8cc <[^>]+> f380 8200 msr SPSR_x, r0 +0+8d0 <[^>]+> f380 8400 msr SPSR_s, r0 +0+8d4 <[^>]+> f380 8800 msr SPSR_f, r0 +0+8d8 <[^>]+> fb00 f000 mul\.w r0, r0, r0 +0+8dc <[^>]+> fb09 f000 mul\.w r0, r9, r0 +0+8e0 <[^>]+> fb00 f009 mul\.w r0, r0, r9 +0+8e4 <[^>]+> fb00 f000 mul\.w r0, r0, r0 +0+8e8 <[^>]+> fb00 f909 mul\.w r9, r0, r9 +0+8ec <[^>]+> 4345 muls r5, r0 +0+8ee <[^>]+> 4345 muls r5, r0 +0+8f0 <[^>]+> 4368 muls r0, r5 +0+8f2 <[^>]+> fb80 0100 smull r0, r1, r0, r0 +0+8f6 <[^>]+> fba0 0100 umull r0, r1, r0, r0 +0+8fa <[^>]+> fbc0 0100 smlal r0, r1, r0, r0 +0+8fe <[^>]+> fbe0 0100 umlal r0, r1, r0, r0 +0+902 <[^>]+> fb80 9000 smull r9, r0, r0, r0 +0+906 <[^>]+> fb80 0900 smull r0, r9, r0, r0 +0+90a <[^>]+> fb89 0100 smull r0, r1, r9, r0 +0+90e <[^>]+> fb80 0109 smull r0, r1, r0, r9 +0+912 <[^>]+> 4240 negs r0, r0 +0+914 <[^>]+> 4268 negs r0, r5 +0+916 <[^>]+> 4245 negs r5, r0 +0+918 <[^>]+> f1d0 0000 rsbs r0, r0, #0 ; 0x0 +0+91c <[^>]+> f1d0 0500 rsbs r5, r0, #0 ; 0x0 +0+920 <[^>]+> f1d5 0000 rsbs r0, r5, #0 ; 0x0 +0+924 <[^>]+> f1c9 0000 rsb r0, r9, #0 ; 0x0 +0+928 <[^>]+> f1c0 0900 rsb r9, r0, #0 ; 0x0 +0+92c <[^>]+> f1d9 0000 rsbs r0, r9, #0 ; 0x0 +0+930 <[^>]+> f1d0 0900 rsbs r9, r0, #0 ; 0x0 +0+934 <[^>]+> eac0 0000 pkhbt r0, r0, r0 +0+938 <[^>]+> eac0 0900 pkhbt r9, r0, r0 +0+93c <[^>]+> eac9 0000 pkhbt r0, r9, r0 +0+940 <[^>]+> eac0 0009 pkhbt r0, r0, r9 +0+944 <[^>]+> eac0 5000 pkhbt r0, r0, r0, lsl #20 +0+948 <[^>]+> eac0 00c0 pkhbt r0, r0, r0, lsl #3 +0+94c <[^>]+> eac2 0103 pkhbt r1, r2, r3 +0+950 <[^>]+> eac2 4163 pkhtb r1, r2, r3, asr #17 +0+954 <[^>]+> b401 push \{r0\} +0+956 <[^>]+> bc01 pop \{r0\} +0+958 <[^>]+> b502 push \{r1, lr\} +0+95a <[^>]+> bd02 pop \{r1, pc\} +0+95c <[^>]+> e8bd 1f00 ldmia\.w sp!, \{r8, r9, sl, fp, ip\} +0+960 <[^>]+> e8ad 1f00 stmia\.w sp!, \{r8, r9, sl, fp, ip\} +0+964 <[^>]+> fa92 f113 qadd16 r1, r2, r3 +0+968 <[^>]+> fa82 f113 qadd8 r1, r2, r3 +0+96c <[^>]+> faa2 f113 qaddsubx r1, r2, r3 +0+970 <[^>]+> fad2 f113 qsub16 r1, r2, r3 +0+974 <[^>]+> fac2 f113 qsub8 r1, r2, r3 +0+978 <[^>]+> fae2 f113 qsubaddx r1, r2, r3 +0+97c <[^>]+> fa92 f103 sadd16 r1, r2, r3 +0+980 <[^>]+> fa82 f103 sadd8 r1, r2, r3 +0+984 <[^>]+> faa2 f103 saddsubx r1, r2, r3 +0+988 <[^>]+> fad2 f103 ssub16 r1, r2, r3 +0+98c <[^>]+> fac2 f103 ssub8 r1, r2, r3 +0+990 <[^>]+> fae2 f103 ssubaddx r1, r2, r3 +0+994 <[^>]+> fa92 f123 shadd16 r1, r2, r3 +0+998 <[^>]+> fa82 f123 shadd8 r1, r2, r3 +0+99c <[^>]+> faa2 f123 shaddsubx r1, r2, r3 +0+9a0 <[^>]+> fad2 f123 shsub16 r1, r2, r3 +0+9a4 <[^>]+> fac2 f123 shsub8 r1, r2, r3 +0+9a8 <[^>]+> fae2 f123 shsubaddx r1, r2, r3 +0+9ac <[^>]+> fa92 f143 uadd16 r1, r2, r3 +0+9b0 <[^>]+> fa82 f143 uadd8 r1, r2, r3 +0+9b4 <[^>]+> faa2 f143 uaddsubx r1, r2, r3 +0+9b8 <[^>]+> fad2 f143 usub16 r1, r2, r3 +0+9bc <[^>]+> fac2 f143 usub8 r1, r2, r3 +0+9c0 <[^>]+> fae2 f143 usubaddx r1, r2, r3 +0+9c4 <[^>]+> fa92 f163 uhadd16 r1, r2, r3 +0+9c8 <[^>]+> fa82 f163 uhadd8 r1, r2, r3 +0+9cc <[^>]+> faa2 f163 uhaddsubx r1, r2, r3 +0+9d0 <[^>]+> fad2 f163 uhsub16 r1, r2, r3 +0+9d4 <[^>]+> fac2 f163 uhsub8 r1, r2, r3 +0+9d8 <[^>]+> fae2 f163 uhsubaddx r1, r2, r3 +0+9dc <[^>]+> fa92 f153 uqadd16 r1, r2, r3 +0+9e0 <[^>]+> fa82 f153 uqadd8 r1, r2, r3 +0+9e4 <[^>]+> faa2 f153 uqaddsubx r1, r2, r3 +0+9e8 <[^>]+> fad2 f153 uqsub16 r1, r2, r3 +0+9ec <[^>]+> fac2 f153 uqsub8 r1, r2, r3 +0+9f0 <[^>]+> fae2 f153 uqsubaddx r1, r2, r3 +0+9f4 <[^>]+> faa2 f183 sel r1, r2, r3 +0+9f8 <[^>]+> ba00 rev r0, r0 +0+9fa <[^>]+> fa90 f080 rev\.w r0, r0 +0+9fe <[^>]+> ba28 rev r0, r5 +0+a00 <[^>]+> ba05 rev r5, r0 +0+a02 <[^>]+> fa99 f089 rev\.w r0, r9 +0+a06 <[^>]+> fa90 f980 rev\.w r9, r0 +0+a0a <[^>]+> ba40 rev16 r0, r0 +0+a0c <[^>]+> fa90 f090 rev16\.w r0, r0 +0+a10 <[^>]+> ba68 rev16 r0, r5 +0+a12 <[^>]+> ba45 rev16 r5, r0 +0+a14 <[^>]+> fa99 f099 rev16\.w r0, r9 +0+a18 <[^>]+> fa90 f990 rev16\.w r9, r0 +0+a1c <[^>]+> bac0 revsh r0, r0 +0+a1e <[^>]+> fa90 f0b0 revsh\.w r0, r0 +0+a22 <[^>]+> bae8 revsh r0, r5 +0+a24 <[^>]+> bac5 revsh r5, r0 +0+a26 <[^>]+> fa99 f0b9 revsh\.w r0, r9 +0+a2a <[^>]+> fa90 f9b0 revsh\.w r9, r0 +0+a2e <[^>]+> fa90 f0a0 rbit r0, r0 +0+a32 <[^>]+> fa90 f0a0 rbit r0, r0 +0+a36 <[^>]+> fa95 f0a0 rbit r0, r5 +0+a3a <[^>]+> fa90 f5a0 rbit r5, r0 +0+a3e <[^>]+> fa99 f0a0 rbit r0, r9 +0+a42 <[^>]+> fa90 f9a0 rbit r9, r0 +0+a46 <[^>]+> 0440 lsls r0, r0, #17 +0+a48 <[^>]+> 0380 lsls r0, r0, #14 +0+a4a <[^>]+> 0445 lsls r5, r0, #17 +0+a4c <[^>]+> 03a8 lsls r0, r5, #14 +0+a4e <[^>]+> 4080 lsls r0, r0 +0+a50 <[^>]+> 40a8 lsls r0, r5 +0+a52 <[^>]+> 40a8 lsls r0, r5 +0+a54 <[^>]+> ea4f 4949 mov\.w r9, r9, lsl #17 +0+a58 <[^>]+> ea4f 3989 mov\.w r9, r9, lsl #14 +0+a5c <[^>]+> ea5f 4049 movs\.w r0, r9, lsl #17 +0+a60 <[^>]+> ea4f 3980 mov\.w r9, r0, lsl #14 +0+a64 <[^>]+> fa00 f000 lsl\.w r0, r0, r0 +0+a68 <[^>]+> fa09 f909 lsl\.w r9, r9, r9 +0+a6c <[^>]+> fa19 f900 lsls\.w r9, r9, r0 +0+a70 <[^>]+> fa00 f009 lsl\.w r0, r0, r9 +0+a74 <[^>]+> fa00 f005 lsl\.w r0, r0, r5 +0+a78 <[^>]+> fa11 f002 lsls\.w r0, r1, r2 +0+a7c <[^>]+> 0c40 lsrs r0, r0, #17 +0+a7e <[^>]+> 0b80 lsrs r0, r0, #14 +0+a80 <[^>]+> 0c45 lsrs r5, r0, #17 +0+a82 <[^>]+> 0ba8 lsrs r0, r5, #14 +0+a84 <[^>]+> 40c0 lsrs r0, r0 +0+a86 <[^>]+> 40e8 lsrs r0, r5 +0+a88 <[^>]+> 40e8 lsrs r0, r5 +0+a8a <[^>]+> ea4f 4959 mov\.w r9, r9, lsr #17 +0+a8e <[^>]+> ea4f 3999 mov\.w r9, r9, lsr #14 +0+a92 <[^>]+> ea5f 4059 movs\.w r0, r9, lsr #17 +0+a96 <[^>]+> ea4f 3990 mov\.w r9, r0, lsr #14 +0+a9a <[^>]+> fa20 f000 lsr\.w r0, r0, r0 +0+a9e <[^>]+> fa29 f909 lsr\.w r9, r9, r9 +0+aa2 <[^>]+> fa39 f900 lsrs\.w r9, r9, r0 +0+aa6 <[^>]+> fa20 f009 lsr\.w r0, r0, r9 +0+aaa <[^>]+> fa20 f005 lsr\.w r0, r0, r5 +0+aae <[^>]+> fa31 f002 lsrs\.w r0, r1, r2 +0+ab2 <[^>]+> 1440 asrs r0, r0, #17 +0+ab4 <[^>]+> 1380 asrs r0, r0, #14 +0+ab6 <[^>]+> 1445 asrs r5, r0, #17 +0+ab8 <[^>]+> 13a8 asrs r0, r5, #14 +0+aba <[^>]+> 4100 asrs r0, r0 +0+abc <[^>]+> 4128 asrs r0, r5 +0+abe <[^>]+> 4128 asrs r0, r5 +0+ac0 <[^>]+> ea4f 4969 mov\.w r9, r9, asr #17 +0+ac4 <[^>]+> ea4f 39a9 mov\.w r9, r9, asr #14 +0+ac8 <[^>]+> ea5f 4069 movs\.w r0, r9, asr #17 +0+acc <[^>]+> ea4f 39a0 mov\.w r9, r0, asr #14 +0+ad0 <[^>]+> fa40 f000 asr\.w r0, r0, r0 +0+ad4 <[^>]+> fa49 f909 asr\.w r9, r9, r9 +0+ad8 <[^>]+> fa59 f900 asrs\.w r9, r9, r0 +0+adc <[^>]+> fa40 f009 asr\.w r0, r0, r9 +0+ae0 <[^>]+> fa40 f005 asr\.w r0, r0, r5 +0+ae4 <[^>]+> fa51 f002 asrs\.w r0, r1, r2 +0+ae8 <[^>]+> ea5f 4070 movs\.w r0, r0, ror #17 +0+aec <[^>]+> ea5f 30b0 movs\.w r0, r0, ror #14 +0+af0 <[^>]+> ea5f 4570 movs\.w r5, r0, ror #17 +0+af4 <[^>]+> ea5f 30b5 movs\.w r0, r5, ror #14 +0+af8 <[^>]+> 41c0 rors r0, r0 +0+afa <[^>]+> 41e8 rors r0, r5 +0+afc <[^>]+> 41e8 rors r0, r5 +0+afe <[^>]+> ea4f 4979 mov\.w r9, r9, ror #17 +0+b02 <[^>]+> ea4f 39b9 mov\.w r9, r9, ror #14 +0+b06 <[^>]+> ea5f 4079 movs\.w r0, r9, ror #17 +0+b0a <[^>]+> ea4f 39b0 mov\.w r9, r0, ror #14 +0+b0e <[^>]+> fa60 f000 ror\.w r0, r0, r0 +0+b12 <[^>]+> fa69 f909 ror\.w r9, r9, r9 +0+b16 <[^>]+> fa79 f900 rors\.w r9, r9, r0 +0+b1a <[^>]+> fa60 f009 ror\.w r0, r0, r9 +0+b1e <[^>]+> fa60 f005 ror\.w r0, r0, r5 +0+b22 <[^>]+> fa71 f002 rors\.w r0, r1, r2 +0+b26 <[^>]+> f7f0 8000 smi #0 ; 0x0 +0+b2a <[^>]+> f7fd 8bca smi #43981 ; 0xabcd +0+b2e <[^>]+> fb10 0000 smlabb r0, r0, r0, r0 +0+b32 <[^>]+> fb10 0900 smlabb r9, r0, r0, r0 +0+b36 <[^>]+> fb19 0000 smlabb r0, r9, r0, r0 +0+b3a <[^>]+> fb10 0009 smlabb r0, r0, r9, r0 +0+b3e <[^>]+> fb10 9000 smlabb r0, r0, r0, r9 +0+b42 <[^>]+> fb10 0020 smlatb r0, r0, r0, r0 +0+b46 <[^>]+> fb10 0010 smlabt r0, r0, r0, r0 +0+b4a <[^>]+> fb10 0030 smlatt r0, r0, r0, r0 +0+b4e <[^>]+> fb30 0000 smlawb r0, r0, r0, r0 +0+b52 <[^>]+> fb30 0010 smlawt r0, r0, r0, r0 +0+b56 <[^>]+> fb20 0000 smlad r0, r0, r0, r0 +0+b5a <[^>]+> fb20 0010 smladx r0, r0, r0, r0 +0+b5e <[^>]+> fb40 0000 smlsd r0, r0, r0, r0 +0+b62 <[^>]+> fb40 0010 smlsdx r0, r0, r0, r0 +0+b66 <[^>]+> fb50 0000 smmla r0, r0, r0, r0 +0+b6a <[^>]+> fb50 0010 smmlar r0, r0, r0, r0 +0+b6e <[^>]+> fb60 0000 smmls r0, r0, r0, r0 +0+b72 <[^>]+> fb60 0010 smmlsr r0, r0, r0, r0 +0+b76 <[^>]+> fb70 0000 usada8 r0, r0, r0, r0 +0+b7a <[^>]+> fbc0 0080 smlalbb r0, r0, r0, r0 +0+b7e <[^>]+> fbc0 9080 smlalbb r9, r0, r0, r0 +0+b82 <[^>]+> fbc0 0980 smlalbb r0, r9, r0, r0 +0+b86 <[^>]+> fbc9 0080 smlalbb r0, r0, r9, r0 +0+b8a <[^>]+> fbc0 0089 smlalbb r0, r0, r0, r9 +0+b8e <[^>]+> fbc0 00a0 smlaltb r0, r0, r0, r0 +0+b92 <[^>]+> fbc0 0090 smlalbt r0, r0, r0, r0 +0+b96 <[^>]+> fbc0 00b0 smlaltt r0, r0, r0, r0 +0+b9a <[^>]+> fbc0 00c0 smlald r0, r0, r0, r0 +0+b9e <[^>]+> fbc0 00d0 smlaldx r0, r0, r0, r0 +0+ba2 <[^>]+> fbd0 00c0 smlsld r0, r0, r0, r0 +0+ba6 <[^>]+> fbd0 00d0 smlsldx r0, r0, r0, r0 +0+baa <[^>]+> fbe0 0060 umaal r0, r0, r0, r0 +0+bae <[^>]+> fb10 f000 smulbb r0, r0, r0 +0+bb2 <[^>]+> fb10 f900 smulbb r9, r0, r0 +0+bb6 <[^>]+> fb19 f000 smulbb r0, r9, r0 +0+bba <[^>]+> fb10 f009 smulbb r0, r0, r9 +0+bbe <[^>]+> fb10 f020 smultb r0, r0, r0 +0+bc2 <[^>]+> fb10 f010 smulbt r0, r0, r0 +0+bc6 <[^>]+> fb10 f030 smultt r0, r0, r0 +0+bca <[^>]+> fb30 f000 smulwb r0, r0, r0 +0+bce <[^>]+> fb30 f010 smulwt r0, r0, r0 +0+bd2 <[^>]+> fb50 f000 smmul r0, r0, r0 +0+bd6 <[^>]+> fb50 f010 smmulr r0, r0, r0 +0+bda <[^>]+> fb20 f000 smuad r0, r0, r0 +0+bde <[^>]+> fb20 f010 smuadx r0, r0, r0 +0+be2 <[^>]+> fb40 f000 smusd r0, r0, r0 +0+be6 <[^>]+> fb40 f010 smusdx r0, r0, r0 +0+bea <[^>]+> fb70 f000 usad8 r0, r0, r0 +0+bee <[^>]+> f300 0000 ssat r0, #0, r0 +0+bf2 <[^>]+> f300 0000 ssat r0, #0, r0 +0+bf6 <[^>]+> f300 0000 ssat r0, #0, r0 +0+bfa <[^>]+> f300 0900 ssat r9, #0, r0 +0+bfe <[^>]+> f300 0011 ssat r0, #17, r0 +0+c02 <[^>]+> f309 0000 ssat r0, #0, r9 +0+c06 <[^>]+> f300 7000 ssat r0, #0, r0, lsl #28 +0+c0a <[^>]+> f320 00c0 ssat r0, #0, r0, asr #3 +0+c0e <[^>]+> f320 0000 ssat16 r0, #0, r0 +0+c12 <[^>]+> f320 0900 ssat16 r9, #0, r0 +0+c16 <[^>]+> f320 0009 ssat16 r0, #9, r0 +0+c1a <[^>]+> f329 0000 ssat16 r0, #0, r9 +0+c1e <[^>]+> f380 0000 usat r0, #0, r0 +0+c22 <[^>]+> f380 0000 usat r0, #0, r0 +0+c26 <[^>]+> f380 0000 usat r0, #0, r0 +0+c2a <[^>]+> f380 0900 usat r9, #0, r0 +0+c2e <[^>]+> f380 0011 usat r0, #17, r0 +0+c32 <[^>]+> f389 0000 usat r0, #0, r9 +0+c36 <[^>]+> f380 7000 usat r0, #0, r0, lsl #28 +0+c3a <[^>]+> f3a0 00c0 usat r0, #0, r0, asr #3 +0+c3e <[^>]+> f3a0 0000 usat16 r0, #0, r0 +0+c42 <[^>]+> f3a0 0900 usat16 r9, #0, r0 +0+c46 <[^>]+> f3a0 0009 usat16 r0, #9, r0 +0+c4a <[^>]+> f3a9 0000 usat16 r0, #0, r9 +0+c4e <[^>]+> b240 sxtb r0, r0 +0+c50 <[^>]+> b240 sxtb r0, r0 +0+c52 <[^>]+> b245 sxtb r5, r0 +0+c54 <[^>]+> b268 sxtb r0, r5 +0+c56 <[^>]+> fa4f f182 sxtb\.w r1, r2 +0+c5a <[^>]+> fa4f f192 sxtb\.w r1, r2, ror #8 +0+c5e <[^>]+> fa4f f1a2 sxtb\.w r1, r2, ror #16 +0+c62 <[^>]+> fa4f f1b2 sxtb\.w r1, r2, ror #24 +0+c66 <[^>]+> fa2f f182 sxtb16 r1, r2 +0+c6a <[^>]+> fa2f f889 sxtb16 r8, r9 +0+c6e <[^>]+> b211 sxth r1, r2 +0+c70 <[^>]+> fa0f f889 sxth\.w r8, r9 +0+c74 <[^>]+> b2d1 uxtb r1, r2 +0+c76 <[^>]+> fa5f f889 uxtb\.w r8, r9 +0+c7a <[^>]+> fa3f f182 uxtb16 r1, r2 +0+c7e <[^>]+> fa3f f889 uxtb16 r8, r9 +0+c82 <[^>]+> b291 uxth r1, r2 +0+c84 <[^>]+> fa1f f889 uxth\.w r8, r9 +0+c88 <[^>]+> fa40 f080 sxtab r0, r0, r0 +0+c8c <[^>]+> fa40 f080 sxtab r0, r0, r0 +0+c90 <[^>]+> fa40 f990 sxtab r9, r0, r0, ror #8 +0+c94 <[^>]+> fa49 f0a0 sxtab r0, r9, r0, ror #16 +0+c98 <[^>]+> fa40 f0b9 sxtab r0, r0, r9, ror #24 +0+c9c <[^>]+> fa22 f183 sxtab16 r1, r2, r3 +0+ca0 <[^>]+> fa02 f183 sxtah r1, r2, r3 +0+ca4 <[^>]+> fa52 f183 uxtab r1, r2, r3 +0+ca8 <[^>]+> fa32 f183 uxtab16 r1, r2, r3 +0+cac <[^>]+> fa12 f183 uxtah r1, r2, r3 diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/thumb32.s binutils-2.16.91.0.1/gas/testsuite/gas/arm/thumb32.s --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/thumb32.s 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/thumb32.s 2005-06-22 13:53:35.195269407 -0700 @@ -0,0 +1,735 @@ + .text + .thumb + .syntax unified + +encode_thumb32_immediate: + orr r0, r1, #0x00000000 + orr r0, r1, #0x000000a5 + orr r0, r1, #0x00a500a5 + orr r0, r1, #0xa500a500 + orr r0, r1, #0xa5a5a5a5 + + orr r0, r1, #0xa5 << 31 + orr r0, r1, #0xa5 << 30 + orr r0, r1, #0xa5 << 29 + orr r0, r1, #0xa5 << 28 + orr r0, r1, #0xa5 << 27 + orr r0, r1, #0xa5 << 26 + orr r0, r1, #0xa5 << 25 + orr r0, r1, #0xa5 << 24 + orr r0, r1, #0xa5 << 23 + orr r0, r1, #0xa5 << 22 + orr r0, r1, #0xa5 << 21 + orr r0, r1, #0xa5 << 20 + orr r0, r1, #0xa5 << 19 + orr r0, r1, #0xa5 << 18 + orr r0, r1, #0xa5 << 17 + orr r0, r1, #0xa5 << 16 + orr r0, r1, #0xa5 << 15 + orr r0, r1, #0xa5 << 14 + orr r0, r1, #0xa5 << 13 + orr r0, r1, #0xa5 << 12 + orr r0, r1, #0xa5 << 11 + orr r0, r1, #0xa5 << 10 + orr r0, r1, #0xa5 << 9 + orr r0, r1, #0xa5 << 8 + orr r0, r1, #0xa5 << 7 + orr r0, r1, #0xa5 << 6 + orr r0, r1, #0xa5 << 5 + orr r0, r1, #0xa5 << 4 + orr r0, r1, #0xa5 << 3 + orr r0, r1, #0xa5 << 2 + orr r0, r1, #0xa5 << 1 + +add_sub: + adds r0, r0, #0 @ format 1 + adds r5, r0, #0 + adds r0, r5, #0 + adds r0, r0, #5 + + adds r0, #129 @ format 2 + adds r0, r0, #129 + adds r5, #126 + + adds r0, r0, r0 @ format 3 + adds r5, r0, r0 + adds r0, r5, r0 + adds r0, r0, r5 + adds r1, r2, r3 + + add r8, r0 @ format 4 + add r0, r8 + add r0, r8, r0 + add r0, r0, r8 + add r8, r0, r0 @ ... not this one + + add r1, r0 + add r0, r1 + + add r0, pc, #0 @ format 5 + add r5, pc, #0 + add r0, pc, #516 + + add r0, sp, #0 @ format 6 + add r5, sp, #0 + add r0, sp, #516 + + add sp, #0 @ format 7 + add sp, sp, #0 + add sp, #260 + + add.w r0, r0, #0 @ T32 format 1 + adds.w r0, r0, #0 + add.w r9, r0, #0 + add.w r0, r9, #0 + add.w r0, r0, #129 + + add.w r0, r0, r0 @ T32 format 2 + adds.w r0, r0, r0 + add.w r9, r0, r0 + add.w r0, r9, r0 + add.w r0, r0, r9 + + add.w r8, r9, r10 + add.w r8, r9, r10, lsl #17 + add.w r8, r8, r10, lsr #32 + add.w r8, r8, r10, lsr #17 + add.w r8, r9, r10, asr #32 + add.w r8, r9, r10, asr #17 + add.w r8, r9, r10, rrx + add.w r8, r9, r10, ror #17 + + subs r0, r0, #0 @ format 1 + subs r5, r0, #0 + subs r0, r5, #0 + subs r0, r0, #5 + + subs r0, r0, #129 + subs r5, #8 + + subs r0, r0, r0 @ format 3 + subs r5, r0, r0 + subs r0, r5, r0 + subs r0, r0, r5 + + sub sp, #260 @ format 4 + sub sp, sp, #260 + + subs r8, r0 @ T32 format 2 + subs r0, r8 + subs r0, #260 @ T32 format 1 + +arit3: + .macro arit3 op ops opw opsw + \ops r0, r0 + \ops r5, r0 + \ops r0, r5 + \ops r0, r0, r5 + \ops r0, r5, r0 + \op r0, r5, r0 + \op r0, r1, r2 + \op r9, r0, r0 + \op r0, r9, r0 + \op r0, r0, r9 + \opsw r0, r0, r0 + \opw r0, r1, r2, asr #17 + \opw r0, r1, #129 + .endm + + arit3 adc adcs adc.w adcs.w + arit3 and ands and.w ands.w + arit3 bic bics bic.w bics.w + arit3 eor eors eor.w eors.w + arit3 orr orrs orr.w orrs.w + arit3 rsb rsbs rsb.w rsbs.w + arit3 sbc sbcs sbc.w sbcs.w + + .purgem arit3 + +bfc_bfi_bfx: + bfc r0, #0, #1 + bfc r9, #0, #1 + bfi r9, #0, #0, #1 + bfc r0, #21, #1 + bfc r0, #0, #18 + + bfi r0, r0, #0, #1 + bfi r9, r0, #0, #1 + bfi r0, r9, #0, #1 + bfi r0, r0, #21, #1 + bfi r0, r0, #0, #18 + + sbfx r0, r0, #0, #1 + ubfx r9, r0, #0, #1 + sbfx r0, r9, #0, #1 + ubfx r0, r0, #21, #1 + sbfx r0, r0, #0, #18 + + .globl branches +branches: + .macro bra op + \op 1b + \op 1f + .endm +1: + bra beq.n + bra bne.n + bra bcs.n + bra bhs.n + bra bcc.n + bra bul.n + bra blo.n + bra bmi.n + bra bpl.n + bra bvs.n + bra bvc.n + bra bhi.n + bra bls.n + bra bvc.n + bra bhi.n + bra bls.n + bra bge.n + bra blt.n + bra bgt.n + bra ble.n + bra bal.n + bra b.n + @ bl, blx have no short form. + .balign 4 +1: + bra beq + bra bne + bra bcs + bra bhs + bra bcc + bra bul + bra blo + bra bmi + bra bpl + bra bvs + bra bvc + bra bhi + bra bls + bra bvc + bra bhi + bra bls + bra bge + bra blt + bra bgt + bra ble + bra b + bra bl + bra blx + .balign 4 +1: + bx r9 + blx r0 + blx r9 + bxj r0 + bxj r9 + .purgem bra + +clz: + clz r0, r0 + clz r9, r0 + clz r0, r9 + +cps: + cpsie f + cpsid i + cpsie a + cpsid.w f + cpsie.w i + cpsid.w a + cpsie i, #0 + cpsid i, #17 + cps #0 + cps #17 + +cpy: + cpy r0, r0 + cpy r9, r0 + cpy r0, r9 + cpy.w r0, r0 + cpy.w r9, r0 + cpy.w r0, r9 + +czb: + cbnz r0, 2f + cbz r5, 1f + +nop_hint: + nop +1: yield +2: wfe + wfi + sev + + nop.w + yield.w + wfe.w + wfi.w + sev.w + + nop {9} + nop {129} + +it: + .macro itx opc cond n + \opc \cond + .rept \n + nop + .endr + .endm + + itx it eq 1 + itx it ne 1 + itx it cs 1 + itx it hs 1 + itx it cc 1 + itx it ul 1 + itx it lo 1 + itx it mi 1 + itx it pl 1 + itx it vs 1 + itx it vc 1 + itx it hi 1 + itx it ge 1 + itx it lt 1 + itx it gt 1 + itx it le 1 + itx it al 1 + + itx itt eq 2 + itx ite eq 2 + itx ittt eq 3 + itx itet eq 3 + itx itte eq 3 + itx itee eq 3 + itx itttt eq 4 + itx itett eq 4 + itx ittet eq 4 + itx ittte eq 4 + itx ittee eq 4 + itx itete eq 4 + itx iteet eq 4 + itx iteee eq 4 + + itx itt ne 2 + itx ite ne 2 + itx ittt ne 3 + itx itet ne 3 + itx itte ne 3 + itx itee ne 3 + itx itttt ne 4 + itx itett ne 4 + itx ittet ne 4 + itx ittte ne 4 + itx ittee ne 4 + itx itete ne 4 + itx iteet ne 4 + itx iteee ne 4 + + .purgem itx + +ldst: + .macro ls op + \op r1, [r5] + \op r1, [r5, #0x330] + \op r1, [r5, #-0x30] + \op r1, [r5], #0x30 + \op r1, [r5], #-0x30 + \op r1, [r5, #0x30]! + \op r1, [r5, #-0x30]! + \op r1, [r5, r4] + \op r1, [r9, ip] + \op r1, 1f + \op r1, 1b + .endm +1: + ls ldrb + ls ldrsb + ls ldrh + ls ldrsh + ls ldr +1: + ls strb + ls strh + ls str + + pld [r5] + pld [r5, #0x330] + pld [r5, #-0x30] + pld [r5], #0x30 + pld [r5], #-0x30 + pld [r5, #0x30]! + pld [r5, #-0x30]! + pld [r5, r4] + pld [r9, ip] + pld 1f + pld 1b +1: + + ldrd r2, r3, [r5] + ldrd r2, [r5, #0x30] + ldrd r2, [r5, #-0x30] + strd r2, r3, [r5] + strd r2, [r5, #0x30] + strd r2, [r5, #-0x30] + + ldrbt r1, [r5] + ldrbt r1, [r5, #0x30] + ldrsbt r1, [r5] + ldrsbt r1, [r5, #0x30] + ldrht r1, [r5] + ldrht r1, [r5, #0x30] + ldrsht r1, [r5] + ldrsht r1, [r5, #0x30] + ldrt r1, [r5] + ldrt r1, [r5, #0x30] + + .purgem ls + +ldxstx: + ldrexb r1, [r4] + ldrexh r1, [r4] + ldrex r1, [r4] + ldrexd r1, r2, [r4] + + strexb r1, r2, [r4] + strexh r1, r2, [r4] + strex r1, r2, [r4] + strexd r1, r2, r3, [r4] + + ldrex r1, [r4,#516] + strex r1, r2, [r4,#516] + +ldmstm: + ldmia r0!, {r1,r2,r3} + ldmia r2, {r0,r1,r2} + ldmia.w r2, {r0,r1,r2} + ldmia r9, {r0,r1,r2} + ldmia r0, {r7,r8,r10} + ldmia r0!, {r7,r8,r10} + + stmia r0!, {r1,r2,r3} + stmia r2!, {r0,r1,r3} + stmia.w r2!, {r0,r1,r3} + stmia r9, {r0,r1,r2} + stmia r0, {r7,r8,r10} + stmia r0!, {r7,r8,r10} + + ldmdb r0, {r7,r8,r10} + stmdb r0, {r7,r8,r10} + +mlas: + mla r0, r0, r0, r0 + mls r0, r0, r0, r0 + mla r9, r0, r0, r0 + mla r0, r9, r0, r0 + mla r0, r0, r9, r0 + mla r0, r0, r0, r9 + +tst_teq_cmp_cmn_mov_mvn: + .macro mt op ops opw opsw + \ops r0, r0 + \op r0, r0 + \ops r5, r0 + \op r0, r5 + \op r0, r5, asr #17 + \opw r0, r0 + \ops r9, r0 + \opsw r0, r9 + \op r0, #129 + \op r5, #129 + .endm + + mt tst tsts tst.w tsts.w + mt teq teqs teq.w teqs.w + mt cmp cmps cmp.w cmps.w + mt cmn cmns cmn.w cmns.w + mt mov movs mov.w movs.w + mt mvn mvns mvn.w mvns.w + .purgem mt + +mov16: + movw r0, #0 + movt r0, #0 + movw r9, #0 + movw r0, #0x9000 + movw r0, #0x0800 + movw r0, #0x0500 + movw r0, #0x0081 + movw r0, #0xffff + +mrs_msr: + mrs r0, CPSR + mrs r0, SPSR + mrs r9, CPSR_all + mrs r9, SPSR_all + + msr CPSR_c, r0 + msr SPSR_c, r0 + msr CPSR_c, r9 + msr CPSR_x, r0 + msr CPSR_s, r0 + msr CPSR_f, r0 + +mul: + mul r0, r0, r0 + mul r0, r9, r0 + mul r0, r0, r9 + mul r0, r0 + mul r9, r0 + muls r5, r0 + muls r5, r0, r5 + muls r0, r5 + +mull: + smull r0, r1, r0, r0 + umull r0, r1, r0, r0 + smlal r0, r1, r0, r0 + umlal r0, r1, r0, r0 + smull r9, r0, r0, r0 + smull r0, r9, r0, r0 + smull r0, r1, r9, r0 + smull r0, r1, r0, r9 + +neg: + negs r0, r0 + negs r0, r5 + negs r5, r0 + negs.w r0, r0 + negs.w r5, r0 + negs.w r0, r5 + + neg r0, r9 + neg r9, r0 + negs r0, r9 + negs r9, r0 + +pkh: + pkhbt r0, r0, r0 + pkhbt r9, r0, r0 + pkhbt r0, r9, r0 + pkhbt r0, r0, r9 + pkhbt r0, r0, r0, lsl #0x14 + pkhbt r0, r0, r0, lsl #3 + pkhtb r1, r2, r3 + pkhtb r1, r2, r3, asr #0x11 + +push_pop: + push {r0} + pop {r0} + push {r1,lr} + pop {r1,pc} + push {r8,r9,r10,r11,r12} + pop {r8,r9,r10,r11,r12} + +qadd: + qadd16 r1, r2, r3 + qadd8 r1, r2, r3 + qaddsubx r1, r2, r3 + qsub16 r1, r2, r3 + qsub8 r1, r2, r3 + qsubaddx r1, r2, r3 + sadd16 r1, r2, r3 + sadd8 r1, r2, r3 + saddsubx r1, r2, r3 + ssub16 r1, r2, r3 + ssub8 r1, r2, r3 + ssubaddx r1, r2, r3 + shadd16 r1, r2, r3 + shadd8 r1, r2, r3 + shaddsubx r1, r2, r3 + shsub16 r1, r2, r3 + shsub8 r1, r2, r3 + shsubaddx r1, r2, r3 + uadd16 r1, r2, r3 + uadd8 r1, r2, r3 + uaddsubx r1, r2, r3 + usub16 r1, r2, r3 + usub8 r1, r2, r3 + usubaddx r1, r2, r3 + uhadd16 r1, r2, r3 + uhadd8 r1, r2, r3 + uhaddsubx r1, r2, r3 + uhsub16 r1, r2, r3 + uhsub8 r1, r2, r3 + uhsubaddx r1, r2, r3 + uqadd16 r1, r2, r3 + uqadd8 r1, r2, r3 + uqaddsubx r1, r2, r3 + uqsub16 r1, r2, r3 + uqsub8 r1, r2, r3 + uqsubaddx r1, r2, r3 + sel r1, r2, r3 + +rbit_rev: + .macro rx op opw + \op r0, r0 + \opw r0, r0 + \op r0, r5 + \op r5, r0 + \op r0, r9 + \op r9, r0 + .endm + + rx rev rev.w + rx rev16 rev16.w + rx revsh revsh.w + rx rbit rbit.w + + .purgem rx + +shift: + .macro sh op ops opw opsw + \ops r0, #17 @ 16-bit format 1 + \ops r0, r0, #14 + \ops r5, r0, #17 + \ops r0, r5, #14 + \ops r0, r0 @ 16-bit format 2 + \ops r0, r5 + \ops r0, r0, r5 + \op r9, #17 @ 32-bit format 1 + \op r9, r9, #14 + \ops r0, r9, #17 + \op r9, r0, #14 + \opw r0, r0, r0 @ 32-bit format 2 + \op r9, r9 + \ops r9, r0 + \op r0, r9 + \op r0, r5 + \ops r0, r1, r2 + .endm + + sh lsl lsls lsl.w lsls.w + sh lsr lsrs lsr.w lsrs.w + sh asr asrs asr.w asrs.w + sh ror rors ror.w rors.w + + .purgem sh + +smi: + smi #0 + smi #0xabcd + +smla: + smlabb r0, r0, r0, r0 + smlabb r9, r0, r0, r0 + smlabb r0, r9, r0, r0 + smlabb r0, r0, r9, r0 + smlabb r0, r0, r0, r9 + + smlatb r0, r0, r0, r0 + smlabt r0, r0, r0, r0 + smlatt r0, r0, r0, r0 + smlawb r0, r0, r0, r0 + smlawt r0, r0, r0, r0 + smlad r0, r0, r0, r0 + smladx r0, r0, r0, r0 + smlsd r0, r0, r0, r0 + smlsdx r0, r0, r0, r0 + smmla r0, r0, r0, r0 + smmlar r0, r0, r0, r0 + smmls r0, r0, r0, r0 + smmlsr r0, r0, r0, r0 + usada8 r0, r0, r0, r0 + +smlal: + smlalbb r0, r0, r0, r0 + smlalbb r9, r0, r0, r0 + smlalbb r0, r9, r0, r0 + smlalbb r0, r0, r9, r0 + smlalbb r0, r0, r0, r9 + + smlaltb r0, r0, r0, r0 + smlalbt r0, r0, r0, r0 + smlaltt r0, r0, r0, r0 + smlald r0, r0, r0, r0 + smlaldx r0, r0, r0, r0 + smlsld r0, r0, r0, r0 + smlsldx r0, r0, r0, r0 + umaal r0, r0, r0, r0 + +smul: + smulbb r0, r0, r0 + smulbb r9, r0, r0 + smulbb r0, r9, r0 + smulbb r0, r0, r9 + + smultb r0, r0, r0 + smulbt r0, r0, r0 + smultt r0, r0, r0 + smulwb r0, r0, r0 + smulwt r0, r0, r0 + smmul r0, r0, r0 + smmulr r0, r0, r0 + smuad r0, r0, r0 + smuadx r0, r0, r0 + smusd r0, r0, r0 + smusdx r0, r0, r0 + usad8 r0, r0, r0 + +sat: + ssat r0, #1, r0 + ssat r0, #1, r0, lsl #0 + ssat r0, #1, r0, asr #0 + ssat r9, #1, r0 + ssat r0, #18, r0 + ssat r0, #1, r9 + ssat r0, #1, r0, lsl #0x1c + ssat r0, #1, r0, asr #0x03 + + ssat16 r0, #1, r0 + ssat16 r9, #1, r0 + ssat16 r0, #10, r0 + ssat16 r0, #1, r9 + + usat r0, #0, r0 + usat r0, #0, r0, lsl #0 + usat r0, #0, r0, asr #0 + usat r9, #0, r0 + usat r0, #17, r0 + usat r0, #0, r9 + usat r0, #0, r0, lsl #0x1c + usat r0, #0, r0, asr #0x03 + + usat16 r0, #0, r0 + usat16 r9, #0, r0 + usat16 r0, #9, r0 + usat16 r0, #0, r9 + +xt: + sxtb r0, r0 + sxtb r0, r0, ror #0 + sxtb r5, r0 + sxtb r0, r5 + sxtb.w r1, r2 + sxtb r1, r2, ror #8 + sxtb r1, r2, ror #16 + sxtb r1, r2, ror #24 + + sxtb16 r1, r2 + sxtb16 r8, r9 + sxth r1, r2 + sxth r8, r9 + uxtb r1, r2 + uxtb r8, r9 + uxtb16 r1, r2 + uxtb16 r8, r9 + uxth r1, r2 + uxth r8, r9 + +xta: + sxtab r0, r0, r0 + sxtab r0, r0, r0, ror #0 + sxtab r9, r0, r0, ror #8 + sxtab r0, r9, r0, ror #16 + sxtab r0, r0, r9, ror #24 + + sxtab16 r1, r2, r3 + sxtah r1, r2, r3 + uxtab r1, r2, r3 + uxtab16 r1, r2, r3 + uxtah r1, r2, r3 diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/thumb.d binutils-2.16.91.0.1/gas/testsuite/gas/arm/thumb.d --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/thumb.d 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/thumb.d 2005-06-22 13:53:35.192269903 -0700 @@ -0,0 +1,162 @@ +# name: Thumb instructions +# as: -mcpu=arm7t +# objdump: -dr --prefix-addresses --show-raw-insn + +.*: +file format .*arm.* + +Disassembly of section \.text: +0+000 <[^>]+> 00ca lsls r2, r1, #3 +0+002 <[^>]+> 0fe3 lsrs r3, r4, #31 +0+004 <[^>]+> 1147 asrs r7, r0, #5 +0+006 <[^>]+> 0011 lsls r1, r2, #0 +0+008 <[^>]+> 0023 lsls r3, r4, #0 +0+00a <[^>]+> 002c lsls r4, r5, #0 +0+00c <[^>]+> 083e lsrs r6, r7, #32 +0+00e <[^>]+> 1008 asrs r0, r1, #32 +0+010 <[^>]+> 18d1 adds r1, r2, r3 +0+012 <[^>]+> 1ca2 adds r2, r4, #2 +0+014 <[^>]+> 1beb sub r3, r5, r7 +0+016 <[^>]+> 1fe2 sub r2, r4, #7 +0+018 <[^>]+> 24ff movs r4, #255 +0+01a <[^>]+> 2bfa cmp r3, #250 +0+01c <[^>]+> 367b adds r6, #123 +0+01e <[^>]+> 3d80 subs r5, #128 +0+020 <[^>]+> 402b ands r3, r5 +0+022 <[^>]+> 4074 eors r4, r6 +0+024 <[^>]+> 4081 lsls r1, r0 +0+026 <[^>]+> 40da lsrs r2, r3 +0+028 <[^>]+> 4134 asrs r4, r6 +0+02a <[^>]+> 417d adcs r5, r7 +0+02c <[^>]+> 41a0 sbcs r0, r4 +0+02e <[^>]+> 41e1 rors r1, r4 +0+030 <[^>]+> 422a tst r2, r5 +0+032 <[^>]+> 4249 negs r1, r1 +0+034 <[^>]+> 429a cmp r2, r3 +0+036 <[^>]+> 42e1 cmn r1, r4 +0+038 <[^>]+> 4318 orrs r0, r3 +0+03a <[^>]+> 436c muls r4, r5 +0+03c <[^>]+> 43bd bics r5, r7 +0+03e <[^>]+> 43ed mvns r5, r5 +0+040 <[^>]+> 4469 add r1, sp +0+042 <[^>]+> 4494 add ip, r2 +0+044 <[^>]+> 44c9 add r9, r9 +0+046 <[^>]+> 4571 cmp r1, lr +0+048 <[^>]+> 4580 cmp r8, r0 +0+04a <[^>]+> 45f4 cmp ip, lr +0+04c <[^>]+> 4648 mov r0, r9 +0+04e <[^>]+> 46a1 mov r9, r4 +0+050 <[^>]+> 46c0 nop \(mov r8, r8\) +0+052 <[^>]+> 4738 bx r7 +0+054 <[^>]+> 4740 bx r8 +0+056 <[^>]+> 0000 lsls r0, r0, #0 +0+058 <[^>]+> 4778 bx pc +0+05a <[^>]+> 4b20 ldr r3, \[pc, #128\] \(0+0dc <[^>]+>\) +0+05c <[^>]+> 4c02 ldr r4, \[pc, #8\] \(0+068 <[^>]+>\) +0+05e <[^>]+> 5088 str r0, \[r1, r2\] +0+060 <[^>]+> 5511 strb r1, \[r2, r4\] +0+062 <[^>]+> 59f5 ldr r5, \[r6, r7\] +0+064 <[^>]+> 5d62 ldrb r2, \[r4, r5\] + \.\.\. +0+068 <[^>]+> 52d1 strh r1, \[r2, r3\] +0+06a <[^>]+> 5a23 ldrh r3, \[r4, r0\] +0+06c <[^>]+> 57f1 ldrsb r1, \[r6, r7\] +0+06e <[^>]+> 5f42 ldrsh r2, \[r0, r5\] +0+070 <[^>]+> 67db str r3, \[r3, #124\] +0+072 <[^>]+> 6fe1 ldr r1, \[r4, #124\] +0+074 <[^>]+> 682d ldr r5, \[r5, #0\] +0+076 <[^>]+> 77e9 strb r1, \[r5, #31\] +0+078 <[^>]+> 7161 strb r1, \[r4, #5\] +0+07a <[^>]+> 7032 strb r2, \[r6, #0\] +0+07c <[^>]+> 87ec strh r4, \[r5, #62\] +0+07e <[^>]+> 8885 ldrh r5, \[r0, #4\] +0+080 <[^>]+> 8813 ldrh r3, \[r2, #0\] +0+082 <[^>]+> 93ff str r3, \[sp, #1020\] +0+084 <[^>]+> 990b ldr r1, \[sp, #44\] +0+086 <[^>]+> 9a00 ldr r2, \[sp, #0\] +0+088 <[^>]+> a7ff add r7, pc, #1020 \(adr r7,0+488 <[^>]+>\) +0+08a <[^>]+> ac80 add r4, sp, #512 +0+08c <[^>]+> b043 add sp, #268 +0+08e <[^>]+> b09a sub sp, #104 +0+090 <[^>]+> b0c3 sub sp, #268 +0+092 <[^>]+> b01b add sp, #108 +0+094 <[^>]+> b417 push {r0, r1, r2, r4} +0+096 <[^>]+> b5f9 push {r0, r3, r4, r5, r6, r7, lr} +0+098 <[^>]+> bc98 pop {r3, r4, r7} +0+09a <[^>]+> bdff pop {r0, r1, r2, r3, r4, r5, r6, r7, pc} +0+09c <[^>]+> c3f3 stmia r3!, {r0, r1, r4, r5, r6, r7} +0+09e <[^>]+> c8fe ldmia r0!, {r1, r2, r3, r4, r5, r6, r7} +0+0a0 <[^>]+> d0e2 beq.n 0+068 <[^>]+> +0+0a2 <[^>]+> d1e1 bne.n 0+068 <[^>]+> +0+0a4 <[^>]+> d2e0 bcs.n 0+068 <[^>]+> +0+0a6 <[^>]+> d3df bcc.n 0+068 <[^>]+> +0+0a8 <[^>]+> d4de bmi.n 0+068 <[^>]+> +0+0aa <[^>]+> d5dd bpl.n 0+068 <[^>]+> +0+0ac <[^>]+> d6dc bvs.n 0+068 <[^>]+> +0+0ae <[^>]+> d7db bvc.n 0+068 <[^>]+> +0+0b0 <[^>]+> d8da bhi.n 0+068 <[^>]+> +0+0b2 <[^>]+> d9d9 bls.n 0+068 <[^>]+> +0+0b4 <[^>]+> dad8 bge.n 0+068 <[^>]+> +0+0b6 <[^>]+> dcd7 bgt.n 0+068 <[^>]+> +0+0b8 <[^>]+> dbd6 blt.n 0+068 <[^>]+> +0+0ba <[^>]+> dcd5 bgt.n 0+068 <[^>]+> +0+0bc <[^>]+> ddd4 ble.n 0+068 <[^>]+> +0+0be <[^>]+> d8d3 bhi.n 0+068 <[^>]+> +0+0c0 <[^>]+> d3d2 bcc.n 0+068 <[^>]+> +0+0c2 <[^>]+> d3d1 bcc.n 0+068 <[^>]+> +0+0c4 <[^>]+> e7d0 b.n 0+068 <[^>]+> +0+0c6 <[^>]+> 00ac lsls r4, r5, #2 +0+0c8 <[^>]+> 1c9a adds r2, r3, #2 +0+0ca <[^>]+> b07f add sp, #508 +0+0cc <[^>]+> b0ff sub sp, #508 +0+0ce <[^>]+> a8ff add r0, sp, #1020 +0+0d0 <[^>]+> a0ff add r0, pc, #1020 \(adr r0,0+4d0 <[^>]+>\) +0+0d2 <[^>]+> b01a add sp, #104 +0+0d4 <[^>]+> b09a sub sp, #104 +0+0d6 <[^>]+> a81a add r0, sp, #104 +0+0d8 <[^>]+> a01a add r0, pc, #104 \(adr r0,0+144 <[^>]+>\) +0+0da <[^>]+> 3168 adds r1, #104 +0+0dc <[^>]+> 2668 movs r6, #104 +0+0de <[^>]+> 2f68 cmp r7, #104 +0+0e0 <[^>]+> 46c0 nop \(mov r8, r8\) +0+0e2 <[^>]+> 46c0 nop \(mov r8, r8\) +0+0e4 <[^>]+> eafffffe b 0+0e4 <[^>]+> +0+0e8 <[^>]+> ea000011 b 0+134 <[^>]+> +0+0ec <[^>]+> ebfffffc bl 0+0e4 <[^>]+> +0+0f0 <[^>]+> eb00000f bl 0+134 <[^>]+> +0+0f4 <[^>]+> e12fff10 bx r0 +0+0f8 <[^>]+> ef123456 swi 0x00123456 +0+0fc <[^>]+> a004 add r0, pc, #16 \(adr r0,0+110 <[^>]+>\) +0+0fe <[^>]+> e77f b.n 0+000 <[^>]+> +0+100 <[^>]+> e018 b.n 0+134 <[^>]+> +0+102 <[^>]+> f7ff ff7d bl 0+000 <[^>]+> +0+106 <[^>]+> f000 f815 bl 0+134 <[^>]+> +0+10a <[^>]+> 4700 bx r0 +0+10c <[^>]+> dfff swi 255 + \.\.\. +0+110 <[^>]+> d010 beq.n 0+134 <[^>]+> +0+112 <[^>]+> d10f bne.n 0+134 <[^>]+> +0+114 <[^>]+> d20e bcs.n 0+134 <[^>]+> +0+116 <[^>]+> d30d bcc.n 0+134 <[^>]+> +0+118 <[^>]+> d40c bmi.n 0+134 <[^>]+> +0+11a <[^>]+> d50b bpl.n 0+134 <[^>]+> +0+11c <[^>]+> d60a bvs.n 0+134 <[^>]+> +0+11e <[^>]+> d709 bvc.n 0+134 <[^>]+> +0+120 <[^>]+> d808 bhi.n 0+134 <[^>]+> +0+122 <[^>]+> d907 bls.n 0+134 <[^>]+> +0+124 <[^>]+> da06 bge.n 0+134 <[^>]+> +0+126 <[^>]+> dc05 bgt.n 0+134 <[^>]+> +0+128 <[^>]+> db04 blt.n 0+134 <[^>]+> +0+12a <[^>]+> dc03 bgt.n 0+134 <[^>]+> +0+12c <[^>]+> dd02 ble.n 0+134 <[^>]+> +0+12e <[^>]+> d801 bhi.n 0+134 <[^>]+> +0+130 <[^>]+> d300 bcc.n 0+134 <[^>]+> +0+132 <[^>]+> d3ff bcc.n 0+134 <[^>]+> +0+134 <[^>]+> f000 fc00 bl 0+938 <[^>]+> + \.\.\. +0+938 <[^>]+> f7ff fbfc bl 0+134 <[^>]+> +0+93c <[^>]+> 4801 ldr r0, \[pc, #4\] \(0+944 <[^>]+>\) +0+93e <[^>]+> 4801 ldr r0, \[pc, #4\] \(0+944 <[^>]+>\) +0+940 <[^>]+> 4801 ldr r0, \[pc, #4\] \(0+948 <[^>]+>\) +0+942 <[^>]+> 4801 ldr r0, \[pc, #4\] \(0+948 <[^>]+>\) +0+944 <[^>]+> 46c0 nop \(mov r8, r8\) +0+946 <[^>]+> 46c0 nop \(mov r8, r8\) diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/thumb.s binutils-2.16.91.0.1/gas/testsuite/gas/arm/thumb.s --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/thumb.s 2000-03-31 09:17:13.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/thumb.s 2005-06-22 13:53:35.193269737 -0700 @@ -145,9 +145,9 @@ near: .arm .localbar: b .localbar - b .wombat + b .back bl .localbar - bl .wombat + bl .back bx r0 swi 0x123456 @@ -159,36 +159,44 @@ morethumb: adr r0, forwardonly b .foo - b .wombat + b .back bl .foo - bl .wombat + bl .back bx r0 swi 0xff .align 0 forwardonly: - beq .wombat - bne .wombat - bcs .wombat - bcc .wombat - bmi .wombat - bpl .wombat - bvs .wombat - bvc .wombat - bhi .wombat - bls .wombat - bge .wombat - bgt .wombat - blt .wombat - bgt .wombat - ble .wombat - bhi .wombat - blo .wombat - bul .wombat + beq .back + bne .back + bcs .back + bcc .back + bmi .back + bpl .back + bvs .back + bvc .back + bhi .back + bls .back + bge .back + bgt .back + blt .back + bgt .back + ble .back + bhi .back + blo .back + bul .back .back: bl .local .space (1 << 11) @ leave space to force long offsets .local: bl .back + + ldr r0, .target + ldr r0, .target + ldr r0, [pc, #4] + ldr r0, [pc, #4] +.target: + nop @ pad for a.out + nop diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/thumbv6.d binutils-2.16.91.0.1/gas/testsuite/gas/arm/thumbv6.d --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/thumbv6.d 2004-12-20 11:16:50.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/thumbv6.d 2005-06-22 13:53:35.202268251 -0700 @@ -7,7 +7,7 @@ Disassembly of section .text: 0+000 <[^>]*> b666 * cpsie ai 0+002 <[^>]*> b675 * cpsid af -0+004 <[^>]*> 4623 * cpy r3, r4 +0+004 <[^>]*> 4623 * mov r3, r4 0+006 <[^>]*> ba3a * rev r2, r7 0+008 <[^>]*> ba4d * rev16 r5, r1 0+00a <[^>]*> baf3 * revsh r3, r6 diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/arm/vfp-bad.l binutils-2.16.91.0.1/gas/testsuite/gas/arm/vfp-bad.l --- binutils-2.16.90.0.3/gas/testsuite/gas/arm/vfp-bad.l 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/arm/vfp-bad.l 2005-06-22 13:53:35.202268251 -0700 @@ -1,9 +1,9 @@ [^:]*: Assembler messages: -[^:]*:4: Error: garbage following instruction -- `fstd d0,\[r0\],#8' -[^:]*:5: Error: garbage following instruction -- `fstd d0,\[r0,#-8\]!' -[^:]*:6: Error: garbage following instruction -- `fsts s0,\[r0\],#8' -[^:]*:7: Error: garbage following instruction -- `fsts s0,\[r0,#-8\]!' -[^:]*:8: Error: garbage following instruction -- `fldd d0,\[r0\],#8' -[^:]*:9: Error: garbage following instruction -- `fldd d0,\[r0,#-8\]!' -[^:]*:10: Error: garbage following instruction -- `flds s0,\[r0\],#8' -[^:]*:11: Error: garbage following instruction -- `flds s0,\[r0,#-8\]!' +[^:]*:4: Error: instruction does not support writeback -- `fstd d0,\[r0\],#8' +[^:]*:5: Error: instruction does not support writeback -- `fstd d0,\[r0,#-8\]!' +[^:]*:6: Error: instruction does not support writeback -- `fsts s0,\[r0\],#8' +[^:]*:7: Error: instruction does not support writeback -- `fsts s0,\[r0,#-8\]!' +[^:]*:8: Error: instruction does not support writeback -- `fldd d0,\[r0\],#8' +[^:]*:9: Error: instruction does not support writeback -- `fldd d0,\[r0,#-8\]!' +[^:]*:10: Error: instruction does not support writeback -- `flds s0,\[r0\],#8' +[^:]*:11: Error: instruction does not support writeback -- `flds s0,\[r0,#-8\]!' diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/elf/group0b.d binutils-2.16.91.0.1/gas/testsuite/gas/elf/group0b.d --- binutils-2.16.90.0.3/gas/testsuite/gas/elf/group0b.d 2004-05-27 11:26:04.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/elf/group0b.d 2005-06-22 13:53:35.220265277 -0700 @@ -3,7 +3,7 @@ #source: group0.s #... -COMDAT group section `.foo_group' \[.foo_group\] contains 2 sections: +COMDAT group section \[ 1\] `.foo_group' \[.foo_group\] contains 2 sections: [ ]+\[Index\][ ]+Name [ ]+\[.*\][ ]+.foo [ ]+\[.*\][ ]+.bar diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/elf/group1b.d binutils-2.16.91.0.1/gas/testsuite/gas/elf/group1b.d --- binutils-2.16.90.0.3/gas/testsuite/gas/elf/group1b.d 2004-05-27 11:26:04.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/elf/group1b.d 2005-06-22 13:53:35.220265277 -0700 @@ -3,7 +3,7 @@ #source: group1.s #... -COMDAT group section `.foo_group' \[.foo_group\] contains 1 sections: +COMDAT group section \[ 1\] `.foo_group' \[.foo_group\] contains 1 sections: [ ]+\[Index\][ ]+Name [ ]+\[.*\][ ]+.text #pass diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/hppa/parse/block1.s binutils-2.16.91.0.1/gas/testsuite/gas/hppa/parse/block1.s --- binutils-2.16.90.0.3/gas/testsuite/gas/hppa/parse/block1.s 1999-08-31 10:12:29.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/hppa/parse/block1.s 2005-06-22 13:53:35.226264286 -0700 @@ -4,7 +4,7 @@ foo: .block bar: - .block 0x7fffffff + .block 0x3fffffff com: diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/i386/intelok.d binutils-2.16.91.0.1/gas/testsuite/gas/i386/intelok.d --- binutils-2.16.90.0.3/gas/testsuite/gas/i386/intelok.d 2005-04-09 12:03:13.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/i386/intelok.d 2005-06-22 13:53:35.229263790 -0700 @@ -104,8 +104,8 @@ Disassembly of section .text: [ ]*[0-9a-f]+: 8b 40 0c[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+12\] [ ]*[0-9a-f]+: 8b 40 12[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+18\] [ ]*[0-9a-f]+: 8b 40 12[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+18\] -[ ]*[0-9a-f]+: 8b 04 85 02 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*4\+2\] -[ ]*[0-9a-f]+: 8b 04 85 02 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*4\+2\] +[ ]*[0-9a-f]+: 8b 04 85 02 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*4\+(0x)?2\] +[ ]*[0-9a-f]+: 8b 04 85 02 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*4\+(0x)?2\] [ ]*[0-9a-f]+: 8b 04 45 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*2\] [ ]*[0-9a-f]+: 8b 04 45 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*2\] [ ]*[0-9a-f]+: 8b 04 8d 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[ecx\*4\] @@ -156,7 +156,7 @@ Disassembly of section .text: [ ]*[0-9a-f]+: 8b 80 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\] [ ]*[0-9a-f]+: 8b 40 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+1] [ ]*[0-9a-f]+: 8b 80 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\] -[ ]*[0-9a-f]+: 8b 80 01 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+1\] +[ ]*[0-9a-f]+: 8b 80 01 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+(0x)?1\] [ ]*[0-9a-f]+: 8b 80 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\] [ ]*[0-9a-f]+: 8b 40 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+1\] [ ]*[0-9a-f]+: a1 01 00 00 00[ ]+mov[ ]+eax,ds:0x1 diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/i386/x86_64.d binutils-2.16.91.0.1/gas/testsuite/gas/i386/x86_64.d --- binutils-2.16.90.0.3/gas/testsuite/gas/i386/x86_64.d 2005-04-09 12:03:13.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/i386/x86_64.d 2005-06-22 13:53:35.231263460 -0700 @@ -122,4 +122,22 @@ Disassembly of section .text: 1f0: 8b 04 25 00 00 00 00 mov[ ]+0x0,%eax 1f7: 8b 80 00 00 00 00[ ]+mov[ ]+0x0\(%rax\),%eax 1fd: 8b 05 00 00 00 00[ ]+mov[ ]+0\(%rip\),%eax.* + +0+203 : + 203: a0 11 22 33 44 55 66 77 88 mov[ ]+0x8877665544332211,%al + 20c: 66 a1 11 22 33 44 55 66 77 88 mov[ ]+0x8877665544332211,%ax + 216: a1 11 22 33 44 55 66 77 88 mov[ ]+0x8877665544332211,%eax + 21f: 48 a1 11 22 33 44 55 66 77 88 mov[ ]+0x8877665544332211,%rax + 229: a2 11 22 33 44 55 66 77 88 mov[ ]+%al,0x8877665544332211 + 232: 66 a3 11 22 33 44 55 66 77 88 mov[ ]+%ax,0x8877665544332211 + 23c: a3 11 22 33 44 55 66 77 88 mov[ ]+%eax,0x8877665544332211 + 245: 48 a3 11 22 33 44 55 66 77 88 mov[ ]+%rax,0x8877665544332211 + 24f: a0 11 22 33 44 55 66 77 88 mov[ ]+0x8877665544332211,%al + 258: 66 a1 11 22 33 44 55 66 77 88 mov[ ]+0x8877665544332211,%ax + 262: a1 11 22 33 44 55 66 77 88 mov[ ]+0x8877665544332211,%eax + 26b: 48 a1 11 22 33 44 55 66 77 88 mov[ ]+0x8877665544332211,%rax + 275: a2 11 22 33 44 55 66 77 88 mov[ ]+%al,0x8877665544332211 + 27e: 66 a3 11 22 33 44 55 66 77 88 mov[ ]+%ax,0x8877665544332211 + 288: a3 11 22 33 44 55 66 77 88 mov[ ]+%eax,0x8877665544332211 + 291: 48 a3 11 22 33 44 55 66 77 88 mov[ ]+%rax,0x8877665544332211 #pass diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/i386/x86-64-pcrel.d binutils-2.16.91.0.1/gas/testsuite/gas/i386/x86-64-pcrel.d --- binutils-2.16.90.0.3/gas/testsuite/gas/i386/x86-64-pcrel.d 2005-04-09 12:03:13.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/i386/x86-64-pcrel.d 2005-06-22 13:53:35.230263625 -0700 @@ -8,7 +8,12 @@ Disassembly of section .text: 0+000 <_start>: [ ]*[0-9a-f]+:[ ]+b0 00[ ]+movb?[ ]+\$(0x)?0,%al[ ]*[0-9a-f]+:[ ]+R_X86_64_PC8[ ]+xtrn\+(0x)?1 [ ]*[0-9a-f]+:[ ]+66 b8 00 00[ ]+movw?[ ]+\$(0x)?0,%ax[ ]*[0-9a-f]+:[ ]+R_X86_64_PC16[ ]+xtrn\+(0x)?2 -[ ]*[0-9a-f]+:[ ]+b8 00 00 00 00[ ]+movl?[ ]+\$(0x)?0,%eax[ ]*[0-9a-f]+:[ ]+R_X86_64_PC32[ ]+xtrn\+(0x)?1 -[ ]*[0-9a-f]+:[ ]+48 c7 c0 00 00 00 00[ ]+movq?[ ]+\$(0x)?0,%rax[ ]*[0-9a-f]+:[ ]+R_X86_64_PC32[ ]+xtrn\+(0x)?3 -[ ]*[0-9a-f]+:[ ]+48 c7 c0 00 00 00 00[ ]+movq?[ ]+\$(0x)?0,%rax[ ]*[0-9a-f]+:[ ]+R_X86_64_32S[ ]+xtrn +[ ]*[0-9a-f]+:[ ]+b8( 00){4}[ ]+movl?[ ]+\$(0x)?0,%eax[ ]*[0-9a-f]+:[ ]+R_X86_64_PC32[ ]+xtrn\+(0x)?1 +[ ]*[0-9a-f]+:[ ]+48 c7 c0( 00){4}[ ]+movq?[ ]+\$(0x)?0,%rax[ ]*[0-9a-f]+:[ ]+R_X86_64_PC32[ ]+xtrn\+(0x)?3 +[ ]*[0-9a-f]+:[ ]+48 b8( 00){8}[ ]+mov(abs)?q?[ ]+\$(0x)?0,%rax[ ]*[0-9a-f]+:[ ]+R_X86_64_PC64[ ]+xtrn\+(0x)?2 +[ ]*[0-9a-f]+:[ ]+b0 00[ ]+movb?[ ]+\$(0x)?0,%al[ ]*[0-9a-f]+:[ ]+R_X86_64_8[ ]+xtrn +[ ]*[0-9a-f]+:[ ]+66 b8 00 00[ ]+movw?[ ]+\$(0x)?0,%ax[ ]*[0-9a-f]+:[ ]+R_X86_64_16[ ]+xtrn +[ ]*[0-9a-f]+:[ ]+b8( 00){4}[ ]+movl?[ ]+\$(0x)?0,%eax[ ]*[0-9a-f]+:[ ]+R_X86_64_32[ ]+xtrn +[ ]*[0-9a-f]+:[ ]+48 c7 c0( 00){4}[ ]+movq?[ ]+\$(0x)?0,%rax[ ]*[0-9a-f]+:[ ]+R_X86_64_32S[ ]+xtrn +[ ]*[0-9a-f]+:[ ]+48 b8( 00){8}[ ]+mov(abs)?q?[ ]+\$(0x)?0,%rax[ ]*[0-9a-f]+:[ ]+R_X86_64_64[ ]+xtrn #pass diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/i386/x86-64-pcrel.s binutils-2.16.91.0.1/gas/testsuite/gas/i386/x86-64-pcrel.s --- binutils-2.16.90.0.3/gas/testsuite/gas/i386/x86-64-pcrel.s 2005-04-09 12:03:13.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/i386/x86-64-pcrel.s 2005-06-22 13:53:35.230263625 -0700 @@ -4,6 +4,12 @@ _start: movw $(xtrn - .), %ax movl $(xtrn - .), %eax movq $(xtrn - .), %rax + movabsq $(xtrn - .), %rax + + movb $xtrn, %al + movw $xtrn, %ax + movl $xtrn, %eax movq $xtrn, %rax + movabsq $xtrn, %rax .p2align 4,0 diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/i386/x86_64.s binutils-2.16.91.0.1/gas/testsuite/gas/i386/x86_64.s --- binutils-2.16.90.0.3/gas/testsuite/gas/i386/x86_64.s 2005-04-09 12:03:13.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/i386/x86_64.s 2005-06-22 13:53:35.231263460 -0700 @@ -150,5 +150,25 @@ mov eax, [rax+symbol] #RIP relative mov eax, [rip+symbol] +foo: +.att_syntax +#absolute 64bit addressing +mov 0x8877665544332211,%al +mov 0x8877665544332211,%ax +mov 0x8877665544332211,%eax +mov 0x8877665544332211,%rax +mov %al,0x8877665544332211 +mov %ax,0x8877665544332211 +mov %eax,0x8877665544332211 +mov %rax,0x8877665544332211 +movb 0x8877665544332211,%al +movw 0x8877665544332211,%ax +movl 0x8877665544332211,%eax +movq 0x8877665544332211,%rax +movb %al,0x8877665544332211 +movw %ax,0x8877665544332211 +movl %eax,0x8877665544332211 +movq %rax,0x8877665544332211 + # Get a good alignment. .p2align 4,0 diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/ia64/global.d binutils-2.16.91.0.1/gas/testsuite/gas/ia64/global.d --- binutils-2.16.90.0.3/gas/testsuite/gas/ia64/global.d 2004-01-14 13:07:47.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/ia64/global.d 2005-06-22 13:53:35.249260486 -0700 @@ -1,4 +1,4 @@ -#readelf: --sym +#readelf: --syms #name: ia64 global label Symbol table '.symtab' contains 5 entries: diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/ia64/group-1.d binutils-2.16.91.0.1/gas/testsuite/gas/ia64/group-1.d --- binutils-2.16.90.0.3/gas/testsuite/gas/ia64/group-1.d 2004-12-20 11:16:50.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/ia64/group-1.d 2005-06-22 13:53:35.251260156 -0700 @@ -29,6 +29,6 @@ Key to Flags: I \(info\), L \(link order\), G \(group\), x \(unknown\) O \(extra OS processing required\) o \(OS specific\), p \(processor specific\) -COMDAT group section `\._foo' \[\._foo\] contains 1 sections: +COMDAT group section \[ 1\] `\._foo' \[\._foo\] contains 1 sections: \[Index\] Name \[ 5\] \.text diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/ia64/group-2.d binutils-2.16.91.0.1/gas/testsuite/gas/ia64/group-2.d --- binutils-2.16.90.0.3/gas/testsuite/gas/ia64/group-2.d 2005-05-10 15:46:46.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/ia64/group-2.d 2005-06-22 13:53:35.253259826 -0700 @@ -36,7 +36,7 @@ Key to Flags: I \(info\), L \(link order\), G \(group\), x \(unknown\) O \(extra OS processing required\) o \(OS specific\), p \(processor specific\) -COMDAT group section `\.group' \[foo\] contains 3 sections: +COMDAT group section \[ 1\] `\.group' \[foo\] contains 3 sections: \[Index\] Name \[ 5\] \.gnu\.linkonce\.t\.foo \[ 6\] \.gnu\.linkonce\.ia64unwi\.foo diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/ia64/ia64.exp binutils-2.16.91.0.1/gas/testsuite/gas/ia64/ia64.exp --- binutils-2.16.90.0.3/gas/testsuite/gas/ia64/ia64.exp 2005-05-10 15:46:46.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/ia64/ia64.exp 2005-06-22 13:53:35.259258834 -0700 @@ -65,11 +65,13 @@ if [istarget "ia64-*"] then { run_dump_test "unwind-ilp32" run_dump_test "alias-ilp32" run_dump_test "xdata-ilp32" + run_dump_test "reloc-uw-ilp32" } else { run_dump_test "secname" run_dump_test "unwind" run_dump_test "alias" run_dump_test "xdata" + run_dump_test "reloc-uw" run_dump_test "group-1" run_dump_test "group-2" } @@ -80,6 +82,7 @@ if [istarget "ia64-*"] then { run_list_test "no-fit" "" run_list_test "pound" "-al" run_list_test "proc" "-munwind-check=error" + run_list_test "radix" "" run_list_test "slot2" "" run_list_test "unwind-err" "-munwind-check=error" run_dump_test "operand-or" diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/ia64/proc.l binutils-2.16.91.0.1/gas/testsuite/gas/ia64/proc.l --- binutils-2.16.90.0.3/gas/testsuite/gas/ia64/proc.l 2005-04-09 12:03:14.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/ia64/proc.l 2005-06-22 13:53:35.260258669 -0700 @@ -1,5 +1,6 @@ .*: Assembler messages: .*:4: Error: .* already defined.* .*:7: Error: .* not defined.* +.*:7: Warning: .* not specified.* .*:12: Error: Empty argument of .proc .*:13: Error: Empty argument of .endp diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/ia64/radix.l binutils-2.16.91.0.1/gas/testsuite/gas/ia64/radix.l --- binutils-2.16.90.0.3/gas/testsuite/gas/ia64/radix.l 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/ia64/radix.l 2005-06-22 13:53:35.260258669 -0700 @@ -0,0 +1,4 @@ +.*: Assembler messages: +.*:1: Error: Radix .a. .*invalid +.*:4: Error: Radix .cc. .*invalid +.*:5: Error: Radix .Z. .*invalid diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/ia64/radix.s binutils-2.16.91.0.1/gas/testsuite/gas/ia64/radix.s --- binutils-2.16.90.0.3/gas/testsuite/gas/ia64/radix.s 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/ia64/radix.s 2005-06-22 13:53:35.260258669 -0700 @@ -0,0 +1,5 @@ + .radix a + .radix c + .radix C# + .radix cc + .radix Z diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/ia64/reloc-uw.d binutils-2.16.91.0.1/gas/testsuite/gas/ia64/reloc-uw.d --- binutils-2.16.90.0.3/gas/testsuite/gas/ia64/reloc-uw.d 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/ia64/reloc-uw.d 2005-06-22 13:53:35.260258669 -0700 @@ -0,0 +1,13 @@ +# objdump: -r +# name: ia64 unwind relocations + +.*: +file format .* + +RELOCATION RECORDS FOR \[\.IA_64\.unwind\]: +OFFSET[[:space:]]+TYPE[[:space:]]+VALUE[[:space:]]* +0*00 SEGREL64[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)? +0*08 SEGREL64[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)? +0*10 SEGREL64[ML]SB[[:space:]]+\.IA_64\.unwind_info(\+0x[[:xdigit:]]*[08])? +0*18 SEGREL64[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)? +0*20 SEGREL64[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)? +0*28 SEGREL64[ML]SB[[:space:]]+\.IA_64\.unwind_info(\+0x[[:xdigit:]]*[08])? diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/ia64/reloc-uw-ilp32.d binutils-2.16.91.0.1/gas/testsuite/gas/ia64/reloc-uw-ilp32.d --- binutils-2.16.90.0.3/gas/testsuite/gas/ia64/reloc-uw-ilp32.d 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/ia64/reloc-uw-ilp32.d 2005-06-22 13:53:35.260258669 -0700 @@ -0,0 +1,15 @@ +#objdump: -r +#name: ia64 unwind relocations (ilp32) +#as: -milp32 +#source: reloc-uw.s + +.*: +file format .* + +RELOCATION RECORDS FOR \[\.IA_64\.unwind\]: +OFFSET[[:space:]]+TYPE[[:space:]]+VALUE[[:space:]]* +0*00 SEGREL32[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)? +0*04 SEGREL32[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)? +0*08 SEGREL32[ML]SB[[:space:]]+\.IA_64\.unwind_info(\+0x[[:xdigit:]]*[048c])? +0*0c SEGREL32[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)? +0*10 SEGREL32[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)? +0*14 SEGREL32[ML]SB[[:space:]]+\.IA_64\.unwind_info(\+0x[[:xdigit:]]*[048c])? diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/ia64/reloc-uw.s binutils-2.16.91.0.1/gas/testsuite/gas/ia64/reloc-uw.s --- binutils-2.16.90.0.3/gas/testsuite/gas/ia64/reloc-uw.s 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/ia64/reloc-uw.s 2005-06-22 13:53:35.261258504 -0700 @@ -0,0 +1,13 @@ + .text + + .macro uw, type + .proc uw\type + .\type uw\type +uw\type: + .unwentry + br.ret.sptk rp + .endp uw\type + .endm + + uw global + uw weak diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/mips/ldstla-32-1.l binutils-2.16.91.0.1/gas/testsuite/gas/mips/ldstla-32-1.l --- binutils-2.16.90.0.3/gas/testsuite/gas/mips/ldstla-32-1.l 2005-04-29 10:50:29.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/mips/ldstla-32-1.l 2005-06-22 13:53:35.279255530 -0700 @@ -2,80 +2,80 @@ .*:3: Error: Number \(0xfffffffeffffffff\) larger than 32 bits .*:4: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:5: Error: Number \(0xabcdef0123456789\) larger than 32 bits -.*:6: Error: Number \(0x123456789abcdef\) larger than 32 bits -.*:7: Error: Number \(0x1ffffffff\) larger than 32 bits -.*:8: Error: Number \(0x100000000\) larger than 32 bits +.*:6: Error: Number \(0x0*123456789abcdef\) larger than 32 bits +.*:7: Error: Number \(0x0*1ffffffff\) larger than 32 bits +.*:8: Error: Number \(0x0*100000000\) larger than 32 bits .*:10: Error: Number \(0xfffffffeffffffff\) larger than 32 bits .*:11: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:12: Error: Number \(0xabcdef0123456789\) larger than 32 bits -.*:13: Error: Number \(0x123456789abcdef\) larger than 32 bits -.*:14: Error: Number \(0x1ffffffff\) larger than 32 bits -.*:15: Error: Number \(0x100000000\) larger than 32 bits +.*:13: Error: Number \(0x0*123456789abcdef\) larger than 32 bits +.*:14: Error: Number \(0x0*1ffffffff\) larger than 32 bits +.*:15: Error: Number \(0x0*100000000\) larger than 32 bits .*:17: Error: Number \(0xfffffffeffffffff\) larger than 32 bits .*:18: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:19: Error: Number \(0xabcdef0123456789\) larger than 32 bits -.*:20: Error: Number \(0x123456789abcdef\) larger than 32 bits -.*:21: Error: Number \(0x1ffffffff\) larger than 32 bits -.*:22: Error: Number \(0x100000000\) larger than 32 bits +.*:20: Error: Number \(0x0*123456789abcdef\) larger than 32 bits +.*:21: Error: Number \(0x0*1ffffffff\) larger than 32 bits +.*:22: Error: Number \(0x0*100000000\) larger than 32 bits .*:24: Error: Number \(0xfffffffeffffffff\) larger than 32 bits .*:25: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:26: Error: Number \(0xabcdef0123456789\) larger than 32 bits -.*:27: Error: Number \(0x123456789abcdef\) larger than 32 bits -.*:28: Error: Number \(0x1ffffffff\) larger than 32 bits -.*:29: Error: Number \(0x100000000\) larger than 32 bits +.*:27: Error: Number \(0x0*123456789abcdef\) larger than 32 bits +.*:28: Error: Number \(0x0*1ffffffff\) larger than 32 bits +.*:29: Error: Number \(0x0*100000000\) larger than 32 bits .*:31: Error: Number \(0xfffffffeffffffff\) larger than 32 bits .*:32: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:32: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:33: Error: Number \(0xabcdef0123456789\) larger than 32 bits .*:33: Error: Number \(0xabcdef0123450000\) larger than 32 bits -.*:34: Error: Number \(0x123456789abcdef\) larger than 32 bits -.*:34: Error: Number \(0x123456789ac0000\) larger than 32 bits -.*:35: Error: Number \(0x1ffffffff\) larger than 32 bits -.*:35: Error: Number \(0x200000000\) larger than 32 bits -.*:36: Error: Number \(0x100000000\) larger than 32 bits -.*:36: Error: Number \(0x100000000\) larger than 32 bits +.*:34: Error: Number \(0x0*123456789abcdef\) larger than 32 bits +.*:34: Error: Number \(0x0*123456789ac0000\) larger than 32 bits +.*:35: Error: Number \(0x0*1ffffffff\) larger than 32 bits +.*:35: Error: Number \(0x0*200000000\) larger than 32 bits +.*:36: Error: Number \(0x0*100000000\) larger than 32 bits +.*:36: Error: Number \(0x0*100000000\) larger than 32 bits .*:38: Error: Number \(0xfffffffeffffffff\) larger than 32 bits .*:39: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:39: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:40: Error: Number \(0xabcdef0123456789\) larger than 32 bits .*:40: Error: Number \(0xabcdef0123450000\) larger than 32 bits -.*:41: Error: Number \(0x123456789abcdef\) larger than 32 bits -.*:41: Error: Number \(0x123456789ac0000\) larger than 32 bits -.*:42: Error: Number \(0x1ffffffff\) larger than 32 bits -.*:42: Error: Number \(0x200000000\) larger than 32 bits -.*:43: Error: Number \(0x100000000\) larger than 32 bits -.*:43: Error: Number \(0x100000000\) larger than 32 bits +.*:41: Error: Number \(0x0*123456789abcdef\) larger than 32 bits +.*:41: Error: Number \(0x0*123456789ac0000\) larger than 32 bits +.*:42: Error: Number \(0x0*1ffffffff\) larger than 32 bits +.*:42: Error: Number \(0x0*200000000\) larger than 32 bits +.*:43: Error: Number \(0x0*100000000\) larger than 32 bits +.*:43: Error: Number \(0x0*100000000\) larger than 32 bits .*:45: Error: Number \(0xfffffffeffffffff\) larger than 32 bits .*:46: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:46: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:47: Error: Number \(0xabcdef0123456789\) larger than 32 bits .*:47: Error: Number \(0xabcdef0123450000\) larger than 32 bits -.*:48: Error: Number \(0x123456789abcdef\) larger than 32 bits -.*:48: Error: Number \(0x123456789ac0000\) larger than 32 bits -.*:49: Error: Number \(0x1ffffffff\) larger than 32 bits -.*:49: Error: Number \(0x200000000\) larger than 32 bits -.*:50: Error: Number \(0x100000000\) larger than 32 bits -.*:50: Error: Number \(0x100000000\) larger than 32 bits +.*:48: Error: Number \(0x0*123456789abcdef\) larger than 32 bits +.*:48: Error: Number \(0x0*123456789ac0000\) larger than 32 bits +.*:49: Error: Number \(0x0*1ffffffff\) larger than 32 bits +.*:49: Error: Number \(0x0*200000000\) larger than 32 bits +.*:50: Error: Number \(0x0*100000000\) larger than 32 bits +.*:50: Error: Number \(0x0*100000000\) larger than 32 bits .*:52: Error: Number \(0xfffffffeffffffff\) larger than 32 bits .*:53: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:53: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:54: Error: Number \(0xabcdef0123456789\) larger than 32 bits .*:54: Error: Number \(0xabcdef0123450000\) larger than 32 bits -.*:55: Error: Number \(0x123456789abcdef\) larger than 32 bits -.*:55: Error: Number \(0x123456789ac0000\) larger than 32 bits -.*:56: Error: Number \(0x1ffffffff\) larger than 32 bits -.*:56: Error: Number \(0x200000000\) larger than 32 bits -.*:57: Error: Number \(0x100000000\) larger than 32 bits -.*:57: Error: Number \(0x100000000\) larger than 32 bits +.*:55: Error: Number \(0x0*123456789abcdef\) larger than 32 bits +.*:55: Error: Number \(0x0*123456789ac0000\) larger than 32 bits +.*:56: Error: Number \(0x0*1ffffffff\) larger than 32 bits +.*:56: Error: Number \(0x0*200000000\) larger than 32 bits +.*:57: Error: Number \(0x0*100000000\) larger than 32 bits +.*:57: Error: Number \(0x0*100000000\) larger than 32 bits .*:59: Error: Number \(0xfffffffeffffffff\) larger than 32 bits .*:60: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:61: Error: Number \(0xabcdef0123456789\) larger than 32 bits -.*:62: Error: Number \(0x123456789abcdef\) larger than 32 bits -.*:63: Error: Number \(0x1ffffffff\) larger than 32 bits -.*:64: Error: Number \(0x100000000\) larger than 32 bits +.*:62: Error: Number \(0x0*123456789abcdef\) larger than 32 bits +.*:63: Error: Number \(0x0*1ffffffff\) larger than 32 bits +.*:64: Error: Number \(0x0*100000000\) larger than 32 bits .*:66: Error: Number \(0xfffffffeffffffff\) larger than 32 bits .*:67: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:68: Error: Number \(0xabcdef0123456789\) larger than 32 bits -.*:69: Error: Number \(0x123456789abcdef\) larger than 32 bits -.*:70: Error: Number \(0x1ffffffff\) larger than 32 bits -.*:71: Error: Number \(0x100000000\) larger than 32 bits +.*:69: Error: Number \(0x0*123456789abcdef\) larger than 32 bits +.*:70: Error: Number \(0x0*1ffffffff\) larger than 32 bits +.*:71: Error: Number \(0x0*100000000\) larger than 32 bits diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/mips/ldstla-32-mips3-1.l binutils-2.16.91.0.1/gas/testsuite/gas/mips/ldstla-32-mips3-1.l --- binutils-2.16.90.0.3/gas/testsuite/gas/mips/ldstla-32-mips3-1.l 2005-04-29 10:50:29.000000000 -0700 +++ binutils-2.16.91.0.1/gas/testsuite/gas/mips/ldstla-32-mips3-1.l 2005-06-22 13:53:35.280255365 -0700 @@ -4,98 +4,98 @@ .*:4: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:5: Error: Number \(0xabcdef0123456789\) larger than 32 bits .*:5: Error: Number \(0xabcdef0123450000\) larger than 32 bits -.*:6: Error: Number \(0x123456789abcdef\) larger than 32 bits -.*:6: Error: Number \(0x123456789ac0000\) larger than 32 bits -.*:7: Error: Number \(0x1ffffffff\) larger than 32 bits -.*:7: Error: Number \(0x200000000\) larger than 32 bits -.*:8: Error: Number \(0x100000000\) larger than 32 bits -.*:8: Error: Number \(0x100000000\) larger than 32 bits +.*:6: Error: Number \(0x0*123456789abcdef\) larger than 32 bits +.*:6: Error: Number \(0x0*123456789ac0000\) larger than 32 bits +.*:7: Error: Number \(0x0*1ffffffff\) larger than 32 bits +.*:7: Error: Number \(0x0*200000000\) larger than 32 bits +.*:8: Error: Number \(0x0*100000000\) larger than 32 bits +.*:8: Error: Number \(0x0*100000000\) larger than 32 bits .*:10: Error: Number \(0xfffffffeffffffff\) larger than 32 bits .*:11: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:11: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:12: Error: Number \(0xabcdef0123456789\) larger than 32 bits .*:12: Error: Number \(0xabcdef0123450000\) larger than 32 bits -.*:13: Error: Number \(0x123456789abcdef\) larger than 32 bits -.*:13: Error: Number \(0x123456789ac0000\) larger than 32 bits -.*:14: Error: Number \(0x1ffffffff\) larger than 32 bits -.*:14: Error: Number \(0x200000000\) larger than 32 bits -.*:15: Error: Number \(0x100000000\) larger than 32 bits -.*:15: Error: Number \(0x100000000\) larger than 32 bits +.*:13: Error: Number \(0x0*123456789abcdef\) larger than 32 bits +.*:13: Error: Number \(0x0*123456789ac0000\) larger than 32 bits +.*:14: Error: Number \(0x0*1ffffffff\) larger than 32 bits +.*:14: Error: Number \(0x0*200000000\) larger than 32 bits +.*:15: Error: Number \(0x0*100000000\) larger than 32 bits +.*:15: Error: Number \(0x0*100000000\) larger than 32 bits .*:17: Error: Number \(0xfffffffeffffffff\) larger than 32 bits .*:18: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:18: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:19: Error: Number \(0xabcdef0123456789\) larger than 32 bits .*:19: Error: Number \(0xabcdef0123450000\) larger than 32 bits -.*:20: Error: Number \(0x123456789abcdef\) larger than 32 bits -.*:20: Error: Number \(0x123456789ac0000\) larger than 32 bits -.*:21: Error: Number \(0x1ffffffff\) larger than 32 bits -.*:21: Error: Number \(0x200000000\) larger than 32 bits -.*:22: Error: Number \(0x100000000\) larger than 32 bits -.*:22: Error: Number \(0x100000000\) larger than 32 bits +.*:20: Error: Number \(0x0*123456789abcdef\) larger than 32 bits +.*:20: Error: Number \(0x0*123456789ac0000\) larger than 32 bits +.*:21: Error: Number \(0x0*1ffffffff\) larger than 32 bits +.*:21: Error: Number \(0x0*200000000\) larger than 32 bits +.*:22: Error: Number \(0x0*100000000\) larger than 32 bits +.*:22: Error: Number \(0x0*100000000\) larger than 32 bits .*:24: Error: Number \(0xfffffffeffffffff\) larger than 32 bits .*:25: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:25: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:26: Error: Number \(0xabcdef0123456789\) larger than 32 bits .*:26: Error: Number \(0xabcdef0123450000\) larger than 32 bits -.*:27: Error: Number \(0x123456789abcdef\) larger than 32 bits -.*:27: Error: Number \(0x123456789ac0000\) larger than 32 bits -.*:28: Error: Number \(0x1ffffffff\) larger than 32 bits -.*:28: Error: Number \(0x200000000\) larger than 32 bits -.*:29: Error: Number \(0x100000000\) larger than 32 bits -.*:29: Error: Number \(0x100000000\) larger than 32 bits +.*:27: Error: Number \(0x0*123456789abcdef\) larger than 32 bits +.*:27: Error: Number \(0x0*123456789ac0000\) larger than 32 bits +.*:28: Error: Number \(0x0*1ffffffff\) larger than 32 bits +.*:28: Error: Number \(0x0*200000000\) larger than 32 bits +.*:29: Error: Number \(0x0*100000000\) larger than 32 bits +.*:29: Error: Number \(0x0*100000000\) larger than 32 bits .*:31: Error: Number \(0xfffffffeffffffff\) larger than 32 bits .*:32: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:32: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:33: Error: Number \(0xabcdef0123456789\) larger than 32 bits .*:33: Error: Number \(0xabcdef0123450000\) larger than 32 bits -.*:34: Error: Number \(0x123456789abcdef\) larger than 32 bits -.*:34: Error: Number \(0x123456789ac0000\) larger than 32 bits -.*:35: Error: Number \(0x1ffffffff\) larger than 32 bits -.*:35: Error: Number \(0x200000000\) larger than 32 bits -.*:36: Error: Number \(0x100000000\) larger than 32 bits -.*:36: Error: Number \(0x100000000\) larger than 32 bits +.*:34: Error: Number \(0x0*123456789abcdef\) larger than 32 bits +.*:34: Error: Number \(0x0*123456789ac0000\) larger than 32 bits +.*:35: Error: Number \(0x0*1ffffffff\) larger than 32 bits +.*:35: Error: Number \(0x0*200000000\) larger than 32 bits +.*:36: Error: Number \(0x0*100000000\) larger than 32 bits +.*:36: Error: Number \(0x0*100000000\) larger than 32 bits .*:38: Error: Number \(0xfffffffeffffffff\) larger than 32 bits .*:39: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:39: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:40: Error: Number \(0xabcdef0123456789\) larger than 32 bits .*:40: Error: Number \(0xabcdef0123450000\) larger than 32 bits -.*:41: Error: Number \(0x123456789abcdef\) larger than 32 bits -.*:41: Error: Number \(0x123456789ac0000\) larger than 32 bits -.*:42: Error: Number \(0x1ffffffff\) larger than 32 bits -.*:42: Error: Number \(0x200000000\) larger than 32 bits -.*:43: Error: Number \(0x100000000\) larger than 32 bits -.*:43: Error: Number \(0x100000000\) larger than 32 bits +.*:41: Error: Number \(0x0*123456789abcdef\) larger than 32 bits +.*:41: Error: Number \(0x0*123456789ac0000\) larger than 32 bits +.*:42: Error: Number \(0x0*1ffffffff\) larger than 32 bits +.*:42: Error: Number \(0x0*200000000\) larger than 32 bits +.*:43: Error: Number \(0x0*100000000\) larger than 32 bits +.*:43: Error: Number \(0x0*100000000\) larger than 32 bits .*:45: Error: Number \(0xfffffffeffffffff\) larger than 32 bits .*:46: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:46: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:47: Error: Number \(0xabcdef0123456789\) larger than 32 bits .*:47: Error: Number \(0xabcdef0123450000\) larger than 32 bits -.*:48: Error: Number \(0x123456789abcdef\) larger than 32 bits -.*:48: Error: Number \(0x123456789ac0000\) larger than 32 bits -.*:49: Error: Number \(0x1ffffffff\) larger than 32 bits -.*:49: Error: Number \(0x200000000\) larger than 32 bits -.*:50: Error: Number \(0x100000000\) larger than 32 bits -.*:50: Error: Number \(0x100000000\) larger than 32 bits +.*:48: Error: Number \(0x0*123456789abcdef\) larger than 32 bits +.*:48: Error: Number \(0x0*123456789ac0000\) larger than 32 bits +.*:49: Error: Number \(0x0*1ffffffff\) larger than 32 bits +.*:49: Error: Number \(0x0*200000000\) larger than 32 bits +.*:50: Error: Number \(0x0*100000000\) larger than 32 bits +.*:50: Error: Number \(0x0*100000000\) larger than 32 bits .*:52: Error: Number \(0xfffffffeffffffff\) larger than 32 bits .*:53: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:53: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:54: Error: Number \(0xabcdef0123456789\) larger than 32 bits .*:54: Error: Number \(0xabcdef0123450000\) larger than 32 bits -.*:55: Error: Number \(0x123456789abcdef\) larger than 32 bits -.*:55: Error: Number \(0x123456789ac0000\) larger than 32 bits -.*:56: Error: Number \(0x1ffffffff\) larger than 32 bits -.*:56: Error: Number \(0x200000000\) larger than 32 bits -.*:57: Error: Number \(0x100000000\) larger than 32 bits -.*:57: Error: Number \(0x100000000\) larger than 32 bits +.*:55: Error: Number \(0x0*123456789abcdef\) larger than 32 bits +.*:55: Error: Number \(0x0*123456789ac0000\) larger than 32 bits +.*:56: Error: Number \(0x0*1ffffffff\) larger than 32 bits +.*:56: Error: Number \(0x0*200000000\) larger than 32 bits +.*:57: Error: Number \(0x0*100000000\) larger than 32 bits +.*:57: Error: Number \(0x0*100000000\) larger than 32 bits .*:59: Error: Number \(0xfffffffeffffffff\) larger than 32 bits .*:60: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:61: Error: Number \(0xabcdef0123456789\) larger than 32 bits -.*:62: Error: Number \(0x123456789abcdef\) larger than 32 bits -.*:63: Error: Number \(0x1ffffffff\) larger than 32 bits -.*:64: Error: Number \(0x100000000\) larger than 32 bits +.*:62: Error: Number \(0x0*123456789abcdef\) larger than 32 bits +.*:63: Error: Number \(0x0*1ffffffff\) larger than 32 bits +.*:64: Error: Number \(0x0*100000000\) larger than 32 bits .*:66: Error: Number \(0xfffffffeffffffff\) larger than 32 bits .*:67: Error: Number \(0xfffffffe00000000\) larger than 32 bits .*:68: Error: Number \(0xabcdef0123456789\) larger than 32 bits -.*:69: Error: Number \(0x123456789abcdef\) larger than 32 bits -.*:70: Error: Number \(0x1ffffffff\) larger than 32 bits -.*:71: Error: Number \(0x100000000\) larger than 32 bits +.*:69: Error: Number \(0x0*123456789abcdef\) larger than 32 bits +.*:70: Error: Number \(0x0*1ffffffff\) larger than 32 bits +.*:71: Error: Number \(0x0*100000000\) larger than 32 bits diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/mmix/err-byte1.s binutils-2.16.91.0.1/gas/testsuite/gas/mmix/err-byte1.s --- binutils-2.16.90.0.3/gas/testsuite/gas/mmix/err-byte1.s 2001-11-16 14:05:52.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/mmix/err-byte1.s 2005-06-22 13:53:35.284254704 -0700 @@ -1,5 +1,5 @@ % { dg-do assemble { target mmix-*-* } } -% { dg-error "unterminated string" "" { target mmix-*-* } 10 } +% { dg-error "unterminated string|missing closing" "" { target mmix-*-* } 10 } % { dg-bogus "end of file" "" { xfail mmix-*-* } 0 } # Note that the error is detected in the preformatter, before the text diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/v850/split-lo16.d binutils-2.16.91.0.1/gas/testsuite/gas/v850/split-lo16.d --- binutils-2.16.90.0.3/gas/testsuite/gas/v850/split-lo16.d 2004-12-20 11:16:51.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/v850/split-lo16.d 2005-06-22 13:53:35.289253878 -0700 @@ -13,4 +13,6 @@ c: R_V850_LO16_SPLIT_OFFSET foo 10: a1 17 45 23 ld\.bu 9029\[r1\],r2 14: 81 17 57 34 ld\.bu 13398\[r1\],r2 + 18: 20 57 01 00 ld.w 0\[r0\],r10 + 1c: 20 57 79 56 ld.w 22136\[r0\],r10 #pass diff -uprN binutils-2.16.90.0.3/gas/testsuite/gas/v850/split-lo16.s binutils-2.16.91.0.1/gas/testsuite/gas/v850/split-lo16.s --- binutils-2.16.90.0.3/gas/testsuite/gas/v850/split-lo16.s 2004-12-20 11:16:51.000000000 -0800 +++ binutils-2.16.91.0.1/gas/testsuite/gas/v850/split-lo16.s 2005-06-22 13:53:35.289253878 -0700 @@ -5,3 +5,6 @@ ld.bu lo(0x12345),r1,r2 ld.bu lo(0x123456),r1,r2 + + ld.w lo(0)[r0], r10 + ld.w lo(0x12345678)[r0], r10 diff -uprN binutils-2.16.90.0.3/gas/write.c binutils-2.16.91.0.1/gas/write.c --- binutils-2.16.90.0.3/gas/write.c 2005-05-10 15:46:44.000000000 -0700 +++ binutils-2.16.91.0.1/gas/write.c 2005-06-22 13:53:34.755342094 -0700 @@ -713,12 +713,8 @@ size_seg (bfd *abfd, asection *sec, PTR #ifdef DEBUG2 static void -dump_section_relocs (abfd, sec, stream_) - bfd *abfd ATTRIBUTE_UNUSED; - asection *sec; - char *stream_; +dump_section_relocs (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, FILE *stream) { - FILE *stream = (FILE *) stream_; segment_info_type *seginfo = seg_info (sec); fixS *fixp = seginfo->fix_root; @@ -1060,7 +1056,7 @@ write_relocs (bfd *abfd, asection *sec, #ifdef DEBUG4 { - int i, j, nsyms; + unsigned int i, j, nsyms; asymbol **sympp; sympp = bfd_get_outsymbols (stdoutput); nsyms = bfd_get_symcount (stdoutput); @@ -1089,7 +1085,7 @@ write_relocs (bfd *abfd, asection *sec, #ifdef DEBUG3 { - int i; + unsigned int i; arelent *r; asymbol *s; fprintf (stderr, "relocs for sec %s\n", sec->name); @@ -1097,8 +1093,8 @@ write_relocs (bfd *abfd, asection *sec, { r = relocs[i]; s = *r->sym_ptr_ptr; - fprintf (stderr, " reloc %2d @%08x off %4x : sym %-10s addend %x\n", - i, r, r->address, s->name, r->addend); + fprintf (stderr, " reloc %2d @%p off %4lx : sym %-10s addend %lx\n", + i, r, (unsigned long)r->address, s->name, (unsigned long)r->addend); } } #endif @@ -2526,7 +2522,7 @@ relax_segment (struct frag *segment_frag Go through all the fixS's in a segment and see which ones can be handled now. (These consist of fixS where we have since discovered the value of a symbol, or the address of the frag involved.) - For each one, call md_apply_fix3 to put the fix into the frag data. + For each one, call md_apply_fix to put the fix into the frag data. Result is a count of how many relocation structs will be needed to handle the remaining fixS's that we couldn't completely handle here. @@ -2707,7 +2703,7 @@ fixup_segment (fixS *fixP, segT this_seg } if (!fixP->fx_done) - md_apply_fix3 (fixP, &add_number, this_segment); + md_apply_fix (fixP, &add_number, this_segment); if (!fixP->fx_done) { diff -uprN binutils-2.16.90.0.3/include/ansidecl.h binutils-2.16.91.0.1/include/ansidecl.h --- binutils-2.16.90.0.3/include/ansidecl.h 2005-05-10 15:46:48.000000000 -0700 +++ binutils-2.16.91.0.1/include/ansidecl.h 2005-06-22 13:53:35.303251566 -0700 @@ -258,11 +258,11 @@ So instead we use the macro below and te /* Attributes on labels were valid as of gcc 2.93. */ #ifndef ATTRIBUTE_UNUSED_LABEL -# if (GCC_VERSION >= 2093) +# if (!defined (__cplusplus) && GCC_VERSION >= 2093) # define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED # else # define ATTRIBUTE_UNUSED_LABEL -# endif /* GNUC >= 2.93 */ +# endif /* !__cplusplus && GNUC >= 2.93 */ #endif /* ATTRIBUTE_UNUSED_LABEL */ #ifndef ATTRIBUTE_UNUSED @@ -312,6 +312,22 @@ So instead we use the macro below and te #define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6) #endif /* ATTRIBUTE_PRINTF */ +/* Use ATTRIBUTE_FPTR_PRINTF when the format attribute is to be set on + a function pointer. Format attributes were allowed on function + pointers as of gcc 3.1. */ +#ifndef ATTRIBUTE_FPTR_PRINTF +# if (GCC_VERSION >= 3001) +# define ATTRIBUTE_FPTR_PRINTF(m, n) ATTRIBUTE_PRINTF(m, n) +# else +# define ATTRIBUTE_FPTR_PRINTF(m, n) +# endif /* GNUC >= 3.1 */ +# define ATTRIBUTE_FPTR_PRINTF_1 ATTRIBUTE_FPTR_PRINTF(1, 2) +# define ATTRIBUTE_FPTR_PRINTF_2 ATTRIBUTE_FPTR_PRINTF(2, 3) +# define ATTRIBUTE_FPTR_PRINTF_3 ATTRIBUTE_FPTR_PRINTF(3, 4) +# define ATTRIBUTE_FPTR_PRINTF_4 ATTRIBUTE_FPTR_PRINTF(4, 5) +# define ATTRIBUTE_FPTR_PRINTF_5 ATTRIBUTE_FPTR_PRINTF(5, 6) +#endif /* ATTRIBUTE_FPTR_PRINTF */ + /* Use ATTRIBUTE_NULL_PRINTF when the format specifier may be NULL. A NULL format specifier was allowed as of gcc 3.3. */ #ifndef ATTRIBUTE_NULL_PRINTF diff -uprN binutils-2.16.90.0.3/include/bfdlink.h binutils-2.16.91.0.1/include/bfdlink.h --- binutils-2.16.90.0.3/include/bfdlink.h 2005-05-10 15:46:48.000000000 -0700 +++ binutils-2.16.91.0.1/include/bfdlink.h 2005-06-22 13:53:35.304251400 -0700 @@ -422,11 +422,11 @@ struct bfd_link_info }; /* This structures holds a set of callback functions. These are - called by the BFD linker routines. The first argument to each - callback function is the bfd_link_info structure being used. Each - function returns a boolean value. If the function returns FALSE, - then the BFD function which called it will return with a failure - indication. */ + called by the BFD linker routines. Except for einfo, the first + argument to each callback function is the bfd_link_info structure + being used and each function returns a boolean value. If the + function returns FALSE, then the BFD function which called it should + return with a failure indication. */ struct bfd_link_callbacks { @@ -535,6 +535,9 @@ struct bfd_link_callbacks bfd_boolean (*notice) (struct bfd_link_info *, const char *name, bfd *abfd, asection *section, bfd_vma address); + /* General link info message. */ + void (*einfo) + (const char *fmt, ...); }; /* The linker builds link_order structures which tell the code how to diff -uprN binutils-2.16.90.0.3/include/ChangeLog binutils-2.16.91.0.1/include/ChangeLog --- binutils-2.16.90.0.3/include/ChangeLog 2005-05-10 15:46:48.000000000 -0700 +++ binutils-2.16.91.0.1/include/ChangeLog 2005-06-22 13:53:35.295252887 -0700 @@ -1,3 +1,58 @@ +2005-06-20 Geoffrey Keating + + * libiberty.h (strverscmp): Prototype. + +2005-06-17 Jakub Jelinek + + * elf/external.h (GRP_ENTRY_SIZE): Define. + +2005-06-08 Zack Weinberg + + * dis-asm.h (get_arm_regnames): Update prototype. + +2005-06-07 Aldy Hernandez + Michael Snyder + Stan Cox + + * dis-asm.h: Externalize print_insn_ms1. + +2005-06-06 Gabriel Dos Reis + + * libiberty.h (XOBFINISH): New. + +2005-06-03 Alan Modra + + * bfdlink.h (struct bfd_link_callbacks): Add einfo. + +2005-06-01 Kaveh R. Ghazi + + * libiberty.h (vsnprintf): Add format attribute. + +2005-05-29 Kaveh R. Ghazi + + * ansidecl.h: Add ATTRIBUTE_FPTR_PRINTF. + +2005-05-28 Eli Zaretskii + + * libiberty.h: (snprintf) [!HAVE_DECL_SNPRINTF]: Declare if + needed. + (vsnprintf) [!HAVE_DECL_VSNPRINTF]: Declare if needed. + +2005-05-25 Richard Henderson + + * demangle.h (DEMANGLE_COMPONENT_HIDDEN_ALIAS): New. + +2005-05-24 Gabriel Dos Reis + + * libiberty.h (ACONCAT): Properly cast value of alloca(). + + * ansidecl.h (ATTRIBUTE_UNUSED_LABEL): Don't define if + __cplusplus. + +2005-05-12 Steve Ellcey + + libiberty.h: Do not define empty basename prototype. + 2005-05-10 Nick Clifton * Update the address and phone number of the FSF organization in @@ -52,7 +107,7 @@ 2005-03-28 Mark Mitchell * libiberty.h (ffs): Declare, if necessary. - + 2005-03-27 Gabriel Dos Reis * ternary.h: Don't use PARAMS anymore. diff -uprN binutils-2.16.90.0.3/include/demangle.h binutils-2.16.91.0.1/include/demangle.h --- binutils-2.16.90.0.3/include/demangle.h 2005-05-10 15:46:48.000000000 -0700 +++ binutils-2.16.91.0.1/include/demangle.h 2005-06-22 13:53:35.304251400 -0700 @@ -255,6 +255,9 @@ enum demangle_component_type /* A reference temporary. This has one subtree, the name for which this is a temporary. */ DEMANGLE_COMPONENT_REFTEMP, + /* A hidden alias. This has one subtree, the encoding for which it + is providing alternative linkage. */ + DEMANGLE_COMPONENT_HIDDEN_ALIAS, /* A standard substitution. This holds the name of the substitution. */ DEMANGLE_COMPONENT_SUB_STD, diff -uprN binutils-2.16.90.0.3/include/dis-asm.h binutils-2.16.91.0.1/include/dis-asm.h --- binutils-2.16.90.0.3/include/dis-asm.h 2005-05-10 15:46:48.000000000 -0700 +++ binutils-2.16.91.0.1/include/dis-asm.h 2005-06-22 13:53:35.305251235 -0700 @@ -237,6 +237,7 @@ extern int print_insn_mcore (bfd_vma, d extern int print_insn_mmix (bfd_vma, disassemble_info *); extern int print_insn_mn10200 (bfd_vma, disassemble_info *); extern int print_insn_mn10300 (bfd_vma, disassemble_info *); +extern int print_insn_ms1 (bfd_vma, disassemble_info *); extern int print_insn_msp430 (bfd_vma, disassemble_info *); extern int print_insn_ns32k (bfd_vma, disassemble_info *); extern int print_insn_crx (bfd_vma, disassemble_info *); @@ -273,7 +274,7 @@ extern void print_arm_disassembler_optio extern void parse_arm_disassembler_option (char *); extern int get_arm_regname_num_options (void); extern int set_arm_regname_option (int); -extern int get_arm_regnames (int, const char **, const char **, const char ***); +extern int get_arm_regnames (int, const char **, const char **, const char *const **); extern bfd_boolean arm_symbol_is_valid (asymbol *, struct disassemble_info *); /* Fetch the disassembler for a given BFD, if that support is available. */ diff -uprN binutils-2.16.90.0.3/include/elf/alpha.h binutils-2.16.91.0.1/include/elf/alpha.h --- binutils-2.16.90.0.3/include/elf/alpha.h 2005-05-10 15:46:51.000000000 -0700 +++ binutils-2.16.91.0.1/include/elf/alpha.h 2005-06-22 13:53:35.307250905 -0700 @@ -63,6 +63,9 @@ typedef struct #define STO_ALPHA_NOPV 0x80 #define STO_ALPHA_STD_GPLOAD 0x88 +/* Special values for Elf64_Dyn tag. */ +#define DT_ALPHA_PLTRO DT_LOPROC + #include "elf/reloc-macros.h" /* Alpha relocs. */ @@ -122,5 +125,6 @@ END_RELOC_NUMBERS (R_ALPHA_max) #define LITUSE_ALPHA_JSR 3 #define LITUSE_ALPHA_TLSGD 4 #define LITUSE_ALPHA_TLSLDM 5 +#define LITUSE_ALPHA_JSRDIRECT 6 #endif /* _ELF_ALPHA_H */ diff -uprN binutils-2.16.90.0.3/include/elf/arm.h binutils-2.16.91.0.1/include/elf/arm.h --- binutils-2.16.90.0.3/include/elf/arm.h 2005-05-10 15:46:52.000000000 -0700 +++ binutils-2.16.91.0.1/include/elf/arm.h 2005-06-22 13:53:35.307250905 -0700 @@ -38,7 +38,7 @@ #define EF_ARM_MAVERICK_FLOAT 0x800 /* Frame unwind information */ -#define PT_ARM_EXIDX (PT_LOPROC + 1) +#define PT_ARM_EXIDX (PT_LOPROC + 1) /* Other constants defined in the ARM ELF spec. version B-01. */ #define EF_ARM_SYMSARESORTED 0x04 /* NB conflicts with EF_INTERWORK */ @@ -84,93 +84,141 @@ /* Relocation types. */ START_RELOC_NUMBERS (elf_arm_reloc_type) - RELOC_NUMBER (R_ARM_NONE, 0) - RELOC_NUMBER (R_ARM_PC24, 1) - RELOC_NUMBER (R_ARM_ABS32, 2) - RELOC_NUMBER (R_ARM_REL32, 3) -#ifdef OLD_ARM_ABI - RELOC_NUMBER (R_ARM_ABS8, 4) - RELOC_NUMBER (R_ARM_ABS16, 5) - RELOC_NUMBER (R_ARM_ABS12, 6) - RELOC_NUMBER (R_ARM_THM_ABS5, 7) - RELOC_NUMBER (R_ARM_THM_PC22, 8) - RELOC_NUMBER (R_ARM_SBREL32, 9) - RELOC_NUMBER (R_ARM_AMP_VCALL9, 10) - RELOC_NUMBER (R_ARM_THM_PC11, 11) /* Cygnus extension to abi: Thumb unconditional branch. */ - RELOC_NUMBER (R_ARM_THM_PC9, 12) /* Cygnus extension to abi: Thumb conditional branch. */ - RELOC_NUMBER (R_ARM_GNU_VTINHERIT, 13) - RELOC_NUMBER (R_ARM_GNU_VTENTRY, 14) -#else /* not OLD_ARM_ABI */ - RELOC_NUMBER (R_ARM_PC13, 4) - RELOC_NUMBER (R_ARM_ABS16, 5) - RELOC_NUMBER (R_ARM_ABS12, 6) - RELOC_NUMBER (R_ARM_THM_ABS5, 7) - RELOC_NUMBER (R_ARM_ABS8, 8) - RELOC_NUMBER (R_ARM_SBREL32, 9) - RELOC_NUMBER (R_ARM_THM_PC22, 10) - RELOC_NUMBER (R_ARM_THM_PC8, 11) - RELOC_NUMBER (R_ARM_AMP_VCALL9, 12) - RELOC_NUMBER (R_ARM_SWI24, 13) - RELOC_NUMBER (R_ARM_THM_SWI8, 14) - RELOC_NUMBER (R_ARM_XPC25, 15) - RELOC_NUMBER (R_ARM_THM_XPC22, 16) - RELOC_NUMBER (R_ARM_TLS_DTPMOD32, 17) - RELOC_NUMBER (R_ARM_TLS_DTPOFF32, 18) - RELOC_NUMBER (R_ARM_TLS_TPOFF32, 19) -#endif /* not OLD_ARM_ABI */ - RELOC_NUMBER (R_ARM_COPY, 20) /* Copy symbol at runtime. */ - RELOC_NUMBER (R_ARM_GLOB_DAT, 21) /* Create GOT entry. */ - RELOC_NUMBER (R_ARM_JUMP_SLOT, 22) /* Create PLT entry. */ - RELOC_NUMBER (R_ARM_RELATIVE, 23) /* Adjust by program base. */ - RELOC_NUMBER (R_ARM_GOTOFF, 24) /* 32 bit offset to GOT. */ - RELOC_NUMBER (R_ARM_GOTPC, 25) /* 32 bit PC relative offset to GOT. */ - RELOC_NUMBER (R_ARM_GOT32, 26) /* 32 bit GOT entry. */ - RELOC_NUMBER (R_ARM_PLT32, 27) /* 32 bit PLT address. */ -#ifdef OLD_ARM_ABI - FAKE_RELOC (FIRST_INVALID_RELOC, 28) - FAKE_RELOC (LAST_INVALID_RELOC, 249) -#else /* not OLD_ARM_ABI */ - RELOC_NUMBER (R_ARM_CALL, 28) - RELOC_NUMBER (R_ARM_JUMP24, 29) - FAKE_RELOC (FIRST_INVALID_RELOC1, 30) - FAKE_RELOC (LAST_INVALID_RELOC1, 31) - RELOC_NUMBER (R_ARM_ALU_PCREL7_0, 32) - RELOC_NUMBER (R_ARM_ALU_PCREL15_8, 33) - RELOC_NUMBER (R_ARM_ALU_PCREL23_15, 34) - RELOC_NUMBER (R_ARM_LDR_SBREL_11_0, 35) - RELOC_NUMBER (R_ARM_ALU_SBREL_19_12, 36) - RELOC_NUMBER (R_ARM_ALU_SBREL_27_20, 37) - RELOC_NUMBER (R_ARM_TARGET1, 38) - RELOC_NUMBER (R_ARM_ROSEGREL32, 39) - RELOC_NUMBER (R_ARM_V4BX, 40) - RELOC_NUMBER (R_ARM_TARGET2, 41) - RELOC_NUMBER (R_ARM_PREL31, 42) - FAKE_RELOC (FIRST_INVALID_RELOC2, 43) - FAKE_RELOC (LAST_INVALID_RELOC2, 94) - RELOC_NUMBER (R_ARM_GOT_ABS, 95) - RELOC_NUMBER (R_ARM_GOT_PREL, 96) - RELOC_NUMBER (R_ARM_GOT_BREL12, 97) - RELOC_NUMBER (R_ARM_GOTOFF12, 98) - RELOC_NUMBER (R_ARM_GOTRELAX, 99) - RELOC_NUMBER (R_ARM_GNU_VTENTRY, 100) - RELOC_NUMBER (R_ARM_GNU_VTINHERIT, 101) - RELOC_NUMBER (R_ARM_THM_PC11, 102) /* Cygnus extension to abi: Thumb unconditional branch. */ - RELOC_NUMBER (R_ARM_THM_PC9, 103) /* Cygnus extension to abi: Thumb conditional branch. */ - RELOC_NUMBER (R_ARM_TLS_GD32, 104) - RELOC_NUMBER (R_ARM_TLS_LDM32, 105) - RELOC_NUMBER (R_ARM_TLS_LDO32, 106) - RELOC_NUMBER (R_ARM_TLS_IE32, 107) - RELOC_NUMBER (R_ARM_TLS_LE32, 108) - FAKE_RELOC (FIRST_INVALID_RELOC3, 109) - FAKE_RELOC (LAST_INVALID_RELOC3, 248) - RELOC_NUMBER (R_ARM_RXPC25, 249) -#endif /* not OLD_ARM_ABI */ - RELOC_NUMBER (R_ARM_RSBREL32, 250) - RELOC_NUMBER (R_ARM_THM_RPC22, 251) - RELOC_NUMBER (R_ARM_RREL32, 252) - RELOC_NUMBER (R_ARM_RABS32, 253) - RELOC_NUMBER (R_ARM_RPC24, 254) - RELOC_NUMBER (R_ARM_RBASE, 255) +/* AAELF official names and numbers. */ + RELOC_NUMBER (R_ARM_NONE, 0) + RELOC_NUMBER (R_ARM_PC24, 1) /* deprecated */ + RELOC_NUMBER (R_ARM_ABS32, 2) + RELOC_NUMBER (R_ARM_REL32, 3) + RELOC_NUMBER (R_ARM_LDR_PC_G0, 4) + RELOC_NUMBER (R_ARM_ABS16, 5) + RELOC_NUMBER (R_ARM_ABS12, 6) + RELOC_NUMBER (R_ARM_THM_ABS5, 7) + RELOC_NUMBER (R_ARM_ABS8, 8) + RELOC_NUMBER (R_ARM_SBREL32, 9) + RELOC_NUMBER (R_ARM_THM_CALL, 10) + RELOC_NUMBER (R_ARM_THM_PC8, 11) + RELOC_NUMBER (R_ARM_BREL_ADJ, 12) + RELOC_NUMBER (R_ARM_SWI24, 13) /* obsolete */ + RELOC_NUMBER (R_ARM_THM_SWI8, 14) /* obsolete */ + RELOC_NUMBER (R_ARM_XPC25, 15) /* obsolete */ + RELOC_NUMBER (R_ARM_THM_XPC22, 16) /* obsolete */ + RELOC_NUMBER (R_ARM_TLS_DTPMOD32, 17) + RELOC_NUMBER (R_ARM_TLS_DTPOFF32, 18) + RELOC_NUMBER (R_ARM_TLS_TPOFF32, 19) + RELOC_NUMBER (R_ARM_COPY, 20) /* Copy symbol at runtime. */ + RELOC_NUMBER (R_ARM_GLOB_DAT, 21) /* Create GOT entry. */ + RELOC_NUMBER (R_ARM_JUMP_SLOT, 22) /* Create PLT entry. */ + RELOC_NUMBER (R_ARM_RELATIVE, 23) /* Adjust by program base. */ + RELOC_NUMBER (R_ARM_GOTOFF32, 24) /* 32 bit offset to GOT. */ + RELOC_NUMBER (R_ARM_BASE_PREL, 25) /* 32 bit PC relative offset to GOT. */ + RELOC_NUMBER (R_ARM_GOT_BREL, 26) /* 32 bit GOT entry. */ + RELOC_NUMBER (R_ARM_PLT32, 27) /* deprecated - 32 bit PLT address. */ + RELOC_NUMBER (R_ARM_CALL, 28) + RELOC_NUMBER (R_ARM_JUMP24, 29) + RELOC_NUMBER (R_ARM_THM_JUMP24, 30) + RELOC_NUMBER (R_ARM_BASE_ABS, 31) + RELOC_NUMBER (R_ARM_ALU_PCREL7_0, 32) /* obsolete */ + RELOC_NUMBER (R_ARM_ALU_PCREL15_8, 33) /* obsolete */ + RELOC_NUMBER (R_ARM_ALU_PCREL23_15, 34) /* obsolete */ + RELOC_NUMBER (R_ARM_LDR_SBREL_11_0, 35) /* deprecated, should have _NC suffix */ + RELOC_NUMBER (R_ARM_ALU_SBREL_19_12, 36) /* deprecated, should have _NC suffix */ + RELOC_NUMBER (R_ARM_ALU_SBREL_27_20, 37) /* deprecated, should have _CK suffix */ + RELOC_NUMBER (R_ARM_TARGET1, 38) + RELOC_NUMBER (R_ARM_SBREL31, 39) /* deprecated */ + RELOC_NUMBER (R_ARM_V4BX, 40) + RELOC_NUMBER (R_ARM_TARGET2, 41) + RELOC_NUMBER (R_ARM_PREL31, 42) + RELOC_NUMBER (R_ARM_MOVW_ABS_NC, 43) + RELOC_NUMBER (R_ARM_MOVT_ABS, 44) + RELOC_NUMBER (R_ARM_MOVW_PREL_NC, 45) + RELOC_NUMBER (R_ARM_MOVT_PREL, 46) + RELOC_NUMBER (R_ARM_THM_MOVW_ABS_NC, 47) + RELOC_NUMBER (R_ARM_THM_MOVT_ABS, 48) + RELOC_NUMBER (R_ARM_THM_MOVW_PREL_NC, 49) + RELOC_NUMBER (R_ARM_THM_MOVT_PREL, 50) + RELOC_NUMBER (R_ARM_THM_JUMP19, 51) + RELOC_NUMBER (R_ARM_THM_JUMP6, 52) + RELOC_NUMBER (R_ARM_THM_ALU_PREL_11_0, 53) + RELOC_NUMBER (R_ARM_THM_PC12, 54) + RELOC_NUMBER (R_ARM_ABS32_NOI, 55) + RELOC_NUMBER (R_ARM_REL32_NOI, 56) + RELOC_NUMBER (R_ARM_ALU_PC_G0_NC, 57) + RELOC_NUMBER (R_ARM_ALU_PC_G0, 58) + RELOC_NUMBER (R_ARM_ALU_PC_G1_NC, 59) + RELOC_NUMBER (R_ARM_ALU_PC_G1, 60) + RELOC_NUMBER (R_ARM_ALU_PC_G2, 61) + RELOC_NUMBER (R_ARM_LDR_PC_G1, 62) + RELOC_NUMBER (R_ARM_LDR_PC_G2, 63) + RELOC_NUMBER (R_ARM_LDRS_PC_G0, 64) + RELOC_NUMBER (R_ARM_LDRS_PC_G1, 65) + RELOC_NUMBER (R_ARM_LDRS_PC_G2, 66) + RELOC_NUMBER (R_ARM_LDC_PC_G0, 67) + RELOC_NUMBER (R_ARM_LDC_PC_G1, 68) + RELOC_NUMBER (R_ARM_LDC_PC_G2, 69) + RELOC_NUMBER (R_ARM_ALU_SB_G0_NC, 70) + RELOC_NUMBER (R_ARM_ALU_SB_G0, 71) + RELOC_NUMBER (R_ARM_ALU_SB_G1_NC, 72) + RELOC_NUMBER (R_ARM_ALU_SB_G1, 73) + RELOC_NUMBER (R_ARM_ALU_SB_G2, 74) + RELOC_NUMBER (R_ARM_LDR_SB_G0, 75) + RELOC_NUMBER (R_ARM_LDR_SB_G1, 76) + RELOC_NUMBER (R_ARM_LDR_SB_G2, 77) + RELOC_NUMBER (R_ARM_LDRS_SB_G0, 78) + RELOC_NUMBER (R_ARM_LDRS_SB_G1, 79) + RELOC_NUMBER (R_ARM_LDRS_SB_G2, 80) + RELOC_NUMBER (R_ARM_LDC_G0, 81) + RELOC_NUMBER (R_ARM_LDC_G1, 82) + RELOC_NUMBER (R_ARM_LDC_G2, 83) + RELOC_NUMBER (R_ARM_MOVW_BREL_NC, 84) + RELOC_NUMBER (R_ARM_MOVT_BREL, 85) + RELOC_NUMBER (R_ARM_MOVW_BREL, 86) + RELOC_NUMBER (R_ARM_THM_MOVW_BREL_NC, 87) + RELOC_NUMBER (R_ARM_THM_MOVT_BREL, 88) + RELOC_NUMBER (R_ARM_THM_MOVW_BREL, 89) + /* 90-93 unallocated */ + RELOC_NUMBER (R_ARM_PLT32_ABS, 94) + RELOC_NUMBER (R_ARM_GOT_ABS, 95) + RELOC_NUMBER (R_ARM_GOT_PREL, 96) + RELOC_NUMBER (R_ARM_GOT_BREL12, 97) + RELOC_NUMBER (R_ARM_GOTOFF12, 98) + RELOC_NUMBER (R_ARM_GOTRELAX, 99) + RELOC_NUMBER (R_ARM_GNU_VTENTRY, 100) /* deprecated - old C++ abi */ + RELOC_NUMBER (R_ARM_GNU_VTINHERIT, 101) /* deprecated - old C++ abi */ + RELOC_NUMBER (R_ARM_THM_JUMP11, 102) + RELOC_NUMBER (R_ARM_THM_JUMP8, 103) + RELOC_NUMBER (R_ARM_TLS_GD32, 104) + RELOC_NUMBER (R_ARM_TLS_LDM32, 105) + RELOC_NUMBER (R_ARM_TLS_LDO32, 106) + RELOC_NUMBER (R_ARM_TLS_IE32, 107) + RELOC_NUMBER (R_ARM_TLS_LE32, 108) + RELOC_NUMBER (R_ARM_TLS_LDO12, 109) + RELOC_NUMBER (R_ARM_TLS_LE12, 110) + RELOC_NUMBER (R_ARM_TLS_IE12GP, 111) + /* 112 - 127 private range */ + RELOC_NUMBER (R_ARM_ME_TOO, 128) /* obsolete */ + + /* Extensions? R=read-only? */ + RELOC_NUMBER (R_ARM_RXPC25, 249) + RELOC_NUMBER (R_ARM_RSBREL32, 250) + RELOC_NUMBER (R_ARM_THM_RPC22, 251) + RELOC_NUMBER (R_ARM_RREL32, 252) + RELOC_NUMBER (R_ARM_RABS32, 253) + RELOC_NUMBER (R_ARM_RPC24, 254) + RELOC_NUMBER (R_ARM_RBASE, 255) + + /* Unofficial names for some of the relocs. */ + FAKE_RELOC (R_ARM_GOTOFF, R_ARM_GOTOFF32) /* 32 bit offset to GOT. */ + FAKE_RELOC (R_ARM_THM_PC22, R_ARM_THM_CALL) + FAKE_RELOC (R_ARM_THM_PC11, R_ARM_THM_JUMP11) + FAKE_RELOC (R_ARM_THM_PC9, R_ARM_THM_JUMP8) + + /* Relocs with both a different name, and (apparently) different meaning in + GNU usage. */ + FAKE_RELOC (R_ARM_GOTPC, R_ARM_BASE_PREL) /* 32 bit PC relative offset to GOT. */ + FAKE_RELOC (R_ARM_GOT32, R_ARM_GOT_BREL) /* 32 bit GOT entry. */ + FAKE_RELOC (R_ARM_ROSEGREL32, R_ARM_SBREL31) /* ??? */ + FAKE_RELOC (R_ARM_AMP_VCALL9, R_ARM_BREL_ADJ) /* Thumb-something. Not used. */ + FAKE_RELOC (R_ARM_PC13, R_ARM_LDR_PC_G0) /* Unclear whether meaning is different. */ END_RELOC_NUMBERS (R_ARM_max) /* The name of the note section used to identify arm variants. */ diff -uprN binutils-2.16.90.0.3/include/elf/ChangeLog binutils-2.16.91.0.1/include/elf/ChangeLog --- binutils-2.16.90.0.3/include/elf/ChangeLog 2005-05-10 15:46:51.000000000 -0700 +++ binutils-2.16.91.0.1/include/elf/ChangeLog 2005-06-22 13:53:35.306251070 -0700 @@ -1,15 +1,64 @@ +2005-06-17 Jan Beulich + + * x86-64.h (elf_x86_64_reloc_type): Adjust comment for + R_X86_64_GOTPCREL. Add R_X86_64_PC64, R_X86_64_GOTOFF64, and + R_X86_64_GOTPC32. + +2005-06-07 Aldy Hernandez + Michael Snyder + Stan Cox + + * common.h (EM_MS1): Define. + + * ms1.h: New file. + +2005-05-31 Richard Henderson + + * alpha.h (LITUSE_ALPHA_JSRDIRECT): New. + +2005-05-29 Richard Henderson + + * alpha.h (DT_ALPHA_PLTRO): New. + +2005-05-19 Ben Elliston + + * dwarf2.h (enum dwarf_type): Assign DW_ATE_GNU_decimal_float from + the user-defined encoding space pending inclusion in the standard. + +2005-05-18 Zack Weinberg + + * arm.h: Make all #ifndef OLD_ARM_ABI blocks + unconditional, delete all #ifdef OLD_ARM_ABI blocks. + +2005-05-17 Zack Weinberg + + * arm.h: Import complete list of official relocation names + and numbers from AAELF. Define FAKE_RELOCs for old names. + Remove a few old names no longer used anywhere. + +2005-05-14 Alan Modra + + * ppc.h (DT_PPC_GOT): Rename from DT_PPC_GLINK. + +2005-05-11 Alan Modra + + * ppc.h (R_PPC_RELAX32, R_PPC_RELAX32PC, R_PPC_RELAX32_PLT, + R_PPC_RELAX32PC_PLT) Adjust. + (R_PPC_REL16, R_PPC_REL16_LO, R_PPC_REL16_HI, R_PPC_REL16_HA): Define. + (DT_PPC_GLINK): Define. + 2005-05-10 Nick Clifton * Update the address and phone number of the FSF organization in the GPL notices in the following files: - alpha.h, arc.h, arm.h, avr.h, common.h, cr16c.h, cris.h, crx.h, + alpha.h, arc.h, arm.h, avr.h, common.h, cr16c.h, cris.h, crx.h, d10v.h, d30v.h, dlx.h, dwarf.h, dwarf2.h, external.h, fr30.h, frv.h, h8.h, hppa.h, i370.h, i386.h, i860.h, i960.h, ia64.h, internal.h, ip2k.h, iq2000.h, m32r.h, m68hc11.h, m68k.h, mcore.h, mips.h, mmix.h, mn10200.h, mn10300.h, msp430.h, openrisc.h, or32.h, pj.h, ppc.h, ppc64.h, reloc-macros.h, s390.h, sh.h, sparc.h, v850.h, vax.h, x86-64.h, xstormy16.h, xtensa.h - + 2005-04-13 H.J. Lu Moved from ../ChangeLog @@ -101,7 +150,7 @@ (R_PPC_RELAX32, R_PPC_RELAX32PC): Adjust value. 2004-12-22 Klaus Rudolph - + * avr.h (R_AVR_LDI, R_AVR_6, R_AVR_6_ADIW): New relocs. 2004-12-16 Richard Sandiford diff -uprN binutils-2.16.90.0.3/include/elf/common.h binutils-2.16.91.0.1/include/elf/common.h --- binutils-2.16.90.0.3/include/elf/common.h 2005-05-10 15:46:52.000000000 -0700 +++ binutils-2.16.91.0.1/include/elf/common.h 2005-06-22 13:53:35.308250740 -0700 @@ -257,6 +257,8 @@ /* Ubicom IP2xxx; no ABI */ #define EM_IP2K_OLD 0x8217 +#define EM_MS1 0x2530 /* Morpho MS1; no ABI */ + /* MSP430 magic number Written in the absense everything. */ #define EM_MSP430_OLD 0x1059 diff -uprN binutils-2.16.90.0.3/include/elf/dwarf2.h binutils-2.16.91.0.1/include/elf/dwarf2.h --- binutils-2.16.90.0.3/include/elf/dwarf2.h 2005-05-10 15:46:52.000000000 -0700 +++ binutils-2.16.91.0.1/include/elf/dwarf2.h 2005-06-22 13:53:35.317249253 -0700 @@ -1,7 +1,7 @@ /* Declarations and definitions of codes relating to the DWARF2 symbolic debugging information format. Copyright (C) 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002, - 2003 Free Software Foundation, Inc. + 2003, 2005 Free Software Foundation, Inc. Written by Gary Funck (gary@intrepid.com) The Ada Joint Program Office (AJPO), Florida State University and Silicon Graphics Inc. @@ -554,7 +554,9 @@ enum dwarf_type DW_ATE_HP_complex_float128 = 0x83, /* Complex floating-point (128 bit). */ DW_ATE_HP_floathpintel = 0x84, /* Floating-point (82 bit IA64). */ DW_ATE_HP_imaginary_float80 = 0x85, - DW_ATE_HP_imaginary_float128 = 0x86 + DW_ATE_HP_imaginary_float128 = 0x86, + /* GNU extensions. */ + DW_ATE_GNU_decimal_float = 0x87 /* Pending DWARF working group. */ }; #define DW_ATE_lo_user 0x80 diff -uprN binutils-2.16.90.0.3/include/elf/external.h binutils-2.16.91.0.1/include/elf/external.h --- binutils-2.16.90.0.3/include/elf/external.h 2005-05-10 15:46:52.000000000 -0700 +++ binutils-2.16.91.0.1/include/elf/external.h 2005-06-22 13:53:35.318249088 -0700 @@ -1,5 +1,5 @@ /* ELF support for BFD. - Copyright 1991, 1992, 1993, 1995, 1997, 1998, 1999, 2001, 2003 + Copyright 1991, 1992, 1993, 1995, 1997, 1998, 1999, 2001, 2003, 2005 Free Software Foundation, Inc. Written by Fred Fish @ Cygnus Support, from information published @@ -272,5 +272,8 @@ typedef struct unsigned char a_val[8]; } Elf64_External_Auxv; +/* Size of SHT_GROUP section entry. */ + +#define GRP_ENTRY_SIZE 4 #endif /* _ELF_EXTERNAL_H */ diff -uprN binutils-2.16.90.0.3/include/elf/ms1.h binutils-2.16.91.0.1/include/elf/ms1.h --- binutils-2.16.90.0.3/include/elf/ms1.h 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/include/elf/ms1.h 2005-06-22 13:53:35.318249088 -0700 @@ -0,0 +1,45 @@ +/* MS1 ELF support for BFD. + Copyright (C) 2000, 2005 Free Software Foundation, Inc. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software Foundation, Inc., +59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef _ELF_MS1_H +#define _ELF_MS1_H + +#include "elf/reloc-macros.h" + +/* Relocations. */ +START_RELOC_NUMBERS (elf_ms1_reloc_type) + RELOC_NUMBER (R_MS1_NONE, 0) + RELOC_NUMBER (R_MS1_16, 1) + RELOC_NUMBER (R_MS1_32, 2) + RELOC_NUMBER (R_MS1_32_PCREL, 3) + RELOC_NUMBER (R_MS1_PC16, 4) + RELOC_NUMBER (R_MS1_HI16, 5) + RELOC_NUMBER (R_MS1_LO16, 6) +END_RELOC_NUMBERS(R_MS1_max) + +#define EF_MS1_CPU_MRISC 0x00000001 /* default */ +#define EF_MS1_CPU_MRISC2 0x00000002 /* MRISC2 */ +#define EF_MS1_CPU_MASK 0x00000003 /* specific cpu bits */ +#define EF_MS1_ALL_FLAGS (EF_MS1_CPU_MASK) + +/* The location of the memory mapped hardware stack. */ +#define MS1_STACK_VALUE 0x0f000000 +#define MS1_STACK_SIZE 0x20 + +#endif /* _ELF_MS1_H */ diff -uprN binutils-2.16.90.0.3/include/elf/ppc.h binutils-2.16.91.0.1/include/elf/ppc.h --- binutils-2.16.90.0.3/include/elf/ppc.h 2005-05-10 15:46:52.000000000 -0700 +++ binutils-2.16.91.0.1/include/elf/ppc.h 2005-06-22 13:53:35.318249088 -0700 @@ -120,12 +120,17 @@ START_RELOC_NUMBERS (elf_ppc_reloc_type) RELOC_NUMBER (R_PPC_EMB_BIT_FLD, 115) RELOC_NUMBER (R_PPC_EMB_RELSDA, 116) -/* Fake relocations for branch stubs. This will keep them - together. */ -#define R_PPC_RELAX32 249 -#define R_PPC_RELAX32PC 250 -#define R_PPC_RELAX32_PLT 251 -#define R_PPC_RELAX32PC_PLT 252 +/* Fake relocations for branch stubs, only used internally by ld. */ +#define R_PPC_RELAX32 245 +#define R_PPC_RELAX32PC 246 +#define R_PPC_RELAX32_PLT 247 +#define R_PPC_RELAX32PC_PLT 248 + +/* These are GNU extensions used in PIC code sequences. */ + RELOC_NUMBER (R_PPC_REL16, 249) + RELOC_NUMBER (R_PPC_REL16_LO, 250) + RELOC_NUMBER (R_PPC_REL16_HI, 251) + RELOC_NUMBER (R_PPC_REL16_HA, 252) /* These are GNU extensions to enable C++ vtable garbage collection. */ RELOC_NUMBER (R_PPC_GNU_VTINHERIT, 253) @@ -140,6 +145,9 @@ END_RELOC_NUMBERS (R_PPC_max) #define IS_PPC_TLS_RELOC(R) \ ((R) >= R_PPC_TLS && (R) <= R_PPC_GOT_DTPREL16_HA) +/* Specify the value of _GLOBAL_OFFSET_TABLE_. */ +#define DT_PPC_GOT DT_LOPROC + /* Processor specific flags for the ELF header e_flags field. */ #define EF_PPC_EMB 0x80000000 /* PowerPC embedded flag. */ diff -uprN binutils-2.16.90.0.3/include/elf/x86-64.h binutils-2.16.91.0.1/include/elf/x86-64.h --- binutils-2.16.90.0.3/include/elf/x86-64.h 2005-05-10 15:46:52.000000000 -0700 +++ binutils-2.16.91.0.1/include/elf/x86-64.h 2005-06-22 13:53:35.319248922 -0700 @@ -34,7 +34,7 @@ START_RELOC_NUMBERS (elf_x86_64_reloc_ty RELOC_NUMBER (R_X86_64_JUMP_SLOT,7) /* Create PLT entry */ RELOC_NUMBER (R_X86_64_RELATIVE, 8) /* Adjust by program base */ RELOC_NUMBER (R_X86_64_GOTPCREL, 9) /* 32 bit signed pc relative - offset to GOT */ + offset to GOT entry */ RELOC_NUMBER (R_X86_64_32, 10) /* Direct 32 bit zero extended */ RELOC_NUMBER (R_X86_64_32S, 11) /* Direct 32 bit sign extended */ RELOC_NUMBER (R_X86_64_16, 12) /* Direct 16 bit zero extended */ @@ -49,6 +49,10 @@ START_RELOC_NUMBERS (elf_x86_64_reloc_ty RELOC_NUMBER (R_X86_64_DTPOFF32, 21) /* Offset in TLS block */ RELOC_NUMBER (R_X86_64_GOTTPOFF, 22) /* PC relative offset to IE GOT entry */ RELOC_NUMBER (R_X86_64_TPOFF32, 23) /* Offset in initial TLS block */ + RELOC_NUMBER (R_X86_64_PC64, 24) /* PC relative 64 bit */ + RELOC_NUMBER (R_X86_64_GOTOFF64, 25) /* 64 bit offset to GOT */ + RELOC_NUMBER (R_X86_64_GOTPC32, 26) /* 32 bit signed pc relative + offset to GOT */ RELOC_NUMBER (R_X86_64_GNU_VTINHERIT, 250) /* GNU C++ hack */ RELOC_NUMBER (R_X86_64_GNU_VTENTRY, 251) /* GNU C++ hack */ END_RELOC_NUMBERS (R_X86_64_max) diff -uprN binutils-2.16.90.0.3/include/libiberty.h binutils-2.16.91.0.1/include/libiberty.h --- binutils-2.16.90.0.3/include/libiberty.h 2005-05-10 15:46:48.000000000 -0700 +++ binutils-2.16.91.0.1/include/libiberty.h 2005-06-22 13:53:35.306251070 -0700 @@ -97,7 +97,10 @@ extern char **dupargv (char **) ATTRIBUT #if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) || defined (HAVE_DECL_BASENAME) extern char *basename (const char *); #else -extern char *basename (); +/* Do not allow basename to be used if there is no prototype seen. We + either need to use the above prototype or have one from + autoconf which would result in HAVE_DECL_BASENAME being set. */ +#define basename basename_cannot_be_used_without_a_prototype #endif #endif @@ -153,7 +156,7 @@ extern char *libiberty_concat_ptr; strings. Allocates memory using alloca. The arguments are evaluated twice! */ #define ACONCAT(ACONCAT_PARAMS) \ - (libiberty_concat_ptr = alloca (concat_length ACONCAT_PARAMS + 1), \ + (libiberty_concat_ptr = (char *) alloca (concat_length ACONCAT_PARAMS + 1), \ concat_copy2 ACONCAT_PARAMS) /* Check whether two file descriptors refer to the same file. */ @@ -323,7 +326,7 @@ extern double physmem_available (void); /* Type-safe obstack allocator. */ #define XOBNEW(O, T) ((T *) obstack_alloc ((O), sizeof (T))) - +#define XOBFINISH(O, T) ((T) obstack_finish ((O))) /* hex character manipulation routines */ @@ -524,8 +527,22 @@ extern int asprintf (char **, const char /* Like vsprintf but provides a pointer to malloc'd storage, which must be freed by the caller. */ -extern int vasprintf (char **, const char *, va_list) - ATTRIBUTE_PRINTF(2,0); +extern int vasprintf (char **, const char *, va_list) ATTRIBUTE_PRINTF(2,0); +#endif + +#if defined(HAVE_DECL_SNPRINTF) && !HAVE_DECL_SNPRINTF +/* Like sprintf but prints at most N characters. */ +extern int snprintf (char *, size_t, const char *, ...) ATTRIBUTE_PRINTF_3; +#endif + +#if defined(HAVE_DECL_VSNPRINTF) && !HAVE_DECL_VSNPRINTF +/* Like vsprintf but prints at most N characters. */ +extern int vsnprintf (char *, size_t, const char *, va_list) ATTRIBUTE_PRINTF(3,0); +#endif + +#if defined(HAVE_DECL_STRVERSCMP) && !HAVE_DECL_STRVERSCMP +/* Compare version strings. */ +extern int strverscmp (const char *, const char *); #endif #define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0])) diff -uprN binutils-2.16.90.0.3/include/opcode/ChangeLog binutils-2.16.91.0.1/include/opcode/ChangeLog --- binutils-2.16.90.0.3/include/opcode/ChangeLog 2005-05-10 15:46:52.000000000 -0700 +++ binutils-2.16.91.0.1/include/opcode/ChangeLog 2005-06-22 13:53:35.319248922 -0700 @@ -1,3 +1,25 @@ +2005-06-20 H.J. Lu + + PR 1013 + * i386.h (i386_optab): Update comments for 64bit addressing on + mov. Allow 64bit addressing for mov and movq. + +2005-06-11 John David Anglin + + * hppa.h (pa_opcodes): Use cM and cX instead of cm and cx, + respectively, in various floating-point load and store patterns. + +2005-05-23 John David Anglin + + * hppa.h (FLAG_STRICT): Correct comment. + (pa_opcodes): Update load and store entries to allow both PA 1.X and + PA 2.0 mneumonics when equivalent. Entries with cache control + completers now require PA 1.1. Adjust whitespace. + +2005-05-19 Anton Blanchard + + * ppc.h (PPC_OPCODE_POWER5): Define. + 2005-05-10 Nick Clifton * Update the address and phone number of the FSF organization in diff -uprN binutils-2.16.90.0.3/include/opcode/hppa.h binutils-2.16.91.0.1/include/opcode/hppa.h --- binutils-2.16.90.0.3/include/opcode/hppa.h 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/include/opcode/hppa.h 2005-06-22 13:53:35.327247601 -0700 @@ -48,8 +48,7 @@ struct pa_opcode char flags; }; -/* Enable/disable strict syntax checking. Not currently used, but will - be necessary for PA2.0 support in the future. */ +/* Enable/disable strict syntax checking. */ #define FLAG_STRICT 0x1 /* @@ -180,8 +179,8 @@ Completer operands all have 'c' as the p cs store bytes short completer. cA store bytes short completer. Like cs, but emits a space after in disassembler. - ce long load/store completer for LDW/STW with a different encoding than the - others + ce long load/store completer for LDW/STW with a different encoding + than the others cc load cache control hint cd load and clear cache control hint cC store cache control hint @@ -293,7 +292,7 @@ static const struct pa_opcode pa_opcodes { "ldi", 0x34000000, 0xffe00000, "l,x", pa20w, 0},/* ldo val(r0),r */ { "ldi", 0x34000000, 0xffe0c000, "j,x", pa10, 0},/* ldo val(r0),r */ -{ "cmpib", 0xec000000, 0xfc000000, "?Qn5,b,w", pa20, FLAG_STRICT}, +{ "cmpib", 0xec000000, 0xfc000000, "?Qn5,b,w", pa20, FLAG_STRICT}, { "cmpib", 0x84000000, 0xf4000000, "?nn5,b,w", pa10, FLAG_STRICT}, { "comib", 0x84000000, 0xfc000000, "?nn5,b,w", pa10, 0}, /* comib{tf}*/ /* This entry is for the disassembler only. It will never be used by @@ -315,141 +314,195 @@ static const struct pa_opcode pa_opcodes /* This entry is for the disassembler only. It will never be used by assembler. */ { "addib", 0xac000000, 0xfc000000, "?@n5,b,w", pa10, 0}, /* addib{tf}*/ -{ "nop", 0x08000240, 0xffffffff, "", pa10, 0}, /* or 0,0,0 */ -{ "copy", 0x08000240, 0xffe0ffe0, "x,t", pa10, 0}, /* or r,0,t */ -{ "mtsar", 0x01601840, 0xffe0ffff, "x", pa10, 0}, /* mtctl r,cr11 */ +{ "nop", 0x08000240, 0xffffffff, "", pa10, 0}, /* or 0,0,0 */ +{ "copy", 0x08000240, 0xffe0ffe0, "x,t", pa10, 0}, /* or r,0,t */ +{ "mtsar", 0x01601840, 0xffe0ffff, "x", pa10, 0}, /* mtctl r,cr11 */ /* Loads and Stores for integer registers. */ { "ldd", 0x0c0010e0, 0xfc1f33e0, "cocc@(s,b),t", pa20, FLAG_STRICT}, { "ldd", 0x0c0010e0, 0xfc1f33e0, "cocc@(b),t", pa20, FLAG_STRICT}, -{ "ldd", 0x0c0000c0, 0xfc0013c0, "cxccx(s,b),t", pa20, FLAG_STRICT}, -{ "ldd", 0x0c0000c0, 0xfc0013c0, "cxccx(b),t", pa20, FLAG_STRICT}, +{ "ldd", 0x0c0000c0, 0xfc0013c0, "cxccx(s,b),t", pa20, FLAG_STRICT}, +{ "ldd", 0x0c0000c0, 0xfc0013c0, "cxccx(b),t", pa20, FLAG_STRICT}, { "ldd", 0x0c0010c0, 0xfc0013c0, "cmcc5(s,b),t", pa20, FLAG_STRICT}, { "ldd", 0x0c0010c0, 0xfc0013c0, "cmcc5(b),t", pa20, FLAG_STRICT}, -{ "ldd", 0x50000000, 0xfc000002, "cq&(b),x", pa20w, FLAG_STRICT}, -{ "ldd", 0x50000000, 0xfc000002, "cq#(b),x", pa20, FLAG_STRICT}, -{ "ldw", 0x0c000080, 0xfc0013c0, "cxccx(s,b),t", pa10, FLAG_STRICT}, -{ "ldw", 0x0c000080, 0xfc0013c0, "cxccx(b),t", pa10, FLAG_STRICT}, -{ "ldw", 0x0c001080, 0xfc0013c0, "cmcc5(s,b),t", pa10, FLAG_STRICT}, -{ "ldw", 0x0c001080, 0xfc0013c0, "cmcc5(b),t", pa10, FLAG_STRICT}, +{ "ldd", 0x50000000, 0xfc000002, "cq&(b),x", pa20w, FLAG_STRICT}, +{ "ldd", 0x50000000, 0xfc000002, "cq#(b),x", pa20, FLAG_STRICT}, +{ "ldw", 0x0c000080, 0xfc001fc0, "cXx(s,b),t", pa10, FLAG_STRICT}, +{ "ldw", 0x0c000080, 0xfc001fc0, "cXx(b),t", pa10, FLAG_STRICT}, +{ "ldw", 0x0c000080, 0xfc0013c0, "cxccx(s,b),t", pa11, FLAG_STRICT}, +{ "ldw", 0x0c000080, 0xfc0013c0, "cxccx(b),t", pa11, FLAG_STRICT}, +{ "ldw", 0x0c001080, 0xfc001fc0, "cM5(s,b),t", pa10, FLAG_STRICT}, +{ "ldw", 0x0c001080, 0xfc001fc0, "cM5(b),t", pa10, FLAG_STRICT}, +{ "ldw", 0x0c001080, 0xfc0013c0, "cmcc5(s,b),t", pa11, FLAG_STRICT}, +{ "ldw", 0x0c001080, 0xfc0013c0, "cmcc5(b),t", pa11, FLAG_STRICT}, { "ldw", 0x0c0010a0, 0xfc1f33e0, "cocc@(s,b),t", pa20, FLAG_STRICT}, { "ldw", 0x0c0010a0, 0xfc1f33e0, "cocc@(b),t", pa20, FLAG_STRICT}, -{ "ldw", 0x4c000000, 0xfc000000, "ce<(b),x", pa20w, FLAG_STRICT}, -{ "ldw", 0x4c000000, 0xfc000000, "ceJ(s,b),x", pa10, FLAG_STRICT}, -{ "ldw", 0x4c000000, 0xfc000000, "ceJ(b),x", pa10, FLAG_STRICT}, -{ "ldw", 0x5c000004, 0xfc000006, "ce>(b),x", pa20w, FLAG_STRICT}, -{ "ldw", 0x5c000004, 0xfc000006, "ceK(s,b),x", pa20, FLAG_STRICT}, -{ "ldw", 0x5c000004, 0xfc000006, "ceK(b),x", pa20, FLAG_STRICT}, -{ "ldw", 0x48000000, 0xfc000000, "l(b),x", pa20w, FLAG_STRICT}, -{ "ldw", 0x48000000, 0xfc000000, "j(s,b),x", pa10, 0}, -{ "ldw", 0x48000000, 0xfc000000, "j(b),x", pa10, 0}, -{ "ldh", 0x0c000040, 0xfc0013c0, "cxccx(s,b),t", pa10, FLAG_STRICT}, -{ "ldh", 0x0c000040, 0xfc0013c0, "cxccx(b),t", pa10, FLAG_STRICT}, -{ "ldh", 0x0c001040, 0xfc0013c0, "cmcc5(s,b),t", pa10, FLAG_STRICT}, -{ "ldh", 0x0c001040, 0xfc0013c0, "cmcc5(b),t", pa10, FLAG_STRICT}, +{ "ldw", 0x4c000000, 0xfc000000, "ce<(b),x", pa20w, FLAG_STRICT}, +{ "ldw", 0x4c000000, 0xfc000000, "ceJ(s,b),x", pa10, FLAG_STRICT}, +{ "ldw", 0x4c000000, 0xfc000000, "ceJ(b),x", pa10, FLAG_STRICT}, +{ "ldw", 0x5c000004, 0xfc000006, "ce>(b),x", pa20w, FLAG_STRICT}, +{ "ldw", 0x5c000004, 0xfc000006, "ceK(s,b),x", pa20, FLAG_STRICT}, +{ "ldw", 0x5c000004, 0xfc000006, "ceK(b),x", pa20, FLAG_STRICT}, +{ "ldw", 0x48000000, 0xfc000000, "l(b),x", pa20w, FLAG_STRICT}, +{ "ldw", 0x48000000, 0xfc000000, "j(s,b),x", pa10, 0}, +{ "ldw", 0x48000000, 0xfc000000, "j(b),x", pa10, 0}, +{ "ldh", 0x0c000040, 0xfc001fc0, "cXx(s,b),t", pa10, FLAG_STRICT}, +{ "ldh", 0x0c000040, 0xfc001fc0, "cXx(b),t", pa10, FLAG_STRICT}, +{ "ldh", 0x0c000040, 0xfc0013c0, "cxccx(s,b),t", pa11, FLAG_STRICT}, +{ "ldh", 0x0c000040, 0xfc0013c0, "cxccx(b),t", pa11, FLAG_STRICT}, +{ "ldh", 0x0c001040, 0xfc001fc0, "cM5(s,b),t", pa10, FLAG_STRICT}, +{ "ldh", 0x0c001040, 0xfc001fc0, "cM5(b),t", pa10, FLAG_STRICT}, +{ "ldh", 0x0c001040, 0xfc0013c0, "cmcc5(s,b),t", pa11, FLAG_STRICT}, +{ "ldh", 0x0c001040, 0xfc0013c0, "cmcc5(b),t", pa11, FLAG_STRICT}, { "ldh", 0x0c001060, 0xfc1f33e0, "cocc@(s,b),t", pa20, FLAG_STRICT}, { "ldh", 0x0c001060, 0xfc1f33e0, "cocc@(b),t", pa20, FLAG_STRICT}, -{ "ldh", 0x44000000, 0xfc000000, "l(b),x", pa20w, FLAG_STRICT}, -{ "ldh", 0x44000000, 0xfc000000, "j(s,b),x", pa10, 0}, -{ "ldh", 0x44000000, 0xfc000000, "j(b),x", pa10, 0}, -{ "ldb", 0x0c000000, 0xfc0013c0, "cxccx(s,b),t", pa10, FLAG_STRICT}, -{ "ldb", 0x0c000000, 0xfc0013c0, "cxccx(b),t", pa10, FLAG_STRICT}, -{ "ldb", 0x0c001000, 0xfc0013c0, "cmcc5(s,b),t", pa10, FLAG_STRICT}, -{ "ldb", 0x0c001000, 0xfc0013c0, "cmcc5(b),t", pa10, FLAG_STRICT}, +{ "ldh", 0x44000000, 0xfc000000, "l(b),x", pa20w, FLAG_STRICT}, +{ "ldh", 0x44000000, 0xfc000000, "j(s,b),x", pa10, 0}, +{ "ldh", 0x44000000, 0xfc000000, "j(b),x", pa10, 0}, +{ "ldb", 0x0c000000, 0xfc001fc0, "cXx(s,b),t", pa10, FLAG_STRICT}, +{ "ldb", 0x0c000000, 0xfc001fc0, "cXx(b),t", pa10, FLAG_STRICT}, +{ "ldb", 0x0c000000, 0xfc0013c0, "cxccx(s,b),t", pa11, FLAG_STRICT}, +{ "ldb", 0x0c000000, 0xfc0013c0, "cxccx(b),t", pa11, FLAG_STRICT}, +{ "ldb", 0x0c001000, 0xfc001fc0, "cM5(s,b),t", pa10, FLAG_STRICT}, +{ "ldb", 0x0c001000, 0xfc001fc0, "cM5(b),t", pa10, FLAG_STRICT}, +{ "ldb", 0x0c001000, 0xfc0013c0, "cmcc5(s,b),t", pa11, FLAG_STRICT}, +{ "ldb", 0x0c001000, 0xfc0013c0, "cmcc5(b),t", pa11, FLAG_STRICT}, { "ldb", 0x0c001020, 0xfc1f33e0, "cocc@(s,b),t", pa20, FLAG_STRICT}, { "ldb", 0x0c001020, 0xfc1f33e0, "cocc@(b),t", pa20, FLAG_STRICT}, -{ "ldb", 0x40000000, 0xfc000000, "l(b),x", pa20w, FLAG_STRICT}, -{ "ldb", 0x40000000, 0xfc000000, "j(s,b),x", pa10, 0}, -{ "ldb", 0x40000000, 0xfc000000, "j(b),x", pa10, 0}, +{ "ldb", 0x40000000, 0xfc000000, "l(b),x", pa20w, FLAG_STRICT}, +{ "ldb", 0x40000000, 0xfc000000, "j(s,b),x", pa10, 0}, +{ "ldb", 0x40000000, 0xfc000000, "j(b),x", pa10, 0}, { "std", 0x0c0012e0, 0xfc0033ff, "cocCx,@(s,b)", pa20, FLAG_STRICT}, { "std", 0x0c0012e0, 0xfc0033ff, "cocCx,@(b)", pa20, FLAG_STRICT}, { "std", 0x0c0012c0, 0xfc0013c0, "cmcCx,V(s,b)", pa20, FLAG_STRICT}, { "std", 0x0c0012c0, 0xfc0013c0, "cmcCx,V(b)", pa20, FLAG_STRICT}, -{ "std", 0x70000000, 0xfc000002, "cqx,&(b)", pa20w, FLAG_STRICT}, -{ "std", 0x70000000, 0xfc000002, "cqx,#(b)", pa20, FLAG_STRICT}, -{ "stw", 0x0c001280, 0xfc0013c0, "cmcCx,V(s,b)", pa10, FLAG_STRICT}, -{ "stw", 0x0c001280, 0xfc0013c0, "cmcCx,V(b)", pa10, FLAG_STRICT}, +{ "std", 0x70000000, 0xfc000002, "cqx,&(b)", pa20w, FLAG_STRICT}, +{ "std", 0x70000000, 0xfc000002, "cqx,#(b)", pa20, FLAG_STRICT}, +{ "stw", 0x0c001280, 0xfc001fc0, "cMx,V(s,b)", pa10, FLAG_STRICT}, +{ "stw", 0x0c001280, 0xfc001fc0, "cMx,V(b)", pa10, FLAG_STRICT}, +{ "stw", 0x0c001280, 0xfc0013c0, "cmcCx,V(s,b)", pa11, FLAG_STRICT}, +{ "stw", 0x0c001280, 0xfc0013c0, "cmcCx,V(b)", pa11, FLAG_STRICT}, { "stw", 0x0c0012a0, 0xfc0013ff, "cocCx,@(s,b)", pa20, FLAG_STRICT}, { "stw", 0x0c0012a0, 0xfc0013ff, "cocCx,@(b)", pa20, FLAG_STRICT}, -{ "stw", 0x6c000000, 0xfc000000, "cex,<(b)", pa20w, FLAG_STRICT}, -{ "stw", 0x6c000000, 0xfc000000, "cex,J(s,b)", pa10, FLAG_STRICT}, -{ "stw", 0x6c000000, 0xfc000000, "cex,J(b)", pa10, FLAG_STRICT}, -{ "stw", 0x7c000004, 0xfc000006, "cex,>(b)", pa20w, FLAG_STRICT}, -{ "stw", 0x7c000004, 0xfc000006, "cex,K(s,b)", pa20, FLAG_STRICT}, -{ "stw", 0x7c000004, 0xfc000006, "cex,K(b)", pa20, FLAG_STRICT}, -{ "stw", 0x68000000, 0xfc000000, "x,l(b)", pa20w, FLAG_STRICT}, -{ "stw", 0x68000000, 0xfc000000, "x,j(s,b)", pa10, 0}, -{ "stw", 0x68000000, 0xfc000000, "x,j(b)", pa10, 0}, -{ "sth", 0x0c001240, 0xfc0013c0, "cmcCx,V(s,b)", pa10, FLAG_STRICT}, -{ "sth", 0x0c001240, 0xfc0013c0, "cmcCx,V(b)", pa10, FLAG_STRICT}, +{ "stw", 0x6c000000, 0xfc000000, "cex,<(b)", pa20w, FLAG_STRICT}, +{ "stw", 0x6c000000, 0xfc000000, "cex,J(s,b)", pa10, FLAG_STRICT}, +{ "stw", 0x6c000000, 0xfc000000, "cex,J(b)", pa10, FLAG_STRICT}, +{ "stw", 0x7c000004, 0xfc000006, "cex,>(b)", pa20w, FLAG_STRICT}, +{ "stw", 0x7c000004, 0xfc000006, "cex,K(s,b)", pa20, FLAG_STRICT}, +{ "stw", 0x7c000004, 0xfc000006, "cex,K(b)", pa20, FLAG_STRICT}, +{ "stw", 0x68000000, 0xfc000000, "x,l(b)", pa20w, FLAG_STRICT}, +{ "stw", 0x68000000, 0xfc000000, "x,j(s,b)", pa10, 0}, +{ "stw", 0x68000000, 0xfc000000, "x,j(b)", pa10, 0}, +{ "sth", 0x0c001240, 0xfc001fc0, "cMx,V(s,b)", pa10, FLAG_STRICT}, +{ "sth", 0x0c001240, 0xfc001fc0, "cMx,V(b)", pa10, FLAG_STRICT}, +{ "sth", 0x0c001240, 0xfc0013c0, "cmcCx,V(s,b)", pa11, FLAG_STRICT}, +{ "sth", 0x0c001240, 0xfc0013c0, "cmcCx,V(b)", pa11, FLAG_STRICT}, { "sth", 0x0c001260, 0xfc0033ff, "cocCx,@(s,b)", pa20, FLAG_STRICT}, { "sth", 0x0c001260, 0xfc0033ff, "cocCx,@(b)", pa20, FLAG_STRICT}, -{ "sth", 0x64000000, 0xfc000000, "x,l(b)", pa20w, FLAG_STRICT}, -{ "sth", 0x64000000, 0xfc000000, "x,j(s,b)", pa10, 0}, -{ "sth", 0x64000000, 0xfc000000, "x,j(b)", pa10, 0}, -{ "stb", 0x0c001200, 0xfc0013c0, "cmcCx,V(s,b)", pa10, FLAG_STRICT}, -{ "stb", 0x0c001200, 0xfc0013c0, "cmcCx,V(b)", pa10, FLAG_STRICT}, +{ "sth", 0x64000000, 0xfc000000, "x,l(b)", pa20w, FLAG_STRICT}, +{ "sth", 0x64000000, 0xfc000000, "x,j(s,b)", pa10, 0}, +{ "sth", 0x64000000, 0xfc000000, "x,j(b)", pa10, 0}, +{ "stb", 0x0c001200, 0xfc001fc0, "cMx,V(s,b)", pa10, FLAG_STRICT}, +{ "stb", 0x0c001200, 0xfc001fc0, "cMx,V(b)", pa10, FLAG_STRICT}, +{ "stb", 0x0c001200, 0xfc0013c0, "cmcCx,V(s,b)", pa11, FLAG_STRICT}, +{ "stb", 0x0c001200, 0xfc0013c0, "cmcCx,V(b)", pa11, FLAG_STRICT}, { "stb", 0x0c001220, 0xfc0033ff, "cocCx,@(s,b)", pa20, FLAG_STRICT}, { "stb", 0x0c001220, 0xfc0033ff, "cocCx,@(b)", pa20, FLAG_STRICT}, -{ "stb", 0x60000000, 0xfc000000, "x,l(b)", pa20w, FLAG_STRICT}, -{ "stb", 0x60000000, 0xfc000000, "x,j(s,b)", pa10, 0}, -{ "stb", 0x60000000, 0xfc000000, "x,j(b)", pa10, 0}, -{ "ldwm", 0x4c000000, 0xfc000000, "j(s,b),x", pa10, 0}, -{ "ldwm", 0x4c000000, 0xfc000000, "j(b),x", pa10, 0}, -{ "stwm", 0x6c000000, 0xfc000000, "x,j(s,b)", pa10, 0}, -{ "stwm", 0x6c000000, 0xfc000000, "x,j(b)", pa10, 0}, -{ "ldwx", 0x0c000080, 0xfc001fc0, "cXx(s,b),t", pa10, 0}, -{ "ldwx", 0x0c000080, 0xfc001fc0, "cXx(b),t", pa10, 0}, -{ "ldhx", 0x0c000040, 0xfc001fc0, "cXx(s,b),t", pa10, 0}, -{ "ldhx", 0x0c000040, 0xfc001fc0, "cXx(b),t", pa10, 0}, -{ "ldbx", 0x0c000000, 0xfc001fc0, "cXx(s,b),t", pa10, 0}, -{ "ldbx", 0x0c000000, 0xfc001fc0, "cXx(b),t", pa10, 0}, -{ "ldwa", 0x0c000180, 0xfc00d3c0, "cxccx(b),t", pa10, FLAG_STRICT}, -{ "ldwa", 0x0c001180, 0xfc00d3c0, "cmcc5(b),t", pa10, FLAG_STRICT}, +{ "stb", 0x60000000, 0xfc000000, "x,l(b)", pa20w, FLAG_STRICT}, +{ "stb", 0x60000000, 0xfc000000, "x,j(s,b)", pa10, 0}, +{ "stb", 0x60000000, 0xfc000000, "x,j(b)", pa10, 0}, +{ "ldwm", 0x4c000000, 0xfc000000, "j(s,b),x", pa10, 0}, +{ "ldwm", 0x4c000000, 0xfc000000, "j(b),x", pa10, 0}, +{ "stwm", 0x6c000000, 0xfc000000, "x,j(s,b)", pa10, 0}, +{ "stwm", 0x6c000000, 0xfc000000, "x,j(b)", pa10, 0}, +{ "ldwx", 0x0c000080, 0xfc001fc0, "cXx(s,b),t", pa10, FLAG_STRICT}, +{ "ldwx", 0x0c000080, 0xfc001fc0, "cXx(b),t", pa10, FLAG_STRICT}, +{ "ldwx", 0x0c000080, 0xfc0013c0, "cxccx(s,b),t", pa11, FLAG_STRICT}, +{ "ldwx", 0x0c000080, 0xfc0013c0, "cxccx(b),t", pa11, FLAG_STRICT}, +{ "ldhx", 0x0c000040, 0xfc001fc0, "cXx(s,b),t", pa10, FLAG_STRICT}, +{ "ldhx", 0x0c000040, 0xfc001fc0, "cXx(b),t", pa10, FLAG_STRICT}, +{ "ldhx", 0x0c000040, 0xfc0013c0, "cxccx(s,b),t", pa11, FLAG_STRICT}, +{ "ldhx", 0x0c000040, 0xfc0013c0, "cxccx(b),t", pa11, FLAG_STRICT}, +{ "ldbx", 0x0c000000, 0xfc001fc0, "cXx(s,b),t", pa10, FLAG_STRICT}, +{ "ldbx", 0x0c000000, 0xfc001fc0, "cXx(b),t", pa10, FLAG_STRICT}, +{ "ldbx", 0x0c000000, 0xfc0013c0, "cxccx(s,b),t", pa11, FLAG_STRICT}, +{ "ldbx", 0x0c000000, 0xfc0013c0, "cxccx(b),t", pa11, FLAG_STRICT}, +{ "ldwa", 0x0c000180, 0xfc00dfc0, "cXx(b),t", pa10, FLAG_STRICT}, +{ "ldwa", 0x0c000180, 0xfc00d3c0, "cxccx(b),t", pa11, FLAG_STRICT}, +{ "ldwa", 0x0c001180, 0xfc00dfc0, "cM5(b),t", pa10, FLAG_STRICT}, +{ "ldwa", 0x0c001180, 0xfc00d3c0, "cmcc5(b),t", pa11, FLAG_STRICT}, { "ldwa", 0x0c0011a0, 0xfc1ff3e0, "cocc@(b),t", pa20, FLAG_STRICT}, -{ "ldcw", 0x0c0001c0, 0xfc0013c0, "cxcdx(s,b),t", pa10, FLAG_STRICT}, -{ "ldcw", 0x0c0001c0, 0xfc0013c0, "cxcdx(b),t", pa10, FLAG_STRICT}, -{ "ldcw", 0x0c0011c0, 0xfc0013c0, "cmcd5(s,b),t", pa10, FLAG_STRICT}, -{ "ldcw", 0x0c0011c0, 0xfc0013c0, "cmcd5(b),t", pa10, FLAG_STRICT}, -{ "stwa", 0x0c001380, 0xfc00d3c0, "cmcCx,V(b)", pa10, FLAG_STRICT}, +{ "ldcw", 0x0c0001c0, 0xfc001fc0, "cXx(s,b),t", pa10, FLAG_STRICT}, +{ "ldcw", 0x0c0001c0, 0xfc001fc0, "cXx(b),t", pa10, FLAG_STRICT}, +{ "ldcw", 0x0c0001c0, 0xfc0013c0, "cxcdx(s,b),t", pa11, FLAG_STRICT}, +{ "ldcw", 0x0c0001c0, 0xfc0013c0, "cxcdx(b),t", pa11, FLAG_STRICT}, +{ "ldcw", 0x0c0011c0, 0xfc001fc0, "cM5(s,b),t", pa10, FLAG_STRICT}, +{ "ldcw", 0x0c0011c0, 0xfc001fc0, "cM5(b),t", pa10, FLAG_STRICT}, +{ "ldcw", 0x0c0011c0, 0xfc0013c0, "cmcd5(s,b),t", pa11, FLAG_STRICT}, +{ "ldcw", 0x0c0011c0, 0xfc0013c0, "cmcd5(b),t", pa11, FLAG_STRICT}, +{ "stwa", 0x0c001380, 0xfc00dfc0, "cMx,V(b)", pa10, FLAG_STRICT}, +{ "stwa", 0x0c001380, 0xfc00d3c0, "cmcCx,V(b)", pa11, FLAG_STRICT}, { "stwa", 0x0c0013a0, 0xfc00d3ff, "cocCx,@(b)", pa20, FLAG_STRICT}, -{ "stby", 0x0c001300, 0xfc0013c0, "cscCx,V(s,b)", pa10, FLAG_STRICT}, -{ "stby", 0x0c001300, 0xfc0013c0, "cscCx,V(b)", pa10, FLAG_STRICT}, -{ "ldda", 0x0c000100, 0xfc00d3c0, "cxccx(b),t", pa20, FLAG_STRICT}, +{ "stby", 0x0c001300, 0xfc001fc0, "cAx,V(s,b)", pa10, FLAG_STRICT}, +{ "stby", 0x0c001300, 0xfc001fc0, "cAx,V(b)", pa10, FLAG_STRICT}, +{ "stby", 0x0c001300, 0xfc0013c0, "cscCx,V(s,b)", pa11, FLAG_STRICT}, +{ "stby", 0x0c001300, 0xfc0013c0, "cscCx,V(b)", pa11, FLAG_STRICT}, +{ "ldda", 0x0c000100, 0xfc00d3c0, "cxccx(b),t", pa20, FLAG_STRICT}, { "ldda", 0x0c001100, 0xfc00d3c0, "cmcc5(b),t", pa20, FLAG_STRICT}, { "ldda", 0x0c001120, 0xfc1ff3e0, "cocc@(b),t", pa20, FLAG_STRICT}, -{ "ldcd", 0x0c000140, 0xfc0013c0, "cxcdx(s,b),t", pa20, FLAG_STRICT}, -{ "ldcd", 0x0c000140, 0xfc0013c0, "cxcdx(b),t", pa20, FLAG_STRICT}, +{ "ldcd", 0x0c000140, 0xfc0013c0, "cxcdx(s,b),t", pa20, FLAG_STRICT}, +{ "ldcd", 0x0c000140, 0xfc0013c0, "cxcdx(b),t", pa20, FLAG_STRICT}, { "ldcd", 0x0c001140, 0xfc0013c0, "cmcd5(s,b),t", pa20, FLAG_STRICT}, { "ldcd", 0x0c001140, 0xfc0013c0, "cmcd5(b),t", pa20, FLAG_STRICT}, { "stda", 0x0c0013e0, 0xfc0033ff, "cocCx,@(s,b)", pa20, FLAG_STRICT}, { "stda", 0x0c0013e0, 0xfc0033ff, "cocCx,@(b)", pa20, FLAG_STRICT}, { "stda", 0x0c0013c0, 0xfc0013c0, "cmcCx,V(s,b)", pa20, FLAG_STRICT}, { "stda", 0x0c0013c0, 0xfc0013c0, "cmcCx,V(b)", pa20, FLAG_STRICT}, -{ "ldwax", 0x0c000180, 0xfc00dfc0, "cXx(b),t", pa10, 0}, -{ "ldcwx", 0x0c0001c0, 0xfc001fc0, "cXx(s,b),t", pa10, 0}, -{ "ldcwx", 0x0c0001c0, 0xfc001fc0, "cXx(b),t", pa10, 0}, -{ "ldws", 0x0c001080, 0xfc001fc0, "cM5(s,b),t", pa10, 0}, -{ "ldws", 0x0c001080, 0xfc001fc0, "cM5(b),t", pa10, 0}, -{ "ldhs", 0x0c001040, 0xfc001fc0, "cM5(s,b),t", pa10, 0}, -{ "ldhs", 0x0c001040, 0xfc001fc0, "cM5(b),t", pa10, 0}, -{ "ldbs", 0x0c001000, 0xfc001fc0, "cM5(s,b),t", pa10, 0}, -{ "ldbs", 0x0c001000, 0xfc001fc0, "cM5(b),t", pa10, 0}, -{ "ldwas", 0x0c001180, 0xfc00dfc0, "cM5(b),t", pa10, 0}, -{ "ldcws", 0x0c0011c0, 0xfc001fc0, "cM5(s,b),t", pa10, 0}, -{ "ldcws", 0x0c0011c0, 0xfc001fc0, "cM5(b),t", pa10, 0}, -{ "stws", 0x0c001280, 0xfc001fc0, "cMx,V(s,b)", pa10, 0}, -{ "stws", 0x0c001280, 0xfc001fc0, "cMx,V(b)", pa10, 0}, -{ "sths", 0x0c001240, 0xfc001fc0, "cMx,V(s,b)", pa10, 0}, -{ "sths", 0x0c001240, 0xfc001fc0, "cMx,V(b)", pa10, 0}, -{ "stbs", 0x0c001200, 0xfc001fc0, "cMx,V(s,b)", pa10, 0}, -{ "stbs", 0x0c001200, 0xfc001fc0, "cMx,V(b)", pa10, 0}, -{ "stwas", 0x0c001380, 0xfc00dfc0, "cMx,V(b)", pa10, 0}, +{ "ldwax", 0x0c000180, 0xfc00dfc0, "cXx(b),t", pa10, FLAG_STRICT}, +{ "ldwax", 0x0c000180, 0xfc00d3c0, "cxccx(b),t", pa11, FLAG_STRICT}, +{ "ldcwx", 0x0c0001c0, 0xfc001fc0, "cXx(s,b),t", pa10, FLAG_STRICT}, +{ "ldcwx", 0x0c0001c0, 0xfc001fc0, "cXx(b),t", pa10, FLAG_STRICT}, +{ "ldcwx", 0x0c0001c0, 0xfc0013c0, "cxcdx(s,b),t", pa11, FLAG_STRICT}, +{ "ldcwx", 0x0c0001c0, 0xfc0013c0, "cxcdx(b),t", pa11, FLAG_STRICT}, +{ "ldws", 0x0c001080, 0xfc001fc0, "cM5(s,b),t", pa10, FLAG_STRICT}, +{ "ldws", 0x0c001080, 0xfc001fc0, "cM5(b),t", pa10, FLAG_STRICT}, +{ "ldws", 0x0c001080, 0xfc0013c0, "cmcc5(s,b),t", pa11, FLAG_STRICT}, +{ "ldws", 0x0c001080, 0xfc0013c0, "cmcc5(b),t", pa11, FLAG_STRICT}, +{ "ldhs", 0x0c001040, 0xfc001fc0, "cM5(s,b),t", pa10, FLAG_STRICT}, +{ "ldhs", 0x0c001040, 0xfc001fc0, "cM5(b),t", pa10, FLAG_STRICT}, +{ "ldhs", 0x0c001040, 0xfc0013c0, "cmcc5(s,b),t", pa11, FLAG_STRICT}, +{ "ldhs", 0x0c001040, 0xfc0013c0, "cmcc5(b),t", pa11, FLAG_STRICT}, +{ "ldbs", 0x0c001000, 0xfc001fc0, "cM5(s,b),t", pa10, FLAG_STRICT}, +{ "ldbs", 0x0c001000, 0xfc001fc0, "cM5(b),t", pa10, FLAG_STRICT}, +{ "ldbs", 0x0c001000, 0xfc0013c0, "cmcc5(s,b),t", pa11, FLAG_STRICT}, +{ "ldbs", 0x0c001000, 0xfc0013c0, "cmcc5(b),t", pa11, FLAG_STRICT}, +{ "ldwas", 0x0c001180, 0xfc00dfc0, "cM5(b),t", pa10, FLAG_STRICT}, +{ "ldwas", 0x0c001180, 0xfc00d3c0, "cmcc5(b),t", pa11, FLAG_STRICT}, +{ "ldcws", 0x0c0011c0, 0xfc001fc0, "cM5(s,b),t", pa10, FLAG_STRICT}, +{ "ldcws", 0x0c0011c0, 0xfc001fc0, "cM5(b),t", pa10, FLAG_STRICT}, +{ "ldcws", 0x0c0011c0, 0xfc0013c0, "cmcd5(s,b),t", pa11, FLAG_STRICT}, +{ "ldcws", 0x0c0011c0, 0xfc0013c0, "cmcd5(b),t", pa11, FLAG_STRICT}, +{ "stws", 0x0c001280, 0xfc001fc0, "cMx,V(s,b)", pa10, FLAG_STRICT}, +{ "stws", 0x0c001280, 0xfc001fc0, "cMx,V(b)", pa10, FLAG_STRICT}, +{ "stws", 0x0c001280, 0xfc0013c0, "cmcCx,V(s,b)", pa11, FLAG_STRICT}, +{ "stws", 0x0c001280, 0xfc0013c0, "cmcCx,V(b)", pa11, FLAG_STRICT}, +{ "sths", 0x0c001240, 0xfc001fc0, "cMx,V(s,b)", pa10, FLAG_STRICT}, +{ "sths", 0x0c001240, 0xfc001fc0, "cMx,V(b)", pa10, FLAG_STRICT}, +{ "sths", 0x0c001240, 0xfc0013c0, "cmcCx,V(s,b)", pa11, FLAG_STRICT}, +{ "sths", 0x0c001240, 0xfc0013c0, "cmcCx,V(b)", pa11, FLAG_STRICT}, +{ "stbs", 0x0c001200, 0xfc001fc0, "cMx,V(s,b)", pa10, FLAG_STRICT}, +{ "stbs", 0x0c001200, 0xfc001fc0, "cMx,V(b)", pa10, FLAG_STRICT}, +{ "stbs", 0x0c001200, 0xfc0013c0, "cmcCx,V(s,b)", pa11, FLAG_STRICT}, +{ "stbs", 0x0c001200, 0xfc0013c0, "cmcCx,V(b)", pa11, FLAG_STRICT}, +{ "stwas", 0x0c001380, 0xfc00dfc0, "cMx,V(b)", pa10, FLAG_STRICT}, +{ "stwas", 0x0c001380, 0xfc00d3c0, "cmcCx,V(b)", pa11, FLAG_STRICT}, { "stdby", 0x0c001340, 0xfc0013c0, "cscCx,V(s,b)", pa20, FLAG_STRICT}, { "stdby", 0x0c001340, 0xfc0013c0, "cscCx,V(b)", pa20, FLAG_STRICT}, -{ "stbys", 0x0c001300, 0xfc001fc0, "cAx,V(s,b)", pa10, 0}, -{ "stbys", 0x0c001300, 0xfc001fc0, "cAx,V(b)", pa10, 0}, +{ "stbys", 0x0c001300, 0xfc001fc0, "cAx,V(s,b)", pa10, FLAG_STRICT}, +{ "stbys", 0x0c001300, 0xfc001fc0, "cAx,V(b)", pa10, FLAG_STRICT}, +{ "stbys", 0x0c001300, 0xfc0013c0, "cscCx,V(s,b)", pa11, FLAG_STRICT}, +{ "stbys", 0x0c001300, 0xfc0013c0, "cscCx,V(b)", pa11, FLAG_STRICT}, /* Immediate instructions. */ { "ldo", 0x34000000, 0xfc000000, "l(b),x", pa20w, 0}, @@ -500,203 +553,203 @@ static const struct pa_opcode pa_opcodes /* Computation Instructions. */ -{ "cmpclr", 0x080008a0, 0xfc000fe0, "?Sx,b,t", pa20, FLAG_STRICT}, -{ "cmpclr", 0x08000880, 0xfc000fe0, "?sx,b,t", pa10, FLAG_STRICT}, -{ "comclr", 0x08000880, 0xfc000fe0, "?sx,b,t", pa10, 0}, -{ "or", 0x08000260, 0xfc000fe0, "?Lx,b,t", pa20, FLAG_STRICT}, -{ "or", 0x08000240, 0xfc000fe0, "?lx,b,t", pa10, 0}, -{ "xor", 0x080002a0, 0xfc000fe0, "?Lx,b,t", pa20, FLAG_STRICT}, -{ "xor", 0x08000280, 0xfc000fe0, "?lx,b,t", pa10, 0}, -{ "and", 0x08000220, 0xfc000fe0, "?Lx,b,t", pa20, FLAG_STRICT}, -{ "and", 0x08000200, 0xfc000fe0, "?lx,b,t", pa10, 0}, -{ "andcm", 0x08000020, 0xfc000fe0, "?Lx,b,t", pa20, FLAG_STRICT}, -{ "andcm", 0x08000000, 0xfc000fe0, "?lx,b,t", pa10, 0}, -{ "uxor", 0x080003a0, 0xfc000fe0, "?Ux,b,t", pa20, FLAG_STRICT}, -{ "uxor", 0x08000380, 0xfc000fe0, "?ux,b,t", pa10, 0}, -{ "uaddcm", 0x080009a0, 0xfc000fa0, "cT?Ux,b,t", pa20, FLAG_STRICT}, -{ "uaddcm", 0x08000980, 0xfc000fa0, "cT?ux,b,t", pa10, FLAG_STRICT}, -{ "uaddcm", 0x08000980, 0xfc000fe0, "?ux,b,t", pa10, 0}, -{ "uaddcmt", 0x080009c0, 0xfc000fe0, "?ux,b,t", pa10, 0}, -{ "dcor", 0x08000ba0, 0xfc1f0fa0, "ci?Ub,t", pa20, FLAG_STRICT}, -{ "dcor", 0x08000b80, 0xfc1f0fa0, "ci?ub,t", pa10, FLAG_STRICT}, -{ "dcor", 0x08000b80, 0xfc1f0fe0, "?ub,t", pa10, 0}, -{ "idcor", 0x08000bc0, 0xfc1f0fe0, "?ub,t", pa10, 0}, -{ "addi", 0xb0000000, 0xfc000000, "ct?ai,b,x", pa10, FLAG_STRICT}, -{ "addi", 0xb4000000, 0xfc000000, "cv?ai,b,x", pa10, FLAG_STRICT}, -{ "addi", 0xb4000000, 0xfc000800, "?ai,b,x", pa10, 0}, -{ "addio", 0xb4000800, 0xfc000800, "?ai,b,x", pa10, 0}, -{ "addit", 0xb0000000, 0xfc000800, "?ai,b,x", pa10, 0}, -{ "addito", 0xb0000800, 0xfc000800, "?ai,b,x", pa10, 0}, -{ "add", 0x08000720, 0xfc0007e0, "cY?Ax,b,t", pa20, FLAG_STRICT}, -{ "add", 0x08000700, 0xfc0007e0, "cy?ax,b,t", pa10, FLAG_STRICT}, -{ "add", 0x08000220, 0xfc0003e0, "ca?Ax,b,t", pa20, FLAG_STRICT}, -{ "add", 0x08000200, 0xfc0003e0, "ca?ax,b,t", pa10, FLAG_STRICT}, -{ "add", 0x08000600, 0xfc000fe0, "?ax,b,t", pa10, 0}, -{ "addl", 0x08000a00, 0xfc000fe0, "?ax,b,t", pa10, 0}, -{ "addo", 0x08000e00, 0xfc000fe0, "?ax,b,t", pa10, 0}, -{ "addc", 0x08000700, 0xfc000fe0, "?ax,b,t", pa10, 0}, -{ "addco", 0x08000f00, 0xfc000fe0, "?ax,b,t", pa10, 0}, -{ "sub", 0x080004e0, 0xfc0007e0, "ct?Sx,b,t", pa20, FLAG_STRICT}, -{ "sub", 0x080004c0, 0xfc0007e0, "ct?sx,b,t", pa10, FLAG_STRICT}, -{ "sub", 0x08000520, 0xfc0007e0, "cB?Sx,b,t", pa20, FLAG_STRICT}, -{ "sub", 0x08000500, 0xfc0007e0, "cb?sx,b,t", pa10, FLAG_STRICT}, -{ "sub", 0x08000420, 0xfc0007e0, "cv?Sx,b,t", pa20, FLAG_STRICT}, -{ "sub", 0x08000400, 0xfc0007e0, "cv?sx,b,t", pa10, FLAG_STRICT}, -{ "sub", 0x08000400, 0xfc000fe0, "?sx,b,t", pa10, 0}, -{ "subo", 0x08000c00, 0xfc000fe0, "?sx,b,t", pa10, 0}, -{ "subb", 0x08000500, 0xfc000fe0, "?sx,b,t", pa10, 0}, -{ "subbo", 0x08000d00, 0xfc000fe0, "?sx,b,t", pa10, 0}, -{ "subt", 0x080004c0, 0xfc000fe0, "?sx,b,t", pa10, 0}, -{ "subto", 0x08000cc0, 0xfc000fe0, "?sx,b,t", pa10, 0}, -{ "ds", 0x08000440, 0xfc000fe0, "?sx,b,t", pa10, 0}, -{ "subi", 0x94000000, 0xfc000000, "cv?si,b,x", pa10, FLAG_STRICT}, -{ "subi", 0x94000000, 0xfc000800, "?si,b,x", pa10, 0}, -{ "subio", 0x94000800, 0xfc000800, "?si,b,x", pa10, 0}, -{ "cmpiclr", 0x90000800, 0xfc000800, "?Si,b,x", pa20, FLAG_STRICT}, -{ "cmpiclr", 0x90000000, 0xfc000800, "?si,b,x", pa10, FLAG_STRICT}, -{ "comiclr", 0x90000000, 0xfc000800, "?si,b,x", pa10, 0}, -{ "shladd", 0x08000220, 0xfc000320, "ca?Ax,.,b,t", pa20, FLAG_STRICT}, -{ "shladd", 0x08000200, 0xfc000320, "ca?ax,.,b,t", pa10, FLAG_STRICT}, -{ "sh1add", 0x08000640, 0xfc000fe0, "?ax,b,t", pa10, 0}, -{ "sh1addl", 0x08000a40, 0xfc000fe0, "?ax,b,t", pa10, 0}, -{ "sh1addo", 0x08000e40, 0xfc000fe0, "?ax,b,t", pa10, 0}, -{ "sh2add", 0x08000680, 0xfc000fe0, "?ax,b,t", pa10, 0}, -{ "sh2addl", 0x08000a80, 0xfc000fe0, "?ax,b,t", pa10, 0}, -{ "sh2addo", 0x08000e80, 0xfc000fe0, "?ax,b,t", pa10, 0}, -{ "sh3add", 0x080006c0, 0xfc000fe0, "?ax,b,t", pa10, 0}, -{ "sh3addl", 0x08000ac0, 0xfc000fe0, "?ax,b,t", pa10, 0}, -{ "sh3addo", 0x08000ec0, 0xfc000fe0, "?ax,b,t", pa10, 0}, +{ "cmpclr", 0x080008a0, 0xfc000fe0, "?Sx,b,t", pa20, FLAG_STRICT}, +{ "cmpclr", 0x08000880, 0xfc000fe0, "?sx,b,t", pa10, FLAG_STRICT}, +{ "comclr", 0x08000880, 0xfc000fe0, "?sx,b,t", pa10, 0}, +{ "or", 0x08000260, 0xfc000fe0, "?Lx,b,t", pa20, FLAG_STRICT}, +{ "or", 0x08000240, 0xfc000fe0, "?lx,b,t", pa10, 0}, +{ "xor", 0x080002a0, 0xfc000fe0, "?Lx,b,t", pa20, FLAG_STRICT}, +{ "xor", 0x08000280, 0xfc000fe0, "?lx,b,t", pa10, 0}, +{ "and", 0x08000220, 0xfc000fe0, "?Lx,b,t", pa20, FLAG_STRICT}, +{ "and", 0x08000200, 0xfc000fe0, "?lx,b,t", pa10, 0}, +{ "andcm", 0x08000020, 0xfc000fe0, "?Lx,b,t", pa20, FLAG_STRICT}, +{ "andcm", 0x08000000, 0xfc000fe0, "?lx,b,t", pa10, 0}, +{ "uxor", 0x080003a0, 0xfc000fe0, "?Ux,b,t", pa20, FLAG_STRICT}, +{ "uxor", 0x08000380, 0xfc000fe0, "?ux,b,t", pa10, 0}, +{ "uaddcm", 0x080009a0, 0xfc000fa0, "cT?Ux,b,t", pa20, FLAG_STRICT}, +{ "uaddcm", 0x08000980, 0xfc000fa0, "cT?ux,b,t", pa10, FLAG_STRICT}, +{ "uaddcm", 0x08000980, 0xfc000fe0, "?ux,b,t", pa10, 0}, +{ "uaddcmt", 0x080009c0, 0xfc000fe0, "?ux,b,t", pa10, 0}, +{ "dcor", 0x08000ba0, 0xfc1f0fa0, "ci?Ub,t", pa20, FLAG_STRICT}, +{ "dcor", 0x08000b80, 0xfc1f0fa0, "ci?ub,t", pa10, FLAG_STRICT}, +{ "dcor", 0x08000b80, 0xfc1f0fe0, "?ub,t", pa10, 0}, +{ "idcor", 0x08000bc0, 0xfc1f0fe0, "?ub,t", pa10, 0}, +{ "addi", 0xb0000000, 0xfc000000, "ct?ai,b,x", pa10, FLAG_STRICT}, +{ "addi", 0xb4000000, 0xfc000000, "cv?ai,b,x", pa10, FLAG_STRICT}, +{ "addi", 0xb4000000, 0xfc000800, "?ai,b,x", pa10, 0}, +{ "addio", 0xb4000800, 0xfc000800, "?ai,b,x", pa10, 0}, +{ "addit", 0xb0000000, 0xfc000800, "?ai,b,x", pa10, 0}, +{ "addito", 0xb0000800, 0xfc000800, "?ai,b,x", pa10, 0}, +{ "add", 0x08000720, 0xfc0007e0, "cY?Ax,b,t", pa20, FLAG_STRICT}, +{ "add", 0x08000700, 0xfc0007e0, "cy?ax,b,t", pa10, FLAG_STRICT}, +{ "add", 0x08000220, 0xfc0003e0, "ca?Ax,b,t", pa20, FLAG_STRICT}, +{ "add", 0x08000200, 0xfc0003e0, "ca?ax,b,t", pa10, FLAG_STRICT}, +{ "add", 0x08000600, 0xfc000fe0, "?ax,b,t", pa10, 0}, +{ "addl", 0x08000a00, 0xfc000fe0, "?ax,b,t", pa10, 0}, +{ "addo", 0x08000e00, 0xfc000fe0, "?ax,b,t", pa10, 0}, +{ "addc", 0x08000700, 0xfc000fe0, "?ax,b,t", pa10, 0}, +{ "addco", 0x08000f00, 0xfc000fe0, "?ax,b,t", pa10, 0}, +{ "sub", 0x080004e0, 0xfc0007e0, "ct?Sx,b,t", pa20, FLAG_STRICT}, +{ "sub", 0x080004c0, 0xfc0007e0, "ct?sx,b,t", pa10, FLAG_STRICT}, +{ "sub", 0x08000520, 0xfc0007e0, "cB?Sx,b,t", pa20, FLAG_STRICT}, +{ "sub", 0x08000500, 0xfc0007e0, "cb?sx,b,t", pa10, FLAG_STRICT}, +{ "sub", 0x08000420, 0xfc0007e0, "cv?Sx,b,t", pa20, FLAG_STRICT}, +{ "sub", 0x08000400, 0xfc0007e0, "cv?sx,b,t", pa10, FLAG_STRICT}, +{ "sub", 0x08000400, 0xfc000fe0, "?sx,b,t", pa10, 0}, +{ "subo", 0x08000c00, 0xfc000fe0, "?sx,b,t", pa10, 0}, +{ "subb", 0x08000500, 0xfc000fe0, "?sx,b,t", pa10, 0}, +{ "subbo", 0x08000d00, 0xfc000fe0, "?sx,b,t", pa10, 0}, +{ "subt", 0x080004c0, 0xfc000fe0, "?sx,b,t", pa10, 0}, +{ "subto", 0x08000cc0, 0xfc000fe0, "?sx,b,t", pa10, 0}, +{ "ds", 0x08000440, 0xfc000fe0, "?sx,b,t", pa10, 0}, +{ "subi", 0x94000000, 0xfc000000, "cv?si,b,x", pa10, FLAG_STRICT}, +{ "subi", 0x94000000, 0xfc000800, "?si,b,x", pa10, 0}, +{ "subio", 0x94000800, 0xfc000800, "?si,b,x", pa10, 0}, +{ "cmpiclr", 0x90000800, 0xfc000800, "?Si,b,x", pa20, FLAG_STRICT}, +{ "cmpiclr", 0x90000000, 0xfc000800, "?si,b,x", pa10, FLAG_STRICT}, +{ "comiclr", 0x90000000, 0xfc000800, "?si,b,x", pa10, 0}, +{ "shladd", 0x08000220, 0xfc000320, "ca?Ax,.,b,t", pa20, FLAG_STRICT}, +{ "shladd", 0x08000200, 0xfc000320, "ca?ax,.,b,t", pa10, FLAG_STRICT}, +{ "sh1add", 0x08000640, 0xfc000fe0, "?ax,b,t", pa10, 0}, +{ "sh1addl", 0x08000a40, 0xfc000fe0, "?ax,b,t", pa10, 0}, +{ "sh1addo", 0x08000e40, 0xfc000fe0, "?ax,b,t", pa10, 0}, +{ "sh2add", 0x08000680, 0xfc000fe0, "?ax,b,t", pa10, 0}, +{ "sh2addl", 0x08000a80, 0xfc000fe0, "?ax,b,t", pa10, 0}, +{ "sh2addo", 0x08000e80, 0xfc000fe0, "?ax,b,t", pa10, 0}, +{ "sh3add", 0x080006c0, 0xfc000fe0, "?ax,b,t", pa10, 0}, +{ "sh3addl", 0x08000ac0, 0xfc000fe0, "?ax,b,t", pa10, 0}, +{ "sh3addo", 0x08000ec0, 0xfc000fe0, "?ax,b,t", pa10, 0}, /* Subword Operation Instructions. */ -{ "hadd", 0x08000300, 0xfc00ff20, "cHx,b,t", pa20, FLAG_STRICT}, -{ "havg", 0x080002c0, 0xfc00ffe0, "x,b,t", pa20, FLAG_STRICT}, -{ "hshl", 0xf8008800, 0xffe0fc20, "x,*,t", pa20, FLAG_STRICT}, -{ "hshladd", 0x08000700, 0xfc00ff20, "x,.,b,t", pa20, FLAG_STRICT}, -{ "hshr", 0xf800c800, 0xfc1ff820, "cSb,*,t", pa20, FLAG_STRICT}, -{ "hshradd", 0x08000500, 0xfc00ff20, "x,.,b,t", pa20, FLAG_STRICT}, -{ "hsub", 0x08000100, 0xfc00ff20, "cHx,b,t", pa20, FLAG_STRICT}, -{ "mixh", 0xf8008400, 0xfc009fe0, "chx,b,t", pa20, FLAG_STRICT}, -{ "mixw", 0xf8008000, 0xfc009fe0, "chx,b,t", pa20, FLAG_STRICT}, -{ "permh", 0xf8000000, 0xfc009020, "c*a,t", pa20, FLAG_STRICT}, +{ "hadd", 0x08000300, 0xfc00ff20, "cHx,b,t", pa20, FLAG_STRICT}, +{ "havg", 0x080002c0, 0xfc00ffe0, "x,b,t", pa20, FLAG_STRICT}, +{ "hshl", 0xf8008800, 0xffe0fc20, "x,*,t", pa20, FLAG_STRICT}, +{ "hshladd", 0x08000700, 0xfc00ff20, "x,.,b,t", pa20, FLAG_STRICT}, +{ "hshr", 0xf800c800, 0xfc1ff820, "cSb,*,t", pa20, FLAG_STRICT}, +{ "hshradd", 0x08000500, 0xfc00ff20, "x,.,b,t", pa20, FLAG_STRICT}, +{ "hsub", 0x08000100, 0xfc00ff20, "cHx,b,t", pa20, FLAG_STRICT}, +{ "mixh", 0xf8008400, 0xfc009fe0, "chx,b,t", pa20, FLAG_STRICT}, +{ "mixw", 0xf8008000, 0xfc009fe0, "chx,b,t", pa20, FLAG_STRICT}, +{ "permh", 0xf8000000, 0xfc009020, "c*a,t", pa20, FLAG_STRICT}, /* Extract and Deposit Instructions. */ -{ "shrpd", 0xd0000200, 0xfc001fe0, "?Xx,b,!,t", pa20, FLAG_STRICT}, -{ "shrpd", 0xd0000400, 0xfc001400, "?Xx,b,~,t", pa20, FLAG_STRICT}, -{ "shrpw", 0xd0000000, 0xfc001fe0, "?xx,b,!,t", pa10, FLAG_STRICT}, -{ "shrpw", 0xd0000800, 0xfc001c00, "?xx,b,p,t", pa10, FLAG_STRICT}, -{ "vshd", 0xd0000000, 0xfc001fe0, "?xx,b,t", pa10, 0}, -{ "shd", 0xd0000800, 0xfc001c00, "?xx,b,p,t", pa10, 0}, -{ "extrd", 0xd0001200, 0xfc001ae0, "cS?Xb,!,%,x", pa20, FLAG_STRICT}, -{ "extrd", 0xd8000000, 0xfc000000, "cS?Xb,q,|,x", pa20, FLAG_STRICT}, -{ "extrw", 0xd0001000, 0xfc001be0, "cS?xb,!,T,x", pa10, FLAG_STRICT}, -{ "extrw", 0xd0001800, 0xfc001800, "cS?xb,P,T,x", pa10, FLAG_STRICT}, -{ "vextru", 0xd0001000, 0xfc001fe0, "?xb,T,x", pa10, 0}, -{ "vextrs", 0xd0001400, 0xfc001fe0, "?xb,T,x", pa10, 0}, -{ "extru", 0xd0001800, 0xfc001c00, "?xb,P,T,x", pa10, 0}, -{ "extrs", 0xd0001c00, 0xfc001c00, "?xb,P,T,x", pa10, 0}, -{ "depd", 0xd4000200, 0xfc001ae0, "cz?Xx,!,%,b", pa20, FLAG_STRICT}, -{ "depd", 0xf0000000, 0xfc000000, "cz?Xx,~,|,b", pa20, FLAG_STRICT}, -{ "depdi", 0xd4001200, 0xfc001ae0, "cz?X5,!,%,b", pa20, FLAG_STRICT}, -{ "depdi", 0xf4000000, 0xfc000000, "cz?X5,~,|,b", pa20, FLAG_STRICT}, -{ "depw", 0xd4000000, 0xfc001be0, "cz?xx,!,T,b", pa10, FLAG_STRICT}, -{ "depw", 0xd4000800, 0xfc001800, "cz?xx,p,T,b", pa10, FLAG_STRICT}, -{ "depwi", 0xd4001000, 0xfc001be0, "cz?x5,!,T,b", pa10, FLAG_STRICT}, -{ "depwi", 0xd4001800, 0xfc001800, "cz?x5,p,T,b", pa10, FLAG_STRICT}, -{ "zvdep", 0xd4000000, 0xfc001fe0, "?xx,T,b", pa10, 0}, -{ "vdep", 0xd4000400, 0xfc001fe0, "?xx,T,b", pa10, 0}, -{ "zdep", 0xd4000800, 0xfc001c00, "?xx,p,T,b", pa10, 0}, -{ "dep", 0xd4000c00, 0xfc001c00, "?xx,p,T,b", pa10, 0}, -{ "zvdepi", 0xd4001000, 0xfc001fe0, "?x5,T,b", pa10, 0}, -{ "vdepi", 0xd4001400, 0xfc001fe0, "?x5,T,b", pa10, 0}, -{ "zdepi", 0xd4001800, 0xfc001c00, "?x5,p,T,b", pa10, 0}, -{ "depi", 0xd4001c00, 0xfc001c00, "?x5,p,T,b", pa10, 0}, +{ "shrpd", 0xd0000200, 0xfc001fe0, "?Xx,b,!,t", pa20, FLAG_STRICT}, +{ "shrpd", 0xd0000400, 0xfc001400, "?Xx,b,~,t", pa20, FLAG_STRICT}, +{ "shrpw", 0xd0000000, 0xfc001fe0, "?xx,b,!,t", pa10, FLAG_STRICT}, +{ "shrpw", 0xd0000800, 0xfc001c00, "?xx,b,p,t", pa10, FLAG_STRICT}, +{ "vshd", 0xd0000000, 0xfc001fe0, "?xx,b,t", pa10, 0}, +{ "shd", 0xd0000800, 0xfc001c00, "?xx,b,p,t", pa10, 0}, +{ "extrd", 0xd0001200, 0xfc001ae0, "cS?Xb,!,%,x", pa20, FLAG_STRICT}, +{ "extrd", 0xd8000000, 0xfc000000, "cS?Xb,q,|,x", pa20, FLAG_STRICT}, +{ "extrw", 0xd0001000, 0xfc001be0, "cS?xb,!,T,x", pa10, FLAG_STRICT}, +{ "extrw", 0xd0001800, 0xfc001800, "cS?xb,P,T,x", pa10, FLAG_STRICT}, +{ "vextru", 0xd0001000, 0xfc001fe0, "?xb,T,x", pa10, 0}, +{ "vextrs", 0xd0001400, 0xfc001fe0, "?xb,T,x", pa10, 0}, +{ "extru", 0xd0001800, 0xfc001c00, "?xb,P,T,x", pa10, 0}, +{ "extrs", 0xd0001c00, 0xfc001c00, "?xb,P,T,x", pa10, 0}, +{ "depd", 0xd4000200, 0xfc001ae0, "cz?Xx,!,%,b", pa20, FLAG_STRICT}, +{ "depd", 0xf0000000, 0xfc000000, "cz?Xx,~,|,b", pa20, FLAG_STRICT}, +{ "depdi", 0xd4001200, 0xfc001ae0, "cz?X5,!,%,b", pa20, FLAG_STRICT}, +{ "depdi", 0xf4000000, 0xfc000000, "cz?X5,~,|,b", pa20, FLAG_STRICT}, +{ "depw", 0xd4000000, 0xfc001be0, "cz?xx,!,T,b", pa10, FLAG_STRICT}, +{ "depw", 0xd4000800, 0xfc001800, "cz?xx,p,T,b", pa10, FLAG_STRICT}, +{ "depwi", 0xd4001000, 0xfc001be0, "cz?x5,!,T,b", pa10, FLAG_STRICT}, +{ "depwi", 0xd4001800, 0xfc001800, "cz?x5,p,T,b", pa10, FLAG_STRICT}, +{ "zvdep", 0xd4000000, 0xfc001fe0, "?xx,T,b", pa10, 0}, +{ "vdep", 0xd4000400, 0xfc001fe0, "?xx,T,b", pa10, 0}, +{ "zdep", 0xd4000800, 0xfc001c00, "?xx,p,T,b", pa10, 0}, +{ "dep", 0xd4000c00, 0xfc001c00, "?xx,p,T,b", pa10, 0}, +{ "zvdepi", 0xd4001000, 0xfc001fe0, "?x5,T,b", pa10, 0}, +{ "vdepi", 0xd4001400, 0xfc001fe0, "?x5,T,b", pa10, 0}, +{ "zdepi", 0xd4001800, 0xfc001c00, "?x5,p,T,b", pa10, 0}, +{ "depi", 0xd4001c00, 0xfc001c00, "?x5,p,T,b", pa10, 0}, /* System Control Instructions. */ -{ "break", 0x00000000, 0xfc001fe0, "r,A", pa10, 0}, -{ "rfi", 0x00000c00, 0xffffff1f, "cr", pa10, FLAG_STRICT}, -{ "rfi", 0x00000c00, 0xffffffff, "", pa10, 0}, -{ "rfir", 0x00000ca0, 0xffffffff, "", pa11, 0}, -{ "ssm", 0x00000d60, 0xfc00ffe0, "U,t", pa20, FLAG_STRICT}, -{ "ssm", 0x00000d60, 0xffe0ffe0, "R,t", pa10, 0}, -{ "rsm", 0x00000e60, 0xfc00ffe0, "U,t", pa20, FLAG_STRICT}, -{ "rsm", 0x00000e60, 0xffe0ffe0, "R,t", pa10, 0}, -{ "mtsm", 0x00001860, 0xffe0ffff, "x", pa10, 0}, -{ "ldsid", 0x000010a0, 0xfc1f3fe0, "(s,b),t", pa10, 0}, -{ "ldsid", 0x000010a0, 0xfc1f3fe0, "(b),t", pa10, 0}, -{ "mtsp", 0x00001820, 0xffe01fff, "x,S", pa10, 0}, -{ "mtctl", 0x00001840, 0xfc00ffff, "x,^", pa10, 0}, -{ "mtsarcm", 0x016018C0, 0xffe0ffff, "x", pa20, FLAG_STRICT}, -{ "mfia", 0x000014A0, 0xffffffe0, "t", pa20, FLAG_STRICT}, -{ "mfsp", 0x000004a0, 0xffff1fe0, "S,t", pa10, 0}, -{ "mfctl", 0x016048a0, 0xffffffe0, "cW!,t", pa20, FLAG_STRICT}, -{ "mfctl", 0x000008a0, 0xfc1fffe0, "^,t", pa10, 0}, -{ "sync", 0x00000400, 0xffffffff, "", pa10, 0}, -{ "syncdma", 0x00100400, 0xffffffff, "", pa10, 0}, -{ "probe", 0x04001180, 0xfc003fa0, "cw(s,b),x,t", pa10, FLAG_STRICT}, -{ "probe", 0x04001180, 0xfc003fa0, "cw(b),x,t", pa10, FLAG_STRICT}, -{ "probei", 0x04003180, 0xfc003fa0, "cw(s,b),R,t", pa10, FLAG_STRICT}, -{ "probei", 0x04003180, 0xfc003fa0, "cw(b),R,t", pa10, FLAG_STRICT}, -{ "prober", 0x04001180, 0xfc003fe0, "(s,b),x,t", pa10, 0}, -{ "prober", 0x04001180, 0xfc003fe0, "(b),x,t", pa10, 0}, -{ "proberi", 0x04003180, 0xfc003fe0, "(s,b),R,t", pa10, 0}, -{ "proberi", 0x04003180, 0xfc003fe0, "(b),R,t", pa10, 0}, -{ "probew", 0x040011c0, 0xfc003fe0, "(s,b),x,t", pa10, 0}, -{ "probew", 0x040011c0, 0xfc003fe0, "(b),x,t", pa10, 0}, -{ "probewi", 0x040031c0, 0xfc003fe0, "(s,b),R,t", pa10, 0}, -{ "probewi", 0x040031c0, 0xfc003fe0, "(b),R,t", pa10, 0}, -{ "lpa", 0x04001340, 0xfc003fc0, "cZx(s,b),t", pa10, 0}, -{ "lpa", 0x04001340, 0xfc003fc0, "cZx(b),t", pa10, 0}, -{ "lha", 0x04001300, 0xfc003fc0, "cZx(s,b),t", pa10, 0}, -{ "lha", 0x04001300, 0xfc003fc0, "cZx(b),t", pa10, 0}, -{ "lci", 0x04001300, 0xfc003fe0, "x(s,b),t", pa10, 0}, -{ "lci", 0x04001300, 0xfc003fe0, "x(b),t", pa10, 0}, -{ "pdtlb", 0x04001600, 0xfc003fdf, "cLcZx(s,b)", pa20, FLAG_STRICT}, -{ "pdtlb", 0x04001600, 0xfc003fdf, "cLcZx(b)", pa20, FLAG_STRICT}, -{ "pdtlb", 0x04001200, 0xfc003fdf, "cZx(s,b)", pa10, 0}, -{ "pdtlb", 0x04001200, 0xfc003fdf, "cZx(b)", pa10, 0}, -{ "pitlb", 0x04000600, 0xfc001fdf, "cLcZx(S,b)", pa20, FLAG_STRICT}, -{ "pitlb", 0x04000600, 0xfc001fdf, "cLcZx(b)", pa20, FLAG_STRICT}, -{ "pitlb", 0x04000200, 0xfc001fdf, "cZx(S,b)", pa10, 0}, -{ "pitlb", 0x04000200, 0xfc001fdf, "cZx(b)", pa10, 0}, -{ "pdtlbe", 0x04001240, 0xfc003fdf, "cZx(s,b)", pa10, 0}, -{ "pdtlbe", 0x04001240, 0xfc003fdf, "cZx(b)", pa10, 0}, -{ "pitlbe", 0x04000240, 0xfc001fdf, "cZx(S,b)", pa10, 0}, -{ "pitlbe", 0x04000240, 0xfc001fdf, "cZx(b)", pa10, 0}, -{ "idtlba", 0x04001040, 0xfc003fff, "x,(s,b)", pa10, 0}, -{ "idtlba", 0x04001040, 0xfc003fff, "x,(b)", pa10, 0}, -{ "iitlba", 0x04000040, 0xfc001fff, "x,(S,b)", pa10, 0}, -{ "iitlba", 0x04000040, 0xfc001fff, "x,(b)", pa10, 0}, -{ "idtlbp", 0x04001000, 0xfc003fff, "x,(s,b)", pa10, 0}, -{ "idtlbp", 0x04001000, 0xfc003fff, "x,(b)", pa10, 0}, -{ "iitlbp", 0x04000000, 0xfc001fff, "x,(S,b)", pa10, 0}, -{ "iitlbp", 0x04000000, 0xfc001fff, "x,(b)", pa10, 0}, -{ "pdc", 0x04001380, 0xfc003fdf, "cZx(s,b)", pa10, 0}, -{ "pdc", 0x04001380, 0xfc003fdf, "cZx(b)", pa10, 0}, -{ "fdc", 0x04001280, 0xfc003fdf, "cZx(s,b)", pa10, 0}, -{ "fdc", 0x04001280, 0xfc003fdf, "cZx(b)", pa10, 0}, -{ "fic", 0x04000280, 0xfc001fdf, "cZx(S,b)", pa10, 0}, -{ "fic", 0x04000280, 0xfc001fdf, "cZx(b)", pa10, 0}, -{ "fdce", 0x040012c0, 0xfc003fdf, "cZx(s,b)", pa10, 0}, -{ "fdce", 0x040012c0, 0xfc003fdf, "cZx(b)", pa10, 0}, -{ "fice", 0x040002c0, 0xfc001fdf, "cZx(S,b)", pa10, 0}, -{ "fice", 0x040002c0, 0xfc001fdf, "cZx(b)", pa10, 0}, -{ "diag", 0x14000000, 0xfc000000, "D", pa10, 0}, -{ "idtlbt", 0x04001800, 0xfc00ffff, "x,b", pa20, FLAG_STRICT}, -{ "iitlbt", 0x04000800, 0xfc00ffff, "x,b", pa20, FLAG_STRICT}, +{ "break", 0x00000000, 0xfc001fe0, "r,A", pa10, 0}, +{ "rfi", 0x00000c00, 0xffffff1f, "cr", pa10, FLAG_STRICT}, +{ "rfi", 0x00000c00, 0xffffffff, "", pa10, 0}, +{ "rfir", 0x00000ca0, 0xffffffff, "", pa11, 0}, +{ "ssm", 0x00000d60, 0xfc00ffe0, "U,t", pa20, FLAG_STRICT}, +{ "ssm", 0x00000d60, 0xffe0ffe0, "R,t", pa10, 0}, +{ "rsm", 0x00000e60, 0xfc00ffe0, "U,t", pa20, FLAG_STRICT}, +{ "rsm", 0x00000e60, 0xffe0ffe0, "R,t", pa10, 0}, +{ "mtsm", 0x00001860, 0xffe0ffff, "x", pa10, 0}, +{ "ldsid", 0x000010a0, 0xfc1f3fe0, "(s,b),t", pa10, 0}, +{ "ldsid", 0x000010a0, 0xfc1f3fe0, "(b),t", pa10, 0}, +{ "mtsp", 0x00001820, 0xffe01fff, "x,S", pa10, 0}, +{ "mtctl", 0x00001840, 0xfc00ffff, "x,^", pa10, 0}, +{ "mtsarcm", 0x016018C0, 0xffe0ffff, "x", pa20, FLAG_STRICT}, +{ "mfia", 0x000014A0, 0xffffffe0, "t", pa20, FLAG_STRICT}, +{ "mfsp", 0x000004a0, 0xffff1fe0, "S,t", pa10, 0}, +{ "mfctl", 0x016048a0, 0xffffffe0, "cW!,t", pa20, FLAG_STRICT}, +{ "mfctl", 0x000008a0, 0xfc1fffe0, "^,t", pa10, 0}, +{ "sync", 0x00000400, 0xffffffff, "", pa10, 0}, +{ "syncdma", 0x00100400, 0xffffffff, "", pa10, 0}, +{ "probe", 0x04001180, 0xfc003fa0, "cw(s,b),x,t", pa10, FLAG_STRICT}, +{ "probe", 0x04001180, 0xfc003fa0, "cw(b),x,t", pa10, FLAG_STRICT}, +{ "probei", 0x04003180, 0xfc003fa0, "cw(s,b),R,t", pa10, FLAG_STRICT}, +{ "probei", 0x04003180, 0xfc003fa0, "cw(b),R,t", pa10, FLAG_STRICT}, +{ "prober", 0x04001180, 0xfc003fe0, "(s,b),x,t", pa10, 0}, +{ "prober", 0x04001180, 0xfc003fe0, "(b),x,t", pa10, 0}, +{ "proberi", 0x04003180, 0xfc003fe0, "(s,b),R,t", pa10, 0}, +{ "proberi", 0x04003180, 0xfc003fe0, "(b),R,t", pa10, 0}, +{ "probew", 0x040011c0, 0xfc003fe0, "(s,b),x,t", pa10, 0}, +{ "probew", 0x040011c0, 0xfc003fe0, "(b),x,t", pa10, 0}, +{ "probewi", 0x040031c0, 0xfc003fe0, "(s,b),R,t", pa10, 0}, +{ "probewi", 0x040031c0, 0xfc003fe0, "(b),R,t", pa10, 0}, +{ "lpa", 0x04001340, 0xfc003fc0, "cZx(s,b),t", pa10, 0}, +{ "lpa", 0x04001340, 0xfc003fc0, "cZx(b),t", pa10, 0}, +{ "lha", 0x04001300, 0xfc003fc0, "cZx(s,b),t", pa10, 0}, +{ "lha", 0x04001300, 0xfc003fc0, "cZx(b),t", pa10, 0}, +{ "lci", 0x04001300, 0xfc003fe0, "x(s,b),t", pa10, 0}, +{ "lci", 0x04001300, 0xfc003fe0, "x(b),t", pa10, 0}, +{ "pdtlb", 0x04001600, 0xfc003fdf, "cLcZx(s,b)", pa20, FLAG_STRICT}, +{ "pdtlb", 0x04001600, 0xfc003fdf, "cLcZx(b)", pa20, FLAG_STRICT}, +{ "pdtlb", 0x04001200, 0xfc003fdf, "cZx(s,b)", pa10, 0}, +{ "pdtlb", 0x04001200, 0xfc003fdf, "cZx(b)", pa10, 0}, +{ "pitlb", 0x04000600, 0xfc001fdf, "cLcZx(S,b)", pa20, FLAG_STRICT}, +{ "pitlb", 0x04000600, 0xfc001fdf, "cLcZx(b)", pa20, FLAG_STRICT}, +{ "pitlb", 0x04000200, 0xfc001fdf, "cZx(S,b)", pa10, 0}, +{ "pitlb", 0x04000200, 0xfc001fdf, "cZx(b)", pa10, 0}, +{ "pdtlbe", 0x04001240, 0xfc003fdf, "cZx(s,b)", pa10, 0}, +{ "pdtlbe", 0x04001240, 0xfc003fdf, "cZx(b)", pa10, 0}, +{ "pitlbe", 0x04000240, 0xfc001fdf, "cZx(S,b)", pa10, 0}, +{ "pitlbe", 0x04000240, 0xfc001fdf, "cZx(b)", pa10, 0}, +{ "idtlba", 0x04001040, 0xfc003fff, "x,(s,b)", pa10, 0}, +{ "idtlba", 0x04001040, 0xfc003fff, "x,(b)", pa10, 0}, +{ "iitlba", 0x04000040, 0xfc001fff, "x,(S,b)", pa10, 0}, +{ "iitlba", 0x04000040, 0xfc001fff, "x,(b)", pa10, 0}, +{ "idtlbp", 0x04001000, 0xfc003fff, "x,(s,b)", pa10, 0}, +{ "idtlbp", 0x04001000, 0xfc003fff, "x,(b)", pa10, 0}, +{ "iitlbp", 0x04000000, 0xfc001fff, "x,(S,b)", pa10, 0}, +{ "iitlbp", 0x04000000, 0xfc001fff, "x,(b)", pa10, 0}, +{ "pdc", 0x04001380, 0xfc003fdf, "cZx(s,b)", pa10, 0}, +{ "pdc", 0x04001380, 0xfc003fdf, "cZx(b)", pa10, 0}, +{ "fdc", 0x04001280, 0xfc003fdf, "cZx(s,b)", pa10, 0}, +{ "fdc", 0x04001280, 0xfc003fdf, "cZx(b)", pa10, 0}, +{ "fic", 0x04000280, 0xfc001fdf, "cZx(S,b)", pa10, 0}, +{ "fic", 0x04000280, 0xfc001fdf, "cZx(b)", pa10, 0}, +{ "fdce", 0x040012c0, 0xfc003fdf, "cZx(s,b)", pa10, 0}, +{ "fdce", 0x040012c0, 0xfc003fdf, "cZx(b)", pa10, 0}, +{ "fice", 0x040002c0, 0xfc001fdf, "cZx(S,b)", pa10, 0}, +{ "fice", 0x040002c0, 0xfc001fdf, "cZx(b)", pa10, 0}, +{ "diag", 0x14000000, 0xfc000000, "D", pa10, 0}, +{ "idtlbt", 0x04001800, 0xfc00ffff, "x,b", pa20, FLAG_STRICT}, +{ "iitlbt", 0x04000800, 0xfc00ffff, "x,b", pa20, FLAG_STRICT}, /* These may be specific to certain versions of the PA. Joel claimed they were 72000 (7200?) specific. However, I'm almost certain the mtcpu/mfcpu were undocumented, but available in the older 700 machines. */ -{ "mtcpu", 0x14001600, 0xfc00ffff, "x,^", pa10, 0}, -{ "mfcpu", 0x14001A00, 0xfc00ffff, "^,x", pa10, 0}, -{ "tocen", 0x14403600, 0xffffffff, "", pa10, 0}, -{ "tocdis", 0x14401620, 0xffffffff, "", pa10, 0}, -{ "shdwgr", 0x14402600, 0xffffffff, "", pa10, 0}, -{ "grshdw", 0x14400620, 0xffffffff, "", pa10, 0}, +{ "mtcpu", 0x14001600, 0xfc00ffff, "x,^", pa10, 0}, +{ "mfcpu", 0x14001A00, 0xfc00ffff, "^,x", pa10, 0}, +{ "tocen", 0x14403600, 0xffffffff, "", pa10, 0}, +{ "tocdis", 0x14401620, 0xffffffff, "", pa10, 0}, +{ "shdwgr", 0x14402600, 0xffffffff, "", pa10, 0}, +{ "grshdw", 0x14400620, 0xffffffff, "", pa10, 0}, /* gfw and gfr are not in the HP PA 1.1 manual, but they are in either the Timex FPU or the Mustang ERS (not sure which) manual. */ @@ -707,107 +760,139 @@ static const struct pa_opcode pa_opcodes /* Floating Point Coprocessor Instructions. */ -{ "fldw", 0x24000000, 0xfc001380, "cxccx(s,b),fT", pa10, FLAG_STRICT}, -{ "fldw", 0x24000000, 0xfc001380, "cxccx(b),fT", pa10, FLAG_STRICT}, -{ "fldw", 0x24001000, 0xfc001380, "cmcc5(s,b),fT", pa10, FLAG_STRICT}, -{ "fldw", 0x24001000, 0xfc001380, "cmcc5(b),fT", pa10, FLAG_STRICT}, -{ "fldw", 0x24001020, 0xfc1f33a0, "cocc@(s,b),fT", pa20, FLAG_STRICT}, -{ "fldw", 0x24001020, 0xfc1f33a0, "cocc@(b),fT", pa20, FLAG_STRICT}, -{ "fldw", 0x5c000000, 0xfc000004, "y(b),fe", pa20w, FLAG_STRICT}, -{ "fldw", 0x58000000, 0xfc000000, "cJy(b),fe", pa20w, FLAG_STRICT}, -{ "fldw", 0x5c000000, 0xfc000004, "d(b),fe", pa20, FLAG_STRICT}, -{ "fldw", 0x58000000, 0xfc000000, "cJd(b),fe", pa20, FLAG_STRICT}, -{ "fldd", 0x2c000000, 0xfc0013c0, "cxccx(s,b),ft", pa10, FLAG_STRICT}, -{ "fldd", 0x2c000000, 0xfc0013c0, "cxccx(b),ft", pa10, FLAG_STRICT}, -{ "fldd", 0x2c001000, 0xfc0013c0, "cmcc5(s,b),ft", pa10, FLAG_STRICT}, -{ "fldd", 0x2c001000, 0xfc0013c0, "cmcc5(b),ft", pa10, FLAG_STRICT}, -{ "fldd", 0x2c001020, 0xfc1f33e0, "cocc@(s,b),ft", pa20, FLAG_STRICT}, -{ "fldd", 0x2c001020, 0xfc1f33e0, "cocc@(b),ft", pa20, FLAG_STRICT}, -{ "fldd", 0x50000002, 0xfc000002, "cq&(b),fx", pa20w, FLAG_STRICT}, -{ "fldd", 0x50000002, 0xfc000002, "cq#(b),fx", pa20, FLAG_STRICT}, -{ "fstw", 0x24000200, 0xfc001380, "cxcCfT,x(s,b)", pa10, FLAG_STRICT}, -{ "fstw", 0x24000200, 0xfc001380, "cxcCfT,x(b)", pa10, FLAG_STRICT}, -{ "fstw", 0x24001200, 0xfc001380, "cmcCfT,5(s,b)", pa10, FLAG_STRICT}, -{ "fstw", 0x24001200, 0xfc001380, "cmcCfT,5(b)", pa10, FLAG_STRICT}, -{ "fstw", 0x24001220, 0xfc1f33a0, "cocCfT,@(s,b)", pa10, FLAG_STRICT}, -{ "fstw", 0x24001220, 0xfc1f33a0, "cocCfT,@(b)", pa10, FLAG_STRICT}, -{ "fstw", 0x7c000000, 0xfc000004, "fE,y(b)", pa20w, FLAG_STRICT}, -{ "fstw", 0x78000000, 0xfc000000, "cJfe,y(b)", pa20w, FLAG_STRICT}, -{ "fstw", 0x7c000000, 0xfc000004, "fe,d(b)", pa20, FLAG_STRICT}, -{ "fstw", 0x78000000, 0xfc000000, "cJfe,d(b)", pa20, FLAG_STRICT}, -{ "fstd", 0x2c000200, 0xfc0013c0, "cxcCft,x(s,b)", pa10, FLAG_STRICT}, -{ "fstd", 0x2c000200, 0xfc0013c0, "cxcCft,x(b)", pa10, FLAG_STRICT}, -{ "fstd", 0x2c001200, 0xfc0013c0, "cmcCft,5(s,b)", pa10, FLAG_STRICT}, -{ "fstd", 0x2c001200, 0xfc0013c0, "cmcCft,5(b)", pa10, FLAG_STRICT}, -{ "fstd", 0x2c001220, 0xfc1f33e0, "cocCft,@(s,b)", pa10, FLAG_STRICT}, -{ "fstd", 0x2c001220, 0xfc1f33e0, "cocCft,@(b)", pa10, FLAG_STRICT}, -{ "fstd", 0x70000002, 0xfc000002, "cqfx,&(b)", pa20w, FLAG_STRICT}, -{ "fstd", 0x70000002, 0xfc000002, "cqfx,#(b)", pa20, FLAG_STRICT}, -{ "fldwx", 0x24000000, 0xfc001f80, "cXx(s,b),fT", pa10, 0}, -{ "fldwx", 0x24000000, 0xfc001f80, "cXx(b),fT", pa10, 0}, -{ "flddx", 0x2c000000, 0xfc001fc0, "cXx(s,b),ft", pa10, 0}, -{ "flddx", 0x2c000000, 0xfc001fc0, "cXx(b),ft", pa10, 0}, -{ "fstwx", 0x24000200, 0xfc001f80, "cxfT,x(s,b)", pa10, 0}, -{ "fstwx", 0x24000200, 0xfc001f80, "cxfT,x(b)", pa10, 0}, -{ "fstdx", 0x2c000200, 0xfc001fc0, "cxft,x(s,b)", pa10, 0}, -{ "fstdx", 0x2c000200, 0xfc001fc0, "cxft,x(b)", pa10, 0}, -{ "fstqx", 0x3c000200, 0xfc001fc0, "cxft,x(s,b)", pa10, 0}, -{ "fstqx", 0x3c000200, 0xfc001fc0, "cxft,x(b)", pa10, 0}, -{ "fldws", 0x24001000, 0xfc001f80, "cm5(s,b),fT", pa10, 0}, -{ "fldws", 0x24001000, 0xfc001f80, "cm5(b),fT", pa10, 0}, -{ "fldds", 0x2c001000, 0xfc001fc0, "cm5(s,b),ft", pa10, 0}, -{ "fldds", 0x2c001000, 0xfc001fc0, "cm5(b),ft", pa10, 0}, -{ "fstws", 0x24001200, 0xfc001f80, "cmfT,5(s,b)", pa10, 0}, -{ "fstws", 0x24001200, 0xfc001f80, "cmfT,5(b)", pa10, 0}, -{ "fstds", 0x2c001200, 0xfc001fc0, "cmft,5(s,b)", pa10, 0}, -{ "fstds", 0x2c001200, 0xfc001fc0, "cmft,5(b)", pa10, 0}, -{ "fstqs", 0x3c001200, 0xfc001fc0, "cmft,5(s,b)", pa10, 0}, -{ "fstqs", 0x3c001200, 0xfc001fc0, "cmft,5(b)", pa10, 0}, -{ "fadd", 0x30000600, 0xfc00e7e0, "Ffa,fb,fT", pa10, 0}, -{ "fadd", 0x38000600, 0xfc00e720, "IfA,fB,fT", pa10, 0}, -{ "fsub", 0x30002600, 0xfc00e7e0, "Ffa,fb,fT", pa10, 0}, -{ "fsub", 0x38002600, 0xfc00e720, "IfA,fB,fT", pa10, 0}, -{ "fmpy", 0x30004600, 0xfc00e7e0, "Ffa,fb,fT", pa10, 0}, -{ "fmpy", 0x38004600, 0xfc00e720, "IfA,fB,fT", pa10, 0}, -{ "fdiv", 0x30006600, 0xfc00e7e0, "Ffa,fb,fT", pa10, 0}, -{ "fdiv", 0x38006600, 0xfc00e720, "IfA,fB,fT", pa10, 0}, -{ "fsqrt", 0x30008000, 0xfc1fe7e0, "Ffa,fT", pa10, 0}, -{ "fsqrt", 0x38008000, 0xfc1fe720, "FfA,fT", pa10, 0}, -{ "fabs", 0x30006000, 0xfc1fe7e0, "Ffa,fT", pa10, 0}, -{ "fabs", 0x38006000, 0xfc1fe720, "FfA,fT", pa10, 0}, -{ "frem", 0x30008600, 0xfc00e7e0, "Ffa,fb,fT", pa10, 0}, -{ "frem", 0x38008600, 0xfc00e720, "FfA,fB,fT", pa10, 0}, -{ "frnd", 0x3000a000, 0xfc1fe7e0, "Ffa,fT", pa10, 0}, -{ "frnd", 0x3800a000, 0xfc1fe720, "FfA,fT", pa10, 0}, -{ "fcpy", 0x30004000, 0xfc1fe7e0, "Ffa,fT", pa10, 0}, -{ "fcpy", 0x38004000, 0xfc1fe720, "FfA,fT", pa10, 0}, -{ "fcnvff", 0x30000200, 0xfc1f87e0, "FGfa,fT", pa10, 0}, -{ "fcnvff", 0x38000200, 0xfc1f8720, "FGfA,fT", pa10, 0}, -{ "fcnvxf", 0x30008200, 0xfc1f87e0, "FGfa,fT", pa10, 0}, -{ "fcnvxf", 0x38008200, 0xfc1f8720, "FGfA,fT", pa10, 0}, -{ "fcnvfx", 0x30010200, 0xfc1f87e0, "FGfa,fT", pa10, 0}, -{ "fcnvfx", 0x38010200, 0xfc1f8720, "FGfA,fT", pa10, 0}, -{ "fcnvfxt", 0x30018200, 0xfc1f87e0, "FGfa,fT", pa10, 0}, -{ "fcnvfxt", 0x38018200, 0xfc1f8720, "FGfA,fT", pa10, 0}, -{ "fmpyfadd", 0xb8000000, 0xfc000020, "IfA,fB,fC,fT", pa20, FLAG_STRICT}, -{ "fmpynfadd", 0xb8000020, 0xfc000020, "IfA,fB,fC,fT", pa20, FLAG_STRICT}, -{ "fneg", 0x3000c000, 0xfc1fe7e0, "Ffa,fT", pa20, FLAG_STRICT}, -{ "fneg", 0x3800c000, 0xfc1fe720, "IfA,fT", pa20, FLAG_STRICT}, -{ "fnegabs", 0x3000e000, 0xfc1fe7e0, "Ffa,fT", pa20, FLAG_STRICT}, -{ "fnegabs", 0x3800e000, 0xfc1fe720, "IfA,fT", pa20, FLAG_STRICT}, -{ "fcnv", 0x30000200, 0xfc1c0720, "{_fa,fT", pa20, FLAG_STRICT}, -{ "fcnv", 0x38000200, 0xfc1c0720, "FGfA,fT", pa20, FLAG_STRICT}, -{ "fcmp", 0x30000400, 0xfc0007e0, "F?ffa,fb,h", pa20, FLAG_STRICT}, -{ "fcmp", 0x38000400, 0xfc000720, "I?ffA,fB,h", pa20, FLAG_STRICT}, -{ "fcmp", 0x30000400, 0xfc00e7e0, "F?ffa,fb", pa10, 0}, -{ "fcmp", 0x38000400, 0xfc00e720, "I?ffA,fB", pa10, 0}, +{ "fldw", 0x24000000, 0xfc001f80, "cXx(s,b),fT", pa10, FLAG_STRICT}, +{ "fldw", 0x24000000, 0xfc001f80, "cXx(b),fT", pa10, FLAG_STRICT}, +{ "fldw", 0x24000000, 0xfc001380, "cxccx(s,b),fT", pa11, FLAG_STRICT}, +{ "fldw", 0x24000000, 0xfc001380, "cxccx(b),fT", pa11, FLAG_STRICT}, +{ "fldw", 0x24001000, 0xfc001f80, "cM5(s,b),fT", pa10, FLAG_STRICT}, +{ "fldw", 0x24001000, 0xfc001f80, "cM5(b),fT", pa10, FLAG_STRICT}, +{ "fldw", 0x24001000, 0xfc001380, "cmcc5(s,b),fT", pa11, FLAG_STRICT}, +{ "fldw", 0x24001000, 0xfc001380, "cmcc5(b),fT", pa11, FLAG_STRICT}, +{ "fldw", 0x24001020, 0xfc1f33a0, "cocc@(s,b),fT", pa20, FLAG_STRICT}, +{ "fldw", 0x24001020, 0xfc1f33a0, "cocc@(b),fT", pa20, FLAG_STRICT}, +{ "fldw", 0x5c000000, 0xfc000004, "y(b),fe", pa20w, FLAG_STRICT}, +{ "fldw", 0x58000000, 0xfc000000, "cJy(b),fe", pa20w, FLAG_STRICT}, +{ "fldw", 0x5c000000, 0xfc000004, "d(b),fe", pa20, FLAG_STRICT}, +{ "fldw", 0x58000000, 0xfc000000, "cJd(b),fe", pa20, FLAG_STRICT}, +{ "fldd", 0x2c000000, 0xfc001fc0, "cXx(s,b),ft", pa10, FLAG_STRICT}, +{ "fldd", 0x2c000000, 0xfc001fc0, "cXx(b),ft", pa10, FLAG_STRICT}, +{ "fldd", 0x2c000000, 0xfc0013c0, "cxccx(s,b),ft", pa11, FLAG_STRICT}, +{ "fldd", 0x2c000000, 0xfc0013c0, "cxccx(b),ft", pa11, FLAG_STRICT}, +{ "fldd", 0x2c001000, 0xfc001fc0, "cM5(s,b),ft", pa10, FLAG_STRICT}, +{ "fldd", 0x2c001000, 0xfc001fc0, "cM5(b),ft", pa10, FLAG_STRICT}, +{ "fldd", 0x2c001000, 0xfc0013c0, "cmcc5(s,b),ft", pa11, FLAG_STRICT}, +{ "fldd", 0x2c001000, 0xfc0013c0, "cmcc5(b),ft", pa11, FLAG_STRICT}, +{ "fldd", 0x2c001020, 0xfc1f33e0, "cocc@(s,b),ft", pa20, FLAG_STRICT}, +{ "fldd", 0x2c001020, 0xfc1f33e0, "cocc@(b),ft", pa20, FLAG_STRICT}, +{ "fldd", 0x50000002, 0xfc000002, "cq&(b),fx", pa20w, FLAG_STRICT}, +{ "fldd", 0x50000002, 0xfc000002, "cq#(b),fx", pa20, FLAG_STRICT}, +{ "fstw", 0x24000200, 0xfc001f80, "cXfT,x(s,b)", pa10, FLAG_STRICT}, +{ "fstw", 0x24000200, 0xfc001f80, "cXfT,x(b)", pa10, FLAG_STRICT}, +{ "fstw", 0x24000200, 0xfc001380, "cxcCfT,x(s,b)", pa11, FLAG_STRICT}, +{ "fstw", 0x24000200, 0xfc001380, "cxcCfT,x(b)", pa11, FLAG_STRICT}, +{ "fstw", 0x24001200, 0xfc001f80, "cMfT,5(s,b)", pa10, FLAG_STRICT}, +{ "fstw", 0x24001200, 0xfc001f80, "cMfT,5(b)", pa10, FLAG_STRICT}, +{ "fstw", 0x24001200, 0xfc001380, "cmcCfT,5(s,b)", pa11, FLAG_STRICT}, +{ "fstw", 0x24001200, 0xfc001380, "cmcCfT,5(b)", pa11, FLAG_STRICT}, +{ "fstw", 0x24001220, 0xfc1f33a0, "cocCfT,@(s,b)", pa20, FLAG_STRICT}, +{ "fstw", 0x24001220, 0xfc1f33a0, "cocCfT,@(b)", pa20, FLAG_STRICT}, +{ "fstw", 0x7c000000, 0xfc000004, "fE,y(b)", pa20w, FLAG_STRICT}, +{ "fstw", 0x78000000, 0xfc000000, "cJfe,y(b)", pa20w, FLAG_STRICT}, +{ "fstw", 0x7c000000, 0xfc000004, "fe,d(b)", pa20, FLAG_STRICT}, +{ "fstw", 0x78000000, 0xfc000000, "cJfe,d(b)", pa20, FLAG_STRICT}, +{ "fstd", 0x2c000200, 0xfc001fc0, "cXft,x(s,b)", pa10, FLAG_STRICT}, +{ "fstd", 0x2c000200, 0xfc001fc0, "cXft,x(b)", pa10, FLAG_STRICT}, +{ "fstd", 0x2c000200, 0xfc0013c0, "cxcCft,x(s,b)", pa11, FLAG_STRICT}, +{ "fstd", 0x2c000200, 0xfc0013c0, "cxcCft,x(b)", pa11, FLAG_STRICT}, +{ "fstd", 0x2c001200, 0xfc001fc0, "cMft,5(s,b)", pa10, FLAG_STRICT}, +{ "fstd", 0x2c001200, 0xfc001fc0, "cMft,5(b)", pa10, FLAG_STRICT}, +{ "fstd", 0x2c001200, 0xfc0013c0, "cmcCft,5(s,b)", pa11, FLAG_STRICT}, +{ "fstd", 0x2c001200, 0xfc0013c0, "cmcCft,5(b)", pa11, FLAG_STRICT}, +{ "fstd", 0x2c001220, 0xfc1f33e0, "cocCft,@(s,b)", pa20, FLAG_STRICT}, +{ "fstd", 0x2c001220, 0xfc1f33e0, "cocCft,@(b)", pa20, FLAG_STRICT}, +{ "fstd", 0x70000002, 0xfc000002, "cqfx,&(b)", pa20w, FLAG_STRICT}, +{ "fstd", 0x70000002, 0xfc000002, "cqfx,#(b)", pa20, FLAG_STRICT}, +{ "fldwx", 0x24000000, 0xfc001f80, "cXx(s,b),fT", pa10, FLAG_STRICT}, +{ "fldwx", 0x24000000, 0xfc001f80, "cXx(b),fT", pa10, FLAG_STRICT}, +{ "fldwx", 0x24000000, 0xfc001380, "cxccx(s,b),fT", pa11, FLAG_STRICT}, +{ "fldwx", 0x24000000, 0xfc001380, "cxccx(b),fT", pa11, FLAG_STRICT}, +{ "flddx", 0x2c000000, 0xfc001fc0, "cXx(s,b),ft", pa10, FLAG_STRICT}, +{ "flddx", 0x2c000000, 0xfc001fc0, "cXx(b),ft", pa10, FLAG_STRICT}, +{ "flddx", 0x2c000000, 0xfc0013c0, "cxccx(s,b),ft", pa11, FLAG_STRICT}, +{ "flddx", 0x2c000000, 0xfc0013c0, "cxccx(b),ft", pa11, FLAG_STRICT}, +{ "fstwx", 0x24000200, 0xfc001f80, "cxfT,x(s,b)", pa10, FLAG_STRICT}, +{ "fstwx", 0x24000200, 0xfc001f80, "cxfT,x(b)", pa10, FLAG_STRICT}, +{ "fstwx", 0x24000200, 0xfc001380, "cxcCfT,x(s,b)", pa11, FLAG_STRICT}, +{ "fstwx", 0x24000200, 0xfc001380, "cxcCfT,x(b)", pa11, FLAG_STRICT}, +{ "fstdx", 0x2c000200, 0xfc001fc0, "cxft,x(s,b)", pa10, FLAG_STRICT}, +{ "fstdx", 0x2c000200, 0xfc001fc0, "cxft,x(b)", pa10, FLAG_STRICT}, +{ "fstdx", 0x2c000200, 0xfc0013c0, "cxcCft,x(s,b)", pa11, FLAG_STRICT}, +{ "fstdx", 0x2c000200, 0xfc0013c0, "cxcCft,x(b)", pa11, FLAG_STRICT}, +{ "fstqx", 0x3c000200, 0xfc001fc0, "cxft,x(s,b)", pa10, 0}, +{ "fstqx", 0x3c000200, 0xfc001fc0, "cxft,x(b)", pa10, 0}, +{ "fldws", 0x24001000, 0xfc001f80, "cm5(s,b),fT", pa10, FLAG_STRICT}, +{ "fldws", 0x24001000, 0xfc001f80, "cm5(b),fT", pa10, FLAG_STRICT}, +{ "fldws", 0x24001000, 0xfc001380, "cmcc5(s,b),fT", pa11, FLAG_STRICT}, +{ "fldws", 0x24001000, 0xfc001380, "cmcc5(b),fT", pa11, FLAG_STRICT}, +{ "fldds", 0x2c001000, 0xfc001fc0, "cm5(s,b),ft", pa10, FLAG_STRICT}, +{ "fldds", 0x2c001000, 0xfc001fc0, "cm5(b),ft", pa10, FLAG_STRICT}, +{ "fldds", 0x2c001000, 0xfc0013c0, "cmcc5(s,b),ft", pa11, FLAG_STRICT}, +{ "fldds", 0x2c001000, 0xfc0013c0, "cmcc5(b),ft", pa11, FLAG_STRICT}, +{ "fstws", 0x24001200, 0xfc001f80, "cmfT,5(s,b)", pa10, FLAG_STRICT}, +{ "fstws", 0x24001200, 0xfc001f80, "cmfT,5(b)", pa10, FLAG_STRICT}, +{ "fstws", 0x24001200, 0xfc001380, "cmcCfT,5(s,b)", pa11, FLAG_STRICT}, +{ "fstws", 0x24001200, 0xfc001380, "cmcCfT,5(b)", pa11, FLAG_STRICT}, +{ "fstds", 0x2c001200, 0xfc001fc0, "cmft,5(s,b)", pa10, FLAG_STRICT}, +{ "fstds", 0x2c001200, 0xfc001fc0, "cmft,5(b)", pa10, FLAG_STRICT}, +{ "fstds", 0x2c001200, 0xfc0013c0, "cmcCft,5(s,b)", pa11, FLAG_STRICT}, +{ "fstds", 0x2c001200, 0xfc0013c0, "cmcCft,5(b)", pa11, FLAG_STRICT}, +{ "fstqs", 0x3c001200, 0xfc001fc0, "cmft,5(s,b)", pa10, 0}, +{ "fstqs", 0x3c001200, 0xfc001fc0, "cmft,5(b)", pa10, 0}, +{ "fadd", 0x30000600, 0xfc00e7e0, "Ffa,fb,fT", pa10, 0}, +{ "fadd", 0x38000600, 0xfc00e720, "IfA,fB,fT", pa10, 0}, +{ "fsub", 0x30002600, 0xfc00e7e0, "Ffa,fb,fT", pa10, 0}, +{ "fsub", 0x38002600, 0xfc00e720, "IfA,fB,fT", pa10, 0}, +{ "fmpy", 0x30004600, 0xfc00e7e0, "Ffa,fb,fT", pa10, 0}, +{ "fmpy", 0x38004600, 0xfc00e720, "IfA,fB,fT", pa10, 0}, +{ "fdiv", 0x30006600, 0xfc00e7e0, "Ffa,fb,fT", pa10, 0}, +{ "fdiv", 0x38006600, 0xfc00e720, "IfA,fB,fT", pa10, 0}, +{ "fsqrt", 0x30008000, 0xfc1fe7e0, "Ffa,fT", pa10, 0}, +{ "fsqrt", 0x38008000, 0xfc1fe720, "FfA,fT", pa10, 0}, +{ "fabs", 0x30006000, 0xfc1fe7e0, "Ffa,fT", pa10, 0}, +{ "fabs", 0x38006000, 0xfc1fe720, "FfA,fT", pa10, 0}, +{ "frem", 0x30008600, 0xfc00e7e0, "Ffa,fb,fT", pa10, 0}, +{ "frem", 0x38008600, 0xfc00e720, "FfA,fB,fT", pa10, 0}, +{ "frnd", 0x3000a000, 0xfc1fe7e0, "Ffa,fT", pa10, 0}, +{ "frnd", 0x3800a000, 0xfc1fe720, "FfA,fT", pa10, 0}, +{ "fcpy", 0x30004000, 0xfc1fe7e0, "Ffa,fT", pa10, 0}, +{ "fcpy", 0x38004000, 0xfc1fe720, "FfA,fT", pa10, 0}, +{ "fcnvff", 0x30000200, 0xfc1f87e0, "FGfa,fT", pa10, 0}, +{ "fcnvff", 0x38000200, 0xfc1f8720, "FGfA,fT", pa10, 0}, +{ "fcnvxf", 0x30008200, 0xfc1f87e0, "FGfa,fT", pa10, 0}, +{ "fcnvxf", 0x38008200, 0xfc1f8720, "FGfA,fT", pa10, 0}, +{ "fcnvfx", 0x30010200, 0xfc1f87e0, "FGfa,fT", pa10, 0}, +{ "fcnvfx", 0x38010200, 0xfc1f8720, "FGfA,fT", pa10, 0}, +{ "fcnvfxt", 0x30018200, 0xfc1f87e0, "FGfa,fT", pa10, 0}, +{ "fcnvfxt", 0x38018200, 0xfc1f8720, "FGfA,fT", pa10, 0}, +{ "fmpyfadd", 0xb8000000, 0xfc000020, "IfA,fB,fC,fT", pa20, FLAG_STRICT}, +{ "fmpynfadd", 0xb8000020, 0xfc000020, "IfA,fB,fC,fT", pa20, FLAG_STRICT}, +{ "fneg", 0x3000c000, 0xfc1fe7e0, "Ffa,fT", pa20, FLAG_STRICT}, +{ "fneg", 0x3800c000, 0xfc1fe720, "IfA,fT", pa20, FLAG_STRICT}, +{ "fnegabs", 0x3000e000, 0xfc1fe7e0, "Ffa,fT", pa20, FLAG_STRICT}, +{ "fnegabs", 0x3800e000, 0xfc1fe720, "IfA,fT", pa20, FLAG_STRICT}, +{ "fcnv", 0x30000200, 0xfc1c0720, "{_fa,fT", pa20, FLAG_STRICT}, +{ "fcnv", 0x38000200, 0xfc1c0720, "FGfA,fT", pa20, FLAG_STRICT}, +{ "fcmp", 0x30000400, 0xfc0007e0, "F?ffa,fb,h", pa20, FLAG_STRICT}, +{ "fcmp", 0x38000400, 0xfc000720, "I?ffA,fB,h", pa20, FLAG_STRICT}, +{ "fcmp", 0x30000400, 0xfc00e7e0, "F?ffa,fb", pa10, 0}, +{ "fcmp", 0x38000400, 0xfc00e720, "I?ffA,fB", pa10, 0}, { "xmpyu", 0x38004700, 0xfc00e720, "fX,fB,fT", pa11, 0}, { "fmpyadd", 0x18000000, 0xfc000000, "Hfi,fj,fk,fl,fm", pa11, 0}, { "fmpysub", 0x98000000, 0xfc000000, "Hfi,fj,fk,fl,fm", pa11, 0}, -{ "ftest", 0x30002420, 0xffffffe0, ",=", pa20, FLAG_STRICT}, -{ "ftest", 0x30000420, 0xffff1fff, "m", pa20, FLAG_STRICT}, -{ "ftest", 0x30002420, 0xffffffff, "", pa10, 0}, -{ "fid", 0x30000000, 0xffffffff, "", pa11, 0}, +{ "ftest", 0x30002420, 0xffffffe0, ",=", pa20, FLAG_STRICT}, +{ "ftest", 0x30000420, 0xffff1fff, "m", pa20, FLAG_STRICT}, +{ "ftest", 0x30002420, 0xffffffff, "", pa10, 0}, +{ "fid", 0x30000000, 0xffffffff, "", pa11, 0}, /* Performance Monitor Instructions. */ @@ -816,43 +901,83 @@ static const struct pa_opcode pa_opcodes /* Assist Instructions. */ -{ "spop0", 0x10000000, 0xfc000600, "v,ON", pa10, 0}, -{ "spop1", 0x10000200, 0xfc000600, "v,oNt", pa10, 0}, -{ "spop2", 0x10000400, 0xfc000600, "v,1Nb", pa10, 0}, -{ "spop3", 0x10000600, 0xfc000600, "v,0Nx,b", pa10, 0}, -{ "copr", 0x30000000, 0xfc000000, "u,2N", pa10, 0}, -{ "cldwx", 0x24000000, 0xfc001e00, "ucXx(s,b),t", pa10, 0}, -{ "cldwx", 0x24000000, 0xfc001e00, "ucXx(b),t", pa10, 0}, -{ "clddx", 0x2c000000, 0xfc001e00, "ucXx(s,b),t", pa10, 0}, -{ "clddx", 0x2c000000, 0xfc001e00, "ucXx(b),t", pa10, 0}, -{ "cstwx", 0x24000200, 0xfc001e00, "ucXt,x(s,b)", pa10, 0}, -{ "cstwx", 0x24000200, 0xfc001e00, "ucXt,x(b)", pa10, 0}, -{ "cstdx", 0x2c000200, 0xfc001e00, "ucXt,x(s,b)", pa10, 0}, -{ "cstdx", 0x2c000200, 0xfc001e00, "ucXt,x(b)", pa10, 0}, -{ "cldws", 0x24001000, 0xfc001e00, "ucM5(s,b),t", pa10, 0}, -{ "cldws", 0x24001000, 0xfc001e00, "ucM5(b),t", pa10, 0}, -{ "cldds", 0x2c001000, 0xfc001e00, "ucM5(s,b),t", pa10, 0}, -{ "cldds", 0x2c001000, 0xfc001e00, "ucM5(b),t", pa10, 0}, -{ "cstws", 0x24001200, 0xfc001e00, "ucMt,5(s,b)", pa10, 0}, -{ "cstws", 0x24001200, 0xfc001e00, "ucMt,5(b)", pa10, 0}, -{ "cstds", 0x2c001200, 0xfc001e00, "ucMt,5(s,b)", pa10, 0}, -{ "cstds", 0x2c001200, 0xfc001e00, "ucMt,5(b)", pa10, 0}, -{ "cldw", 0x24000000, 0xfc001e00, "ucXx(s,b),t", pa10, FLAG_STRICT}, -{ "cldw", 0x24000000, 0xfc001e00, "ucXx(b),t", pa10, FLAG_STRICT}, -{ "cldw", 0x24001000, 0xfc001e00, "ucM5(s,b),t", pa10, FLAG_STRICT}, -{ "cldw", 0x24001000, 0xfc001e00, "ucM5(b),t", pa10, FLAG_STRICT}, -{ "cldd", 0x2c000000, 0xfc001e00, "ucXx(s,b),t", pa10, FLAG_STRICT}, -{ "cldd", 0x2c000000, 0xfc001e00, "ucXx(b),t", pa10, FLAG_STRICT}, -{ "cldd", 0x2c001000, 0xfc001e00, "ucM5(s,b),t", pa10, FLAG_STRICT}, -{ "cldd", 0x2c001000, 0xfc001e00, "ucM5(b),t", pa20, FLAG_STRICT}, -{ "cstw", 0x24000200, 0xfc001e00, "ucXt,x(s,b)", pa10, FLAG_STRICT}, -{ "cstw", 0x24000200, 0xfc001e00, "ucXt,x(b)", pa10, FLAG_STRICT}, -{ "cstw", 0x24001200, 0xfc001e00, "ucMt,5(s,b)", pa10, FLAG_STRICT}, -{ "cstw", 0x24001200, 0xfc001e00, "ucMt,5(b)", pa10, FLAG_STRICT}, -{ "cstd", 0x2c000200, 0xfc001e00, "ucXt,x(s,b)", pa10, FLAG_STRICT}, -{ "cstd", 0x2c000200, 0xfc001e00, "ucXt,x(b)", pa10, FLAG_STRICT}, -{ "cstd", 0x2c001200, 0xfc001e00, "ucMt,5(s,b)", pa10, FLAG_STRICT}, -{ "cstd", 0x2c001200, 0xfc001e00, "ucMt,5(b)", pa10, FLAG_STRICT}, +{ "spop0", 0x10000000, 0xfc000600, "v,ON", pa10, 0}, +{ "spop1", 0x10000200, 0xfc000600, "v,oNt", pa10, 0}, +{ "spop2", 0x10000400, 0xfc000600, "v,1Nb", pa10, 0}, +{ "spop3", 0x10000600, 0xfc000600, "v,0Nx,b", pa10, 0}, +{ "copr", 0x30000000, 0xfc000000, "u,2N", pa10, 0}, +{ "cldw", 0x24000000, 0xfc001e00, "ucXx(s,b),t", pa10, FLAG_STRICT}, +{ "cldw", 0x24000000, 0xfc001e00, "ucXx(b),t", pa10, FLAG_STRICT}, +{ "cldw", 0x24000000, 0xfc001200, "ucxccx(s,b),t", pa11, FLAG_STRICT}, +{ "cldw", 0x24000000, 0xfc001200, "ucxccx(b),t", pa11, FLAG_STRICT}, +{ "cldw", 0x24001000, 0xfc001e00, "ucM5(s,b),t", pa10, FLAG_STRICT}, +{ "cldw", 0x24001000, 0xfc001e00, "ucM5(b),t", pa10, FLAG_STRICT}, +{ "cldw", 0x24001000, 0xfc001200, "ucmcc5(s,b),t", pa11, FLAG_STRICT}, +{ "cldw", 0x24001000, 0xfc001200, "ucmcc5(b),t", pa11, FLAG_STRICT}, +{ "cldw", 0x24001000, 0xfc001200, "ucocc@(s,b),t", pa20, FLAG_STRICT}, +{ "cldw", 0x24001000, 0xfc001200, "ucocc@(b),t", pa20, FLAG_STRICT}, +{ "cldd", 0x2c000000, 0xfc001e00, "ucXx(s,b),t", pa10, FLAG_STRICT}, +{ "cldd", 0x2c000000, 0xfc001e00, "ucXx(b),t", pa10, FLAG_STRICT}, +{ "cldd", 0x2c000000, 0xfc001200, "ucxccx(s,b),t", pa11, FLAG_STRICT}, +{ "cldd", 0x2c000000, 0xfc001200, "ucxccx(b),t", pa11, FLAG_STRICT}, +{ "cldd", 0x2c001000, 0xfc001e00, "ucM5(s,b),t", pa10, FLAG_STRICT}, +{ "cldd", 0x2c001000, 0xfc001e00, "ucM5(b),t", pa10, FLAG_STRICT}, +{ "cldd", 0x2c001000, 0xfc001200, "ucmcc5(s,b),t", pa11, FLAG_STRICT}, +{ "cldd", 0x2c001000, 0xfc001200, "ucmcc5(b),t", pa11, FLAG_STRICT}, +{ "cldd", 0x2c001000, 0xfc001200, "ucocc@(s,b),t", pa20, FLAG_STRICT}, +{ "cldd", 0x2c001000, 0xfc001200, "ucocc@(b),t", pa20, FLAG_STRICT}, +{ "cstw", 0x24000200, 0xfc001e00, "ucXt,x(s,b)", pa10, FLAG_STRICT}, +{ "cstw", 0x24000200, 0xfc001e00, "ucXt,x(b)", pa10, FLAG_STRICT}, +{ "cstw", 0x24000200, 0xfc001200, "ucxcCt,x(s,b)", pa11, FLAG_STRICT}, +{ "cstw", 0x24000200, 0xfc001200, "ucxcCt,x(b)", pa11, FLAG_STRICT}, +{ "cstw", 0x24001200, 0xfc001e00, "ucMt,5(s,b)", pa10, FLAG_STRICT}, +{ "cstw", 0x24001200, 0xfc001e00, "ucMt,5(b)", pa10, FLAG_STRICT}, +{ "cstw", 0x24001200, 0xfc001200, "ucmcCt,5(s,b)", pa11, FLAG_STRICT}, +{ "cstw", 0x24001200, 0xfc001200, "ucmcCt,5(b)", pa11, FLAG_STRICT}, +{ "cstw", 0x24001200, 0xfc001200, "ucocCt,@(s,b)", pa20, FLAG_STRICT}, +{ "cstw", 0x24001200, 0xfc001200, "ucocCt,@(b)", pa20, FLAG_STRICT}, +{ "cstd", 0x2c000200, 0xfc001e00, "ucXt,x(s,b)", pa10, FLAG_STRICT}, +{ "cstd", 0x2c000200, 0xfc001e00, "ucXt,x(b)", pa10, FLAG_STRICT}, +{ "cstd", 0x2c000200, 0xfc001200, "ucxcCt,x(s,b)", pa11, FLAG_STRICT}, +{ "cstd", 0x2c000200, 0xfc001200, "ucxcCt,x(b)", pa11, FLAG_STRICT}, +{ "cstd", 0x2c001200, 0xfc001e00, "ucMt,5(s,b)", pa10, FLAG_STRICT}, +{ "cstd", 0x2c001200, 0xfc001e00, "ucMt,5(b)", pa10, FLAG_STRICT}, +{ "cstd", 0x2c001200, 0xfc001200, "ucmcCt,5(s,b)", pa11, FLAG_STRICT}, +{ "cstd", 0x2c001200, 0xfc001200, "ucmcCt,5(b)", pa11, FLAG_STRICT}, +{ "cstd", 0x2c001200, 0xfc001200, "ucocCt,@(s,b)", pa20, FLAG_STRICT}, +{ "cstd", 0x2c001200, 0xfc001200, "ucocCt,@(b)", pa20, FLAG_STRICT}, +{ "cldwx", 0x24000000, 0xfc001e00, "ucXx(s,b),t", pa10, FLAG_STRICT}, +{ "cldwx", 0x24000000, 0xfc001e00, "ucXx(b),t", pa10, FLAG_STRICT}, +{ "cldwx", 0x24000000, 0xfc001200, "ucxccx(s,b),t", pa11, FLAG_STRICT}, +{ "cldwx", 0x24000000, 0xfc001200, "ucxccx(b),t", pa11, FLAG_STRICT}, +{ "clddx", 0x2c000000, 0xfc001e00, "ucXx(s,b),t", pa10, FLAG_STRICT}, +{ "clddx", 0x2c000000, 0xfc001e00, "ucXx(b),t", pa10, FLAG_STRICT}, +{ "clddx", 0x2c000000, 0xfc001200, "ucxccx(s,b),t", pa11, FLAG_STRICT}, +{ "clddx", 0x2c000000, 0xfc001200, "ucxccx(b),t", pa11, FLAG_STRICT}, +{ "cstwx", 0x24000200, 0xfc001e00, "ucXt,x(s,b)", pa10, FLAG_STRICT}, +{ "cstwx", 0x24000200, 0xfc001e00, "ucXt,x(b)", pa10, FLAG_STRICT}, +{ "cstwx", 0x24000200, 0xfc001200, "ucxcCt,x(s,b)", pa11, FLAG_STRICT}, +{ "cstwx", 0x24000200, 0xfc001200, "ucxcCt,x(b)", pa11, FLAG_STRICT}, +{ "cstdx", 0x2c000200, 0xfc001e00, "ucXt,x(s,b)", pa10, FLAG_STRICT}, +{ "cstdx", 0x2c000200, 0xfc001e00, "ucXt,x(b)", pa10, FLAG_STRICT}, +{ "cstdx", 0x2c001200, 0xfc001200, "ucmcCt,5(s,b)", pa11, FLAG_STRICT}, +{ "cstdx", 0x2c001200, 0xfc001200, "ucmcCt,5(b)", pa11, FLAG_STRICT}, +{ "cldws", 0x24001000, 0xfc001e00, "ucM5(s,b),t", pa10, FLAG_STRICT}, +{ "cldws", 0x24001000, 0xfc001e00, "ucM5(b),t", pa10, FLAG_STRICT}, +{ "cldws", 0x24001000, 0xfc001200, "ucmcc5(s,b),t", pa11, FLAG_STRICT}, +{ "cldws", 0x24001000, 0xfc001200, "ucmcc5(b),t", pa11, FLAG_STRICT}, +{ "cldds", 0x2c001000, 0xfc001e00, "ucM5(s,b),t", pa10, FLAG_STRICT}, +{ "cldds", 0x2c001000, 0xfc001e00, "ucM5(b),t", pa10, FLAG_STRICT}, +{ "cldds", 0x2c001000, 0xfc001200, "ucmcc5(s,b),t", pa11, FLAG_STRICT}, +{ "cldds", 0x2c001000, 0xfc001200, "ucmcc5(b),t", pa11, FLAG_STRICT}, +{ "cstws", 0x24001200, 0xfc001e00, "ucMt,5(s,b)", pa10, FLAG_STRICT}, +{ "cstws", 0x24001200, 0xfc001e00, "ucMt,5(b)", pa10, FLAG_STRICT}, +{ "cstws", 0x24001200, 0xfc001200, "ucmcCt,5(s,b)", pa11, FLAG_STRICT}, +{ "cstws", 0x24001200, 0xfc001200, "ucmcCt,5(b)", pa11, FLAG_STRICT}, +{ "cstds", 0x2c001200, 0xfc001e00, "ucMt,5(s,b)", pa10, FLAG_STRICT}, +{ "cstds", 0x2c001200, 0xfc001e00, "ucMt,5(b)", pa10, FLAG_STRICT}, +{ "cstds", 0x2c001200, 0xfc001200, "ucmcCt,5(s,b)", pa11, FLAG_STRICT}, +{ "cstds", 0x2c001200, 0xfc001200, "ucmcCt,5(b)", pa11, FLAG_STRICT}, /* More pseudo instructions which must follow the main table. */ { "call", 0xe800f000, 0xfc1ffffd, "n(b)", pa20, FLAG_STRICT}, diff -uprN binutils-2.16.90.0.3/include/opcode/i386.h binutils-2.16.91.0.1/include/opcode/i386.h --- binutils-2.16.90.0.3/include/opcode/i386.h 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/include/opcode/i386.h 2005-06-22 13:53:35.329247270 -0700 @@ -83,12 +83,13 @@ static const template i386_optab[] = /* Move instructions. */ #define MOV_AX_DISP32 0xa0 -/* In the 64bit mode the short form mov immediate is redefined to have - 64bit displacement value. */ +/* We put the 64bit displacement first and we only mark constants + larger than 32bit as Disp64. */ +{ "mov", 2, 0xa0, X, Cpu64, bwlq_Suf|D|W, { Disp64, Acc, 0 } }, { "mov", 2, 0xa0, X, CpuNo64,bwl_Suf|D|W, { Disp16|Disp32, Acc, 0 } }, { "mov", 2, 0x88, X, 0, bwlq_Suf|D|W|Modrm, { Reg, Reg|AnyMem, 0} }, /* In the 64bit mode the short form mov immediate is redefined to have - 64bit displacement value. */ + 64bit value. */ { "mov", 2, 0xb0, X, 0, bwl_Suf|W|ShortForm, { EncImm, Reg8|Reg16|Reg32, 0 } }, { "mov", 2, 0xc6, 0, 0, bwlq_Suf|W|Modrm, { EncImm, Reg|AnyMem, 0 } }, { "mov", 2, 0xb0, X, Cpu64, q_Suf|W|ShortForm, { Imm64, Reg64, 0 } }, @@ -1004,6 +1005,9 @@ static const template i386_optab[] = {"movq", 2, 0x0f7f, X, CpuMMX, NoSuf|IgnoreSize|Modrm, { RegMMX, RegMMX|LongMem, 0 } }, {"movq", 2, 0xf30f7e,X,CpuSSE2,NoSuf|IgnoreSize|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, {"movq", 2, 0x660fd6,X,CpuSSE2,NoSuf|IgnoreSize|Modrm, { RegXMM, RegXMM|LLongMem, 0 } }, +/* We put the 64bit displacement first and we only mark constants + larger than 32bit as Disp64. */ +{"movq", 2, 0xa0, X, Cpu64, NoSuf|D|W|Size64, { Disp64, Acc, 0 } }, {"movq", 2, 0x88, X, Cpu64, NoSuf|D|W|Modrm|Size64,{ Reg64, Reg64|AnyMem, 0 } }, {"movq", 2, 0xc6, 0, Cpu64, NoSuf|W|Modrm|Size64, { Imm32S, Reg64|WordMem, 0 } }, {"movq", 2, 0xb0, X, Cpu64, NoSuf|W|ShortForm|Size64,{ Imm64, Reg64, 0 } }, diff -uprN binutils-2.16.90.0.3/include/opcode/ppc.h binutils-2.16.91.0.1/include/opcode/ppc.h --- binutils-2.16.90.0.3/include/opcode/ppc.h 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/include/opcode/ppc.h 2005-06-22 13:53:35.332246775 -0700 @@ -134,6 +134,9 @@ extern const int powerpc_num_opcodes; /* Opcode is supported by machine check APU. */ #define PPC_OPCODE_RFMCI 0x800000 +/* Opcode is only supported by Power5 architecture. */ +#define PPC_OPCODE_POWER5 0x1000000 + /* A macro to extract the major opcode from an instruction. */ #define PPC_OP(i) (((i) >> 26) & 0x3f) diff -uprN binutils-2.16.90.0.3/intl/bindtextdom.c binutils-2.16.91.0.1/intl/bindtextdom.c --- binutils-2.16.90.0.3/intl/bindtextdom.c 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/intl/bindtextdom.c 2005-06-22 13:53:35.344244792 -0700 @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include diff -uprN binutils-2.16.90.0.3/intl/cat-compat.c binutils-2.16.91.0.1/intl/cat-compat.c --- binutils-2.16.90.0.3/intl/cat-compat.c 1999-06-03 11:02:09.000000000 -0700 +++ binutils-2.16.91.0.1/intl/cat-compat.c 2005-06-22 13:53:35.344244792 -0700 @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include diff -uprN binutils-2.16.90.0.3/intl/ChangeLog binutils-2.16.91.0.1/intl/ChangeLog --- binutils-2.16.90.0.3/intl/ChangeLog 2004-12-20 11:16:51.000000000 -0800 +++ binutils-2.16.91.0.1/intl/ChangeLog 2005-06-22 13:53:35.340245453 -0700 @@ -1,3 +1,14 @@ +2005-05-13 Nick Clifton + + * Update the address and phone number of the FSF organization in + the GPL notices in the following files: + Makefile.in, bindtextdom.c, cat-compat.c, dcgettext.c, + dgettext.c, explodename.c, finddomain.c, gettext.c, gettext.h, + gettextP.h, hash-string.h, intl-compat.c, intlh.inst.in, + l10nflist.c, libgettext.h, libintl.glibc, linux-msg.sed, + loadinfo.h, loadmsgcat.c, localealias.c, po2tbl.sed.in, + textdomain.c, xopen-msg.sed + 2004-11-30 Tero Niemela * Makefile.in: Change LOCALEDIR to $(datadir)/share. diff -uprN binutils-2.16.90.0.3/intl/dcgettext.c binutils-2.16.91.0.1/intl/dcgettext.c --- binutils-2.16.90.0.3/intl/dcgettext.c 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/intl/dcgettext.c 2005-06-22 13:53:35.347244297 -0700 @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include diff -uprN binutils-2.16.90.0.3/intl/dgettext.c binutils-2.16.91.0.1/intl/dgettext.c --- binutils-2.16.90.0.3/intl/dgettext.c 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/intl/dgettext.c 2005-06-22 13:53:35.347244297 -0700 @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include diff -uprN binutils-2.16.90.0.3/intl/explodename.c binutils-2.16.91.0.1/intl/explodename.c --- binutils-2.16.90.0.3/intl/explodename.c 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/intl/explodename.c 2005-06-22 13:53:35.348244132 -0700 @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include diff -uprN binutils-2.16.90.0.3/intl/finddomain.c binutils-2.16.91.0.1/intl/finddomain.c --- binutils-2.16.90.0.3/intl/finddomain.c 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/intl/finddomain.c 2005-06-22 13:53:35.348244132 -0700 @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include diff -uprN binutils-2.16.90.0.3/intl/gettext.c binutils-2.16.91.0.1/intl/gettext.c --- binutils-2.16.90.0.3/intl/gettext.c 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/intl/gettext.c 2005-06-22 13:53:35.348244132 -0700 @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include diff -uprN binutils-2.16.90.0.3/intl/gettext.h binutils-2.16.91.0.1/intl/gettext.h --- binutils-2.16.90.0.3/intl/gettext.h 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/intl/gettext.h 2005-06-22 13:53:35.349243966 -0700 @@ -13,8 +13,8 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, + Boston, MA 02110-1301, USA. */ #ifndef _GETTEXT_H #define _GETTEXT_H 1 diff -uprN binutils-2.16.90.0.3/intl/gettextP.h binutils-2.16.91.0.1/intl/gettextP.h --- binutils-2.16.90.0.3/intl/gettextP.h 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/intl/gettextP.h 2005-06-22 13:53:35.349243966 -0700 @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GETTEXTP_H #define _GETTEXTP_H diff -uprN binutils-2.16.90.0.3/intl/hash-string.h binutils-2.16.91.0.1/intl/hash-string.h --- binutils-2.16.90.0.3/intl/hash-string.h 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/intl/hash-string.h 2005-06-22 13:53:35.349243966 -0700 @@ -13,8 +13,8 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, + Boston, MA 02110-1301, USA. */ /* @@ end of prolog @@ */ diff -uprN binutils-2.16.90.0.3/intl/intl-compat.c binutils-2.16.91.0.1/intl/intl-compat.c --- binutils-2.16.90.0.3/intl/intl-compat.c 1999-06-03 11:02:09.000000000 -0700 +++ binutils-2.16.91.0.1/intl/intl-compat.c 2005-06-22 13:53:35.350243801 -0700 @@ -14,7 +14,7 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include diff -uprN binutils-2.16.90.0.3/intl/intlh.inst.in binutils-2.16.91.0.1/intl/intlh.inst.in --- binutils-2.16.90.0.3/intl/intlh.inst.in 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/intl/intlh.inst.in 2005-06-22 13:53:35.350243801 -0700 @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _LIBINTL_H diff -uprN binutils-2.16.90.0.3/intl/l10nflist.c binutils-2.16.91.0.1/intl/l10nflist.c --- binutils-2.16.90.0.3/intl/l10nflist.c 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/intl/l10nflist.c 2005-06-22 13:53:35.351243636 -0700 @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include diff -uprN binutils-2.16.90.0.3/intl/libgettext.h binutils-2.16.91.0.1/intl/libgettext.h --- binutils-2.16.90.0.3/intl/libgettext.h 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/intl/libgettext.h 2005-06-22 13:53:35.351243636 -0700 @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* Because on some systems (e.g. Solaris) we sometimes have to include the systems libintl.h as well as this file we have more complex diff -uprN binutils-2.16.90.0.3/intl/libintl.glibc binutils-2.16.91.0.1/intl/libintl.glibc --- binutils-2.16.90.0.3/intl/libintl.glibc 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/intl/libintl.glibc 2005-06-22 13:53:35.352243471 -0700 @@ -18,8 +18,8 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, + Boston, MA 02110-1301, USA. */ #ifndef _LIBINTL_H #define _LIBINTL_H 1 diff -uprN binutils-2.16.90.0.3/intl/linux-msg.sed binutils-2.16.91.0.1/intl/linux-msg.sed --- binutils-2.16.90.0.3/intl/linux-msg.sed 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/intl/linux-msg.sed 2005-06-22 13:53:35.352243471 -0700 @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # # The first directive in the .msg should be the definition of the diff -uprN binutils-2.16.90.0.3/intl/loadinfo.h binutils-2.16.91.0.1/intl/loadinfo.h --- binutils-2.16.90.0.3/intl/loadinfo.h 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/intl/loadinfo.h 2005-06-22 13:53:35.352243471 -0700 @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef PARAMS # if __STDC__ diff -uprN binutils-2.16.90.0.3/intl/loadmsgcat.c binutils-2.16.91.0.1/intl/loadmsgcat.c --- binutils-2.16.90.0.3/intl/loadmsgcat.c 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/intl/loadmsgcat.c 2005-06-22 13:53:35.353243306 -0700 @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include diff -uprN binutils-2.16.90.0.3/intl/localealias.c binutils-2.16.91.0.1/intl/localealias.c --- binutils-2.16.90.0.3/intl/localealias.c 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/intl/localealias.c 2005-06-22 13:53:35.353243306 -0700 @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include diff -uprN binutils-2.16.90.0.3/intl/Makefile.in binutils-2.16.91.0.1/intl/Makefile.in --- binutils-2.16.90.0.3/intl/Makefile.in 2004-12-20 11:16:51.000000000 -0800 +++ binutils-2.16.91.0.1/intl/Makefile.in 2005-06-22 13:53:35.340245453 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. PACKAGE = @PACKAGE@ VERSION = @VERSION@ diff -uprN binutils-2.16.90.0.3/intl/po2tbl.sed.in binutils-2.16.91.0.1/intl/po2tbl.sed.in --- binutils-2.16.90.0.3/intl/po2tbl.sed.in 1999-06-03 11:02:09.000000000 -0700 +++ binutils-2.16.91.0.1/intl/po2tbl.sed.in 2005-06-22 13:53:35.354243140 -0700 @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # 1 { i\ diff -uprN binutils-2.16.90.0.3/intl/textdomain.c binutils-2.16.91.0.1/intl/textdomain.c --- binutils-2.16.90.0.3/intl/textdomain.c 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/intl/textdomain.c 2005-06-22 13:53:35.354243140 -0700 @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include diff -uprN binutils-2.16.90.0.3/intl/xopen-msg.sed binutils-2.16.91.0.1/intl/xopen-msg.sed --- binutils-2.16.90.0.3/intl/xopen-msg.sed 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/intl/xopen-msg.sed 2005-06-22 13:53:35.354243140 -0700 @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # # The first directive in the .msg should be the definition of the diff -uprN binutils-2.16.90.0.3/ld/acinclude.m4 binutils-2.16.91.0.1/ld/acinclude.m4 --- binutils-2.16.90.0.3/ld/acinclude.m4 2000-09-02 15:22:18.000000000 -0700 +++ binutils-2.16.91.0.1/ld/acinclude.m4 2005-06-22 13:53:35.401235376 -0700 @@ -1,17 +1,2 @@ sinclude(../bfd/acinclude.m4) sinclude(../libiberty/aclibdl.m4) - -dnl sinclude(../libtool.m4) already included in bfd/acinclude.m4 -dnl The lines below arrange for aclocal not to bring libtool.m4 -dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake -dnl to add a definition of LIBTOOL to Makefile.in. -ifelse(yes,no,[ -AC_DEFUN([AM_PROG_LIBTOOL],) -AC_SUBST(LIBTOOL) -]) - -dnl sinclude(../gettext.m4) already included in bfd/acinclude.m4 -ifelse(yes,no,[ -AC_DEFUN([CY_WITH_NLS],) -AC_SUBST(INTLLIBS) -]) diff -uprN binutils-2.16.90.0.3/ld/aclocal.m4 binutils-2.16.91.0.1/ld/aclocal.m4 --- binutils-2.16.90.0.3/ld/aclocal.m4 2004-09-27 13:46:07.000000000 -0700 +++ binutils-2.16.91.0.1/ld/aclocal.m4 2005-06-22 13:53:35.403235046 -0700 @@ -1,145 +1,771 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p6 +# generated automatically by aclocal 1.9.5 -*- Autoconf -*- -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. - -sinclude(../bfd/acinclude.m4) -sinclude(../libiberty/aclibdl.m4) - -dnl sinclude(../libtool.m4) already included in bfd/acinclude.m4 -dnl The lines below arrange for aclocal not to bring libtool.m4 -dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake -dnl to add a definition of LIBTOOL to Makefile.in. -ifelse(yes,no,[ -AC_DEFUN([AM_PROG_LIBTOOL],) -AC_SUBST(LIBTOOL) -]) - -dnl sinclude(../gettext.m4) already included in bfd/acinclude.m4 -ifelse(yes,no,[ -AC_DEFUN([CY_WITH_NLS],) -AC_SUBST(INTLLIBS) -]) - -# isc-posix.m4 serial 2 (gettext-0.11.2) -dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -# This file is not needed with autoconf-2.53 and newer. Remove it in 2005. - -# This test replaces the one in autoconf. -# Currently this macro should have the same name as the autoconf macro -# because gettext's gettext.m4 (distributed in the automake package) -# still uses it. Otherwise, the use in gettext.m4 makes autoheader -# give these diagnostics: -# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX -# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX - -undefine([AC_ISC_POSIX]) - -AC_DEFUN([AC_ISC_POSIX], - [ - dnl This test replaces the obsolescent AC_ISC_POSIX kludge. - AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) - ] -) - -# Do all the work for Automake. This macro actually does too much -- -# some checks are only needed if your package does certain things. -# But this isn't really a big deal. - -# serial 1 - -dnl Usage: -dnl AM_INIT_AUTOMAKE(package,version, [no-define]) - -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL]) -PACKAGE=[$1] -AC_SUBST(PACKAGE) -VERSION=[$2] -AC_SUBST(VERSION) -dnl test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -fi -ifelse([$3],, -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) -AC_REQUIRE([AM_SANITY_CHECK]) -AC_REQUIRE([AC_ARG_PROGRAM]) -dnl FIXME This is truly gross. -missing_dir=`cd $ac_aux_dir && pwd` -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir) -AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir) -AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) -AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -AC_REQUIRE([AC_PROG_MAKE_SET])]) - -# Copyright 2002 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 -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. -AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"]) +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.4-p6])]) + [AM_AUTOMAKE_VERSION([1.9.5])]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 7 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # -# Check to make sure that the build environment is sane. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. # +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_PROG_LEX +# ----------- +# Autoconf leaves LEX=: if lex or flex can't be found. Change that to a +# "missing" invocation, for better error output. +AC_DEFUN([AM_PROG_LEX], +[AC_PREREQ(2.50)dnl +AC_REQUIRE([AM_MISSING_HAS_RUN])dnl +AC_REQUIRE([AC_PROG_LEX])dnl +if test "$LEX" = :; then + LEX=${am_missing_run}flex +fi]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. +# +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 -echo timestamp > conftestfile +echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "[$]*" = "X"; then + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` + set X `ls -t $srcdir/configure conftest.file` fi - if test "[$]*" != "X $srcdir/configure conftestfile" \ - && test "[$]*" != "X conftestfile $srcdir/configure"; then + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a @@ -149,7 +775,7 @@ if ( alias in your environment]) fi - test "[$]2" = conftestfile + test "$[2]" = conftest.file ) then # Ok. @@ -158,87 +784,130 @@ else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -rm -f conftest* AC_MSG_RESULT(yes)]) -dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) -dnl The program must properly implement --version. -AC_DEFUN([AM_MISSING_PROG], -[AC_MSG_CHECKING(for working $2) -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if ($2 --version) < /dev/null > /dev/null 2>&1; then - $1=$2 - AC_MSG_RESULT(found) -else - $1="$3/missing $2" - AC_MSG_RESULT(missing) +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) fi -AC_SUBST($1)]) +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Like AC_CONFIG_HEADER, but automatically create stamp file. +# Check how to create a tarball. -*- Autoconf -*- -AC_DEFUN([AM_CONFIG_HEADER], -[AC_PREREQ([2.12]) -AC_CONFIG_HEADER([$1]) -dnl When config.status generates a header, we must update the stamp-h file. -dnl This file resides in the same directory as the config header -dnl that is generated. We must strip everything past the first ":", -dnl and everything past the last "/". -AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl -ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, -<>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, -<>; do - case " <<$>>CONFIG_HEADERS " in - *" <<$>>am_file "*<<)>> - echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false ;; esac - am_indx=`expr "<<$>>am_indx" + 1` -done<<>>dnl>>) -changequote([,]))]) - - -dnl AM_PROG_LEX -dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT -AC_DEFUN([AM_PROG_LEX], -[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1) -AC_CHECK_PROGS(LEX, flex lex, [$missing_dir/missing flex]) -AC_PROG_LEX -AC_DECL_YYTEXT]) - -# Add --enable-maintainer-mode option to configure. -# From Jim Meyering -# serial 1 - -AC_DEFUN([AM_MAINTAINER_MODE], -[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode is disabled by default - AC_ARG_ENABLE(maintainer-mode, -[ --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer], - USE_MAINTAINER_MODE=$enableval, - USE_MAINTAINER_MODE=no) - AC_MSG_RESULT($USE_MAINTAINER_MODE) - AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) - MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST(MAINT)dnl -] -) - -# Define a conditional. - -AC_DEFUN([AM_CONDITIONAL], -[AC_SUBST($1_TRUE) -AC_SUBST($1_FALSE) -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi]) + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR +m4_include([acinclude.m4]) diff -uprN binutils-2.16.90.0.3/ld/ChangeLog binutils-2.16.91.0.1/ld/ChangeLog --- binutils-2.16.90.0.3/ld/ChangeLog 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/ld/ChangeLog 2005-06-22 13:53:35.365241323 -0700 @@ -1,3 +1,357 @@ +2005-06-16 Alexander Klimov + + * emultempl/armelf.em: Add quotes to avoid a null test + expression. + +2005-06-12 Daniel Jacobowitz + + * ld.texinfo (Command Line Options): Add @item for --hash-size. + +2005-06-10 Alan Modra + + * scripttempt/elf.sc (.bss): Align tail in a way that allows + empty section pruning. + +2005-06-09 Steve Ellcey + + * configure.in (AM_BINUTILS_WARNINGS): Add. + (BFD_NEED_DECLARATION) Replace with AC_CHECK_DECLS. + * config.in: Regenerate. + * configure: Regenerate. + * sysdep.h (NEED_DECLARATION_*): Replace with HAVE_DECL_* + * ldmain.c: Ditto. + +2005-06-09 Alan Modra + + * ldexp.c (fold_unary ): Revert last change. + +2005-06-09 Alan Modra + + * ld.h (lang_phase_type): Move to.. + * ldexp.h: ..here. Add lang_mark_phase_enum. + (node_type): Remove etree_undef and etree_unspec. + (exp_data_seg): Delete. + (struct ldexp_control, expld): New. + (invalid, exp_mark_used_section): Delete. + (exp_fold_tree, exp_get_vma, exp_get_value_int, exp_get_fill, + exp_get_abs_int): Update prototypes. + * ldexp.c (assigning_to_dot): Delete. + (expld): Define. + (make_abs): Operate directly on expld.result. Update all callers. + (new_abs): Likewise. Return void. + (new_rel_from_abs): Rename from new_rel_from_section. + (new_rel, new_rel_from_abs): Operate on expld.result and return void. + Update all callers. + (fold_unary): Operate on expld.result and return void. Remove + "current_section", "allocation_done", "dot", "dotp" and "mark_used" + params. Update all callers. + (fold_binary, fold_trinary, fold_name, exp_fold_tree_1): Likewise. + (fold_unary ): Ensure alignment is absolute. + (fold_unary ): Use make_abs. + (fold_unary ): Evaluate mark_phase as for + allocating_phase. + (fold_binary ): Ditto. + (fold_binary <'%','/'>): Don't error if marking. + (fold_name ): Don't call bfd_sizeof_headers when + marking. + (fold_name ): Remove FIXME; -R is handled correctly. Don't + error when marking. + (fold_name ): Don't set SEC_KEEP. + (exp_fold_tree_1): Don't error when marking. + (exp_fold_tree_1 ): Evaluate in all phases except first. + (exp_fold_tree_1 ): Don't check for NULL + current section, instead check for NULL dotp. + (exp_fold_tree_1 ): Don't evaluate the assignment + source unless the symbol is referenced and undefined. + (exp_fold_tree): Remove "allocation_done" and "dot" params. Save + params to expld. + (exp_fold_tree_no_dot): Remove "current_section", "allocation_done + and "mark_used" params. Save params to expld. Update all callers. + (exp_assop): Do without temp var. + (exp_print_tree ): Delete code. + (exp_get_vma): Remove "allocation_done" param. Correct error return. + (exp_get_fill, exp_get_abs_int): Likewise. + (exp_get_value_int): Remove "allocation_done" param. + (exp_mark_used_section): Delete. + * ldgram.y (fill_exp): Update exp_get_fill call. + (origin_spec, length_spec): Update exp_get_vma call. + * ldlang.c (lang_init): Don't bother clearing lang_statement_iteration. + (lang_mark_used_section_1, lang_mark_used_section): Delete. + (strip_excluded_output_sections): Call one_lang_size_sections_pass in + marking mode. Merge old lang_mark_used_section code. Correct handling + of output sections with excluded input sections and data statements. + Don't drop non-zero sized sections. Don't zap os->bfd_section. + Do set SEC_EXCLUDE when appropriate. + (print_output_section_statement): Update for changed ldexp.c + interface. + (print_assignment, lang_size_sections_1): Likewise. + (lang_do_assignments_1, lang_enter_output_section_statement): Likewise. + (lang_new_phdr, lang_record_phdrs): Likewise. + (lang_size_sections): Likewise. + (insert_pad): Use following statement if it is a pad, rather than + creating a new one. + (lang_size_sections_1 ): Do + process ignored output section to set vma and lma, but don't + update dot for these sections. Don't error if marking. + (lang_size_sections_1 ): Don't + update dot for ignored sections. + (lang_size_sections_1 ): Don't mark absolute + section with SEC_ALLOC. + (one_lang_size_sections_pass): New function. + (lang_size_sections): Remove first five params. Set expld.phase on + entry and exit. Use one_lang_size_sections_pass. + (lang_do_assignments): Remove all params. Update all callers. + (lang_reset_memory_regions): Clear os->processed for all output + section statements. + * ldlang.h (lang_do_assignments): Update prototype. + (lang_size_sections): Likewise. + (one_lang_size_sections_pass): Declare. + * pe-dll.c (pe_dll_fill_sections, pe_exe_fill_sections): Update + lang_size_sections and lang_do_assignments calls. + * emultempl/elf32.em (layout_sections_again): Likewise. + * emultempl/ppc64elf.em (ppc_before_allocation): Use + one_lang_size_sections_pass. + +2005-06-08 Aldy Hernandez + + * emulparams/elf32ms1.sh: New. + +2005-06-07 Eric Christopher + + * Makefile.am (eelf32ms1.c): Use tab. + * Makefile.in: Regenerate. + +2005-06-07 Aldy Hernandez + Michael Snyder + Stan Cox + + * configure.tgt: Same. + + * Makefile.am (ALL_EMULATIONS): Depend on eelf32ms1.o. + (eelf32ms1.c): Add eelf32ms1.c rule. + + * Makefile.in: Regenerate. + +2005-06-06 Alan Modra + + * emultempl/ppc64elf.em (ppc_before_allocation): Always run + ppc64_elf_edit_opd. + +2005-06-05 H.J. Lu + + * ldexp.c (exp_mark_used_section): Set SEC_KEEP on current + section only if the symbol will be defined. + +2005-06-04 H.J. Lu + + PR 992 + * ldexp.c (exp_mark_used_section): Set SEC_KEEP on current + section for etree_assign, etree_provide and etree_provided. + Call fold_binary on etree_binary. + + * ldlang.c (lang_mark_used_section_1): Handle load base. + +2005-06-03 Alan Modra + + * ldmain.c (link_callbacks): Add einfo. + (add_archive_element): Use passed info, not link_info. + (constructor_callback): Likewise. + (reloc_overflow): Don't handle null bfd specially. + (reloc_dangerous, unattached_reloc): Likewise. + * ldmisc.c (vfinfo ): Print "ld generated" for null bfd. + (vfinfo ): Handle null bfd. Wrap comments. + +2005-06-02 Alan Modra + + * ldexp.h (etree_value_type): Use "asection *" in place of + "struct lang_output_section_statement_struct *" for "section". + (exp_fold_tree): Likewise. + (exp_mark_used_section): Likewise. + * ldexp.c (new_rel, new_rel_from_section, fold_unary, fold_binary, + fold_trinary, fold_name, exp_fold_tree_1, exp_fold_tree, + exp_mark_used_section): Likewise for "current_section" param. + (make_abs, new_abs, exp_binop, exp_unop, exp_get_vma, exp_get_fill, + exp_get_abs_int): Adjust for above changes. + * ldlang.c (lang_mark_used_section_1, print_assignment, + lang_size_sections_1, lang_do_assignments_1): Likewise. + * ldexp.c (fold_name): Init entire result struct. + +2005-06-01 Maciej W. Rozycki + + * emulparams/elf32btsmip.sh: Unset DATA_ADDR. + +2005-05-31 Zack Weinberg + + * ldlang.c (entry_symbol_default): New file-scope global. + (lang_finish): Use it, not a hardwired "start". + (lang_default_entry): Set it. + * ldlang.h: Declare lang_default_entry. + * emultempl/beos.em, emultempl/pe.em: Use lang_default_entry, + not lang_add_entry, to override default entry point symbol. + +2005-05-29 Richard Henderson + + * emulparams/elf64alpha.sh (PLT): New. + (TEXT_PLT): New. + * emultempl/alphaelf.em (disable_relaxation): New. + (limit_32bit): Rename from elf64alpha_32bit; update all users. + (elf64_alpha_use_secureplt): Declare. + (bfd_elf64_alpha_vec, bfd_elf64_alpha_freebsd_vec): Declare. + (alpha_after_open): New. + (alpha_before_allocation): New. + (OPTION_NO_RELAX, OPTION_SECUREPLT, OPTION_NO_SECUREPLT): New. + (PARSE_AND_LIST_LONGOPTS): Include them. + (PARSE_AND_LIST_OPTIONS): Likewise. + (PARSE_AND_LIST_ARGS_CASES): Likewise. + (LDEMUL_AFTER_OPEN, LDEMUL_BEFORE_ALLOCATION): New. + * scripttempl/elf.sc (TEXT_PLT): New. + (PLT): Use it. + +2005-05-27 Andreas Schwab + + * configure.host (HOSTING_LIBS): Add libunwind.a if it exists. + +2005-05-24 Alan Modra + + * emultempl/ppc32elf.em (after_allocation): Don't call + ppc_elf_set_sdata_syms when relocatable. + +2005-05-21 H.J. Lu + + * Makefile.am (ld.1): Revert the last 2 changes. + (info-recursive): Depend on ld.1. + * Makefile.in: Regenerated. + +2005-05-21 H.J. Lu + + * Makefile.am (ld.1): Depend on "info" instead of + "configdoc.texi ldver.texi". + * Makefile.in: Regenerated. + +2005-05-21 H.J. Lu + + * Makefile.am (ld.1): Depend on "info". + * Makefile.in: Regenerated. + +2005-05-19 Zack Weinberg + + * Makefile.am: Have 'all' depend on 'info' and 'ld.1'. + * Makefile.in: Regenerate. + +2005-05-17 Zack Weinberg + + * ld-arm/mixed-app.d: Adjust expected disassembly a little. + +2005-05-17 Daniel Jacobowitz + + * Makefile.am (ldver.texi): Don't use $<. + * Makefile.in: Regenerated. + +2005-05-17 Daniel Jacobowitz + + * Makefile.am (AM_MAKEINFOFLAGS, TEXI2DVI): Explicitly include + $(srcdir) before $(BFDDIR)/doc. + * Makefile.in: Regenerated. + +2005-05-17 H.J. Lu + + PR 797 + * ldexp.c (exp_fold_tree_1): Renamed from exp_fold_tree and + take take a bfd_boolean, mark_used. Ignore assert failure if + mark_used is TRUE. + (exp_fold_tree) Call exp_fold_tree_1 with mark_used == FALSE. + (exp_fold_tree_no_dot): Updated to take a bfd_boolean, + mark_used and pass down. + (fold_unary): Likewise. + (fold_binary): Likewise. + (fold_trinary): Likewise. + (exp_binop): Add FALSE to call to exp_fold_tree_no_dot. + (exp_trinop): Likewise. + (exp_unop): Likewise. + (exp_nameop): Likewise. + (exp_get_vma): Likewise. + (exp_get_fill): Likewise. + (exp_get_abs_int): Likewise. + (fold_name): Likewise. Set SEC_KEEP in output section flags. + (exp_mark_used_section): New. + + * ldexp.h (exp_mark_used_section): New. + + * ldlang.c (lang_output_section_statement_lookup_1): Set the + ignored field to FALSE. + (lang_mark_used_section_1): New. + (lang_mark_used_section): Call lang_mark_used_section_1. + (strip_excluded_output_sections): Call lang_mark_used_section + and check for unused sections. + (lang_size_sections_1): Skip an output section if it should + be ignored. + (lang_do_assignments_1): Likewise. + (lang_process): Don't call lang_mark_used_section here. + + * ldlang.h (lang_output_section_statement_type): Change + all_input_readonly to bitfield. Add ignored. + +2005-05-17 Lennert Buytenhek + Peter S. Mazinger" + + * emulparams/armelf_linux.sh (GENERATE_PIE_SCRIPT): Define as "yes". + * emulparams/hppalinux.sh (GENERATE_PIE_SCRIPT): Define as "yes". + +2005-05-17 Julian Brown + + * ldlang.c (print_assignment): Do not rely upon a valid result + having a section associated with it. + +2005-05-17 Nick Clifton + + * ldlang.c (Scan_for_self_assignment): Check an assignment tree to + see if the same value is being used on the rhs as on the lhs. + (print_assignment): Call scan_for_self_assignment and if it + returns true, do no display the result of the computation but + instead just the final value of the symbol on the lhs. + * ld.texinfo: Document this behaviour and provide an example of + when it will happen. + +2005-05-15 Daniel Jacobowitz + + * Makefile.am (AM_MAKEINFOFLAGS): Define. + (TEXI2DVI): Define. + (ldver.texi): Depend on distributed files instead of built files. + (ld.info): Include $(srcdir) in the rule target. Remove actions. + (ld.dvi): Remove actions. + (MAINTAINERCLEANFILES): Add configdoc.texi. + (CONFIG_STATUS_DEPENDENCIES): Add bfd/configure.in. + (install-data-local): Renamed from install. + (Makefile): Remove explicit dependency. + * acinclude.m4: Remove obsolete code. + * configure.in: Update AC_PREREQ. Remove extra $CONFIG_SHELL. + * Makefile.in, aclocal.m4, config.in, configure: Regenerated. + +2005-05-11 Bob Wilson + + * scripttempl/elfxtensa.sc: Sync up with elf.sc. + * emulparams/elf32xtensa.sh (PLT, GOT): Define. + +2005-05-11 Alan Modra + + * ldgram.y: Add SPECIAL token. + (sect_constraint): Handle SPECIAL. + * ldlang.c (lang_output_section_find_1): Don't match SPECIAL. + (map_input_to_output_sections): Likewise. + * ldlex.l (SPECIAL): Define. + * emulparams/elf32ppc.sh (DATA_GOT, SDATA_GOT, SEPARATE_GOTPLT, + GOT, PLT, GOTPLT): Define. + * emultempl/ppc32elf.em (old_plt, old_got): New static vars. + (ppc_after_open): New function. + (PARSE_AND_LIST_PROLOGUE): Define OPTION_OLD_LPT and OPTION_OLD_GOT. + (PARSE_AND_LIST_LONGOPTS): Add "bss-plt" and "sdata-got". + (PARSE_AND_LIST_OPTIONS): Document them. + (PARSE_AND_LIST_ARGS_CASES): Handle them. + (LDEMUL_AFTER_OPEN): Define. + * scripttempl/elf.sc (PLT): Don't override existing define. + (DATA_GOT, SDATA_GOT): Define and use to enable alternate got + placement rather than using NO_SMALL_DATA. Emit GOTPLT for RELRO_NOW. + 2005-05-10 Alan Modra * scripttempl/elf.sc (DATA_SEGMENT_RELRO_GOTPLT_END): Delete. @@ -164,7 +518,7 @@ 2005-04-07 Nick Clifton * emultempl/m68kcoff.em: Include ldexp.h and ldlang.h so that - ldfile.h can use the lang_input_statement type. + ldfile.h can use the lang_input_statement type. 2005-04-06 Jakub Jelinek diff -uprN binutils-2.16.90.0.3/ld/ChangeLog.linux binutils-2.16.91.0.1/ld/ChangeLog.linux --- binutils-2.16.90.0.3/ld/ChangeLog.linux 2004-09-15 12:05:04.000000000 -0700 +++ binutils-2.16.91.0.1/ld/ChangeLog.linux 2005-06-22 13:53:35.368240828 -0700 @@ -1,3 +1,10 @@ +2005-05-14 H.J. Lu + + * acinclude.m4: Updated. + * aclocal.m4: Likewise. + * config.in: Likewise. + * configure: Likewise. + 2004-09-01 H.J. Lu * lexsup.c (ld_options): Use N_("DSO:FUNCTION") for diff -uprN binutils-2.16.90.0.3/ld/config.in binutils-2.16.91.0.1/ld/config.in --- binutils-2.16.90.0.3/ld/config.in 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/ld/config.in 2005-06-22 13:53:35.409234055 -0700 @@ -1,180 +1,222 @@ -/* config.in. Generated automatically from configure.in by autoheader. */ +/* config.in. Generated from configure.in by autoheader. */ -/* Define if using alloca.c. */ +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +#undef CRAY_STACKSEG_END + +/* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA -/* Define to empty if the keyword does not work. */ -#undef const +/* Define to 1 if NLS is requested */ +#undef ENABLE_NLS -/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. - This function is required for alloca.c support on those systems. */ -#undef CRAY_STACKSEG_END +/* Additional extension a shared object might have. */ +#undef EXTRA_SHLIB_EXTENSION -/* Define if you have alloca, as a function or macro. */ +/* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA -/* Define if you have and it should be used (not on Ultrix). */ +/* Define to 1 if you have and it should be used (not on Ultrix). + */ #undef HAVE_ALLOCA_H -/* Define if you have a working `mmap' system call. */ -#undef HAVE_MMAP +/* Define to 1 if you have the header file. */ +#undef HAVE_ARGZ_H -/* Define as __inline if that's what the C compiler calls it. */ -#undef inline +/* Define to 1 if you have the `dcgettext' function. */ +#undef HAVE_DCGETTEXT -/* Define to `long' if doesn't define. */ -#undef off_t +/* Define to 1 if you have the declaration of `environ', and to 0 if you + don't. */ +#undef HAVE_DECL_ENVIRON + +/* Define to 1 if you have the declaration of `free', and to 0 if you don't. + */ +#undef HAVE_DECL_FREE + +/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't. + */ +#undef HAVE_DECL_GETENV -/* Define to `unsigned' if doesn't define. */ -#undef size_t +/* Is the prototype for getopt in in the expected format? */ +#undef HAVE_DECL_GETOPT -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown - */ -#undef STACK_DIRECTION +/* Define to 1 if you have the declaration of `sbrk', and to 0 if you don't. + */ +#undef HAVE_DECL_SBRK + +/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. + */ +#undef HAVE_DECL_STRSTR -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_DIRENT_H -/* Define if lex declares yytext as a char * by default, not a char[]. */ -#undef YYTEXT_POINTER +/* Define to 1 if you have the `getcwd' function. */ +#undef HAVE_GETCWD -/* Define if you have the __argz_count function. */ -#undef HAVE___ARGZ_COUNT +/* Define to 1 if you have the `getpagesize' function. */ +#undef HAVE_GETPAGESIZE -/* Define if you have the __argz_next function. */ -#undef HAVE___ARGZ_NEXT +/* Define as 1 if you have gettext and don't want to use GNU gettext. */ +#undef HAVE_GETTEXT -/* Define if you have the __argz_stringify function. */ -#undef HAVE___ARGZ_STRINGIFY +/* Define to 1 if you have the `glob' function. */ +#undef HAVE_GLOB -/* Define if you have the dcgettext function. */ -#undef HAVE_DCGETTEXT +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H -/* Define if you have the getcwd function. */ -#undef HAVE_GETCWD +/* Define if your locale.h file contains LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES -/* Define if you have the getpagesize function. */ -#undef HAVE_GETPAGESIZE +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H -/* Define if you have the glob function. */ -#undef HAVE_GLOB +/* Define to 1 if you have the header file. */ +#undef HAVE_LOCALE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MALLOC_H -/* Define if you have the munmap function. */ +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define to 1 if you have the `munmap' function. */ #undef HAVE_MUNMAP -/* Define if you have the putenv function. */ +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NL_TYPES_H + +/* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV -/* Define if you have the realpath function. */ +/* Define to 1 if you have the `realpath' function. */ #undef HAVE_REALPATH -/* Define if you have the sbrk function. */ +/* Define to 1 if you have the `sbrk' function. */ #undef HAVE_SBRK -/* Define if you have the setenv function. */ +/* Define to 1 if you have the `setenv' function. */ #undef HAVE_SETENV -/* Define if you have the setlocale function. */ +/* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE -/* Define if you have the stpcpy function. */ +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define if you have the stpcpy function */ #undef HAVE_STPCPY -/* Define if you have the strcasecmp function. */ +/* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP -/* Define if you have the strchr function. */ +/* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR -/* Define if you have the header file. */ -#undef HAVE_ARGZ_H - -/* Define if you have the header file. */ -#undef HAVE_DIRENT_H - -/* Define if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define if you have the header file. */ -#undef HAVE_LOCALE_H - -/* Define if you have the header file. */ -#undef HAVE_MALLOC_H - -/* Define if you have the header file. */ -#undef HAVE_NDIR_H - -/* Define if you have the header file. */ -#undef HAVE_NL_TYPES_H - -/* Define if you have the header file. */ -#undef HAVE_STDLIB_H +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_STRING_H -/* Define if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define if you have the header file. */ +/* Define to 1 if you have the header file, and it defines `DIR'. + */ #undef HAVE_SYS_DIR_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file, and it defines `DIR'. + */ #undef HAVE_SYS_NDIR_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_VALUES_H +/* Define if weak symbol works. */ +#undef HAVE_WEAK_SYMBOL + +/* Define to 1 if you have the `__argz_count' function. */ +#undef HAVE___ARGZ_COUNT + +/* Define to 1 if you have the `__argz_next' function. */ +#undef HAVE___ARGZ_NEXT + +/* Define to 1 if you have the `__argz_stringify' function. */ +#undef HAVE___ARGZ_STRINGIFY + /* Name of package */ #undef PACKAGE -/* Version number of package */ -#undef VERSION +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT -/* Define if you have the stpcpy function */ -#undef HAVE_STPCPY +/* Define to the full name of this package. */ +#undef PACKAGE_NAME -/* Define if your locale.h file contains LC_MESSAGES. */ -#undef HAVE_LC_MESSAGES +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING -/* Define as 1 if you have gettext and don't want to use GNU gettext. */ -#undef HAVE_GETTEXT +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME -/* Define to 1 if NLS is requested */ -#undef ENABLE_NLS +/* Define to the version of this package. */ +#undef PACKAGE_VERSION -/* Is the prototype for getopt in in the expected format? */ -#undef HAVE_DECL_GETOPT +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS /* Use b modifier when opening binary files? */ #undef USE_BINARY_FOPEN -/* Define if strstr is not declared in system header files. */ -#undef NEED_DECLARATION_STRSTR - -/* Define if free is not declared in system header files. */ -#undef NEED_DECLARATION_FREE +/* Version number of package */ +#undef VERSION -/* Define if sbrk is not declared in system header files. */ -#undef NEED_DECLARATION_SBRK +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#undef YYTEXT_POINTER -/* Define if getenv is not declared in system header files. */ -#undef NEED_DECLARATION_GETENV +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const -/* Define if environ is not declared in system header files. */ -#undef NEED_DECLARATION_ENVIRON +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif -/* Additional extension a shared object might have. */ -#undef EXTRA_SHLIB_EXTENSION +/* Define to `long' if does not define. */ +#undef off_t +/* Define to `unsigned' if does not define. */ +#undef size_t diff -uprN binutils-2.16.90.0.3/ld/configure binutils-2.16.91.0.1/ld/configure --- binutils-2.16.90.0.3/ld/configure 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/ld/configure 2005-06-22 13:53:35.427231081 -0700 @@ -1,57 +1,325 @@ #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# Generated by GNU Autoconf 2.59. # +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + -# Defaults: -ac_help= +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help - --enable-shared[=PKGS] build shared libraries [default=yes]" -ac_help="$ac_help - --enable-static[=PKGS] build static libraries [default=yes]" -ac_help="$ac_help - --enable-fast-install[=PKGS] optimize for fast installation [default=yes]" -ac_help="$ac_help - --with-gnu-ld assume the C compiler uses GNU ld [default=no]" -ac_help="$ac_help - --disable-libtool-lock avoid locking (might break parallel builds)" -ac_help="$ac_help - --with-pic try to use only PIC/non-PIC objects [default=use both]" -ac_help="$ac_help - --with-lib-path=dir1:dir2... set default LIB_PATH" -ac_help="$ac_help - --enable-targets alternative target configurations" -ac_help="$ac_help - --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)" -ac_help="$ac_help - --with-sysroot[=DIR] Search for usr/lib et al within DIR." -ac_help="$ac_help - --enable-werror treat compile warnings as errors" -ac_help="$ac_help - --enable-build-warnings Enable build-time compiler warnings" -ac_help="$ac_help - --disable-nls do not use Native Language Support" -ac_help="$ac_help - --with-included-gettext use the GNU gettext library included here" -ac_help="$ac_help - --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer" +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="ldmain.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S RANLIB ac_ct_RANLIB LIBTOOL use_sysroot TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE WARN_CFLAGS NO_WERROR CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l YACC LEX LEXLIB LEX_OUTPUT_ROOT MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT HDEFINES HOSTING_CRT0 HOSTING_LIBS NATIVE_LIB_DIRS STRINGIFY EMUL EMULATION_OFILES EMUL_EXTRA_OFILES LIB_PATH EMULATION_LIBPATH TESTBFDLIB LIBOBJS LTLIBOBJS' +ac_subst_files='TDIRS' # Initialize some variables set by options. +ac_init_help= +ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. -build=NONE -cache_file=./config.cache +cache_file=/dev/null exec_prefix=NONE -host=NONE no_create= -nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE @@ -60,10 +328,15 @@ program_transform_name=s,x,x, silent= site= srcdir= -target=NONE verbose= x_includes=NONE x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' @@ -77,17 +350,9 @@ oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - ac_prev= for ac_option do - # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" @@ -95,59 +360,59 @@ do continue fi - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. - case "$ac_option" in + case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; + bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) - ac_prev=build ;; + ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; + build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) - datadir="$ac_optarg" ;; + datadir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "enable_${ac_feature}='$ac_optarg'" ;; + eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -156,95 +421,47 @@ do -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; + exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; -host | --host | --hos | --ho) - ac_prev=host ;; + ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; + host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; + includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; + infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; + libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; + libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ @@ -253,19 +470,19 @@ EOF -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; + localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; + mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) + | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ @@ -279,26 +496,26 @@ EOF -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; + oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; + prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; + program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; + program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ @@ -315,7 +532,7 @@ EOF | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; + program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) @@ -325,7 +542,7 @@ EOF ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; + sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ @@ -336,58 +553,57 @@ EOF | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; + sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; + site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; + srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; + sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; + ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; + target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "with_${ac_package}='$ac_optarg'" ;; + eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. @@ -398,99 +614,110 @@ EOF ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; + x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; + x_libraries=$ac_optarg ;; - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } fi -exec 5>./config.log -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; esac done -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=ldmain.c # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. @@ -500,799 +727,2419 @@ else fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } fi fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi +Usage: $0 [OPTION]... [VAR=VALUE]... -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi +Defaults for the options are specified in brackets. -echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:556: 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 - rm -rf conftest* - ac_cv_cygwin=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_cygwin=no -fi -rm -f conftest* -rm -f conftest* -fi + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] -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:589: 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 - rm -rf conftest* - ac_cv_mingw32=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_mingw32=no -fi -rm -f conftest* -rm -f conftest* +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF fi -echo "$ac_t""$ac_cv_mingw32" 1>&6 -MINGW32= -test "$ac_cv_mingw32" = yes && MINGW32=yes - +if test -n "$ac_init_help"; then -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + cat <<\_ACEOF +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-shared=PKGS build shared libraries default=yes + --enable-static=PKGS build static libraries default=yes + --enable-fast-install=PKGS optimize for fast installation default=yes + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-targets alternative target configurations + --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) + --enable-werror treat compile warnings as errors + --enable-build-warnings Enable build-time compiler warnings + --disable-nls do not use Native Language Support + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer -# Do some error checking and defaulting for the host and target type. -# The inputs are: -# configure --host=HOST --target=TARGET --build=BUILD NONOPT -# -# The rules are: -# 1. You are not allowed to specify --host, --target, and nonopt at the -# same time. -# 2. Host defaults to nonopt. -# 3. If nonopt is not specified, then host defaults to the current host, -# as determined by config.guess. -# 4. Target and build default to nonopt. -# 5. If nonopt is not specified, then target and build default to host. +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld default=no + --with-pic try to use only PIC/non-PIC objects default=use both + --with-lib-path=dir1:dir2... set default LIB_PATH + --with-sysroot=DIR Search for usr/lib et al within DIR. + --with-included-gettext use the GNU gettext library included here + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -case $host---$target---$nonopt in -NONE---*---* | *---NONE---* | *---*---NONE) ;; -*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; esac + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:666: checking host system type" >&5 +It was created by $as_me, which was +generated by GNU Autoconf 2.59. Invocation command line was -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac + $ $0 $@ -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - -echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:687: checking target system type" >&5 - -target_alias=$target -case "$target_alias" in -NONE) - case $nonopt in - NONE) target_alias=$host_alias ;; - *) target_alias=$nonopt ;; - esac ;; -esac - -target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` -target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$target" 1>&6 - -echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:705: checking build system type" >&5 - -build_alias=$build -case "$build_alias" in -NONE) - case $nonopt in - NONE) build_alias=$host_alias ;; - *) build_alias=$nonopt ;; - esac ;; -esac - -build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` -build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$build" 1>&6 +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` -test "$host_alias" != "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- +_ASUNAME +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done - echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6 -echo "configure:729: checking for strerror in -lcposix" >&5 -ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lcposix $LIBS" -cat > conftest.$ac_ext <&5 -int main() { -strerror() -; return 0; } -EOF -if { (eval echo configure:748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" +cat >&5 <<_ACEOF -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -lcposix" -else - echo "$ac_t""no" 1>&6 -fi - +## ----------- ## +## Core tests. ## +## ----------- ## +_ACEOF -BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in` -am__api_version="1.4" -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:785: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6 +if test "${ac_cv_target+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_target_alias=$target_alias +test "x$ac_cv_target_alias" = "x" && + ac_cv_target_alias=$ac_cv_host_alias +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6 +target=$ac_cv_target +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +echo "$as_me:$LINENO: checking for library containing strerror" >&5 +echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6 +if test "${ac_cv_search_strerror+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_strerror=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strerror (); +int +main () +{ +strerror (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_strerror="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_strerror" = no; then + for ac_lib in cposix; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strerror (); +int +main () +{ +strerror (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_strerror="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext done - IFS="$ac_save_IFS" +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 +echo "${ECHO_T}$ac_cv_search_strerror" >&6 +if test "$ac_cv_search_strerror" != no; then + test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS" + +fi + + +BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in` +am__api_version="1.9" +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + fi if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" + INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. - INSTALL="$ac_install_sh" + INSTALL=$ac_install_sh fi fi -echo "$ac_t""$INSTALL" 1>&6 +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:838: checking whether build environment is sane" >&5 +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 -echo timestamp > conftestfile +echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` + set X `ls -t $srcdir/configure conftest.file` fi - if test "$*" != "X $srcdir/configure conftestfile" \ - && test "$*" != "X conftestfile $srcdir/configure"; then + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". - { echo "configure: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } fi - test "$2" = conftestfile + test "$2" = conftest.file ) then # Ok. : else - { echo "configure: error: newly created file is older than distributed files! -Check your system clock" 1>&2; exit 1; } -fi -rm -f conftest* -echo "$ac_t""yes" 1>&6 -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" + program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi + +for ac_prog in gawk mawk nawk awk +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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," + test -n "$AWK" && break +done -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:895: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftestmake <<\EOF + cat >conftest.make <<\_ACEOF all: - @echo 'ac_maketemp="${MAKE}"' -EOF + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi -rm -f conftestmake +rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 SET_MAKE= else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +DEPDIR="${am__leading_dot}deps" + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi -PACKAGE=ld - -VERSION=${BFD_VERSION} -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; } -fi -cat >> confdefs.h <&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf -cat >> confdefs.h <&6 -echo "configure:941: checking for working aclocal-${am__api_version}" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (aclocal-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then - ACLOCAL=aclocal-${am__api_version} - echo "$ac_t""found" 1>&6 -else - ACLOCAL="$missing_dir/missing aclocal-${am__api_version}" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:954: checking for working autoconf" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoconf --version) < /dev/null > /dev/null 2>&1; then - AUTOCONF=autoconf - echo "$ac_t""found" 1>&6 -else - AUTOCONF="$missing_dir/missing autoconf" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working automake-${am__api_version}""... $ac_c" 1>&6 -echo "configure:967: checking for working automake-${am__api_version}" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (automake-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then - AUTOMAKE=automake-${am__api_version} - echo "$ac_t""found" 1>&6 -else - AUTOMAKE="$missing_dir/missing automake-${am__api_version}" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:980: checking for working autoheader" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoheader --version) < /dev/null > /dev/null 2>&1; then - AUTOHEADER=autoheader - echo "$ac_t""found" 1>&6 -else - AUTOHEADER="$missing_dir/missing autoheader" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:993: checking for working makeinfo" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (makeinfo --version) < /dev/null > /dev/null 2>&1; then - MAKEINFO=makeinfo - echo "$ac_t""found" 1>&6 +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' else - MAKEINFO="$missing_dir/missing makeinfo" - echo "$ac_t""missing" 1>&6 + AMDEP_TRUE='#' + AMDEP_FALSE= fi -# Check whether --enable-shared or --disable-shared was given. -if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - p=${PACKAGE-default} -case $enableval in -yes) enable_shared=yes ;; -no) enable_shared=no ;; -*) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac -else - enable_shared=yes +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } fi -# Check whether --enable-static or --disable-static was given. -if test "${enable_static+set}" = set; then - enableval="$enable_static" - p=${PACKAGE-default} -case $enableval in -yes) enable_static=yes ;; -no) enable_static=no ;; -*) - enable_static=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac -else - enable_static=yes +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi fi -# Check whether --enable-fast-install or --disable-fast-install was given. -if test "${enable_fast_install+set}" = set; then - enableval="$enable_fast_install" - p=${PACKAGE-default} -case $enableval in -yes) enable_fast_install=yes ;; -no) enable_fast_install=no ;; -*) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac -else - enable_fast_install=yes -fi -# Extract the first word of "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:1079: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +# Define the identity of the package. + PACKAGE=ld + VERSION=${BFD_VERSION} + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -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:1109: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1160: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + STRIP=$ac_ct_STRIP else - echo "$ac_t""no" 1>&6 + STRIP="$ac_cv_prog_STRIP" fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } + fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1192: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross +AMTAR=${AMTAR-"${am_missing_run}tar"} -cat > conftest.$ac_ext << EOF +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' -#line 1203 "configure" -#include "confdefs.h" -main(){return(0);} -EOF -if { (eval echo configure:1208: \"$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 - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1234: 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:1239: 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 + + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir else - ac_cv_prog_gcc=no + am_cv_CC_dependencies_compiler_type=none fi + fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1267: 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 - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' else - ac_cv_prog_cc_g=no + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= fi -rm -f conftest* -fi -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi + + +# Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + p=${PACKAGE-default} +case $enableval in +yes) enable_shared=yes ;; +no) enable_shared=no ;; +*) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi + enable_shared=yes +fi; +# Check whether --enable-static or --disable-static was given. +if test "${enable_static+set}" = set; then + enableval="$enable_static" + p=${PACKAGE-default} +case $enableval in +yes) enable_static=yes ;; +no) enable_static=no ;; +*) + enable_static=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_static=yes +fi; +# Check whether --enable-fast-install or --disable-fast-install was given. +if test "${enable_fast_install+set}" = set; then + enableval="$enable_fast_install" + p=${PACKAGE-default} +case $enableval in +yes) enable_fast_install=yes ;; +no) enable_fast_install=no ;; +*) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_fast_install=yes +fi; # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then @@ -1300,13 +3147,12 @@ if test "${with_gnu_ld+set}" = set; then test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no -fi - +fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1310: checking for ld used by GCC" >&5 + echo "$as_me:$LINENO: checking for ld used by GCC" >&5 +echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1335,14 +3181,14 @@ echo "configure:1310: checking for ld us ;; esac elif test "$with_gnu_ld" = yes; then - echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1340: checking for GNU ld" >&5 + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else - echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1343: checking for non-GNU ld" >&5 + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi -if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" @@ -1368,15 +3214,19 @@ fi LD="$lt_cv_path_LD" if test -n "$LD"; then - echo "$ac_t""$LD" 1>&6 + echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } -echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1378: checking if the linker ($LD) is GNU ld" >&5 -if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then @@ -1385,27 +3235,27 @@ else lt_cv_prog_gnu_ld=no fi fi - -echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6 +echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld -echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1395: checking for $LD option to reload object files" >&5 -if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi - -echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6 +echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" -echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1407: checking for BSD-compatible nm" >&5 -if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 +if test "${lt_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. @@ -1438,33 +3288,24 @@ fi fi NM="$lt_cv_path_NM" -echo "$ac_t""$NM" 1>&6 - -echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1445: checking whether ln -s works" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - rm -f conftestdata -if ln -s X conftestdata 2>/dev/null -then - rm -f conftestdata - ac_cv_prog_LN_S="ln -s" -else - ac_cv_prog_LN_S=ln -fi -fi -LN_S="$ac_cv_prog_LN_S" -if test "$ac_cv_prog_LN_S" = "ln -s"; then - echo "$ac_t""yes" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi +echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6 -echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1466: checking how to recognise dependant libraries" >&5 -if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + +echo "$as_me:$LINENO: checking how to recognise dependant libraries" >&5 +echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" >&6 +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= @@ -1629,73 +3470,13 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) esac fi - -echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6 +echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method -echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1639: checking for object suffix" >&5 -if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - rm -f conftest* -echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1645: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - for ac_file in conftest.*; do - case $ac_file in - *.c) ;; - *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; - esac - done -else - { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_objext" 1>&6 -OBJEXT=$ac_cv_objext -ac_objext=$ac_cv_objext - - - -echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1665: checking for executable suffix" >&5 -if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$CYGWIN" = yes || test "$MINGW32" = yes; then - ac_cv_exeext=.exe -else - rm -f conftest* - echo 'int main () { return 0; }' > conftest.$ac_ext - ac_cv_exeext= - if { (eval echo configure:1675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then - for file in conftest.*; do - case $file in - *.c | *.o | *.obj) ;; - *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; - esac - done - else - { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } - fi - rm -f conftest* - test x"${ac_cv_exeext}" = x && ac_cv_exeext=no -fi -fi -EXEEXT="" -test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} -echo "$ac_t""${ac_cv_exeext}" 1>&6 -ac_exeext=$EXEEXT -if test $host != $build; then - ac_tool_prefix=${host_alias}- -else - ac_tool_prefix= -fi # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! @@ -1703,10 +3484,10 @@ fi case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then - echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:1708: checking for ${ac_tool_prefix}file" >&5 -if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in /*) @@ -1758,17 +3539,19 @@ fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - echo "$ac_t""$MAGIC_CMD" 1>&6 + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then - echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:1770: checking for file" >&5 -if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in /*) @@ -1820,9 +3603,11 @@ fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - echo "$ac_t""$MAGIC_CMD" 1>&6 + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi else @@ -1834,138 +3619,164 @@ fi ;; esac -# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1841: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -RANLIB="$ac_cv_prog_RANLIB" +RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - +fi if test -z "$ac_cv_prog_RANLIB"; then -if test -n "$ac_tool_prefix"; then + ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1873: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi + RANLIB=$ac_ct_RANLIB else - RANLIB=":" -fi + RANLIB="$ac_cv_prog_RANLIB" fi -# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1908: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -STRIP="$ac_cv_prog_STRIP" +STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - echo "$ac_t""$STRIP" 1>&6 + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - +fi if test -z "$ac_cv_prog_STRIP"; then -if test -n "$ac_tool_prefix"; then + ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1940: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_STRIP="strip" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi -STRIP="$ac_cv_prog_STRIP" -if test -n "$STRIP"; then - echo "$ac_t""$STRIP" 1>&6 +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi + STRIP=$ac_ct_STRIP else - STRIP=":" -fi + STRIP="$ac_cv_prog_STRIP" fi @@ -1981,20 +3792,19 @@ test "$lt_cv_prog_gnu_ld" = yes && libto # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" - : -fi +fi; test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" + # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default -fi - +fi; test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic" test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" @@ -2003,8 +3813,12 @@ test x"$pic_mode" = xno && libtool_flags case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 2007 "configure"' > conftest.$ac_ext - if { (eval echo configure:2008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 3816 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) @@ -2037,7 +3851,11 @@ case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext - if { (eval echo configure:2041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then case "`/usr/bin/file conftest.o`" in *ELF-32*) HPUX_IA64_MODE="32" @@ -2054,47 +3872,74 @@ ia64-*-hpux*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" - echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2059: checking whether the C compiler needs -belf" >&5 -if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + + ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then lt_cv_cc_needs_belf=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - lt_cv_cc_needs_belf=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +lt_cv_cc_needs_belf=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu fi - -echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 +echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" @@ -2106,54 +3951,61 @@ esac # Save cache, so that ltconfig can load it -cat > confcache <<\EOF +cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. # -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. # -EOF +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache - # Actually configure libtool. ac_aux_dir is where install-sh is found. AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ @@ -2163,15 +4015,26 @@ objext="$OBJEXT" exeext="$EXEEXT" reload deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ $libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \ -|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; } +|| { { echo "$as_me:$LINENO: error: libtool configure failed" >&5 +echo "$as_me: error: libtool configure failed" >&2;} + { (exit 1); exit 1; }; } # Reload cache, that may have been modified by ltconfig if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi else - echo "creating cache $cache_file" - > $cache_file + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file fi @@ -2185,44 +4048,47 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtoo # clobbered by the next message. exec 5>>./config.log - - - - + + + + + # Check whether --with-lib-path or --without-lib-path was given. if test "${with_lib_path+set}" = set; then withval="$with_lib_path" LIB_PATH=$withval -fi - +fi; # Check whether --enable-targets or --disable-targets was given. if test "${enable_targets+set}" = set; then enableval="$enable_targets" case "${enableval}" in - yes | "") { echo "configure: error: enable-targets option must specify target names or 'all'" 1>&2; exit 1; } + yes | "") { { echo "$as_me:$LINENO: error: enable-targets option must specify target names or 'all'" >&5 +echo "$as_me: error: enable-targets option must specify target names or 'all'" >&2;} + { (exit 1); exit 1; }; } ;; no) enable_targets= ;; *) enable_targets=$enableval ;; esac -fi -# Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given. +fi; # Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given. if test "${enable_64_bit_bfd+set}" = set; then enableval="$enable_64_bit_bfd" case "${enableval}" in yes) want64=true ;; no) want64=false ;; - *) { echo "configure: error: bad value ${enableval} for 64-bit-bfd option" 1>&2; exit 1; } ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for 64-bit-bfd option" >&5 +echo "$as_me: error: bad value ${enableval} for 64-bit-bfd option" >&2;} + { (exit 1); exit 1; }; } ;; esac else want64=false -fi +fi; # Check whether --with-sysroot or --without-sysroot was given. if test "${with_sysroot+set}" = set; then withval="$with_sysroot" - + case ${with_sysroot} in yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_alias}/sys-root' ;; *) TARGET_SYSTEM_ROOT=$with_sysroot ;; @@ -2249,12 +4115,12 @@ if test "${with_sysroot+set}" = set; the esac else - + use_sysroot=no TARGET_SYSTEM_ROOT= TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"\"' -fi +fi; @@ -2268,10 +4134,11 @@ if test "${enable_werror+set}" = set; th case "${enableval}" in yes | y) ERROR_ON_WARNING="yes" ;; no | n) ERROR_ON_WARNING="no" ;; - *) { echo "configure: error: bad value ${enableval} for --enable-werror" 1>&2; exit 1; } ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-werror" >&5 +echo "$as_me: error: bad value ${enableval} for --enable-werror" >&2;} + { (exit 1); exit 1; }; } ;; esac -fi - +fi; # Enable -Werror by default when using gcc if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then @@ -2283,7 +4150,7 @@ if test "${ERROR_ON_WARNING}" = yes ; th WARN_CFLAGS="$WARN_CFLAGS -Werror" NO_WERROR="-Wno-error" fi - + # Check whether --enable-build-warnings or --disable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then enableval="$enable_build_warnings" @@ -2296,8 +4163,7 @@ if test "${enable_build_warnings+set}" = WARN_CFLAGS="${t} ${WARN_CFLAGS}";; *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; esac -fi - +fi; if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then echo "Setting warning flags = $WARN_CFLAGS" 6>&1 @@ -2307,226 +4173,474 @@ fi - + ac_config_headers="$ac_config_headers config.h:config.in" if test -z "$target" ; then - { echo "configure: error: Unrecognized target system type; please check config.sub." 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: Unrecognized target system type; please check config.sub." >&5 +echo "$as_me: error: Unrecognized target system type; please check config.sub." >&2;} + { (exit 1); exit 1; }; } fi if test -z "$host" ; then - { echo "configure: error: Unrecognized host system type; please check config.sub." 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: Unrecognized host system type; please check config.sub." >&5 +echo "$as_me: error: Unrecognized host system type; please check config.sub." >&2;} + { (exit 1); exit 1; }; } fi # host-specific stuff: -# Extract the first word of "gcc", so it can be a program name with args. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # 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:2326: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC else - echo "$ac_t""no" 1>&6 + CC="$ac_cv_prog_CC" fi +fi 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:2356: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift - if test $# -gt 0; then + if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2407: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - ;; - esac + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2439: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + test -n "$ac_ct_CC" && break +done -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross + CC=$ac_ct_CC +fi -cat > conftest.$ac_ext << EOF +fi -#line 2450 "configure" -#include "confdefs.h" -main(){return(0);} -EOF -if { (eval echo configure:2455: \"$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 - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2481: 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:2486: 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 - cat > conftest.c <&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me #endif -EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2495: \"$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 -fi -fi -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi +int +main () +{ -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:2514: 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 - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else - ac_cv_prog_cc_g=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" + CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" @@ -2540,6 +4654,269 @@ else CFLAGS= fi fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2548,215 +4925,480 @@ fi # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:2557: checking for a BSD compatible install" >&5 +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 fi fi done - ;; - esac - done - IFS="$ac_save_IFS" + done + ;; +esac +done + fi if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" + INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. - INSTALL="$ac_install_sh" + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +ALL_LINGUAS="fr sv tr es da" +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi -fi -echo "$ac_t""$INSTALL" 1>&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' +done +done -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi -ALL_LINGUAS="fr sv tr es da" -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2612: checking how to run the C preprocessor" >&5 +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. # 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:2633: \"$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 - : + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2650: \"$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 + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then : else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2667: \"$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 - : + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp + ac_cpp_err=yes fi -rm -f conftest* +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break fi -rm -f conftest* +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes fi - CPP="$ac_cv_prog_CPP" +if test -z "$ac_cpp_err"; then + : else - ac_cv_prog_CPP="$CPP" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue fi -echo "$ac_t""$CPP" 1>&6 +rm -f conftest.err conftest.$ac_ext -# Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2694: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_t""no" 1>&6 + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2722: 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 +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include #include #include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2735: \"$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* + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_header_stdc=yes else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_stdc=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -EOF + +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then + $EGREP "memchr" >/dev/null 2>&1; then : else - rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* @@ -2765,16 +5407,19 @@ 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 <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -EOF + +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then + $EGREP "free" >/dev/null 2>&1; then : else - rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* @@ -2783,269 +5428,530 @@ fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif -EOF -if { (eval echo configure:2802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then : else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no fi -rm -fr conftest* +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi fi - -echo "$ac_t""$ac_cv_header_stdc" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 -EOF +_ACEOF fi -echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2826: 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 <j = 5; -} -{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; -} +echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -; return 0; } -EOF -if { (eval echo configure:2880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_const=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_c_const=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_const=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi - -echo "$ac_t""$ac_cv_c_const" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then - cat >> confdefs.h <<\EOF -#define const -EOF + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF fi -echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2901: checking for inline" >&5 -if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6 +if test "${ac_cv_c_inline+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 - rm -rf conftest* + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done fi +echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6 -echo "$ac_t""$ac_cv_c_inline" 1>&6 -case "$ac_cv_c_inline" in + +case $ac_cv_c_inline in inline | yes) ;; - no) cat >> confdefs.h <<\EOF -#define inline -EOF - ;; - *) cat >> confdefs.h <>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; esac -echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2941: 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 -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6 +if test "${ac_cv_type_off_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((off_t *) 0) + return 0; +if (sizeof (off_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_type_off_t=yes else - rm -rf conftest* - ac_cv_type_off_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_off_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$ac_cv_type_off_t" 1>&6 -if test $ac_cv_type_off_t = no; then - cat >> confdefs.h <<\EOF +echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6 +if test $ac_cv_type_off_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF #define off_t long -EOF +_ACEOF fi -echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2974: 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 -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_type_size_t=yes else - rm -rf conftest* - ac_cv_type_size_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_size_t=no fi -echo "$ac_t""$ac_cv_type_size_t" 1>&6 -if test $ac_cv_type_size_t = no; then - cat >> confdefs.h <<\EOF +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF #define size_t unsigned -EOF +_ACEOF 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:3009: 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 <&5 +echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 +if test "${ac_cv_working_alloca_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -int main() { -char *p = alloca(2 * sizeof(int)); -; return 0; } -EOF -if { (eval echo configure:3021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_header_alloca_h=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_alloca_h=no -fi -rm -f conftest* -fi +int +main () +{ +char *p = (char *) alloca (2 * sizeof (int)); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_working_alloca_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_working_alloca_h=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 +echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 +if test $ac_cv_working_alloca_h = yes; then -echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 -if test $ac_cv_header_alloca_h = yes; then - cat >> confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 -EOF +_ACEOF fi -echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3042: 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 +echo $ECHO_N "checking for alloca... $ECHO_C" >&6 +if test "${ac_cv_func_alloca_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else @@ -3067,137 +5973,217 @@ char *alloca (); # endif #endif -int main() { -char *p = (char *) alloca(1); -; return 0; } -EOF -if { (eval echo configure:3075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* +int +main () +{ +char *p = (char *) alloca (1); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_func_alloca_works=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_func_alloca_works=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_alloca_works=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi +echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 +echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 -echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 if test $ac_cv_func_alloca_works = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_ALLOCA 1 -EOF -fi +cat >>confdefs.h <<\_ACEOF +#define HAVE_ALLOCA 1 +_ACEOF -if test $ac_cv_func_alloca_works = no; then +else # The SVR3 libPW and SVR4 libucb both contain incompatible functions - # that cause trouble. Some versions do not even contain alloca or - # contain a buggy version. If you still want to use their alloca, - # use ar to extract alloca.o from them instead of compiling alloca.c. - ALLOCA=alloca.${ac_objext} - cat >> confdefs.h <<\EOF +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + +ALLOCA=alloca.$ac_objext + +cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 -EOF +_ACEOF -echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3107: 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 <&5 +echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 +if test "${ac_cv_os_cray+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #if defined(CRAY) && ! defined(CRAY2) webecray #else wenotbecray #endif -EOF +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "webecray" >/dev/null 2>&1; then - rm -rf conftest* + $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else - rm -rf conftest* ac_cv_os_cray=no fi rm -f conftest* fi - -echo "$ac_t""$ac_cv_os_cray" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 +echo "${ECHO_T}$ac_cv_os_cray" >&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:3137: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif -int main() { +#undef $ac_func +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:3165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func -EOF +_ACEOF - break -else - echo "$ac_t""no" 1>&6 + break fi -done + done fi -echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3192: 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 +echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 +echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 +if test "${ac_cv_c_stack_direction+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int find_stack_direction () { static char *addr = 0; @@ -3210,138 +6196,316 @@ find_stack_direction () else return (&dummy > addr) ? 1 : -1; } + +int main () { - exit (find_stack_direction() < 0); + exit (find_stack_direction () < 0); } -EOF -if { (eval echo configure:3219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_c_stack_direction=-1 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_stack_direction=-1 fi -rm -fr conftest* +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi +echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 -echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 -cat >> confdefs.h <>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction -EOF +_ACEOF + fi -for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h + + +for ac_header in stdlib.h unistd.h do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3244: 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:3254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + ac_cpp_err=yes fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_t""no" 1>&6 + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi + done + for ac_func in getpagesize do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3283: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif -int main() { +#undef $ac_func +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:3311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 fi done -echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3336: 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 +echo "$as_me:$LINENO: checking for working mmap" >&5 +echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 +if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_mmap_fixed_mapped=no else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +/* malloc might have been renamed as rpl_malloc. */ +#undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: @@ -3355,47 +6519,34 @@ else back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the - VM page cache was not coherent with the filesystem buffer cache + VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get - propogated back to all the places they're supposed to be. + propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ -#include + #include #include -#if HAVE_SYS_TYPES_H -# include -#endif - -#if HAVE_STDLIB_H -# include -#endif - -#if HAVE_SYS_STAT_H -# include -#endif - -#if HAVE_UNISTD_H -# include +#if !STDC_HEADERS && !HAVE_STDLIB_H +char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ -#ifndef HAVE_GETPAGESIZE - +#if !HAVE_GETPAGESIZE /* Assume that all systems that can run configure have sys/param.h. */ -# ifndef HAVE_SYS_PARAM_H +# if !HAVE_SYS_PARAM_H # define HAVE_SYS_PARAM_H 1 # endif # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ -# ifdef HAVE_SYS_PARAM_H +# if HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE @@ -3422,323 +6573,573 @@ else #endif /* no HAVE_GETPAGESIZE */ -#ifdef __cplusplus -extern "C" { void *malloc(unsigned); } -#else -char *malloc(); -#endif - int -main() +main () { - char *data, *data2, *data3; - int i, pagesize; - int fd; - - pagesize = getpagesize(); - - /* - * First, make a file with some known garbage in it. - */ - data = malloc(pagesize); - if (!data) - exit(1); - for (i = 0; i < pagesize; ++i) - *(data + i) = rand(); - umask(0); - fd = creat("conftestmmap", 0600); - if (fd < 0) - exit(1); - if (write(fd, data, pagesize) != pagesize) - exit(1); - close(fd); - - /* - * Next, try to mmap the file at a fixed address which - * already has something else allocated at it. If we can, - * also make sure that we see the same garbage. - */ - fd = open("conftestmmap", O_RDWR); - if (fd < 0) - exit(1); - data2 = malloc(2 * pagesize); - if (!data2) - exit(1); - data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); - if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_FIXED, fd, 0L)) - exit(1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data2 + i)) - exit(1); - - /* - * Finally, make sure that changes to the mapped area - * do not percolate back to the file as seen by read(). - * (This is a bug on some variants of i386 svr4.0.) - */ - for (i = 0; i < pagesize; ++i) - *(data2 + i) = *(data2 + i) + 1; - data3 = malloc(pagesize); - if (!data3) - exit(1); - if (read(fd, data3, pagesize) != pagesize) - exit(1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data3 + i)) - exit(1); - close(fd); - unlink("conftestmmap"); - exit(0); + char *data, *data2, *data3; + int i, pagesize; + int fd; + + pagesize = getpagesize (); + + /* First, make a file with some known garbage in it. */ + data = (char *) malloc (pagesize); + if (!data) + exit (1); + for (i = 0; i < pagesize; ++i) + *(data + i) = rand (); + umask (0); + fd = creat ("conftest.mmap", 0600); + if (fd < 0) + exit (1); + if (write (fd, data, pagesize) != pagesize) + exit (1); + close (fd); + + /* Next, try to mmap the file at a fixed address which already has + something else allocated at it. If we can, also make sure that + we see the same garbage. */ + fd = open ("conftest.mmap", O_RDWR); + if (fd < 0) + exit (1); + data2 = (char *) malloc (2 * pagesize); + if (!data2) + exit (1); + data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); + if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + exit (1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + exit (1); + + /* Finally, make sure that changes to the mapped area do not + percolate back to the file as seen by read(). (This is a bug on + some variants of i386 svr4.0.) */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = (char *) malloc (pagesize); + if (!data3) + exit (1); + if (read (fd, data3, pagesize) != pagesize) + exit (1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + exit (1); + close (fd); + exit (0); } - -EOF -if { (eval echo configure:3497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_func_mmap_fixed_mapped=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_func_mmap_fixed_mapped=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_mmap_fixed_mapped=no fi -rm -fr conftest* +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi - -echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 +echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 if test $ac_cv_func_mmap_fixed_mapped = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_MMAP 1 -EOF +_ACEOF fi +rm -f conftest.mmap + + + + + - - for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \ + + + + + +for ac_header in argz.h limits.h locale.h nl_types.h malloc.h string.h \ unistd.h values.h sys/param.h do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3525: 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:3535: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* + ac_cpp_err=yes fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_t""no" 1>&6 + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi + done - for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \ + + + + + + + + + + +for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \ __argz_count __argz_stringify __argz_next do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3565: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif -int main() { +#undef $ac_func +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:3593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 fi done if test "${ac_cv_func_stpcpy+set}" != "set"; then - for ac_func in stpcpy + +for ac_func in stpcpy do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3622: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif -int main() { +#undef $ac_func +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:3650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 fi done fi if test "${ac_cv_func_stpcpy}" = "yes"; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_STPCPY 1 -EOF +_ACEOF fi if test $ac_cv_header_locale_h = yes; then - echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3684: 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 <&5 +echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6 +if test "${am_cv_val_LC_MESSAGES+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -int main() { +int +main () +{ return LC_MESSAGES -; return 0; } -EOF -if { (eval echo configure:3696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then am_cv_val_LC_MESSAGES=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - am_cv_val_LC_MESSAGES=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +am_cv_val_LC_MESSAGES=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi - -echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6 +echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 +echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6 if test $am_cv_val_LC_MESSAGES = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_LC_MESSAGES 1 -EOF +_ACEOF fi fi - echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3717: checking whether NLS is requested" >&5 + echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" USE_NLS=$enableval else USE_NLS=yes -fi +fi; + echo "$as_me:$LINENO: result: $USE_NLS" >&5 +echo "${ECHO_T}$USE_NLS" >&6 - echo "$ac_t""$USE_NLS" 1>&6 - USE_INCLUDED_LIBINTL=no if test "$USE_NLS" = "yes"; then - echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3733: checking whether included gettext is requested" >&5 - # Check whether --with-included-gettext or --without-included-gettext was given. + echo "$as_me:$LINENO: checking whether included gettext is requested" >&5 +echo $ECHO_N "checking whether included gettext is requested... $ECHO_C" >&6 + +# Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" nls_cv_force_use_gnu_gettext=$withval else nls_cv_force_use_gnu_gettext=no -fi - - echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6 +fi; + echo "$as_me:$LINENO: result: $nls_cv_force_use_gnu_gettext" >&5 +echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then @@ -3746,141 +7147,336 @@ fi nls_cv_header_libgt= CATOBJEXT= - ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3752: 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 <&5 +echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6 +if test "${ac_cv_header_libintl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 +echo "${ECHO_T}$ac_cv_header_libintl_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking libintl.h usability" >&5 +echo $ECHO_N "checking libintl.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default #include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking libintl.h presence" >&5 +echo $ECHO_N "checking libintl.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* + ac_cpp_err=yes 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:3779: 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 <&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: libintl.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: libintl.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: libintl.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: libintl.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: libintl.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: libintl.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for libintl.h" >&5 +echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6 +if test "${ac_cv_header_libintl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_libintl_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 +echo "${ECHO_T}$ac_cv_header_libintl_h" >&6 + +fi +if test $ac_cv_header_libintl_h = yes; then + echo "$as_me:$LINENO: checking for gettext in libc" >&5 +echo $ECHO_N "checking for gettext in libc... $ECHO_C" >&6 +if test "${gt_cv_func_gettext_libc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -int main() { +int +main () +{ return (int) gettext ("") -; return 0; } -EOF -if { (eval echo configure:3791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then gt_cv_func_gettext_libc=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - gt_cv_func_gettext_libc=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gt_cv_func_gettext_libc=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi - -echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 +echo "$as_me:$LINENO: result: $gt_cv_func_gettext_libc" >&5 +echo "${ECHO_T}$gt_cv_func_gettext_libc" >&6 if test "$gt_cv_func_gettext_libc" != "yes"; then - echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3807: 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 + echo "$as_me:$LINENO: checking for bindtextdomain in -lintl" >&5 +echo $ECHO_N "checking for bindtextdomain in -lintl... $ECHO_C" >&6 +if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char bindtextdomain(); - -int main() { -bindtextdomain() -; return 0; } -EOF -if { (eval echo configure:3826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3842: 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>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_intl_bindtextdomain=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_intl_bindtextdomain=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_intl_bindtextdomain" >&5 +echo "${ECHO_T}$ac_cv_lib_intl_bindtextdomain" >&6 +if test $ac_cv_lib_intl_bindtextdomain = yes; then + echo "$as_me:$LINENO: checking for gettext in libintl" >&5 +echo $ECHO_N "checking for gettext in libintl... $ECHO_C" >&6 +if test "${gt_cv_func_gettext_libintl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { +int +main () +{ return (int) gettext ("") -; return 0; } -EOF -if { (eval echo configure:3854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then gt_cv_func_gettext_libintl=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - gt_cv_func_gettext_libintl=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gt_cv_func_gettext_libintl=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi - -echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6 -else - echo "$ac_t""no" 1>&6 +echo "$as_me:$LINENO: result: $gt_cv_func_gettext_libintl" >&5 +echo "${ECHO_T}$gt_cv_func_gettext_libintl" >&6 fi fi if test "$gt_cv_func_gettext_libc" = "yes" \ || test "$gt_cv_func_gettext_libintl" = "yes"; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_GETTEXT 1 -EOF +_ACEOF # 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:3882: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in /*) @@ -3904,108 +7500,161 @@ esac fi MSGFMT="$ac_cv_path_MSGFMT" if test -n "$MSGFMT"; then - echo "$ac_t""$MSGFMT" 1>&6 + echo "$as_me:$LINENO: result: $MSGFMT" >&5 +echo "${ECHO_T}$MSGFMT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi if test "$MSGFMT" != "no"; then - for ac_func in dcgettext + +for ac_func in dcgettext do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3916: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ -int main() { +#ifdef __STDC__ +# include +#else +# include +#endif +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:3944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 fi done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3971: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_GMSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$GMSGFMT" in - /*) + case $GMSGFMT in + [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_GMSGFMT="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi -GMSGFMT="$ac_cv_path_GMSGFMT" +GMSGFMT=$ac_cv_path_GMSGFMT + if test -n "$GMSGFMT"; then - echo "$ac_t""$GMSGFMT" 1>&6 + echo "$as_me:$LINENO: result: $GMSGFMT" >&5 +echo "${ECHO_T}$GMSGFMT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4007: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_XGETTEXT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in /*) @@ -4029,42 +7678,71 @@ esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test -n "$XGETTEXT"; then - echo "$ac_t""$XGETTEXT" 1>&6 + echo "$as_me:$LINENO: result: $XGETTEXT" >&5 +echo "${ECHO_T}$XGETTEXT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { +int +main () +{ extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr -; return 0; } -EOF -if { (eval echo configure:4047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then CATOBJEXT=.gmo DATADIRNAME=share else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CATOBJEXT=.mo + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +CATOBJEXT=.mo DATADIRNAME=lib fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext INSTOBJEXT=.mo fi fi - -else - echo "$ac_t""no" 1>&6 + fi - + + if test x"$CATOBJEXT" = x && test -d $srcdir/../intl; then # Neither gettext nor catgets in included in the C library. # Fall back on GNU gettext library (assuming it is present). @@ -4076,10 +7754,10 @@ fi INTLOBJS="\$(GETTOBJS)" # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4081: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in /*) @@ -4103,53 +7781,59 @@ esac fi MSGFMT="$ac_cv_path_MSGFMT" if test -n "$MSGFMT"; then - echo "$ac_t""$MSGFMT" 1>&6 + echo "$as_me:$LINENO: result: $MSGFMT" >&5 +echo "${ECHO_T}$MSGFMT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4115: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_GMSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$GMSGFMT" in - /*) + case $GMSGFMT in + [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_GMSGFMT="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi -GMSGFMT="$ac_cv_path_GMSGFMT" +GMSGFMT=$ac_cv_path_GMSGFMT + if test -n "$GMSGFMT"; then - echo "$ac_t""$GMSGFMT" 1>&6 + echo "$as_me:$LINENO: result: $GMSGFMT" >&5 +echo "${ECHO_T}$GMSGFMT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4151: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_XGETTEXT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in /*) @@ -4173,12 +7857,14 @@ esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test -n "$XGETTEXT"; then - echo "$ac_t""$XGETTEXT" 1>&6 + echo "$as_me:$LINENO: result: $XGETTEXT" >&5 +echo "${ECHO_T}$XGETTEXT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + USE_INCLUDED_LIBINTL=yes CATOBJEXT=.gmo INSTOBJEXT=.mo @@ -4194,7 +7880,8 @@ fi if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else - echo "$ac_t""found xgettext programs is not GNU xgettext; ignore it" 1>&6 + echo "$as_me:$LINENO: result: found xgettext programs is not GNU xgettext; ignore it" >&5 +echo "${ECHO_T}found xgettext programs is not GNU xgettext; ignore it" >&6 XGETTEXT=":" fi fi @@ -4219,31 +7906,32 @@ fi POFILES="$POFILES $lang.po" done - - - - - - - - - - - + + + + + + + + + + + if test "x$CATOBJEXT" != "x"; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define ENABLE_NLS 1 -EOF +_ACEOF fi - + if test "x$CATOBJEXT" != "x"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else - echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:4247: checking for catalogs to be installed" >&5 + echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 +echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -4251,7 +7939,8 @@ echo "configure:4247: checking for catal esac done LINGUAS=$NEW_LINGUAS - echo "$ac_t""$LINGUAS" 1>&6 + echo "$as_me:$LINENO: result: $LINGUAS" >&5 +echo "${ECHO_T}$LINGUAS" >&6 fi if test -n "$LINGUAS"; then @@ -4265,45 +7954,155 @@ echo "configure:4247: checking for catal INCLUDE_LOCALE_H="\ /* The system does not provide the header . Take care yourself. */" fi - + if test -f $srcdir/po2tbl.sed.in; then if test "$CATOBJEXT" = ".cat"; then - ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:4275: 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 <&5 +echo $ECHO_N "checking for linux/version.h... $ECHO_C" >&6 +if test "${ac_cv_header_linux_version_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_linux_version_h" >&5 +echo "${ECHO_T}$ac_cv_header_linux_version_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking linux/version.h usability" >&5 +echo $ECHO_N "checking linux/version.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default #include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking linux/version.h presence" >&5 +echo $ECHO_N "checking linux/version.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + ac_cpp_err=yes fi -rm -f conftest* +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: linux/version.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: linux/version.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/version.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: linux/version.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: linux/version.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: linux/version.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/version.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: linux/version.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/version.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: linux/version.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/version.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: linux/version.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/version.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: linux/version.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/version.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: linux/version.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for linux/version.h" >&5 +echo $ECHO_N "checking for linux/version.h... $ECHO_C" >&6 +if test "${ac_cv_header_linux_version_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_linux_version_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_linux_version_h" >&5 +echo "${ECHO_T}$ac_cv_header_linux_version_h" >&6 + fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 +if test $ac_cv_header_linux_version_h = yes; then msgformat=linux else - echo "$ac_t""no" 1>&6 -msgformat=xopen + msgformat=xopen fi + sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed fi sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ @@ -4317,14 +8116,14 @@ fi GT_NO= GT_YES="#YES#" fi - - + + MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs" - + l= - + if test -f $srcdir/po/POTFILES.in; then test -d po || mkdir po @@ -4341,266 +8140,341 @@ fi sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES fi - - -echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:4350: checking for executable suffix" >&5 -if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$CYGWIN" = yes || test "$MINGW32" = yes; then - ac_cv_exeext=.exe -else - rm -f conftest* - echo 'int main () { return 0; }' > conftest.$ac_ext - ac_cv_exeext= - if { (eval echo configure:4360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then - for file in conftest.*; do - case $file in - *.c | *.o | *.obj) ;; - *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; - esac - done - else - { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } - fi - rm -f conftest* - test x"${ac_cv_exeext}" = x && ac_cv_exeext=no -fi -fi - -EXEEXT="" -test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} -echo "$ac_t""${ac_cv_exeext}" 1>&6 -ac_exeext=$EXEEXT for ac_prog in 'bison -y' byacc do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # 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:4386: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_YACC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_YACC="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_YACC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -YACC="$ac_cv_prog_YACC" +YACC=$ac_cv_prog_YACC if test -n "$YACC"; then - echo "$ac_t""$YACC" 1>&6 + echo "$as_me:$LINENO: result: $YACC" >&5 +echo "${ECHO_T}$YACC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$YACC" && break + test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" -missing_dir=`cd $ac_aux_dir && pwd` for ac_prog in flex lex do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # 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:4422: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LEX="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -LEX="$ac_cv_prog_LEX" -if test -n "$LEX"; then - echo "$ac_t""$LEX" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -test -n "$LEX" && break +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LEX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done -test -n "$LEX" || LEX="$missing_dir/missing flex" -# 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:4455: 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 - if test -n "$LEX"; then - ac_cv_prog_LEX="$LEX" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LEX="flex" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex" fi fi -LEX="$ac_cv_prog_LEX" +LEX=$ac_cv_prog_LEX if test -n "$LEX"; then - echo "$ac_t""$LEX" 1>&6 + echo "$as_me:$LINENO: result: $LEX" >&5 +echo "${ECHO_T}$LEX" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi + test -n "$LEX" && break +done +test -n "$LEX" || LEX=":" + if test -z "$LEXLIB" then - case "$LEX" in - flex*) ac_lib=fl ;; - *) ac_lib=l ;; - esac - echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:4489: 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 -else - ac_save_LIBS="$LIBS" -LIBS="-l$ac_lib $LIBS" -cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 +if test "${ac_cv_lib_fl_yywrap+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lfl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char yywrap(); + builtin and then its argument prototype would still apply. */ +char yywrap (); +int +main () +{ +yywrap (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_fl_yywrap=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_fl_yywrap=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 +echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 +if test $ac_cv_lib_fl_yywrap = yes; then + LEXLIB="-lfl" +else + echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 +echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 +if test "${ac_cv_lib_l_yywrap+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ll $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { -yywrap() -; return 0; } -EOF -if { (eval echo configure:4508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char yywrap (); +int +main () +{ +yywrap (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_l_yywrap=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_l_yywrap=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 +echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 +if test $ac_cv_lib_l_yywrap = yes; then + LEXLIB="-ll" fi -rm -f conftest* -LIBS="$ac_save_LIBS" fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LEXLIB="-l$ac_lib" -else - echo "$ac_t""no" 1>&6 -fi fi -echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:4531: 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 +if test "x$LEX" != "x:"; then + echo "$as_me:$LINENO: checking lex output file root" >&5 +echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 +if test "${ac_cv_prog_lex_root+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else # The minimal lex program is just a single line: %%. But some broken lexes # (Solaris, I think it was) want two %% lines, so accommodate them. -echo '%% -%%' | $LEX +cat >conftest.l <<_ACEOF +%% +%% +_ACEOF +{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 + (eval $LEX conftest.l) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else - { echo "configure: error: cannot find output from $LEX; giving up" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 +echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} + { (exit 1); exit 1; }; } fi fi - -echo "$ac_t""$ac_cv_prog_lex_root" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 +rm -f conftest.l LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root -echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 -echo "configure:4552: 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 +echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 +echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 +if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c -ac_save_LIBS="$LIBS" +ac_save_LIBS=$LIBS LIBS="$LIBS $LEXLIB" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF `cat $LEX_OUTPUT_ROOT.c` -int main() { - -; return 0; } -EOF -if { (eval echo configure:4571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_lex_yytext_pointer=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest* -LIBS="$ac_save_LIBS" +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_save_LIBS rm -f "${LEX_OUTPUT_ROOT}.c" fi - -echo "$ac_t""$ac_cv_prog_lex_yytext_pointer" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 if test $ac_cv_prog_lex_yytext_pointer = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define YYTEXT_POINTER 1 -EOF +_ACEOF fi +fi +if test "$LEX" = :; then + LEX=${am_missing_run}flex +fi -echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:4594: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no -fi +fi; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 - echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 - if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= @@ -4609,8 +8483,9 @@ else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi + MAINT=$MAINTAINER_MODE_TRUE - + . ${srcdir}/configure.host @@ -4620,638 +8495,1273 @@ fi -for ac_hdr in string.h strings.h stdlib.h unistd.h + + + + +for ac_header in string.h strings.h stdlib.h unistd.h do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4628: 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:4638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* + ac_cpp_err=yes fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_t""no" 1>&6 + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + done + + + for ac_func in sbrk realpath glob do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4667: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif -int main() { +#undef $ac_func +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:4695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + fi done + + + + + ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:4724: checking for $ac_hdr that defines DIR" >&5 -if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include <$ac_hdr> -int main() { -DIR *dirp = 0; -; return 0; } -EOF -if { (eval echo configure:4737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - eval "ac_cv_header_dirent_$ac_safe=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_dirent_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break fi + done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then -echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:4762: checking for opendir in -ldir" >&5 -ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldir $LIBS" -cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 +if test "${ac_cv_search_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_opendir=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir(); + builtin and then its argument prototype would still apply. */ +char opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_opendir="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_opendir" = no; then + for ac_lib in dir; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { -opendir() -; return 0; } -EOF -if { (eval echo configure:4781: \"$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" +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_opendir="-l$ac_lib" +break else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -ldir" -else - echo "$ac_t""no" 1>&6 +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6 +if test "$ac_cv_search_opendir" != no; then + test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" + fi else -echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:4803: checking for opendir in -lx" >&5 -ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 +if test "${ac_cv_search_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" -LIBS="-lx $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir(); + builtin and then its argument prototype would still apply. */ +char opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_opendir="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_opendir" = no; then + for ac_lib in x; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { -opendir() -; return 0; } -EOF -if { (eval echo configure:4822: \"$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" +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_opendir="-l$ac_lib" +break else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -lx" -else - echo "$ac_t""no" 1>&6 +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6 +if test "$ac_cv_search_opendir" != no; then + test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" + fi fi -echo $ac_n "checking for a known getopt prototype in unistd.h""... $ac_c" 1>&6 -echo "configure:4846: checking for a known getopt prototype in unistd.h" >&5 -if eval "test \"`echo '$''{'ld_cv_decl_getopt_unistd_h'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for a known getopt prototype in unistd.h" >&5 +echo $ECHO_N "checking for a known getopt prototype in unistd.h... $ECHO_C" >&6 +if test "${ld_cv_decl_getopt_unistd_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -int main() { +int +main () +{ extern int getopt (int, char *const*, const char *); -; return 0; } -EOF -if { (eval echo configure:4858: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ld_cv_decl_getopt_unistd_h=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ld_cv_decl_getopt_unistd_h=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ld_cv_decl_getopt_unistd_h=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$ld_cv_decl_getopt_unistd_h" 1>&6 +echo "$as_me:$LINENO: result: $ld_cv_decl_getopt_unistd_h" >&5 +echo "${ECHO_T}$ld_cv_decl_getopt_unistd_h" >&6 if test $ld_cv_decl_getopt_unistd_h = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_DECL_GETOPT 1 -EOF +_ACEOF fi - -echo $ac_n "checking whether weak symbol works""... $ac_c" 1>&6 -echo "configure:4879: checking whether weak symbol works" >&5 -if eval "test \"`echo '$''{'libiberty_cv_have_weak_symbol'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking whether weak symbol works... $ECHO_C" >&6 +if test "${libiberty_cv_have_weak_symbol+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #pragma weak liberty_weak_symbol_test extern void liberty_weak_symbol_test (); -int main() { +int +main () +{ if (return &liberty_weak_symbol_test != NULL) return 1 -; return 0; } -EOF -if { (eval echo configure:4893: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then libiberty_cv_have_weak_symbol=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - libiberty_cv_have_weak_symbol=yes + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +libiberty_cv_have_weak_symbol=yes fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$libiberty_cv_have_weak_symbol" 1>&6 +echo "$as_me:$LINENO: result: $libiberty_cv_have_weak_symbol" >&5 +echo "${ECHO_T}$libiberty_cv_have_weak_symbol" >&6 if test $libiberty_cv_have_weak_symbol = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_WEAK_SYMBOL 1 -EOF +_ACEOF fi if test $libiberty_cv_have_weak_symbol = yes; then # demangler may use dlopen. - -echo $ac_n "checking for library containing dlopen""... $ac_c" 1>&6 -echo "configure:4917: checking for library containing dlopen" >&5 -if eval "test \"`echo '$''{'ac_cv_search_dlopen'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_func_search_save_LIBS="$LIBS" -ac_cv_search_dlopen="no" -cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for library containing dlopen... $ECHO_C" >&6 +if test "${ac_cv_search_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_dlopen=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen(); - -int main() { -dlopen() -; return 0; } -EOF -if { (eval echo configure:4935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_search_dlopen="none required" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest* -test "$ac_cv_search_dlopen" = "no" && for i in dl; do -LIBS="-l$i $ac_func_search_save_LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen(); - -int main() { -dlopen() -; return 0; } -EOF -if { (eval echo configure:4957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_search_dlopen="-l$i" + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_dlopen="-l$ac_lib" break else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest* -done -LIBS="$ac_func_search_save_LIBS" +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done fi - -echo "$ac_t""$ac_cv_search_dlopen" 1>&6 -if test "$ac_cv_search_dlopen" != "no"; then +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_dlopen" >&5 +echo "${ECHO_T}$ac_cv_search_dlopen" >&6 +if test "$ac_cv_search_dlopen" != no; then test "$ac_cv_search_dlopen" = "none required" || LIBS="$ac_cv_search_dlopen $LIBS" - -else : - + fi + fi case "${host}" in *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define USE_BINARY_FOPEN 1 -EOF +_ACEOF ;; esac -echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4989: checking whether strstr must be declared" >&5 -if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#ifdef HAVE_STRING_H -#include -#else -#ifdef HAVE_STRINGS_H -#include -#endif -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include +echo "$as_me:$LINENO: checking whether strstr is declared" >&5 +echo $ECHO_N "checking whether strstr is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_strstr+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef strstr + char *p = (char *) strstr; #endif -int main() { -char *(*pfn) = (char *(*)) strstr -; return 0; } -EOF -if { (eval echo configure:5015: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - bfd_cv_decl_needed_strstr=no + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_strstr=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_strstr=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_strstr" >&5 +echo "${ECHO_T}$ac_cv_have_decl_strstr" >&6 +if test $ac_cv_have_decl_strstr = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRSTR 1 +_ACEOF + + else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - bfd_cv_decl_needed_strstr=yes -fi -rm -f conftest* -fi + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRSTR 0 +_ACEOF -echo "$ac_t""$bfd_cv_decl_needed_strstr" 1>&6 -if test $bfd_cv_decl_needed_strstr = yes; then - cat >> confdefs.h <<\EOF -#define NEED_DECLARATION_STRSTR 1 -EOF fi +echo "$as_me:$LINENO: checking whether free is declared" >&5 +echo $ECHO_N "checking whether free is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_free+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef free + char *p = (char *) free; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_free=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_free=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_free" >&5 +echo "${ECHO_T}$ac_cv_have_decl_free" >&6 +if test $ac_cv_have_decl_free = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FREE 1 +_ACEOF -echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:5036: checking whether free must be declared" >&5 -if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#ifdef HAVE_STRING_H -#include -#else -#ifdef HAVE_STRINGS_H -#include -#endif -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -int main() { -char *(*pfn) = (char *(*)) free -; return 0; } -EOF -if { (eval echo configure:5062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - bfd_cv_decl_needed_free=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - bfd_cv_decl_needed_free=yes -fi -rm -f conftest* -fi + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FREE 0 +_ACEOF -echo "$ac_t""$bfd_cv_decl_needed_free" 1>&6 -if test $bfd_cv_decl_needed_free = yes; then - cat >> confdefs.h <<\EOF -#define NEED_DECLARATION_FREE 1 -EOF fi +echo "$as_me:$LINENO: checking whether sbrk is declared" >&5 +echo $ECHO_N "checking whether sbrk is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_sbrk+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef sbrk + char *p = (char *) sbrk; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_sbrk=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_sbrk=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_sbrk" >&5 +echo "${ECHO_T}$ac_cv_have_decl_sbrk" >&6 +if test $ac_cv_have_decl_sbrk = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SBRK 1 +_ACEOF -echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6 -echo "configure:5083: checking whether sbrk must be declared" >&5 -if eval "test \"`echo '$''{'bfd_cv_decl_needed_sbrk'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#ifdef HAVE_STRING_H -#include -#else -#ifdef HAVE_STRINGS_H -#include -#endif -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -int main() { -char *(*pfn) = (char *(*)) sbrk -; return 0; } -EOF -if { (eval echo configure:5109: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - bfd_cv_decl_needed_sbrk=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - bfd_cv_decl_needed_sbrk=yes -fi -rm -f conftest* -fi + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SBRK 0 +_ACEOF -echo "$ac_t""$bfd_cv_decl_needed_sbrk" 1>&6 -if test $bfd_cv_decl_needed_sbrk = yes; then - cat >> confdefs.h <<\EOF -#define NEED_DECLARATION_SBRK 1 -EOF fi +echo "$as_me:$LINENO: checking whether getenv is declared" >&5 +echo $ECHO_N "checking whether getenv is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_getenv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef getenv + char *p = (char *) getenv; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_getenv=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_getenv=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6 +if test $ac_cv_have_decl_getenv = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETENV 1 +_ACEOF -echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:5130: checking whether getenv must be declared" >&5 -if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#ifdef HAVE_STRING_H -#include -#else -#ifdef HAVE_STRINGS_H -#include -#endif -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -int main() { -char *(*pfn) = (char *(*)) getenv -; return 0; } -EOF -if { (eval echo configure:5156: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - bfd_cv_decl_needed_getenv=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - bfd_cv_decl_needed_getenv=yes -fi -rm -f conftest* -fi + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETENV 0 +_ACEOF -echo "$ac_t""$bfd_cv_decl_needed_getenv" 1>&6 -if test $bfd_cv_decl_needed_getenv = yes; then - cat >> confdefs.h <<\EOF -#define NEED_DECLARATION_GETENV 1 -EOF fi +echo "$as_me:$LINENO: checking whether environ is declared" >&5 +echo $ECHO_N "checking whether environ is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_environ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef environ + char *p = (char *) environ; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_environ=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_environ=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_environ" >&5 +echo "${ECHO_T}$ac_cv_have_decl_environ" >&6 +if test $ac_cv_have_decl_environ = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ENVIRON 1 +_ACEOF -echo $ac_n "checking whether environ must be declared""... $ac_c" 1>&6 -echo "configure:5177: checking whether environ must be declared" >&5 -if eval "test \"`echo '$''{'bfd_cv_decl_needed_environ'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#ifdef HAVE_STRING_H -#include -#else -#ifdef HAVE_STRINGS_H -#include -#endif -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -int main() { -char *(*pfn) = (char *(*)) environ -; return 0; } -EOF -if { (eval echo configure:5203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - bfd_cv_decl_needed_environ=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - bfd_cv_decl_needed_environ=yes -fi -rm -f conftest* -fi + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ENVIRON 0 +_ACEOF -echo "$ac_t""$bfd_cv_decl_needed_environ" 1>&6 -if test $bfd_cv_decl_needed_environ = yes; then - cat >> confdefs.h <<\EOF -#define NEED_DECLARATION_ENVIRON 1 -EOF fi + # When converting linker scripts into strings for use in emulation # files, use astring.sed if the compiler supports ANSI string # concatenation, or ostring.sed otherwise. This is to support the # broken Microsoft MSVC compiler, which limits the length of string # constants, while still supporting pre-ANSI compilers which do not # support string concatenation. -echo $ac_n "checking whether ANSI C string concatenation works""... $ac_c" 1>&6 -echo "configure:5231: checking whether ANSI C string concatenation works" >&5 -if eval "test \"`echo '$''{'ld_cv_string_concatenation'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking whether ANSI C string concatenation works... $ECHO_C" >&6 +if test "${ld_cv_string_concatenation+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { +int +main () +{ char *a = "a" "a"; -; return 0; } -EOF -if { (eval echo configure:5243: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ld_cv_string_concatenation=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ld_cv_string_concatenation=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ld_cv_string_concatenation=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$ld_cv_string_concatenation" 1>&6 +echo "$as_me:$LINENO: result: $ld_cv_string_concatenation" >&5 +echo "${ECHO_T}$ld_cv_string_concatenation" >&6 if test "$ld_cv_string_concatenation" = "yes"; then STRINGIFY=astring.sed else @@ -5275,7 +9785,7 @@ do all_targets=true else # Canonicalize the secondary target names. - result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ_alias 2>/dev/null` + result=`$ac_config_sub $targ_alias 2>/dev/null` if test -n "$result"; then targ=$result else @@ -5365,443 +9875,1478 @@ case "$target_os" in esac if test x${EXTRA_SHLIB_EXTENSION} != x ; then - cat >> confdefs.h <>confdefs.h <<_ACEOF #define EXTRA_SHLIB_EXTENSION "$EXTRA_SHLIB_EXTENSION" -EOF +_ACEOF fi -trap '' 1 2 15 -cat > confcache <<\EOF + ac_config_files="$ac_config_files Makefile po/Makefile.in:po/Make-in" + ac_config_commands="$ac_config_commands default" +cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. # -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. # -EOF +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' fi -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - DEFS=-DHAVE_CONFIG_H -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS <&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. # Run this file to recreate the current configuration. -# This directory was configured as follows, -# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# $0 $ac_configure_args -# # Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. +# configure, is in config.log if it exists. -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by $as_me, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 do - case "\$ac_option" in + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + esac + shift done -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" +ac_configure_extra_args= -trap 'rm -fr `echo "Makefile po/Makefile.in:po/Make-in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS </dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi -# Protect against being on the right side of a sed subst in config.status. -sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; - s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@host@%$host%g -s%@host_alias@%$host_alias%g -s%@host_cpu@%$host_cpu%g -s%@host_vendor@%$host_vendor%g -s%@host_os@%$host_os%g -s%@target@%$target%g -s%@target_alias@%$target_alias%g -s%@target_cpu@%$target_cpu%g -s%@target_vendor@%$target_vendor%g -s%@target_os@%$target_os%g -s%@build@%$build%g -s%@build_alias@%$build_alias%g -s%@build_cpu@%$build_cpu%g -s%@build_vendor@%$build_vendor%g -s%@build_os@%$build_os%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@PACKAGE@%$PACKAGE%g -s%@VERSION@%$VERSION%g -s%@ACLOCAL@%$ACLOCAL%g -s%@AUTOCONF@%$AUTOCONF%g -s%@AUTOMAKE@%$AUTOMAKE%g -s%@AUTOHEADER@%$AUTOHEADER%g -s%@MAKEINFO@%$MAKEINFO%g -s%@SET_MAKE@%$SET_MAKE%g -s%@CC@%$CC%g -s%@LN_S@%$LN_S%g -s%@OBJEXT@%$OBJEXT%g -s%@EXEEXT@%$EXEEXT%g -s%@RANLIB@%$RANLIB%g -s%@STRIP@%$STRIP%g -s%@LIBTOOL@%$LIBTOOL%g -s%@use_sysroot@%$use_sysroot%g -s%@TARGET_SYSTEM_ROOT@%$TARGET_SYSTEM_ROOT%g -s%@TARGET_SYSTEM_ROOT_DEFINE@%$TARGET_SYSTEM_ROOT_DEFINE%g -s%@WARN_CFLAGS@%$WARN_CFLAGS%g -s%@NO_WERROR@%$NO_WERROR%g -s%@CPP@%$CPP%g -s%@ALLOCA@%$ALLOCA%g -s%@USE_NLS@%$USE_NLS%g -s%@MSGFMT@%$MSGFMT%g -s%@GMSGFMT@%$GMSGFMT%g -s%@XGETTEXT@%$XGETTEXT%g -s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g -s%@CATALOGS@%$CATALOGS%g -s%@CATOBJEXT@%$CATOBJEXT%g -s%@DATADIRNAME@%$DATADIRNAME%g -s%@GMOFILES@%$GMOFILES%g -s%@INSTOBJEXT@%$INSTOBJEXT%g -s%@INTLDEPS@%$INTLDEPS%g -s%@INTLLIBS@%$INTLLIBS%g -s%@INTLOBJS@%$INTLOBJS%g -s%@POFILES@%$POFILES%g -s%@POSUB@%$POSUB%g -s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g -s%@GT_NO@%$GT_NO%g -s%@GT_YES@%$GT_YES%g -s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g -s%@l@%$l%g -s%@YACC@%$YACC%g -s%@LEX@%$LEX%g -s%@LEXLIB@%$LEXLIB%g -s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g -s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g -s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g -s%@MAINT@%$MAINT%g -s%@HDEFINES@%$HDEFINES%g -s%@HOSTING_CRT0@%$HOSTING_CRT0%g -s%@HOSTING_LIBS@%$HOSTING_LIBS%g -s%@NATIVE_LIB_DIRS@%$NATIVE_LIB_DIRS%g -s%@STRINGIFY@%$STRINGIFY%g -s%@EMUL@%$EMUL%g -/@TDIRS@/r $TDIRS -s%@TDIRS@%%g -s%@EMULATION_OFILES@%$EMULATION_OFILES%g -s%@EMUL_EXTRA_OFILES@%$EMUL_EXTRA_OFILES%g -s%@LIB_PATH@%$LIB_PATH%g -s%@EMULATION_LIBPATH@%$EMULATION_LIBPATH%g -s%@TESTBFDLIB@%$TESTBFDLIB%g +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in:po/Make-in" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@target@,$target,;t t +s,@target_cpu@,$target_cpu,;t t +s,@target_vendor@,$target_vendor,;t t +s,@target_os@,$target_os,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CYGPATH_W@,$CYGPATH_W,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@mkdir_p@,$mkdir_p,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@am__leading_dot@,$am__leading_dot,;t t +s,@AMTAR@,$AMTAR,;t t +s,@am__tar@,$am__tar,;t t +s,@am__untar@,$am__untar,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@LN_S@,$LN_S,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@LIBTOOL@,$LIBTOOL,;t t +s,@use_sysroot@,$use_sysroot,;t t +s,@TARGET_SYSTEM_ROOT@,$TARGET_SYSTEM_ROOT,;t t +s,@TARGET_SYSTEM_ROOT_DEFINE@,$TARGET_SYSTEM_ROOT_DEFINE,;t t +s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t +s,@NO_WERROR@,$NO_WERROR,;t t +s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t +s,@ALLOCA@,$ALLOCA,;t t +s,@USE_NLS@,$USE_NLS,;t t +s,@MSGFMT@,$MSGFMT,;t t +s,@GMSGFMT@,$GMSGFMT,;t t +s,@XGETTEXT@,$XGETTEXT,;t t +s,@USE_INCLUDED_LIBINTL@,$USE_INCLUDED_LIBINTL,;t t +s,@CATALOGS@,$CATALOGS,;t t +s,@CATOBJEXT@,$CATOBJEXT,;t t +s,@DATADIRNAME@,$DATADIRNAME,;t t +s,@GMOFILES@,$GMOFILES,;t t +s,@INSTOBJEXT@,$INSTOBJEXT,;t t +s,@INTLDEPS@,$INTLDEPS,;t t +s,@INTLLIBS@,$INTLLIBS,;t t +s,@INTLOBJS@,$INTLOBJS,;t t +s,@POFILES@,$POFILES,;t t +s,@POSUB@,$POSUB,;t t +s,@INCLUDE_LOCALE_H@,$INCLUDE_LOCALE_H,;t t +s,@GT_NO@,$GT_NO,;t t +s,@GT_YES@,$GT_YES,;t t +s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t +s,@l@,$l,;t t +s,@YACC@,$YACC,;t t +s,@LEX@,$LEX,;t t +s,@LEXLIB@,$LEXLIB,;t t +s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t +s,@HDEFINES@,$HDEFINES,;t t +s,@HOSTING_CRT0@,$HOSTING_CRT0,;t t +s,@HOSTING_LIBS@,$HOSTING_LIBS,;t t +s,@NATIVE_LIB_DIRS@,$NATIVE_LIB_DIRS,;t t +s,@STRINGIFY@,$STRINGIFY,;t t +s,@EMUL@,$EMUL,;t t +s,@EMULATION_OFILES@,$EMULATION_OFILES,;t t +s,@EMUL_EXTRA_OFILES@,$EMUL_EXTRA_OFILES,;t t +s,@LIB_PATH@,$LIB_PATH,;t t +s,@EMULATION_LIBPATH@,$EMULATION_LIBPATH,;t t +s,@TESTBFDLIB@,$TESTBFDLIB,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +/@TDIRS@/r $TDIRS +s,@TDIRS@,,;t t CEOF -EOF -cat >> $CONFIG_STATUS <<\EOF +_ACEOF -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF +fi # test -n "$CONFIG_FILES" -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; esac - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' +ac_uD=',;t' -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; esac - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - -EOF + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. - +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail -while : +while grep . conftest.undefs >/dev/null do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals -done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h - else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file fi - rm -f $ac_file - mv conftest.h $ac_file + else + cat $tmp/config.h + rm -f $tmp/config.h fi -fi; done +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'`/stamp-h$_am_stamp_count +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF -EOF -cat >> $CONFIG_STATUS </dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac -EOF -cat >> $CONFIG_STATUS <<\EOF -test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h -sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile -exit 0 -EOF + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + default ) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi diff -uprN binutils-2.16.90.0.3/ld/configure.host binutils-2.16.91.0.1/ld/configure.host --- binutils-2.16.90.0.3/ld/configure.host 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/ld/configure.host 2005-06-22 13:53:35.428230916 -0700 @@ -10,7 +10,7 @@ HDEFINES= HOSTING_CRT0=/lib/crt0.o -HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ]; then libgcc=../gcc/libgcc.a; else libgcc=\`${CC} -print-libgcc-file-name\`; fi; if [ -f ../gcc/libgcc_eh.a ]; then libgcc="$libgcc ../gcc/libgcc_eh.a"; else libgcc_eh=\`${CC} -print-file-name=libgcc_eh.a\`; if [ x"$libgcc_eh" != xlibgcc_eh.a ]; then libgcc="$libgcc $libgcc_eh"; fi; fi; echo --start-group $libgcc -lc --end-group`' +HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ]; then libgcc=../gcc/libgcc.a; else libgcc=\`${CC} -print-libgcc-file-name\`; fi; if [ -f ../gcc/libgcc_eh.a ]; then libgcc="$libgcc ../gcc/libgcc_eh.a"; else libgcc_eh=\`${CC} -print-file-name=libgcc_eh.a\`; if [ x"$libgcc_eh" != xlibgcc_eh.a ]; then libgcc="$libgcc $libgcc_eh"; fi; fi; if [ -f ../gcc/libunwind.a ]; then libgcc="$libgcc ../gcc/libunwind.a"; else libunwind=\`${CC} -print-file-name=libunwind.a\`; if [ x"$libunwind" != xlibunwind.a ]; then libgcc="$libgcc $libunwind"; fi; fi; echo --start-group $libgcc -lc --end-group`' # # Generic configurations: diff -uprN binutils-2.16.90.0.3/ld/configure.in binutils-2.16.91.0.1/ld/configure.in --- binutils-2.16.90.0.3/ld/configure.in 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/ld/configure.in 2005-06-22 13:53:35.428230916 -0700 @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script dnl -AC_PREREQ(2.13) +AC_PREREQ(2.57) AC_INIT(ldmain.c) AC_CANONICAL_SYSTEM @@ -66,48 +66,7 @@ AC_SUBST(use_sysroot) AC_SUBST(TARGET_SYSTEM_ROOT) AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) -dnl FIXME: The following is bfd/warning.m4 contents expanded -dnl When converting to current autotools, please replace with -dnl AM_BINUTILS_WARNINGS -WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" - -AC_ARG_ENABLE(werror, - [ --enable-werror treat compile warnings as errors], - [case "${enableval}" in - yes | y) ERROR_ON_WARNING="yes" ;; - no | n) ERROR_ON_WARNING="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;; - esac]) - -# Enable -Werror by default when using gcc -if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then - ERROR_ON_WARNING=yes -fi - -NO_WERROR= -if test "${ERROR_ON_WARNING}" = yes ; then - WARN_CFLAGS="$WARN_CFLAGS -Werror" - NO_WERROR="-Wno-error" -fi - -AC_ARG_ENABLE(build-warnings, -[ --enable-build-warnings Enable build-time compiler warnings], -[case "${enableval}" in - yes) ;; - no) WARN_CFLAGS="-w";; - ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${WARN_CFLAGS} ${t}";; - *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${t} ${WARN_CFLAGS}";; - *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; -esac]) - -if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then - echo "Setting warning flags = $WARN_CFLAGS" 6>&1 -fi - -AC_SUBST(WARN_CFLAGS) -AC_SUBST(NO_WERROR) +AM_BINUTILS_WARNINGS AM_CONFIG_HEADER(config.h:config.in) @@ -162,11 +121,7 @@ fi BFD_BINARY_FOPEN -BFD_NEED_DECLARATION(strstr) -BFD_NEED_DECLARATION(free) -BFD_NEED_DECLARATION(sbrk) -BFD_NEED_DECLARATION(getenv) -BFD_NEED_DECLARATION(environ) +AC_CHECK_DECLS([strstr, free, sbrk, getenv, environ]) # When converting linker scripts into strings for use in emulation # files, use astring.sed if the compiler supports ANSI string @@ -207,7 +162,7 @@ do all_targets=true else # Canonicalize the secondary target names. - result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ_alias 2>/dev/null` + result=`$ac_config_sub $targ_alias 2>/dev/null` if test -n "$result"; then targ=$result else diff -uprN binutils-2.16.90.0.3/ld/configure.tgt binutils-2.16.91.0.1/ld/configure.tgt --- binutils-2.16.90.0.3/ld/configure.tgt 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/ld/configure.tgt 2005-06-22 13:53:35.429230751 -0700 @@ -41,6 +41,7 @@ d30v-*-*ext*) targ_emul=d30v_e; targ_ex d30v-*-*onchip*) targ_emul=d30v_o; targ_extra_emuls="d30velf d30v_e" ;; d30v-*-*) targ_emul=d30velf; targ_extra_emuls="d30v_e d30v_o" ;; dlx-*-elf*) targ_emul=elf32_dlx ;; +ms1-*elf) targ_emul=elf32ms1 ;; sparc64-*-aout*) targ_emul=sparcaout ;; sparc64-*-elf*) targ_emul=elf64_sparc ;; sparc-sun-sunos4*) targ_emul=sun4 ;; diff -uprN binutils-2.16.90.0.3/ld/deffile.h binutils-2.16.91.0.1/ld/deffile.h --- binutils-2.16.90.0.3/ld/deffile.h 2004-01-14 13:07:52.000000000 -0800 +++ binutils-2.16.91.0.1/ld/deffile.h 2005-06-22 13:53:35.430230585 -0700 @@ -16,8 +16,8 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ #ifndef DEFFILE_H #define DEFFILE_H diff -uprN binutils-2.16.90.0.3/ld/deffilep.y binutils-2.16.91.0.1/ld/deffilep.y --- binutils-2.16.90.0.3/ld/deffilep.y 2005-04-09 12:03:19.000000000 -0700 +++ binutils-2.16.91.0.1/ld/deffilep.y 2005-06-22 13:53:35.434229925 -0700 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "libiberty.h" diff -uprN binutils-2.16.90.0.3/ld/emulparams/armelf_linux.sh binutils-2.16.91.0.1/ld/emulparams/armelf_linux.sh --- binutils-2.16.90.0.3/ld/emulparams/armelf_linux.sh 2004-09-27 13:46:07.000000000 -0700 +++ binutils-2.16.91.0.1/ld/emulparams/armelf_linux.sh 2005-06-22 13:53:35.577206301 -0700 @@ -8,6 +8,7 @@ COMMONPAGESIZE=0x1000 TEMPLATE_NAME=elf32 EXTRA_EM_FILE=armelf GENERATE_SHLIB_SCRIPT=yes +GENERATE_PIE_SCRIPT=yes DATA_START_SYMBOLS='__data_start = . ;'; OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)' diff -uprN binutils-2.16.90.0.3/ld/emulparams/elf32btsmip.sh binutils-2.16.91.0.1/ld/emulparams/elf32btsmip.sh --- binutils-2.16.90.0.3/ld/emulparams/elf32btsmip.sh 2002-02-03 11:22:32.000000000 -0800 +++ binutils-2.16.91.0.1/ld/emulparams/elf32btsmip.sh 2005-06-22 13:53:35.580205806 -0700 @@ -5,5 +5,6 @@ OUTPUT_FORMAT="elf32-tradbigmips" BIG_OUTPUT_FORMAT="elf32-tradbigmips" LITTLE_OUTPUT_FORMAT="elf32-tradlittlemips" +unset DATA_ADDR SHLIB_TEXT_START_ADDR=0 ENTRY=__start diff -uprN binutils-2.16.90.0.3/ld/emulparams/elf32ms1.sh binutils-2.16.91.0.1/ld/emulparams/elf32ms1.sh --- binutils-2.16.90.0.3/ld/emulparams/elf32ms1.sh 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/ld/emulparams/elf32ms1.sh 2005-06-22 13:53:35.580205806 -0700 @@ -0,0 +1,24 @@ +MACHINE= +SCRIPT_NAME=elf +OUTPUT_FORMAT="elf32-ms1" +# See also `include/elf/ms1.h' +TEXT_START_ADDR=0x2000 +ARCH=ms1 +ENTRY=_start +EMBEDDED=yes +ELFSIZE=32 +MAXPAGESIZE=256 +# This is like setting STACK_ADDR to 0x0073FFFF0, except that the setting can +# be overridden, e.g. --defsym _stack=0x0f00, and that we put an extra +# sentinal value at the bottom. +# N.B. We can't use PROVIDE to set the default value in a symbol because +# the address is needed to place the .stack section, which in turn is needed +# to hold the sentinel value(s). +test -z "$CREATE_SHLIB" && OTHER_SECTIONS=" .stack ${RELOCATING-0}${RELOCATING+(DEFINED(__stack) ? __stack : 0x007FFFF0)} : + { + ${RELOCATING+__stack = .;} + *(.stack) + LONG(0xdeaddead) + }" +# We do not need .stack for shared library. +test -n "$CREATE_SHLIB" && OTHER_SECTIONS="" diff -uprN binutils-2.16.90.0.3/ld/emulparams/elf32ppc.sh binutils-2.16.91.0.1/ld/emulparams/elf32ppc.sh --- binutils-2.16.90.0.3/ld/emulparams/elf32ppc.sh 2004-05-27 11:26:05.000000000 -0700 +++ binutils-2.16.91.0.1/ld/emulparams/elf32ppc.sh 2005-06-22 13:53:35.581205640 -0700 @@ -12,7 +12,16 @@ MAXPAGESIZE=0x10000 COMMONPAGESIZE=0x1000 ARCH=powerpc:common MACHINE= +# Yes, we want duplicate .got and .plt sections. The linker chooses the +# appropriate one magically in ppc_after_open +DATA_GOT= +SDATA_GOT= +SEPARATE_GOTPLT=0 BSS_PLT= +GOT=".got ${RELOCATING-0} : SPECIAL { *(.got) }" +PLT=".plt ${RELOCATING-0} : SPECIAL { *(.plt) }" +GOTPLT="${PLT}" +OTHER_TEXT_SECTIONS="*(.glink)" EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);' OTHER_BSS_END_SYMBOLS='__end = .;' OTHER_RELRO_SECTIONS=" diff -uprN binutils-2.16.90.0.3/ld/emulparams/elf32xtensa.sh binutils-2.16.91.0.1/ld/emulparams/elf32xtensa.sh --- binutils-2.16.90.0.3/ld/emulparams/elf32xtensa.sh 2004-11-22 12:33:33.000000000 -0800 +++ binutils-2.16.91.0.1/ld/emulparams/elf32xtensa.sh 2005-06-22 13:53:35.586204814 -0700 @@ -15,6 +15,8 @@ MACHINE= GENERATE_SHLIB_SCRIPT=yes GENERATE_COMBRELOC_SCRIPT=yes NO_SMALL_DATA=yes +PLT="/* .plt* sections are embedded in .text */" +GOT=".got ${RELOCATING-0} : { *(.got) }" OTHER_READONLY_SECTIONS=" .got.loc ${RELOCATING-0} : { *(.got.loc) } .xt_except_table ${RELOCATING-0} : { KEEP (*(.xt_except_table)) } diff -uprN binutils-2.16.90.0.3/ld/emulparams/elf64alpha.sh binutils-2.16.91.0.1/ld/emulparams/elf64alpha.sh --- binutils-2.16.90.0.3/ld/emulparams/elf64alpha.sh 2004-01-14 13:07:52.000000000 -0800 +++ binutils-2.16.91.0.1/ld/emulparams/elf64alpha.sh 2005-06-22 13:53:35.587204649 -0700 @@ -12,7 +12,13 @@ ARCH=alpha MACHINE= GENERATE_SHLIB_SCRIPT=yes GENERATE_PIE_SCRIPT=yes -DATA_PLT= + +# Yes, we want duplicate .plt sections. The linker chooses the +# appropriate one magically in alpha_after_open. +PLT=".plt ${RELOCATING-0} : SPECIAL { *(.plt) }" +DATA_PLT=yes +TEXT_PLT=yes + # Note that the number is always big-endian, thus we have to # reverse the digit string. NOP=0x0000fe2f1f04ff47 # unop; nop diff -uprN binutils-2.16.90.0.3/ld/emulparams/hppalinux.sh binutils-2.16.91.0.1/ld/emulparams/hppalinux.sh --- binutils-2.16.90.0.3/ld/emulparams/hppalinux.sh 2004-07-27 21:36:11.000000000 -0700 +++ binutils-2.16.91.0.1/ld/emulparams/hppalinux.sh 2005-06-22 13:53:35.589204319 -0700 @@ -17,5 +17,6 @@ DATA_START_SYMBOLS='PROVIDE ($global$ = DATA_PLT= PLT_BEFORE_GOT= GENERATE_SHLIB_SCRIPT=yes +oGENERATE_PIE_SCRIPT=yes TEMPLATE_NAME=elf32 EXTRA_EM_FILE=hppaelf diff -uprN binutils-2.16.90.0.3/ld/emultempl/aix.em binutils-2.16.91.0.1/ld/emultempl/aix.em --- binutils-2.16.90.0.3/ld/emultempl/aix.em 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/ld/emultempl/aix.em 2005-06-22 13:53:35.590204154 -0700 @@ -30,7 +30,7 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #define TARGET_IS_${EMULATION_NAME} diff -uprN binutils-2.16.90.0.3/ld/emultempl/alphaelf.em binutils-2.16.91.0.1/ld/emultempl/alphaelf.em --- binutils-2.16.90.0.3/ld/emultempl/alphaelf.em 2005-04-09 12:03:23.000000000 -0700 +++ binutils-2.16.91.0.1/ld/emultempl/alphaelf.em 2005-06-22 13:53:35.590204154 -0700 @@ -1,5 +1,5 @@ # This shell script emits a C file. -*- C -*- -# Copyright 2003, 2004 Free Software Foundation, Inc. +# Copyright 2003, 2004, 2005 Free Software Foundation, Inc. # # This file is part of GLD, the Gnu Linker. # @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # This file is sourced from elf32.em, and defines extra alpha @@ -27,15 +27,54 @@ cat >>e${EMULATION_NAME}.c <creator == &bfd_elf64_alpha_vec + || link_info.hash->creator == &bfd_elf64_alpha_freebsd_vec) + { + unsigned int num_plt; + lang_output_section_statement_type *os; + lang_output_section_statement_type *plt_os[2]; + + num_plt = 0; + for (os = &lang_output_section_statement.head->output_section_statement; + os != NULL; + os = os->next) + { + if (os->constraint == SPECIAL && strcmp (os->name, ".plt") == 0) + { + if (num_plt < 2) + plt_os[num_plt] = os; + ++num_plt; + } + } + + if (num_plt == 2) + { + plt_os[0]->constraint = elf64_alpha_use_secureplt ? 0 : -1; + plt_os[1]->constraint = elf64_alpha_use_secureplt ? -1 : 0; + } + } + + gld${EMULATION_NAME}_after_open (); +} + +static void alpha_after_parse (void) { - if (elf64alpha_32bit && !link_info.shared && !link_info.relocatable) + if (limit_32bit && !link_info.shared && !link_info.relocatable) lang_section_start (".interp", exp_binop ('+', exp_intop (ALPHA_TEXT_START_32BIT), @@ -44,9 +83,20 @@ alpha_after_parse (void) } static void +alpha_before_allocation (void) +{ + /* Call main function; we're just extending it. */ + gld${EMULATION_NAME}_before_allocation (); + + /* Add -relax if -O, not -r, and not explicitly disabled. */ + if (link_info.optimize && !link_info.relocatable && !disable_relaxation) + command_line.relax = TRUE; +} + +static void alpha_finish (void) { - if (elf64alpha_32bit) + if (limit_32bit) elf_elfheader (output_bfd)->e_flags |= EF_ALPHA_32BIT; gld${EMULATION_NAME}_finish (); @@ -57,25 +107,47 @@ EOF # parse_args and list_options functions. # PARSE_AND_LIST_PROLOGUE=' -#define OPTION_TASO 300 +#define OPTION_TASO 300 +#define OPTION_NO_RELAX (OPTION_TASO + 1) +#define OPTION_SECUREPLT (OPTION_NO_RELAX + 1) +#define OPTION_NO_SECUREPLT (OPTION_SECUREPLT + 1) ' PARSE_AND_LIST_LONGOPTS=' - {"taso", no_argument, NULL, OPTION_TASO}, + { "taso", no_argument, NULL, OPTION_TASO }, + { "no-relax", no_argument, NULL, OPTION_NO_RELAX }, + { "secureplt", no_argument, NULL, OPTION_SECUREPLT }, + { "no-secureplt", no_argument, NULL, OPTION_NO_SECUREPLT }, ' PARSE_AND_LIST_OPTIONS=' - fprintf (file, _(" -taso\t\t\tLoad executable in the lower 31-bit addressable\n")); - fprintf (file, _("\t\t\t virtual address range\n")); + fprintf (file, _("\ + --taso Load executable in the lower 31-bit addressable\n\ + virtual address range.\n\ + --no-relax Do not relax call and gp sequences.\n\ + --secureplt Force PLT in text segment.\n\ + --no-secureplt Force PLT in data segment.\n\ +")); ' PARSE_AND_LIST_ARGS_CASES=' case OPTION_TASO: - elf64alpha_32bit = 1; + limit_32bit = 1; + break; + case OPTION_NO_RELAX: + disable_relaxation = TRUE; + break; + case OPTION_SECUREPLT: + elf64_alpha_use_secureplt = TRUE; + break; + case OPTION_NO_SECUREPLT: + elf64_alpha_use_secureplt = FALSE; break; ' # Put these extra alpha routines in ld_${EMULATION_NAME}_emulation # +LDEMUL_AFTER_OPEN=alpha_after_open LDEMUL_AFTER_PARSE=alpha_after_parse +LDEMUL_BEFORE_ALLOCATION=alpha_before_allocation LDEMUL_FINISH=alpha_finish diff -uprN binutils-2.16.90.0.3/ld/emultempl/armcoff.em binutils-2.16.91.0.1/ld/emultempl/armcoff.em --- binutils-2.16.90.0.3/ld/emultempl/armcoff.em 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/ld/emultempl/armcoff.em 2005-06-22 13:53:35.591203988 -0700 @@ -22,7 +22,7 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #define TARGET_IS_${EMULATION_NAME} diff -uprN binutils-2.16.90.0.3/ld/emultempl/armelf.em binutils-2.16.91.0.1/ld/emultempl/armelf.em --- binutils-2.16.90.0.3/ld/emultempl/armelf.em 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/ld/emultempl/armelf.em 2005-06-22 13:53:35.591203988 -0700 @@ -17,13 +17,13 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # This file is sourced from elf32.em, and defines extra arm-elf # specific routines. # -test -z $TARGET2_TYPE && TARGET2_TYPE="rel" +test -z "$TARGET2_TYPE" && TARGET2_TYPE="rel" cat >>e${EMULATION_NAME}.c <head, abs_output_section, - &stat_ptr->head, 0, (bfd_vma) 0, NULL, TRUE); + lang_size_sections (NULL, TRUE); /* Redo special stuff. */ ldemul_after_allocation (); /* Do the assignments again. */ - lang_do_assignments (stat_ptr->head, abs_output_section, - (fill_type *) 0, (bfd_vma) 0); + lang_do_assignments (); } static void diff -uprN binutils-2.16.90.0.3/ld/emultempl/generic.em binutils-2.16.91.0.1/ld/emultempl/generic.em --- binutils-2.16.90.0.3/ld/emultempl/generic.em 2005-04-09 12:03:24.000000000 -0700 +++ binutils-2.16.91.0.1/ld/emultempl/generic.em 2005-06-22 13:53:35.604201841 -0700 @@ -22,7 +22,7 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #define TARGET_IS_${EMULATION_NAME} diff -uprN binutils-2.16.90.0.3/ld/emultempl/gld960c.em binutils-2.16.91.0.1/ld/emultempl/gld960c.em --- binutils-2.16.90.0.3/ld/emultempl/gld960c.em 2005-04-09 12:03:24.000000000 -0700 +++ binutils-2.16.91.0.1/ld/emultempl/gld960c.em 2005-06-22 13:53:35.605201676 -0700 @@ -18,8 +18,8 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ +Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA +02110-1301, USA. */ /* * emulate the Intels port of gld diff -uprN binutils-2.16.90.0.3/ld/emultempl/gld960.em binutils-2.16.91.0.1/ld/emultempl/gld960.em --- binutils-2.16.90.0.3/ld/emultempl/gld960.em 2005-04-09 12:03:24.000000000 -0700 +++ binutils-2.16.91.0.1/ld/emultempl/gld960.em 2005-06-22 13:53:35.604201841 -0700 @@ -18,7 +18,7 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* * emulate the Intels port of gld diff -uprN binutils-2.16.90.0.3/ld/emultempl/hppaelf.em binutils-2.16.91.0.1/ld/emultempl/hppaelf.em --- binutils-2.16.90.0.3/ld/emultempl/hppaelf.em 2005-04-09 12:03:24.000000000 -0700 +++ binutils-2.16.91.0.1/ld/emultempl/hppaelf.em 2005-06-22 13:53:35.605201676 -0700 @@ -16,7 +16,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # This file is sourced from elf32.em, and defines extra hppa-elf diff -uprN binutils-2.16.90.0.3/ld/emultempl/ia64elf.em binutils-2.16.91.0.1/ld/emultempl/ia64elf.em --- binutils-2.16.90.0.3/ld/emultempl/ia64elf.em 2004-01-14 13:07:53.000000000 -0800 +++ binutils-2.16.91.0.1/ld/emultempl/ia64elf.em 2005-06-22 13:53:35.606201510 -0700 @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # This file is sourced from elf32.em, and defines extra ia64-elf diff -uprN binutils-2.16.90.0.3/ld/emultempl/irix.em binutils-2.16.91.0.1/ld/emultempl/irix.em --- binutils-2.16.90.0.3/ld/emultempl/irix.em 2004-04-12 12:56:36.000000000 -0700 +++ binutils-2.16.91.0.1/ld/emultempl/irix.em 2005-06-22 13:53:35.606201510 -0700 @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # cat >>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <creator == &bfd_elf32_powerpc_vec + || link_info.hash->creator == &bfd_elf32_powerpcle_vec) + { + int new_plt; + int keep_new; + unsigned int num_plt; + unsigned int num_got; + lang_output_section_statement_type *os; + lang_output_section_statement_type *plt_os[2]; + lang_output_section_statement_type *got_os[2]; + + new_plt = ppc_elf_select_plt_layout (output_bfd, &link_info, old_plt); + if (new_plt < 0) + einfo ("%X%P: select_plt_layout problem %E\n"); + + num_got = 0; + num_plt = 0; + for (os = &lang_output_section_statement.head->output_section_statement; + os != NULL; + os = os->next) + { + if (os->constraint == SPECIAL && strcmp (os->name, ".plt") == 0) + { + if (num_plt < 2) + plt_os[num_plt] = os; + ++num_plt; + } + if (os->constraint == SPECIAL && strcmp (os->name, ".got") == 0) + { + if (num_got < 2) + got_os[num_got] = os; + ++num_got; + } + } + + keep_new = new_plt == 1 ? 0 : -1; + if (num_plt == 2) + { + plt_os[0]->constraint = keep_new; + plt_os[1]->constraint = ~keep_new; + } + if (num_got == 2) + { + if (old_got) + keep_new = -1; + got_os[0]->constraint = keep_new; + got_os[1]->constraint = ~keep_new; + } + } + + gld${EMULATION_NAME}_after_open (); +} + static void ppc_before_allocation (void) { @@ -53,8 +113,9 @@ ppc_before_allocation (void) static void gld${EMULATION_NAME}_after_allocation (void) { - if (link_info.hash->creator == &bfd_elf32_powerpc_vec - || link_info.hash->creator == &bfd_elf32_powerpcle_vec) + if ((link_info.hash->creator == &bfd_elf32_powerpc_vec + || link_info.hash->creator == &bfd_elf32_powerpcle_vec) + && !link_info.relocatable) { if (!ppc_elf_set_sdata_syms (output_bfd, &link_info)) einfo ("%X%P: cannot set sdata syms %E\n"); @@ -68,15 +129,21 @@ EOF # PARSE_AND_LIST_PROLOGUE=' #define OPTION_NO_TLS_OPT 301 +#define OPTION_OLD_PLT 302 +#define OPTION_OLD_GOT 303 ' PARSE_AND_LIST_LONGOPTS=' { "no-tls-optimize", no_argument, NULL, OPTION_NO_TLS_OPT }, + { "bss-plt", no_argument, NULL, OPTION_OLD_PLT }, + { "sdata-got", no_argument, NULL, OPTION_OLD_GOT }, ' PARSE_AND_LIST_OPTIONS=' fprintf (file, _("\ - --no-tls-optimize Don'\''t try to optimize TLS accesses.\n" + --no-tls-optimize Don'\''t try to optimize TLS accesses.\n\ + --bss-plt Force old-style BSS PLT.\n\ + --sdata-got Force GOT location just before .sdata.\n" )); ' @@ -84,9 +151,18 @@ PARSE_AND_LIST_ARGS_CASES=' case OPTION_NO_TLS_OPT: notlsopt = 1; break; + + case OPTION_OLD_PLT: + old_plt = 1; + break; + + case OPTION_OLD_GOT: + old_got = 1; + break; ' # Put these extra ppc32elf routines in ld_${EMULATION_NAME}_emulation # +LDEMUL_AFTER_OPEN=ppc_after_open LDEMUL_BEFORE_ALLOCATION=ppc_before_allocation LDEMUL_AFTER_ALLOCATION=gld${EMULATION_NAME}_after_allocation diff -uprN binutils-2.16.90.0.3/ld/emultempl/ppc64elf.em binutils-2.16.91.0.1/ld/emultempl/ppc64elf.em --- binutils-2.16.90.0.3/ld/emultempl/ppc64elf.em 2005-04-09 12:03:24.000000000 -0700 +++ binutils-2.16.91.0.1/ld/emultempl/ppc64elf.em 2005-06-22 13:53:35.625198372 -0700 @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # This file is sourced from elf32.em, and defines extra powerpc64-elf @@ -102,22 +102,22 @@ ppc_before_allocation (void) { if (stub_file != NULL) { - if (!no_opd_opt - && !ppc64_elf_edit_opd (output_bfd, &link_info, non_overlapping_opd)) + if (!ppc64_elf_edit_opd (output_bfd, &link_info, no_opd_opt, + non_overlapping_opd)) einfo ("%X%P: can not edit %s %E\n", "opd"); if (ppc64_elf_tls_setup (output_bfd, &link_info) && !no_tls_opt) { /* Size the sections. This is premature, but we want to know the TLS segment layout so that certain optimizations can be done. */ - lang_size_sections (stat_ptr->head, abs_output_section, - &stat_ptr->head, 0, 0, NULL, TRUE); + expld.phase = lang_mark_phase_enum; + expld.dataseg.phase = exp_dataseg_none; + one_lang_size_sections_pass (NULL, TRUE); if (!ppc64_elf_tls_optimize (output_bfd, &link_info)) einfo ("%X%P: TLS problem %E\n"); /* We must not cache anything from the preliminary sizing. */ - elf_tdata (output_bfd)->program_header_size = 0; lang_reset_memory_regions (); } diff -uprN binutils-2.16.90.0.3/ld/emultempl/sh64elf.em binutils-2.16.91.0.1/ld/emultempl/sh64elf.em --- binutils-2.16.90.0.3/ld/emultempl/sh64elf.em 2004-07-27 21:36:11.000000000 -0700 +++ binutils-2.16.91.0.1/ld/emultempl/sh64elf.em 2005-06-22 13:53:35.625198372 -0700 @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # This file is sourced from elf32.em, and defines extra sh64 diff -uprN binutils-2.16.90.0.3/ld/emultempl/sunos.em binutils-2.16.91.0.1/ld/emultempl/sunos.em --- binutils-2.16.90.0.3/ld/emultempl/sunos.em 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/ld/emultempl/sunos.em 2005-06-22 13:53:35.637196389 -0700 @@ -28,7 +28,7 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #define TARGET_IS_${EMULATION_NAME} diff -uprN binutils-2.16.90.0.3/ld/emultempl/ticoff.em binutils-2.16.91.0.1/ld/emultempl/ticoff.em --- binutils-2.16.90.0.3/ld/emultempl/ticoff.em 2004-01-14 13:07:53.000000000 -0800 +++ binutils-2.16.91.0.1/ld/emultempl/ticoff.em 2005-06-22 13:53:35.637196389 -0700 @@ -17,7 +17,7 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* For TI COFF */ /* Need to determine load and run pages for output sections */ diff -uprN binutils-2.16.90.0.3/ld/emultempl/vanilla.em binutils-2.16.91.0.1/ld/emultempl/vanilla.em --- binutils-2.16.90.0.3/ld/emultempl/vanilla.em 2004-01-14 13:07:53.000000000 -0800 +++ binutils-2.16.91.0.1/ld/emultempl/vanilla.em 2005-06-22 13:53:35.638196224 -0700 @@ -20,7 +20,7 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #include "bfd.h" #include "sysdep.h" diff -uprN binutils-2.16.90.0.3/ld/emultempl/xtensaelf.em binutils-2.16.91.0.1/ld/emultempl/xtensaelf.em --- binutils-2.16.90.0.3/ld/emultempl/xtensaelf.em 2005-04-09 12:03:24.000000000 -0700 +++ binutils-2.16.91.0.1/ld/emultempl/xtensaelf.em 2005-06-22 13:53:35.639196059 -0700 @@ -16,7 +16,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # This file is sourced from elf32.em, and defines extra xtensa-elf diff -uprN binutils-2.16.90.0.3/ld/fdl.texi binutils-2.16.91.0.1/ld/fdl.texi --- binutils-2.16.90.0.3/ld/fdl.texi 2005-04-09 12:03:20.000000000 -0700 +++ binutils-2.16.91.0.1/ld/fdl.texi 2005-06-22 13:53:35.436229594 -0700 @@ -5,7 +5,7 @@ @display Copyright (C) 2000, 2003 Free Software Foundation, Inc. -59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. diff -uprN binutils-2.16.90.0.3/ld/ldcref.c binutils-2.16.91.0.1/ld/ldcref.c --- binutils-2.16.90.0.3/ld/ldcref.c 2005-04-09 12:03:20.000000000 -0700 +++ binutils-2.16.91.0.1/ld/ldcref.c 2005-06-22 13:53:35.451227116 -0700 @@ -17,7 +17,7 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file holds routines that manage the cross reference table. The table is used to generate cross reference reports. It is also diff -uprN binutils-2.16.90.0.3/ld/ldctor.c binutils-2.16.91.0.1/ld/ldctor.c --- binutils-2.16.90.0.3/ld/ldctor.c 2004-11-22 12:33:32.000000000 -0800 +++ binutils-2.16.91.0.1/ld/ldctor.c 2005-06-22 13:53:35.457226125 -0700 @@ -17,8 +17,8 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ +Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA +02110-1301, USA. */ #include "bfd.h" #include "sysdep.h" diff -uprN binutils-2.16.90.0.3/ld/ldctor.h binutils-2.16.91.0.1/ld/ldctor.h --- binutils-2.16.90.0.3/ld/ldctor.h 2004-01-14 13:07:52.000000000 -0800 +++ binutils-2.16.91.0.1/ld/ldctor.h 2005-06-22 13:53:35.458225960 -0700 @@ -16,8 +16,8 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ +Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA +02110-1301, USA. */ #ifndef LDCTOR_H #define LDCTOR_H diff -uprN binutils-2.16.90.0.3/ld/ldemul.c binutils-2.16.91.0.1/ld/ldemul.c --- binutils-2.16.90.0.3/ld/ldemul.c 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/ld/ldemul.c 2005-06-22 13:53:35.458225960 -0700 @@ -17,8 +17,8 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ +Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA +02110-1301, USA. */ #include "config.h" #include "bfd.h" diff -uprN binutils-2.16.90.0.3/ld/ldexp.c binutils-2.16.91.0.1/ld/ldexp.c --- binutils-2.16.90.0.3/ld/ldexp.c 2005-04-09 12:03:20.000000000 -0700 +++ binutils-2.16.91.0.1/ld/ldexp.c 2005-06-22 13:53:35.477222821 -0700 @@ -18,8 +18,8 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ /* This module is in charge of working out the contents of expressions. @@ -41,17 +41,13 @@ #include "libiberty.h" #include "safe-ctype.h" -static etree_value_type exp_fold_tree_no_dot - (etree_type *, lang_output_section_statement_type *, lang_phase_type); -static bfd_vma align_n - (bfd_vma, bfd_vma); - -struct exp_data_seg exp_data_seg; +static void exp_fold_tree_1 (etree_type *); +static void exp_fold_tree_no_dot (etree_type *); +static bfd_vma align_n (bfd_vma, bfd_vma); segment_type *segments; -/* Principally used for diagnostics. */ -static bfd_boolean assigning_to_dot = FALSE; +struct ldexp_control expld; /* Print the string representation of the given token. Surround it with spaces if INFIX_P is TRUE. */ @@ -133,22 +129,19 @@ exp_print_token (token_code_type code, i } static void -make_abs (etree_value_type *ptr) +make_abs (void) { - asection *s = ptr->section->bfd_section; - ptr->value += s->vma; - ptr->section = abs_output_section; + expld.result.value += expld.result.section->vma; + expld.result.section = bfd_abs_section_ptr; } -static etree_value_type +static void new_abs (bfd_vma value) { - etree_value_type new; - new.valid_p = TRUE; - new.section = abs_output_section; - new.value = value; - new.str = NULL; - return new; + expld.result.valid_p = TRUE; + expld.result.section = bfd_abs_section_ptr; + expld.result.value = value; + expld.result.str = NULL; } etree_type * @@ -186,112 +179,87 @@ exp_relop (asection *section, bfd_vma va return new; } -static etree_value_type -new_rel (bfd_vma value, - char *str, - lang_output_section_statement_type *section) -{ - etree_value_type new; - new.valid_p = TRUE; - new.value = value; - new.str = str; - new.section = section; - return new; +static void +new_rel (bfd_vma value, char *str, asection *section) +{ + expld.result.valid_p = TRUE; + expld.result.value = value; + expld.result.str = str; + expld.result.section = section; } -static etree_value_type -new_rel_from_section (bfd_vma value, - lang_output_section_statement_type *section) -{ - etree_value_type new; - new.valid_p = TRUE; - new.value = value; - new.str = NULL; - new.section = section; - - new.value -= section->bfd_section->vma; - - return new; +static void +new_rel_from_abs (bfd_vma value) +{ + expld.result.valid_p = TRUE; + expld.result.value = value - expld.section->vma; + expld.result.str = NULL; + expld.result.section = expld.section; } -static etree_value_type -fold_unary (etree_type *tree, - lang_output_section_statement_type *current_section, - lang_phase_type allocation_done, - bfd_vma dot, - bfd_vma *dotp) -{ - etree_value_type result; - - result = exp_fold_tree (tree->unary.child, - current_section, - allocation_done, dot, dotp); - if (result.valid_p) +static void +fold_unary (etree_type *tree) +{ + exp_fold_tree_1 (tree->unary.child); + if (expld.result.valid_p) { switch (tree->type.node_code) { case ALIGN_K: - if (allocation_done != lang_first_phase_enum) - result = new_rel_from_section (align_n (dot, result.value), - current_section); + if (expld.phase != lang_first_phase_enum) + new_rel_from_abs (align_n (expld.dot, expld.result.value)); else - result.valid_p = FALSE; + expld.result.valid_p = FALSE; break; case ABSOLUTE: - if (allocation_done != lang_first_phase_enum) - { - result.value += result.section->bfd_section->vma; - result.section = abs_output_section; - } - else - result.valid_p = FALSE; + make_abs (); break; case '~': - make_abs (&result); - result.value = ~result.value; + make_abs (); + expld.result.value = ~expld.result.value; break; case '!': - make_abs (&result); - result.value = !result.value; + make_abs (); + expld.result.value = !expld.result.value; break; case '-': - make_abs (&result); - result.value = -result.value; + make_abs (); + expld.result.value = -expld.result.value; break; case NEXT: /* Return next place aligned to value. */ - if (allocation_done == lang_allocating_phase_enum) + if (expld.phase != lang_first_phase_enum) { - make_abs (&result); - result.value = align_n (dot, result.value); + make_abs (); + expld.result.value = align_n (expld.dot, expld.result.value); } else - result.valid_p = FALSE; + expld.result.valid_p = FALSE; break; case DATA_SEGMENT_END: - if (allocation_done != lang_first_phase_enum - && current_section == abs_output_section - && (exp_data_seg.phase == exp_dataseg_align_seen - || exp_data_seg.phase == exp_dataseg_relro_seen - || exp_data_seg.phase == exp_dataseg_adjust - || exp_data_seg.phase == exp_dataseg_relro_adjust - || allocation_done != lang_allocating_phase_enum)) + if (expld.phase != lang_first_phase_enum + && expld.section == bfd_abs_section_ptr + && (expld.dataseg.phase == exp_dataseg_align_seen + || expld.dataseg.phase == exp_dataseg_relro_seen + || expld.dataseg.phase == exp_dataseg_adjust + || expld.dataseg.phase == exp_dataseg_relro_adjust + || expld.phase == lang_final_phase_enum)) { - if (exp_data_seg.phase == exp_dataseg_align_seen - || exp_data_seg.phase == exp_dataseg_relro_seen) + if (expld.dataseg.phase == exp_dataseg_align_seen + || expld.dataseg.phase == exp_dataseg_relro_seen) { - exp_data_seg.phase = exp_dataseg_end_seen; - exp_data_seg.end = result.value; + expld.dataseg.phase = exp_dataseg_end_seen; + expld.dataseg.end = expld.result.value; } } else - result.valid_p = FALSE; + expld.result.valid_p = FALSE; break; default: @@ -299,25 +267,16 @@ fold_unary (etree_type *tree, break; } } - - return result; } -static etree_value_type -fold_binary (etree_type *tree, - lang_output_section_statement_type *current_section, - lang_phase_type allocation_done, - bfd_vma dot, - bfd_vma *dotp) +static void +fold_binary (etree_type *tree) { - etree_value_type result; - - result = exp_fold_tree (tree->binary.lhs, current_section, - allocation_done, dot, dotp); + exp_fold_tree_1 (tree->binary.lhs); /* The SEGMENT_START operator is special because its first operand is a string, not the name of a symbol. */ - if (result.valid_p && tree->type.node_code == SEGMENT_START) + if (expld.result.valid_p && tree->type.node_code == SEGMENT_START) { const char *segment_name; segment_type *seg; @@ -328,67 +287,70 @@ fold_binary (etree_type *tree, if (strcmp (seg->name, segment_name) == 0) { seg->used = TRUE; - result.value = seg->value; - result.str = NULL; - result.section = NULL; + expld.result.value = seg->value; + expld.result.str = NULL; + expld.result.section = NULL; break; } } - else if (result.valid_p) + else if (expld.result.valid_p) { - etree_value_type other; + etree_value_type lhs = expld.result; - other = exp_fold_tree (tree->binary.rhs, - current_section, - allocation_done, dot, dotp); - if (other.valid_p) + exp_fold_tree_1 (tree->binary.rhs); + if (expld.result.valid_p) { /* If the values are from different sections, or this is an absolute expression, make both the source arguments absolute. However, adding or subtracting an absolute value from a relative value is meaningful, and is an exception. */ - if (current_section != abs_output_section - && (other.section == abs_output_section - || (result.section == abs_output_section - && tree->type.node_code == '+')) + if (expld.section != bfd_abs_section_ptr + && lhs.section == bfd_abs_section_ptr + && tree->type.node_code == '+') + { + /* Keep the section of the rhs term. */ + expld.result.value = lhs.value + expld.result.value; + return; + } + else if (expld.section != bfd_abs_section_ptr + && expld.result.section == bfd_abs_section_ptr && (tree->type.node_code == '+' || tree->type.node_code == '-')) { - if (other.section != abs_output_section) - { - /* Keep the section of the other term. */ - if (tree->type.node_code == '+') - other.value = result.value + other.value; - else - other.value = result.value - other.value; - return other; - } + /* Keep the section of the lhs term. */ + expld.result.section = lhs.section; } - else if (result.section != other.section - || current_section == abs_output_section) + else if (expld.result.section != lhs.section + || expld.section == bfd_abs_section_ptr) { - make_abs (&result); - make_abs (&other); + make_abs (); + lhs.value += lhs.section->vma; } switch (tree->type.node_code) { case '%': - if (other.value == 0) + if (expld.result.value != 0) + expld.result.value = ((bfd_signed_vma) lhs.value + % (bfd_signed_vma) expld.result.value); + else if (expld.phase != lang_mark_phase_enum) einfo (_("%F%S %% by zero\n")); - result.value = ((bfd_signed_vma) result.value - % (bfd_signed_vma) other.value); break; case '/': - if (other.value == 0) + if (expld.result.value != 0) + expld.result.value = ((bfd_signed_vma) lhs.value + / (bfd_signed_vma) expld.result.value); + else if (expld.phase != lang_mark_phase_enum) einfo (_("%F%S / by zero\n")); - result.value = ((bfd_signed_vma) result.value - / (bfd_signed_vma) other.value); break; -#define BOP(x,y) case x : result.value = result.value y other.value; break; +#define BOP(x, y) \ + case x: \ + expld.result.value = lhs.value y expld.result.value; \ + break; + BOP ('+', +); BOP ('*', *); BOP ('-', -); @@ -407,77 +369,82 @@ fold_binary (etree_type *tree, BOP (OROR, ||); case MAX_K: - if (result.value < other.value) - result = other; + if (lhs.value > expld.result.value) + expld.result.value = lhs.value; break; case MIN_K: - if (result.value > other.value) - result = other; + if (lhs.value < expld.result.value) + expld.result.value = lhs.value; break; case ALIGN_K: - result.value = align_n (result.value, other.value); + expld.result.value = align_n (lhs.value, expld.result.value); break; case DATA_SEGMENT_ALIGN: - if (allocation_done != lang_first_phase_enum - && current_section == abs_output_section - && (exp_data_seg.phase == exp_dataseg_none - || exp_data_seg.phase == exp_dataseg_adjust - || exp_data_seg.phase == exp_dataseg_relro_adjust - || allocation_done != lang_allocating_phase_enum)) + if (expld.phase != lang_first_phase_enum + && expld.section == bfd_abs_section_ptr + && (expld.dataseg.phase == exp_dataseg_none + || expld.dataseg.phase == exp_dataseg_adjust + || expld.dataseg.phase == exp_dataseg_relro_adjust + || expld.phase == lang_final_phase_enum)) { - bfd_vma maxpage = result.value; + bfd_vma maxpage = lhs.value; + bfd_vma commonpage = expld.result.value; - result.value = align_n (dot, maxpage); - if (exp_data_seg.phase == exp_dataseg_relro_adjust) - result.value = exp_data_seg.base; - else if (exp_data_seg.phase != exp_dataseg_adjust) + expld.result.value = align_n (expld.dot, maxpage); + if (expld.dataseg.phase == exp_dataseg_relro_adjust) + expld.result.value = expld.dataseg.base; + else if (expld.dataseg.phase != exp_dataseg_adjust) { - result.value += dot & (maxpage - 1); - if (allocation_done == lang_allocating_phase_enum) + expld.result.value += expld.dot & (maxpage - 1); + if (expld.phase == lang_allocating_phase_enum) { - exp_data_seg.phase = exp_dataseg_align_seen; - exp_data_seg.min_base = align_n (dot, maxpage); - exp_data_seg.base = result.value; - exp_data_seg.pagesize = other.value; - exp_data_seg.maxpagesize = maxpage; - exp_data_seg.relro_end = 0; + expld.dataseg.phase = exp_dataseg_align_seen; + expld.dataseg.min_base = align_n (expld.dot, maxpage); + expld.dataseg.base = expld.result.value; + expld.dataseg.pagesize = commonpage; + expld.dataseg.maxpagesize = maxpage; + expld.dataseg.relro_end = 0; } } - else if (other.value < maxpage) - result.value += (dot + other.value - 1) - & (maxpage - other.value); + else if (commonpage < maxpage) + expld.result.value += ((expld.dot + commonpage - 1) + & (maxpage - commonpage)); } else - result.valid_p = FALSE; + expld.result.valid_p = FALSE; break; case DATA_SEGMENT_RELRO_END: - if (allocation_done != lang_first_phase_enum - && (exp_data_seg.phase == exp_dataseg_align_seen - || exp_data_seg.phase == exp_dataseg_adjust - || exp_data_seg.phase == exp_dataseg_relro_adjust - || allocation_done != lang_allocating_phase_enum)) + if (expld.phase != lang_first_phase_enum + && (expld.dataseg.phase == exp_dataseg_align_seen + || expld.dataseg.phase == exp_dataseg_adjust + || expld.dataseg.phase == exp_dataseg_relro_adjust + || expld.phase == lang_final_phase_enum)) { - if (exp_data_seg.phase == exp_dataseg_align_seen - || exp_data_seg.phase == exp_dataseg_relro_adjust) - exp_data_seg.relro_end - = result.value + other.value; - if (exp_data_seg.phase == exp_dataseg_relro_adjust - && (exp_data_seg.relro_end - & (exp_data_seg.pagesize - 1))) + if (expld.dataseg.phase == exp_dataseg_align_seen + || expld.dataseg.phase == exp_dataseg_relro_adjust) + expld.dataseg.relro_end = lhs.value + expld.result.value; + + if (expld.dataseg.phase == exp_dataseg_relro_adjust + && (expld.dataseg.relro_end + & (expld.dataseg.pagesize - 1))) { - exp_data_seg.relro_end += exp_data_seg.pagesize - 1; - exp_data_seg.relro_end &= ~(exp_data_seg.pagesize - 1); - result.value = exp_data_seg.relro_end - other.value; + expld.dataseg.relro_end += expld.dataseg.pagesize - 1; + expld.dataseg.relro_end &= ~(expld.dataseg.pagesize - 1); + expld.result.value = (expld.dataseg.relro_end + - expld.result.value); } - if (exp_data_seg.phase == exp_dataseg_align_seen) - exp_data_seg.phase = exp_dataseg_relro_seen; + else + expld.result.value = lhs.value; + + if (expld.dataseg.phase == exp_dataseg_align_seen) + expld.dataseg.phase = exp_dataseg_relro_seen; } else - result.valid_p = FALSE; + expld.result.valid_p = FALSE; break; default: @@ -485,54 +452,40 @@ fold_binary (etree_type *tree, } } else - { - result.valid_p = FALSE; - } + expld.result.valid_p = FALSE; } - - return result; } -static etree_value_type -fold_trinary (etree_type *tree, - lang_output_section_statement_type *current_section, - lang_phase_type allocation_done, - bfd_vma dot, - bfd_vma *dotp) +static void +fold_trinary (etree_type *tree) { - etree_value_type result; - - result = exp_fold_tree (tree->trinary.cond, current_section, - allocation_done, dot, dotp); - if (result.valid_p) - result = exp_fold_tree ((result.value - ? tree->trinary.lhs - : tree->trinary.rhs), - current_section, - allocation_done, dot, dotp); - - return result; + exp_fold_tree_1 (tree->trinary.cond); + if (expld.result.valid_p) + exp_fold_tree_1 (expld.result.value + ? tree->trinary.lhs + : tree->trinary.rhs); } -static etree_value_type -fold_name (etree_type *tree, - lang_output_section_statement_type *current_section, - lang_phase_type allocation_done, - bfd_vma dot) +static void +fold_name (etree_type *tree) { - etree_value_type result; - - result.valid_p = FALSE; + memset (&expld.result, 0, sizeof (expld.result)); switch (tree->type.node_code) { case SIZEOF_HEADERS: - if (allocation_done != lang_first_phase_enum) - result = new_abs (bfd_sizeof_headers (output_bfd, - link_info.relocatable)); + if (expld.phase != lang_first_phase_enum) + { + bfd_vma hdr_size = 0; + /* Don't find the real header size if only marking sections; + The bfd function may cache incorrect data. */ + if (expld.phase != lang_mark_phase_enum) + hdr_size = bfd_sizeof_headers (output_bfd, link_info.relocatable); + new_abs (hdr_size); + } break; case DEFINED: - if (allocation_done == lang_first_phase_enum) + if (expld.phase == lang_first_phase_enum) lang_track_definedness (tree->name.name); else { @@ -543,23 +496,22 @@ fold_name (etree_type *tree, h = bfd_wrapped_link_hash_lookup (output_bfd, &link_info, tree->name.name, FALSE, FALSE, TRUE); - result.value = (h != NULL - && (h->type == bfd_link_hash_defined - || h->type == bfd_link_hash_defweak - || h->type == bfd_link_hash_common) - && (def_iteration == lang_statement_iteration - || def_iteration == -1)); - result.section = abs_output_section; - result.valid_p = TRUE; + expld.result.value = (h != NULL + && (h->type == bfd_link_hash_defined + || h->type == bfd_link_hash_defweak + || h->type == bfd_link_hash_common) + && (def_iteration == lang_statement_iteration + || def_iteration == -1)); + expld.result.section = bfd_abs_section_ptr; + expld.result.valid_p = TRUE; } break; case NAME: - if (tree->name.name[0] == '.' && tree->name.name[1] == 0) - { - if (allocation_done != lang_first_phase_enum) - result = new_rel_from_section (dot, current_section); - } - else if (allocation_done != lang_first_phase_enum) + if (expld.phase == lang_first_phase_enum) + ; + else if (tree->name.name[0] == '.' && tree->name.name[1] == 0) + new_rel_from_abs (expld.dot); + else { struct bfd_link_hash_entry *h; @@ -572,35 +524,26 @@ fold_name (etree_type *tree, || h->type == bfd_link_hash_defweak) { if (bfd_is_abs_section (h->u.def.section)) - result = new_abs (h->u.def.value); - else if (allocation_done == lang_final_phase_enum - || allocation_done == lang_allocating_phase_enum) + new_abs (h->u.def.value); + else { asection *output_section; output_section = h->u.def.section->output_section; if (output_section == NULL) - einfo (_("%X%S: unresolvable symbol `%s' referenced in expression\n"), - tree->name.name); - else { - lang_output_section_statement_type *os; - - os = (lang_output_section_statement_lookup - (bfd_get_section_name (output_bfd, - output_section))); - - /* FIXME: Is this correct if this section is - being linked with -R? */ - result = new_rel ((h->u.def.value - + h->u.def.section->output_offset), - NULL, - os); + if (expld.phase != lang_mark_phase_enum) + einfo (_("%X%S: unresolvable symbol `%s'" + " referenced in expression\n"), + tree->name.name); } + else + new_rel (h->u.def.value + h->u.def.section->output_offset, + NULL, output_section); } } - else if (allocation_done == lang_final_phase_enum - || assigning_to_dot) + else if (expld.phase == lang_final_phase_enum + || expld.assigning_to_dot) einfo (_("%F%S: undefined symbol `%s' referenced in expression\n"), tree->name.name); else if (h->type == bfd_link_hash_new) @@ -614,43 +557,41 @@ fold_name (etree_type *tree, break; case ADDR: - if (allocation_done != lang_first_phase_enum) + if (expld.phase != lang_first_phase_enum) { lang_output_section_statement_type *os; os = lang_output_section_find (tree->name.name); - if (os && os->processed > 0) - result = new_rel (0, NULL, os); + if (os != NULL && os->processed > 0) + new_rel (0, NULL, os->bfd_section); } break; case LOADADDR: - if (allocation_done != lang_first_phase_enum) + if (expld.phase != lang_first_phase_enum) { lang_output_section_statement_type *os; os = lang_output_section_find (tree->name.name); - if (os && os->processed != 0) + if (os != NULL && os->processed > 0) { if (os->load_base == NULL) - result = new_rel (0, NULL, os); + new_rel (0, NULL, os->bfd_section); else - result = exp_fold_tree_no_dot (os->load_base, - abs_output_section, - allocation_done); + exp_fold_tree_1 (os->load_base); } } break; case SIZEOF: - if (allocation_done != lang_first_phase_enum) + if (expld.phase != lang_first_phase_enum) { int opb = bfd_octets_per_byte (output_bfd); lang_output_section_statement_type *os; os = lang_output_section_find (tree->name.name); - if (os && os->processed > 0) - result = new_abs (os->bfd_section->size / opb); + if (os != NULL && os->processed > 0) + new_abs (os->bfd_section->size / opb); } break; @@ -660,10 +601,10 @@ fold_name (etree_type *tree, mem = lang_memory_region_lookup (tree->name.name, FALSE); if (mem != NULL) - result = new_abs (mem->length); + new_abs (mem->length); else - einfo (_("%F%S: undefined MEMORY region `%s' referenced in expression\n"), - tree->name.name); + einfo (_("%F%S: undefined MEMORY region `%s'" + " referenced in expression\n"), tree->name.name); } break; @@ -673,10 +614,10 @@ fold_name (etree_type *tree, mem = lang_memory_region_lookup (tree->name.name, FALSE); if (mem != NULL) - result = new_abs (mem->origin); + new_abs (mem->origin); else - einfo (_("%F%S: undefined MEMORY region `%s' referenced in expression\n"), - tree->name.name); + einfo (_("%F%S: undefined MEMORY region `%s'" + " referenced in expression\n"), tree->name.name); } break; @@ -684,63 +625,57 @@ fold_name (etree_type *tree, FAIL (); break; } - - return result; } -etree_value_type -exp_fold_tree (etree_type *tree, - lang_output_section_statement_type *current_section, - lang_phase_type allocation_done, - bfd_vma dot, - bfd_vma *dotp) +static void +exp_fold_tree_1 (etree_type *tree) { - etree_value_type result; - if (tree == NULL) { - memset (&result, 0, sizeof (result)); - return result; + memset (&expld.result, 0, sizeof (expld.result)); + return; } switch (tree->type.node_class) { case etree_value: - result = new_rel (tree->value.value, tree->value.str, current_section); + new_rel (tree->value.value, tree->value.str, expld.section); break; case etree_rel: - if (allocation_done != lang_final_phase_enum) - memset (&result, 0, sizeof (result)); + if (expld.phase != lang_first_phase_enum) + { + asection *output_section = tree->rel.section->output_section; + new_rel (tree->rel.value + tree->rel.section->output_offset, + NULL, output_section); + } else - result = new_rel ((tree->rel.value - + tree->rel.section->output_section->vma - + tree->rel.section->output_offset), - NULL, - current_section); + memset (&expld.result, 0, sizeof (expld.result)); break; case etree_assert: - result = exp_fold_tree (tree->assert_s.child, - current_section, - allocation_done, dot, dotp); - if (result.valid_p && !result.value) - einfo ("%X%P: %s\n", tree->assert_s.message); + exp_fold_tree_1 (tree->assert_s.child); + if (expld.result.valid_p) + { + if (expld.phase == lang_mark_phase_enum) + /* We don't care if assert fails or not when we are just + marking if a section is used or not. */ + expld.result.value = 1; + else if (!expld.result.value) + einfo ("%X%P: %s\n", tree->assert_s.message); + } break; case etree_unary: - result = fold_unary (tree, current_section, allocation_done, - dot, dotp); + fold_unary (tree); break; case etree_binary: - result = fold_binary (tree, current_section, allocation_done, - dot, dotp); + fold_binary (tree); break; case etree_trinary: - result = fold_trinary (tree, current_section, allocation_done, - dot, dotp); + fold_trinary (tree); break; case etree_assign: @@ -751,124 +686,128 @@ exp_fold_tree (etree_type *tree, /* Assignment to dot can only be done during allocation. */ if (tree->type.node_class != etree_assign) einfo (_("%F%S can not PROVIDE assignment to location counter\n")); - if (allocation_done == lang_allocating_phase_enum - || (allocation_done == lang_final_phase_enum - && current_section == abs_output_section)) + if (expld.phase == lang_mark_phase_enum + || expld.phase == lang_allocating_phase_enum + || (expld.phase == lang_final_phase_enum + && expld.section == bfd_abs_section_ptr)) { /* Notify the folder that this is an assignment to dot. */ - assigning_to_dot = TRUE; - result = exp_fold_tree (tree->assign.src, - current_section, - allocation_done, dot, dotp); - assigning_to_dot = FALSE; + expld.assigning_to_dot = TRUE; + exp_fold_tree_1 (tree->assign.src); + expld.assigning_to_dot = FALSE; - if (! result.valid_p) - einfo (_("%F%S invalid assignment to location counter\n")); + if (!expld.result.valid_p) + { + if (expld.phase != lang_mark_phase_enum) + einfo (_("%F%S invalid assignment to location counter\n")); + } + else if (expld.dotp == NULL) + einfo (_("%F%S assignment to location counter" + " invalid outside of SECTION\n")); else { - if (current_section == NULL) - einfo (_("%F%S assignment to location counter invalid outside of SECTION\n")); + bfd_vma nextdot; + + nextdot = expld.result.value + expld.section->vma; + if (nextdot < expld.dot + && expld.section != bfd_abs_section_ptr) + einfo (_("%F%S cannot move location counter backwards" + " (from %V to %V)\n"), expld.dot, nextdot); else { - bfd_vma nextdot; - - nextdot = (result.value - + current_section->bfd_section->vma); - if (nextdot < dot - && current_section != abs_output_section) - einfo (_("%F%S cannot move location counter backwards (from %V to %V)\n"), - dot, nextdot); - else - *dotp = nextdot; + expld.dot = nextdot; + *expld.dotp = nextdot; } } } else - memset (&result, 0, sizeof (result)); + memset (&expld.result, 0, sizeof (expld.result)); } else { - result = exp_fold_tree (tree->assign.src, - current_section, allocation_done, - dot, dotp); - if (result.valid_p) - { - bfd_boolean create; - struct bfd_link_hash_entry *h; + struct bfd_link_hash_entry *h = NULL; - if (tree->type.node_class == etree_assign) - create = TRUE; - else - create = FALSE; + if (tree->type.node_class == etree_provide) + { h = bfd_link_hash_lookup (link_info.hash, tree->assign.dst, - create, FALSE, TRUE); + FALSE, FALSE, TRUE); + if (h == NULL + || (h->type != bfd_link_hash_new + && h->type != bfd_link_hash_undefined + && h->type != bfd_link_hash_common)) + { + /* Do nothing. The symbol was never referenced, or was + defined by some object. */ + break; + } + } + + exp_fold_tree_1 (tree->assign.src); + if (expld.result.valid_p) + { if (h == NULL) { - if (create) + h = bfd_link_hash_lookup (link_info.hash, tree->assign.dst, + TRUE, FALSE, TRUE); + if (h == NULL) einfo (_("%P%F:%s: hash creation failed\n"), tree->assign.dst); } - else if (tree->type.node_class == etree_provide - && h->type != bfd_link_hash_new - && h->type != bfd_link_hash_undefined - && h->type != bfd_link_hash_common) - { - /* Do nothing. The symbol was defined by some - object. */ - } - else - { - /* FIXME: Should we worry if the symbol is already - defined? */ - lang_update_definedness (tree->assign.dst, h); - h->type = bfd_link_hash_defined; - h->u.def.value = result.value; - h->u.def.section = result.section->bfd_section; - if (tree->type.node_class == etree_provide) - tree->type.node_class = etree_provided; - } + + /* FIXME: Should we worry if the symbol is already + defined? */ + lang_update_definedness (tree->assign.dst, h); + h->type = bfd_link_hash_defined; + h->u.def.value = expld.result.value; + h->u.def.section = expld.result.section; + if (tree->type.node_class == etree_provide) + tree->type.node_class = etree_provided; } } break; case etree_name: - result = fold_name (tree, current_section, allocation_done, dot); + fold_name (tree); break; default: FAIL (); - memset (&result, 0, sizeof (result)); + memset (&expld.result, 0, sizeof (expld.result)); break; } +} - return result; +void +exp_fold_tree (etree_type *tree, asection *current_section, bfd_vma *dotp) +{ + expld.dot = *dotp; + expld.dotp = dotp; + expld.section = current_section; + exp_fold_tree_1 (tree); } -static etree_value_type -exp_fold_tree_no_dot (etree_type *tree, - lang_output_section_statement_type *current_section, - lang_phase_type allocation_done) +static void +exp_fold_tree_no_dot (etree_type *tree) { - return exp_fold_tree (tree, current_section, allocation_done, 0, NULL); + expld.dot = 0; + expld.dotp = NULL; + expld.section = bfd_abs_section_ptr; + exp_fold_tree_1 (tree); } etree_type * exp_binop (int code, etree_type *lhs, etree_type *rhs) { etree_type value, *new; - etree_value_type r; value.type.node_code = code; value.binary.lhs = lhs; value.binary.rhs = rhs; value.type.node_class = etree_binary; - r = exp_fold_tree_no_dot (&value, - abs_output_section, - lang_first_phase_enum); - if (r.valid_p) - { - return exp_intop (r.value); - } + exp_fold_tree_no_dot (&value); + if (expld.result.valid_p) + return exp_intop (expld.result.value); + new = stat_alloc (sizeof (new->binary)); memcpy (new, &value, sizeof (new->binary)); return new; @@ -878,15 +817,15 @@ etree_type * exp_trinop (int code, etree_type *cond, etree_type *lhs, etree_type *rhs) { etree_type value, *new; - etree_value_type r; + value.type.node_code = code; value.trinary.lhs = lhs; value.trinary.cond = cond; value.trinary.rhs = rhs; value.type.node_class = etree_trinary; - r = exp_fold_tree_no_dot (&value, NULL, lang_first_phase_enum); - if (r.valid_p) - return exp_intop (r.value); + exp_fold_tree_no_dot (&value); + if (expld.result.valid_p) + return exp_intop (expld.result.value); new = stat_alloc (sizeof (new->trinary)); memcpy (new, &value, sizeof (new->trinary)); @@ -898,14 +837,12 @@ exp_unop (int code, etree_type *child) { etree_type value, *new; - etree_value_type r; value.unary.type.node_code = code; value.unary.child = child; value.unary.type.node_class = etree_unary; - r = exp_fold_tree_no_dot (&value, abs_output_section, - lang_first_phase_enum); - if (r.valid_p) - return exp_intop (r.value); + exp_fold_tree_no_dot (&value); + if (expld.result.valid_p) + return exp_intop (expld.result.value); new = stat_alloc (sizeof (new->unary)); memcpy (new, &value, sizeof (new->unary)); @@ -916,14 +853,14 @@ etree_type * exp_nameop (int code, const char *name) { etree_type value, *new; - etree_value_type r; + value.name.type.node_code = code; value.name.name = name; value.name.type.node_class = etree_name; - r = exp_fold_tree_no_dot (&value, NULL, lang_first_phase_enum); - if (r.valid_p) - return exp_intop (r.value); + exp_fold_tree_no_dot (&value); + if (expld.result.valid_p) + return exp_intop (expld.result.value); new = stat_alloc (sizeof (new->name)); memcpy (new, &value, sizeof (new->name)); @@ -934,16 +871,13 @@ exp_nameop (int code, const char *name) etree_type * exp_assop (int code, const char *dst, etree_type *src) { - etree_type value, *new; - - value.assign.type.node_code = code; - - value.assign.src = src; - value.assign.dst = dst; - value.assign.type.node_class = etree_assign; + etree_type *new; new = stat_alloc (sizeof (new->assign)); - memcpy (new, &value, sizeof (new->assign)); + new->type.node_code = code; + new->type.node_class = etree_assign; + new->assign.src = src; + new->assign.dst = dst; return new; } @@ -1040,9 +974,6 @@ exp_print_tree (etree_type *tree) fprintf (config.map_file, ", %s)", tree->assert_s.message); break; - case etree_undef: - fprintf (config.map_file, "????????"); - break; case etree_name: if (tree->type.node_code == NAME) { @@ -1062,59 +993,51 @@ exp_print_tree (etree_type *tree) } bfd_vma -exp_get_vma (etree_type *tree, - bfd_vma def, - char *name, - lang_phase_type allocation_done) +exp_get_vma (etree_type *tree, bfd_vma def, char *name) { - etree_value_type r; - if (tree != NULL) { - r = exp_fold_tree_no_dot (tree, abs_output_section, allocation_done); - if (! r.valid_p && name != NULL) + exp_fold_tree_no_dot (tree); + if (expld.result.valid_p) + return expld.result.value; + else if (name != NULL && expld.phase != lang_mark_phase_enum) einfo (_("%F%S nonconstant expression for %s\n"), name); - return r.value; } - else - return def; + return def; } int -exp_get_value_int (etree_type *tree, - int def, - char *name, - lang_phase_type allocation_done) +exp_get_value_int (etree_type *tree, int def, char *name) { - return exp_get_vma (tree, def, name, allocation_done); + return exp_get_vma (tree, def, name); } fill_type * -exp_get_fill (etree_type *tree, - fill_type *def, - char *name, - lang_phase_type allocation_done) +exp_get_fill (etree_type *tree, fill_type *def, char *name) { fill_type *fill; - etree_value_type r; size_t len; unsigned int val; if (tree == NULL) return def; - r = exp_fold_tree_no_dot (tree, abs_output_section, allocation_done); - if (! r.valid_p && name != NULL) - einfo (_("%F%S nonconstant expression for %s\n"), name); + exp_fold_tree_no_dot (tree); + if (!expld.result.valid_p) + { + if (name != NULL && expld.phase != lang_mark_phase_enum) + einfo (_("%F%S nonconstant expression for %s\n"), name); + return def; + } - if (r.str != NULL && (len = strlen (r.str)) != 0) + if (expld.result.str != NULL && (len = strlen (expld.result.str)) != 0) { unsigned char *dst; unsigned char *s; fill = xmalloc ((len + 1) / 2 + sizeof (*fill) - 1); fill->size = (len + 1) / 2; dst = fill->data; - s = (unsigned char *) r.str; + s = (unsigned char *) expld.result.str; val = 0; do { @@ -1137,7 +1060,7 @@ exp_get_fill (etree_type *tree, else { fill = xmalloc (4 + sizeof (*fill) - 1); - val = r.value; + val = expld.result.value; fill->data[0] = (val >> 24) & 0xff; fill->data[1] = (val >> 16) & 0xff; fill->data[2] = (val >> 8) & 0xff; @@ -1148,20 +1071,21 @@ exp_get_fill (etree_type *tree, } bfd_vma -exp_get_abs_int (etree_type *tree, - int def ATTRIBUTE_UNUSED, - char *name, - lang_phase_type allocation_done) +exp_get_abs_int (etree_type *tree, int def, char *name) { - etree_value_type res; - res = exp_fold_tree_no_dot (tree, abs_output_section, allocation_done); - - if (res.valid_p) - res.value += res.section->bfd_section->vma; - else - einfo (_("%F%S non constant expression for %s\n"), name); + if (tree != NULL) + { + exp_fold_tree_no_dot (tree); - return res.value; + if (expld.result.valid_p) + { + expld.result.value += expld.result.section->vma; + return expld.result.value; + } + else if (name != NULL && expld.phase != lang_mark_phase_enum) + einfo (_("%F%S non constant expression for %s\n"), name); + } + return def; } static bfd_vma diff -uprN binutils-2.16.90.0.3/ld/ldexp.h binutils-2.16.91.0.1/ld/ldexp.h --- binutils-2.16.90.0.3/ld/ldexp.h 2004-12-20 11:16:51.000000000 -0800 +++ binutils-2.16.91.0.1/ld/ldexp.h 2005-06-22 13:53:35.483221830 -0700 @@ -1,6 +1,6 @@ /* ldexp.h - Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, - 2003, 2004 Free Software Foundation, Inc. + 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -16,8 +16,8 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ #ifndef LDEXP_H #define LDEXP_H @@ -26,7 +26,7 @@ typedef struct { bfd_vma value; char *str; - struct lang_output_section_statement_struct *section; + asection *section; bfd_boolean valid_p; } etree_value_type; @@ -40,8 +40,6 @@ typedef struct { etree_assign, etree_provide, etree_provided, - etree_undef, - etree_unspec, etree_value, etree_assert, etree_rel @@ -91,17 +89,44 @@ typedef union etree_union { } assert_s; } etree_type; -extern struct exp_data_seg { - enum { - exp_dataseg_none, - exp_dataseg_align_seen, - exp_dataseg_relro_seen, - exp_dataseg_end_seen, - exp_dataseg_relro_adjust, - exp_dataseg_adjust - } phase; - bfd_vma base, min_base, relro_end, end, pagesize, maxpagesize; -} exp_data_seg; +typedef enum { + lang_first_phase_enum, + lang_mark_phase_enum, + lang_allocating_phase_enum, + lang_final_phase_enum +} lang_phase_type; + +struct ldexp_control { + /* Modify expression evaluation depending on this. */ + lang_phase_type phase; + + /* Principally used for diagnostics. */ + bfd_boolean assigning_to_dot; + + /* Working results. */ + etree_value_type result; + bfd_vma dot; + + /* Current dot and section passed to ldexp folder. */ + bfd_vma *dotp; + asection *section; + + /* State machine and results for DATASEG. */ + struct { + enum { + exp_dataseg_none, + exp_dataseg_align_seen, + exp_dataseg_relro_seen, + exp_dataseg_end_seen, + exp_dataseg_relro_adjust, + exp_dataseg_adjust + } phase; + + bfd_vma base, min_base, relro_end, end, pagesize, maxpagesize; + } dataseg; +}; + +extern struct ldexp_control expld; /* A maps from a segment name to a base address. */ typedef struct segment_struct { @@ -127,11 +152,8 @@ etree_type *exp_bigintop (bfd_vma, char *); etree_type *exp_relop (asection *, bfd_vma); -etree_value_type invalid - (void); -etree_value_type exp_fold_tree - (etree_type *, struct lang_output_section_statement_struct *, - lang_phase_type, bfd_vma, bfd_vma *); +void exp_fold_tree + (etree_type *, asection *, bfd_vma *); etree_type *exp_binop (int, etree_type *, etree_type *); etree_type *exp_trinop @@ -149,12 +171,12 @@ etree_type *exp_assert void exp_print_tree (etree_type *); bfd_vma exp_get_vma - (etree_type *, bfd_vma, char *, lang_phase_type); + (etree_type *, bfd_vma, char *); int exp_get_value_int - (etree_type *, int, char *, lang_phase_type); + (etree_type *, int, char *); fill_type *exp_get_fill - (etree_type *, fill_type *, char *, lang_phase_type); + (etree_type *, fill_type *, char *); bfd_vma exp_get_abs_int - (etree_type *, int, char *, lang_phase_type); + (etree_type *, int, char *); #endif diff -uprN binutils-2.16.90.0.3/ld/ldfile.c binutils-2.16.91.0.1/ld/ldfile.c --- binutils-2.16.90.0.3/ld/ldfile.c 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/ld/ldfile.c 2005-06-22 13:53:35.483221830 -0700 @@ -16,8 +16,8 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ /* ldfile.c: look after all the file stuff. */ diff -uprN binutils-2.16.90.0.3/ld/ldfile.h binutils-2.16.91.0.1/ld/ldfile.h --- binutils-2.16.90.0.3/ld/ldfile.h 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/ld/ldfile.h 2005-06-22 13:53:35.484221665 -0700 @@ -16,8 +16,8 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + the Free Software Foundation, 51 Franklin Street - Fifth Floor, + Boston, MA 02110-1301, USA. */ #ifndef LDFILE_H #define LDFILE_H diff -uprN binutils-2.16.90.0.3/ld/ldgram.y binutils-2.16.91.0.1/ld/ldgram.y --- binutils-2.16.90.0.3/ld/ldgram.y 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/ld/ldgram.y 2005-06-22 13:53:35.485221499 -0700 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ %{ /* @@ -151,7 +151,7 @@ static int error_index; %token INPUT_SCRIPT INPUT_MRI_SCRIPT INPUT_DEFSYM CASE EXTERN START %token VERS_TAG VERS_IDENTIFIER %token GLOBAL LOCAL VERSIONK INPUT_VERSION_SCRIPT -%token KEEP ONLY_IF_RO ONLY_IF_RW +%token KEEP ONLY_IF_RO ONLY_IF_RW SPECIAL %token EXCLUDE_FILE %type vers_defns %type vers_tag @@ -600,10 +600,7 @@ length: fill_exp: mustbe_exp { - $$ = exp_get_fill ($1, - 0, - "fill value", - lang_first_phase_enum); + $$ = exp_get_fill ($1, 0, "fill value"); } ; @@ -681,18 +678,16 @@ memory_spec: NAME origin_spec: ORIGIN '=' mustbe_exp - { region->current = - region->origin = - exp_get_vma($3, 0L,"origin", lang_first_phase_enum); -} + { + region->origin = exp_get_vma ($3, 0, "origin"); + region->current = region->origin; + } ; length_spec: LENGTH '=' mustbe_exp - { region->length = exp_get_vma($3, - ~((bfd_vma)0), - "length", - lang_first_phase_enum); + { + region->length = exp_get_vma ($3, -1, "length"); } ; @@ -899,6 +894,7 @@ opt_subalign: sect_constraint: ONLY_IF_RO { $$ = ONLY_IF_RO; } | ONLY_IF_RW { $$ = ONLY_IF_RW; } + | SPECIAL { $$ = SPECIAL; } | { $$ = 0; } ; diff -uprN binutils-2.16.90.0.3/ld/ld.h binutils-2.16.91.0.1/ld/ld.h --- binutils-2.16.90.0.3/ld/ld.h 2005-04-09 12:03:20.000000000 -0700 +++ binutils-2.16.91.0.1/ld/ld.h 2005-06-22 13:53:35.436229594 -0700 @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ #ifndef LD_H #define LD_H @@ -238,12 +238,6 @@ typedef struct { extern ld_config_type config; -typedef enum { - lang_first_phase_enum, - lang_allocating_phase_enum, - lang_final_phase_enum -} lang_phase_type; - extern FILE * saved_script_handle; extern bfd_boolean force_make_executable; diff -uprN binutils-2.16.90.0.3/ld/ldint.texinfo binutils-2.16.91.0.1/ld/ldint.texinfo --- binutils-2.16.90.0.3/ld/ldint.texinfo 2004-01-14 13:07:52.000000000 -0800 +++ binutils-2.16.91.0.1/ld/ldint.texinfo 2005-06-22 13:53:35.502218691 -0700 @@ -699,7 +699,7 @@ require more work on behalf of loader th Version 1.1, March 2000 Copyright (C) 2000 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. diff -uprN binutils-2.16.90.0.3/ld/ldlang.c binutils-2.16.91.0.1/ld/ldlang.c --- binutils-2.16.90.0.3/ld/ldlang.c 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/ld/ldlang.c 2005-06-22 13:53:35.512217039 -0700 @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ #include "bfd.h" #include "sysdep.h" @@ -91,6 +91,7 @@ lang_statement_list_type lang_output_sec lang_statement_list_type *stat_ptr = &statement_list; lang_statement_list_type file_chain = { NULL, NULL }; struct bfd_sym_chain entry_symbol = { NULL, NULL }; +static const char *entry_symbol_default = "start"; const char *entry_section = ".text"; bfd_boolean entry_from_cmdline; bfd_boolean lang_has_input_file = FALSE; @@ -100,6 +101,9 @@ bfd_boolean delete_output_file_on_failur struct lang_nocrossrefs *nocrossref_list; static struct unique_sections *unique_section_list; static bfd_boolean ldlang_sysrooted_script = FALSE; + + /* Functions that traverse the linker script and might evaluate + DEFINED() need to increment this. */ int lang_statement_iteration = 0; etree_type *base; /* Relocation base - or null */ @@ -894,9 +898,6 @@ lang_init (void) if (!bfd_hash_table_init_n (&lang_definedness_table, lang_definedness_newfunc, 3)) einfo (_("%P%F: out of memory during initialization")); - - /* Callers of exp_fold_tree need to increment this. */ - lang_statement_iteration = 0; } /*---------------------------------------------------------------------- @@ -991,7 +992,9 @@ lang_output_section_find_1 (const char * { if (strcmp (name, lookup->name) == 0 && lookup->constraint != -1 - && (constraint == 0 || constraint == lookup->constraint)) + && (constraint == 0 + || (constraint == lookup->constraint + && constraint != SPECIAL))) return lookup; } return NULL; @@ -1022,6 +1025,7 @@ lang_output_section_statement_lookup_1 ( lookup->bfd_section = NULL; lookup->processed = 0; lookup->constraint = constraint; + lookup->ignored = FALSE; lookup->sectype = normal_section; lookup->addr_tree = NULL; lang_list_init (&lookup->children); @@ -2951,7 +2955,8 @@ map_input_to_output_sections case lang_output_section_statement_enum: if (s->output_section_statement.constraint) { - if (s->output_section_statement.constraint == -1) + if (s->output_section_statement.constraint != ONLY_IF_RW + && s->output_section_statement.constraint != ONLY_IF_RO) break; s->output_section_statement.all_input_readonly = TRUE; check_input_sections (s->output_section_statement.children.head, @@ -3047,33 +3052,71 @@ void strip_excluded_output_sections (void) { lang_output_section_statement_type *os; + unsigned int gc_sections; + + /* Run lang_size_sections (if not already done) to ensure that all + symbols defined in the linker script are put in the bfd hash + table. */ + if (expld.phase != lang_mark_phase_enum) + { + expld.phase = lang_mark_phase_enum; + expld.dataseg.phase = exp_dataseg_none; + one_lang_size_sections_pass (NULL, FALSE); + lang_reset_memory_regions (); + } + + /* Now call into bfd_gc_sections to mark all sections defining global + symbols with SEC_KEEP. */ + gc_sections = link_info.gc_sections; + link_info.gc_sections = 0; + bfd_gc_sections (output_bfd, &link_info); + link_info.gc_sections = gc_sections; for (os = &lang_output_section_statement.head->output_section_statement; os != NULL; os = os->next) { - asection *s; + asection *output_section; + bfd_boolean exclude; if (os->constraint == -1) continue; - if (os->bfd_section == NULL || os->bfd_section->map_head.s == NULL) + output_section = os->bfd_section; + if (output_section == NULL) continue; - for (s = os->bfd_section->map_head.s; s != NULL; s = s->map_head.s) - if ((s->flags & SEC_EXCLUDE) == 0) - break; + exclude = TRUE; + if (output_section->map_head.s != NULL) + { + asection *s; - os->bfd_section->map_head.link_order = NULL; - os->bfd_section->map_tail.link_order = NULL; + for (s = output_section->map_head.s; s != NULL; + s = s->map_head.s) + if ((s->flags & SEC_EXCLUDE) == 0) + { + exclude = FALSE; + break; + } - if (s == NULL) - { - s = os->bfd_section; - os->bfd_section = NULL; - if (!bfd_section_removed_from_list (output_bfd, s)) + output_section->map_head.link_order = NULL; + output_section->map_tail.link_order = NULL; + } + + if (exclude + && (output_section->flags & SEC_KEEP) == 0 + && output_section->rawsize == 0 + && !bfd_is_abs_section (output_section)) + { + /* We don't set bfd_section to NULL since bfd_section of the + removed output section statement may still be used. */ + os->ignored = TRUE; + output_section->flags |= SEC_EXCLUDE; + + if (!bfd_section_removed_from_list (output_bfd, + output_section)) { - bfd_section_list_remove (output_bfd, s); + bfd_section_list_remove (output_bfd, output_section); output_bfd->section_count--; } } @@ -3118,7 +3161,7 @@ print_output_section_statement bfd_vma addr; addr = exp_get_abs_int (output_section_statement->load_base, 0, - "load base", lang_final_phase_enum); + "load base"); minfo (_(" load address 0x%V"), addr); } } @@ -3130,41 +3173,117 @@ print_output_section_statement output_section_statement); } +/* Scan for the use of the destination in the right hand side + of an expression. In such cases we will not compute the + correct expression, since the value of DST that is used on + the right hand side will be its final value, not its value + just before this expression is evaluated. */ + +static bfd_boolean +scan_for_self_assignment (const char * dst, etree_type * rhs) +{ + if (rhs == NULL || dst == NULL) + return FALSE; + + switch (rhs->type.node_class) + { + case etree_binary: + return scan_for_self_assignment (dst, rhs->binary.lhs) + || scan_for_self_assignment (dst, rhs->binary.rhs); + + case etree_trinary: + return scan_for_self_assignment (dst, rhs->trinary.lhs) + || scan_for_self_assignment (dst, rhs->trinary.rhs); + + case etree_assign: + case etree_provided: + case etree_provide: + if (strcmp (dst, rhs->assign.dst) == 0) + return TRUE; + return scan_for_self_assignment (dst, rhs->assign.src); + + case etree_unary: + return scan_for_self_assignment (dst, rhs->unary.child); + + case etree_value: + if (rhs->value.str) + return strcmp (dst, rhs->value.str) == 0; + return FALSE; + + case etree_name: + if (rhs->name.name) + return strcmp (dst, rhs->name.name) == 0; + return FALSE; + + default: + break; + } + + return FALSE; +} + + static void print_assignment (lang_assignment_statement_type *assignment, lang_output_section_statement_type *output_section) { - int i; - int is_dot; + unsigned int i; + bfd_boolean is_dot; + bfd_boolean computation_is_valid = TRUE; etree_type *tree; - etree_value_type result; for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++) print_space (); if (assignment->exp->type.node_class == etree_assert) { - is_dot = 0; + is_dot = FALSE; tree = assignment->exp->assert_s.child; + computation_is_valid = TRUE; } else { const char *dst = assignment->exp->assign.dst; - is_dot = dst[0] == '.' && dst[1] == 0; + + is_dot = (dst[0] == '.' && dst[1] == 0); tree = assignment->exp->assign.src; + computation_is_valid = is_dot || (scan_for_self_assignment (dst, tree) == FALSE); } - result = exp_fold_tree (tree, output_section, lang_final_phase_enum, - print_dot, &print_dot); - if (result.valid_p) + exp_fold_tree (tree, output_section->bfd_section, &print_dot); + if (expld.result.valid_p) { bfd_vma value; - value = result.value + result.section->bfd_section->vma; + if (computation_is_valid) + { + value = expld.result.value; + + if (expld.result.section) + value += expld.result.section->vma; + + minfo ("0x%V", value); + if (is_dot) + print_dot = value; + } + else + { + struct bfd_link_hash_entry *h; + + h = bfd_link_hash_lookup (link_info.hash, assignment->exp->assign.dst, + FALSE, FALSE, TRUE); + if (h) + { + value = h->u.def.value; - minfo ("0x%V", value); - if (is_dot) - print_dot = value; + if (expld.result.section) + value += expld.result.section->vma; + + minfo ("[0x%V]", value); + } + else + minfo ("[unresolved]"); + } } else { @@ -3627,16 +3746,22 @@ insert_pad (lang_statement_union_type ** bfd_vma dot) { static fill_type zero_fill = { 1, { 0 } }; - lang_statement_union_type *pad; + lang_statement_union_type *pad = NULL; - pad = ((lang_statement_union_type *) - ((char *) ptr - offsetof (lang_statement_union_type, header.next))); - if (ptr != &statement_list.head + if (ptr != &statement_list.head) + pad = ((lang_statement_union_type *) + ((char *) ptr - offsetof (lang_statement_union_type, header.next))); + if (pad != NULL && pad->header.type == lang_padding_statement_enum && pad->padding_statement.output_section == output_section) { - /* Use the existing pad statement. The above test on output - section is probably redundant, but it doesn't hurt to check. */ + /* Use the existing pad statement. */ + } + else if ((pad = *ptr) != NULL + && pad->header.type == lang_padding_statement_enum + && pad->padding_statement.output_section == output_section) + { + /* Use the existing pad statement. */ } else { @@ -3851,12 +3976,12 @@ lang_size_sections_1 { case lang_output_section_statement_enum: { - bfd_vma after; + bfd_vma newdot, after; lang_output_section_statement_type *os; os = &s->output_section_statement; if (os->bfd_section == NULL) - /* This section was never actually created. */ + /* This section was removed or never actually created. */ break; /* If this is a COFF shared library section, use the size and @@ -3915,7 +4040,8 @@ lang_size_sections_1 && lang_memory_region_list != NULL && (strcmp (lang_memory_region_list->name, DEFAULT_MEMORY_REGION) != 0 - || lang_memory_region_list->next != NULL)) + || lang_memory_region_list->next != NULL) + && expld.phase != lang_mark_phase_enum) { /* By default this is an error rather than just a warning because if we allocate the section to the @@ -3938,80 +4064,80 @@ lang_size_sections_1 os->bfd_section)); } - dot = os->region->current; + newdot = os->region->current; if (os->section_alignment == -1) { - bfd_vma olddot; - - olddot = dot; - dot = align_power (dot, - os->bfd_section->alignment_power); - - if (dot != olddot && config.warn_section_align) + bfd_vma savedot = newdot; + newdot = align_power (newdot, + os->bfd_section->alignment_power); + + if (newdot != savedot + && config.warn_section_align + && expld.phase != lang_mark_phase_enum) einfo (_("%P: warning: changing start of section" - " %s by %u bytes\n"), - os->name, (unsigned int) (dot - olddot)); + " %s by %lu bytes\n"), + os->name, (unsigned long) (newdot - savedot)); } } else { - etree_value_type r; - + newdot = dot; os->processed = -1; - r = exp_fold_tree (os->addr_tree, - abs_output_section, - lang_allocating_phase_enum, - dot, &dot); + exp_fold_tree (os->addr_tree, bfd_abs_section_ptr, + &newdot); os->processed = 0; - if (!r.valid_p) + if (!expld.result.valid_p + && expld.phase != lang_mark_phase_enum) einfo (_("%F%S: non constant or forward reference" " address expression for section %s\n"), os->name); - dot = r.value + r.section->bfd_section->vma; + newdot = expld.result.value + expld.result.section->vma; } /* The section starts here. First, align to what the section needs. */ if (os->section_alignment != -1) - dot = align_power (dot, os->section_alignment); + newdot = align_power (newdot, os->section_alignment); - bfd_set_section_vma (0, os->bfd_section, dot); + bfd_set_section_vma (0, os->bfd_section, newdot); os->bfd_section->output_offset = 0; } lang_size_sections_1 (os->children.head, os, &os->children.head, - os->fill, dot, relax, check_regions); + os->fill, newdot, relax, check_regions); + + os->processed = 1; + + if (bfd_is_abs_section (os->bfd_section) || os->ignored) + { + ASSERT (os->bfd_section->size == 0); + break; + } + + dot = os->bfd_section->vma; /* Put the section within the requested block size, or align at the block boundary. */ - after = ((os->bfd_section->vma + after = ((dot + TO_ADDR (os->bfd_section->size) + os->block_value - 1) & - (bfd_vma) os->block_value); - if (bfd_is_abs_section (os->bfd_section)) - ASSERT (after == os->bfd_section->vma); - else - os->bfd_section->size - = TO_SIZE (after - os->bfd_section->vma); + os->bfd_section->size = TO_SIZE (after - os->bfd_section->vma); - dot = os->bfd_section->vma; /* .tbss sections effectively have zero size. */ if ((os->bfd_section->flags & SEC_HAS_CONTENTS) != 0 || (os->bfd_section->flags & SEC_THREAD_LOCAL) == 0 || link_info.relocatable) dot += TO_ADDR (os->bfd_section->size); - os->processed = 1; - if (os->update_dot_tree != 0) - exp_fold_tree (os->update_dot_tree, abs_output_section, - lang_allocating_phase_enum, dot, &dot); + exp_fold_tree (os->update_dot_tree, bfd_abs_section_ptr, &dot); /* Update dot in the region ? We only do this if the section is going to be allocated, @@ -4069,8 +4195,7 @@ lang_size_sections_1 /* We might refer to provided symbols in the expression, and need to mark them as needed. */ - exp_fold_tree (s->data_statement.exp, abs_output_section, - lang_allocating_phase_enum, dot, &dot); + exp_fold_tree (s->data_statement.exp, bfd_abs_section_ptr, &dot); switch (s->data_statement.type) { @@ -4112,21 +4237,21 @@ lang_size_sections_1 break; case lang_wild_statement_enum: - dot = lang_size_sections_1 (s->wild_statement.children.head, output_section_statement, &s->wild_statement.children.head, fill, dot, relax, check_regions); - break; case lang_object_symbols_statement_enum: link_info.create_object_symbols_section = output_section_statement->bfd_section; break; + case lang_output_statement_enum: case lang_target_statement_enum: break; + case lang_input_section_enum: { asection *i; @@ -4145,25 +4270,26 @@ lang_size_sections_1 output_section_statement->fill, dot); } break; + case lang_input_statement_enum: break; + case lang_fill_statement_enum: s->fill_statement.output_section = output_section_statement->bfd_section; fill = s->fill_statement.fill; break; + case lang_assignment_statement_enum: { bfd_vma newdot = dot; exp_fold_tree (s->assignment_statement.exp, - output_section_statement, - lang_allocating_phase_enum, - dot, + output_section_statement->bfd_section, &newdot); - if (newdot != dot) + if (newdot != dot && !output_section_statement->ignored) { if (output_section_statement == abs_output_section) { @@ -4182,15 +4308,15 @@ lang_size_sections_1 /* Don't neuter the pad below when relaxing. */ s = s->header.next; - } - - /* If dot is advanced, this implies that the section should - have space allocated to it, unless the user has explicitly - stated that the section should never be loaded. */ - if (!(output_section_statement->flags - & (SEC_NEVER_LOAD | SEC_ALLOC))) - output_section_statement->bfd_section->flags |= SEC_ALLOC; + /* If dot is advanced, this implies that the section + should have space allocated to it, unless the + user has explicitly stated that the section + should never be loaded. */ + if (!(output_section_statement->flags + & (SEC_NEVER_LOAD | SEC_ALLOC))) + output_section_statement->bfd_section->flags |= SEC_ALLOC; + } dot = newdot; } } @@ -4233,47 +4359,43 @@ lang_size_sections_1 return dot; } -bfd_vma -lang_size_sections - (lang_statement_union_type *s, - lang_output_section_statement_type *output_section_statement, - lang_statement_union_type **prev, - fill_type *fill, - bfd_vma dot, - bfd_boolean *relax, - bfd_boolean check_regions) +void +one_lang_size_sections_pass (bfd_boolean *relax, bfd_boolean check_regions) { - bfd_vma result; - - /* Callers of exp_fold_tree need to increment this. */ lang_statement_iteration++; + lang_size_sections_1 (statement_list.head, abs_output_section, + &statement_list.head, 0, 0, relax, check_regions); +} + +void +lang_size_sections (bfd_boolean *relax, bfd_boolean check_regions) +{ + expld.phase = lang_allocating_phase_enum; + expld.dataseg.phase = exp_dataseg_none; - exp_data_seg.phase = exp_dataseg_none; - result = lang_size_sections_1 (s, output_section_statement, prev, fill, - dot, relax, check_regions); - if (exp_data_seg.phase == exp_dataseg_end_seen - && link_info.relro && exp_data_seg.relro_end) + one_lang_size_sections_pass (relax, check_regions); + if (expld.dataseg.phase == exp_dataseg_end_seen + && link_info.relro && expld.dataseg.relro_end) { /* If DATA_SEGMENT_ALIGN DATA_SEGMENT_RELRO_END pair was seen, try - to put exp_data_seg.relro on a (common) page boundary. */ + to put expld.dataseg.relro on a (common) page boundary. */ bfd_vma old_min_base, relro_end, maxpage; - exp_data_seg.phase = exp_dataseg_relro_adjust; - old_min_base = exp_data_seg.min_base; - maxpage = exp_data_seg.maxpagesize; - exp_data_seg.base += (-exp_data_seg.relro_end - & (exp_data_seg.pagesize - 1)); + expld.dataseg.phase = exp_dataseg_relro_adjust; + old_min_base = expld.dataseg.min_base; + maxpage = expld.dataseg.maxpagesize; + expld.dataseg.base += (-expld.dataseg.relro_end + & (expld.dataseg.pagesize - 1)); /* Compute the expected PT_GNU_RELRO segment end. */ - relro_end = (exp_data_seg.relro_end + exp_data_seg.pagesize - 1) - & ~(exp_data_seg.pagesize - 1); - if (old_min_base + maxpage < exp_data_seg.base) + relro_end = (expld.dataseg.relro_end + expld.dataseg.pagesize - 1) + & ~(expld.dataseg.pagesize - 1); + if (old_min_base + maxpage < expld.dataseg.base) { - exp_data_seg.base -= maxpage; + expld.dataseg.base -= maxpage; relro_end -= maxpage; } - result = lang_size_sections_1 (s, output_section_statement, prev, fill, - dot, relax, check_regions); - if (exp_data_seg.relro_end > relro_end) + one_lang_size_sections_pass (relax, check_regions); + if (expld.dataseg.relro_end > relro_end) { /* The alignment of sections between DATA_SEGMENT_ALIGN and DATA_SEGMENT_RELRO_END caused huge padding to be @@ -4284,46 +4406,42 @@ lang_size_sections /* Find maximum alignment power of sections between DATA_SEGMENT_ALIGN and DATA_SEGMENT_RELRO_END. */ for (sec = output_bfd->sections; sec; sec = sec->next) - if (sec->vma >= exp_data_seg.base - && sec->vma < exp_data_seg.relro_end + if (sec->vma >= expld.dataseg.base + && sec->vma < expld.dataseg.relro_end && sec->alignment_power > max_alignment_power) max_alignment_power = sec->alignment_power; - if (((bfd_vma) 1 << max_alignment_power) < exp_data_seg.pagesize) + if (((bfd_vma) 1 << max_alignment_power) < expld.dataseg.pagesize) { - if (exp_data_seg.base - (1 << max_alignment_power) + if (expld.dataseg.base - (1 << max_alignment_power) < old_min_base) - exp_data_seg.base += exp_data_seg.pagesize; - exp_data_seg.base -= (1 << max_alignment_power); - result = lang_size_sections_1 (s, output_section_statement, - prev, fill, dot, relax, - check_regions); + expld.dataseg.base += expld.dataseg.pagesize; + expld.dataseg.base -= (1 << max_alignment_power); + one_lang_size_sections_pass (relax, check_regions); } } - link_info.relro_start = exp_data_seg.base; - link_info.relro_end = exp_data_seg.relro_end; + link_info.relro_start = expld.dataseg.base; + link_info.relro_end = expld.dataseg.relro_end; } - else if (exp_data_seg.phase == exp_dataseg_end_seen) + else if (expld.dataseg.phase == exp_dataseg_end_seen) { /* If DATA_SEGMENT_ALIGN DATA_SEGMENT_END pair was seen, check whether a page could be saved in the data segment. */ bfd_vma first, last; - first = -exp_data_seg.base & (exp_data_seg.pagesize - 1); - last = exp_data_seg.end & (exp_data_seg.pagesize - 1); + first = -expld.dataseg.base & (expld.dataseg.pagesize - 1); + last = expld.dataseg.end & (expld.dataseg.pagesize - 1); if (first && last - && ((exp_data_seg.base & ~(exp_data_seg.pagesize - 1)) - != (exp_data_seg.end & ~(exp_data_seg.pagesize - 1))) - && first + last <= exp_data_seg.pagesize) - { - exp_data_seg.phase = exp_dataseg_adjust; - lang_statement_iteration++; - result = lang_size_sections_1 (s, output_section_statement, prev, - fill, dot, relax, check_regions); + && ((expld.dataseg.base & ~(expld.dataseg.pagesize - 1)) + != (expld.dataseg.end & ~(expld.dataseg.pagesize - 1))) + && first + last <= expld.dataseg.pagesize) + { + expld.dataseg.phase = exp_dataseg_adjust; + one_lang_size_sections_pass (relax, check_regions); } } - return result; + expld.phase = lang_final_phase_enum; } /* Worker function for lang_do_assignments. Recursiveness goes here. */ @@ -4351,7 +4469,7 @@ lang_do_assignments_1 lang_output_section_statement_type *os; os = &(s->output_section_statement); - if (os->bfd_section != NULL) + if (os->bfd_section != NULL && !os->ignored) { dot = os->bfd_section->vma; lang_do_assignments_1 (os->children.head, os, os->fill, dot); @@ -4365,39 +4483,34 @@ lang_do_assignments_1 { /* If nothing has been placed into the output section then it won't have a bfd_section. */ - if (os->bfd_section) + if (os->bfd_section && !os->ignored) { os->bfd_section->lma - = exp_get_abs_int (os->load_base, 0, "load base", - lang_final_phase_enum); + = exp_get_abs_int (os->load_base, 0, "load base"); } } } break; + case lang_wild_statement_enum: dot = lang_do_assignments_1 (s->wild_statement.children.head, output_section_statement, fill, dot); - break; case lang_object_symbols_statement_enum: case lang_output_statement_enum: case lang_target_statement_enum: break; - case lang_data_statement_enum: - { - etree_value_type value; - value = exp_fold_tree (s->data_statement.exp, - abs_output_section, - lang_final_phase_enum, dot, &dot); - if (!value.valid_p) - einfo (_("%F%P: invalid data statement\n")); - s->data_statement.value - = value.value + value.section->bfd_section->vma; - } + case lang_data_statement_enum: + exp_fold_tree (s->data_statement.exp, bfd_abs_section_ptr, &dot); + if (expld.result.valid_p) + s->data_statement.value = (expld.result.value + + expld.result.section->vma); + else + einfo (_("%F%P: invalid data statement\n")); { unsigned int size; switch (s->data_statement.type) @@ -4425,16 +4538,12 @@ lang_do_assignments_1 break; case lang_reloc_statement_enum: - { - etree_value_type value; - - value = exp_fold_tree (s->reloc_statement.addend_exp, - abs_output_section, - lang_final_phase_enum, dot, &dot); - s->reloc_statement.addend_value = value.value; - if (!value.valid_p) - einfo (_("%F%P: invalid reloc statement\n")); - } + exp_fold_tree (s->reloc_statement.addend_exp, + bfd_abs_section_ptr, &dot); + if (expld.result.valid_p) + s->reloc_statement.addend_value = expld.result.value; + else + einfo (_("%F%P: invalid reloc statement\n")); dot += TO_ADDR (bfd_get_reloc_size (s->reloc_statement.howto)); break; @@ -4449,19 +4558,17 @@ lang_do_assignments_1 case lang_input_statement_enum: break; + case lang_fill_statement_enum: fill = s->fill_statement.fill; break; - case lang_assignment_statement_enum: - { - exp_fold_tree (s->assignment_statement.exp, - output_section_statement, - lang_final_phase_enum, - dot, - &dot); - } + case lang_assignment_statement_enum: + exp_fold_tree (s->assignment_statement.exp, + output_section_statement->bfd_section, + &dot); break; + case lang_padding_statement_enum: dot += TO_ADDR (s->padding_statement.size); break; @@ -4470,30 +4577,24 @@ lang_do_assignments_1 dot = lang_do_assignments_1 (s->group_statement.children.head, output_section_statement, fill, dot); - break; default: FAIL (); break; + case lang_address_statement_enum: break; } - } return dot; } void -lang_do_assignments - (lang_statement_union_type *s, - lang_output_section_statement_type *output_section_statement, - fill_type *fill, - bfd_vma dot) +lang_do_assignments (void) { - /* Callers of exp_fold_tree need to increment this. */ lang_statement_iteration++; - lang_do_assignments_1 (s, output_section_statement, fill, dot); + lang_do_assignments_1 (statement_list.head, abs_output_section, NULL, 0); } /* Fix any .startof. or .sizeof. symbols. When the assemblers see the @@ -4555,9 +4656,9 @@ lang_finish (void) if (entry_symbol.name == NULL) { - /* No entry has been specified. Look for start, but don't warn - if we don't find it. */ - entry_symbol.name = "start"; + /* No entry has been specified. Look for the default entry, but + don't warn if we don't find it. */ + entry_symbol.name = entry_symbol_default; warn = FALSE; } @@ -5033,9 +5134,9 @@ lang_enter_output_section_statement (con stat_ptr = &os->children; os->subsection_alignment = - topower (exp_get_value_int (subalign, -1, "subsection alignment", 0)); + topower (exp_get_value_int (subalign, -1, "subsection alignment")); os->section_alignment = - topower (exp_get_value_int (align, -1, "section alignment", 0)); + topower (exp_get_value_int (align, -1, "section alignment")); os->load_base = ebase; return os; @@ -5057,6 +5158,7 @@ lang_reset_memory_regions (void) { lang_memory_region_type *p = lang_memory_region_list; asection *o; + lang_output_section_statement_type *os; for (p = lang_memory_region_list; p != NULL; p = p->next) { @@ -5064,6 +5166,11 @@ lang_reset_memory_regions (void) p->current = p->origin; } + for (os = &lang_output_section_statement.head->output_section_statement; + os != NULL; + os = os->next) + os->processed = 0; + for (o = output_bfd->sections; o != NULL; o = o->next) { /* Save the last size for possible use by bfd_relax_section. */ @@ -5159,16 +5266,6 @@ lang_gc_sections (void) bfd_gc_sections (output_bfd, &link_info); } -static void -lang_mark_used_section (void) -{ - unsigned int gc_sections = link_info.gc_sections; - - link_info.gc_sections = 0; - bfd_gc_sections (output_bfd, &link_info); - link_info.gc_sections = gc_sections; -} - void lang_process (void) { @@ -5260,9 +5357,7 @@ lang_process (void) lang_record_phdrs (); /* Size up the sections. */ - lang_size_sections (statement_list.head, abs_output_section, - &statement_list.head, 0, 0, NULL, - command_line.relax ? FALSE : TRUE); + lang_size_sections (NULL, !command_line.relax); /* Now run around and relax if we can. */ if (command_line.relax) @@ -5280,8 +5375,7 @@ lang_process (void) /* Do all the assignments with our current guesses as to section sizes. */ - lang_do_assignments (statement_list.head, abs_output_section, - NULL, 0); + lang_do_assignments (); /* We must do this after lang_do_assignments, because it uses size. */ @@ -5289,8 +5383,7 @@ lang_process (void) /* Perform another relax pass - this time we know where the globals are, so can make a better guess. */ - lang_size_sections (statement_list.head, abs_output_section, - &statement_list.head, 0, 0, &relax_again, FALSE); + lang_size_sections (&relax_again, FALSE); /* If the normal relax is done and the relax finalize pass is not performed yet, we perform another relax pass. */ @@ -5303,10 +5396,9 @@ lang_process (void) while (relax_again); /* Final extra sizing to report errors. */ - lang_do_assignments (statement_list.head, abs_output_section, NULL, 0); + lang_do_assignments (); lang_reset_memory_regions (); - lang_size_sections (statement_list.head, abs_output_section, - &statement_list.head, 0, 0, NULL, TRUE); + lang_size_sections (NULL, TRUE); } /* See if anything special should be done now we know how big @@ -5319,7 +5411,7 @@ lang_process (void) /* Do all the assignments, now that we know the final resting places of all the symbols. */ - lang_do_assignments (statement_list.head, abs_output_section, NULL, 0); + lang_do_assignments (); /* Make sure that the section addresses make sense. */ if (! link_info.relocatable @@ -5327,7 +5419,6 @@ lang_process (void) lang_check_section_addresses (); /* Final stuffs. */ - lang_mark_used_section (); ldemul_finish (); lang_finish (); } @@ -5405,6 +5496,16 @@ lang_add_entry (const char *name, bfd_bo } } +/* Set the default start symbol to NAME. .em files should use this, + not lang_add_entry, to override the use of "start" if neither the + linker script nor the command line specifies an entry point. NAME + must be permanently allocated. */ +void +lang_default_entry (const char *name) +{ + entry_symbol_default = name; +} + void lang_add_target (const char *name) { @@ -5698,8 +5799,7 @@ lang_new_phdr (const char *name, n = stat_alloc (sizeof (struct lang_phdr)); n->next = NULL; n->name = name; - n->type = exp_get_value_int (type, 0, "program header type", - lang_final_phase_enum); + n->type = exp_get_value_int (type, 0, "program header type"); n->filehdr = filehdr; n->phdrs = phdrs; n->at = at; @@ -5775,14 +5875,12 @@ lang_record_phdrs (void) if (l->flags == NULL) flags = 0; else - flags = exp_get_vma (l->flags, 0, "phdr flags", - lang_final_phase_enum); + flags = exp_get_vma (l->flags, 0, "phdr flags"); if (l->at == NULL) at = 0; else - at = exp_get_vma (l->at, 0, "phdr load address", - lang_final_phase_enum); + at = exp_get_vma (l->at, 0, "phdr load address"); if (! bfd_record_phdr (output_bfd, l->type, l->flags != NULL, flags, l->at != NULL, diff -uprN binutils-2.16.90.0.3/ld/ldlang.h binutils-2.16.91.0.1/ld/ldlang.h --- binutils-2.16.90.0.3/ld/ldlang.h 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/ld/ldlang.h 2005-06-22 13:53:35.513216874 -0700 @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ #ifndef LDLANG_H #define LDLANG_H @@ -147,7 +147,8 @@ typedef struct lang_output_section_state int subsection_alignment; /* Alignment of components. */ int section_alignment; /* Alignment of start of section. */ int constraint; - bfd_boolean all_input_readonly; + unsigned int all_input_readonly : 1; + unsigned int ignored : 1; union etree_union *load_base; @@ -473,6 +474,8 @@ extern void lang_section_start (const char *, union etree_union *, const segment_type *); extern void lang_add_entry (const char *, bfd_boolean); +extern void lang_default_entry + (const char *); extern void lang_add_target (const char *); extern void lang_add_wild @@ -506,8 +509,7 @@ extern void lang_for_each_file extern void lang_reset_memory_regions (void); extern void lang_do_assignments - (lang_statement_union_type *, lang_output_section_statement_type *, - fill_type *, bfd_vma); + (void); #define LANG_FOR_EACH_INPUT_STATEMENT(statement) \ lang_input_statement_type *statement; \ @@ -553,10 +555,10 @@ extern void strip_excluded_output_sectio (void); extern void dprint_statement (lang_statement_union_type *, int); -extern bfd_vma lang_size_sections - (lang_statement_union_type *, lang_output_section_statement_type *, - lang_statement_union_type **, fill_type *, bfd_vma, bfd_boolean *, - bfd_boolean); +extern void lang_size_sections + (bfd_boolean *, bfd_boolean); +extern void one_lang_size_sections_pass + (bfd_boolean *, bfd_boolean); extern void lang_enter_group (void); extern void lang_leave_group diff -uprN binutils-2.16.90.0.3/ld/ldlex.h binutils-2.16.91.0.1/ld/ldlex.h --- binutils-2.16.90.0.3/ld/ldlex.h 2004-01-14 13:07:52.000000000 -0800 +++ binutils-2.16.91.0.1/ld/ldlex.h 2005-06-22 13:53:35.516216378 -0700 @@ -16,8 +16,8 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ #ifndef LDLEX_H #define LDLEX_H diff -uprN binutils-2.16.90.0.3/ld/ldlex.l binutils-2.16.91.0.1/ld/ldlex.l --- binutils-2.16.90.0.3/ld/ldlex.l 2005-04-09 12:03:21.000000000 -0700 +++ binutils-2.16.91.0.1/ld/ldlex.l 2005-06-22 13:53:35.523215222 -0700 @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ /* This was written by steve chamberlain @@ -303,6 +303,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([ "OVERLAY" { RTOKEN(OVERLAY);} "ONLY_IF_RO" { RTOKEN(ONLY_IF_RO); } "ONLY_IF_RW" { RTOKEN(ONLY_IF_RW); } +"SPECIAL" { RTOKEN(SPECIAL); } "o" { RTOKEN(ORIGIN);} "org" { RTOKEN(ORIGIN);} "l" { RTOKEN( LENGTH);} diff -uprN binutils-2.16.90.0.3/ld/ldmain.c binutils-2.16.91.0.1/ld/ldmain.c --- binutils-2.16.90.0.3/ld/ldmain.c 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/ld/ldmain.c 2005-06-22 13:53:35.524215057 -0700 @@ -18,8 +18,8 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ #include "bfd.h" #include "sysdep.h" @@ -50,7 +50,7 @@ #include #ifdef HAVE_SBRK -#ifdef NEED_DECLARATION_SBRK +#if !HAVE_DECL_SBRK extern void *sbrk (); #endif #endif @@ -160,7 +160,8 @@ static struct bfd_link_callbacks link_ca reloc_overflow, reloc_dangerous, unattached_reloc, - notice + notice, + einfo }; struct bfd_link_info link_info; @@ -873,7 +874,7 @@ add_keepsyms_file (const char *filename) a link. */ static bfd_boolean -add_archive_element (struct bfd_link_info *info ATTRIBUTE_UNUSED, +add_archive_element (struct bfd_link_info *info, bfd *abfd, const char *name) { @@ -904,7 +905,7 @@ add_archive_element (struct bfd_link_inf bfd *from; int len; - h = bfd_link_hash_lookup (link_info.hash, name, FALSE, FALSE, TRUE); + h = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, TRUE); if (h == NULL) from = NULL; @@ -1145,7 +1146,7 @@ constructor_callback (struct bfd_link_in /* Ensure that BFD_RELOC_CTOR exists now, so that we can give a useful error message. */ if (bfd_reloc_type_lookup (output_bfd, BFD_RELOC_CTOR) == NULL - && (link_info.relocatable + && (info->relocatable || bfd_reloc_type_lookup (abfd, BFD_RELOC_CTOR) == NULL)) einfo (_("%P%F: BFD backend error: BFD_RELOC_CTOR unsupported\n")); @@ -1422,10 +1423,7 @@ reloc_overflow (struct bfd_link_info *in if (overflow_cutoff_limit == -1) return TRUE; - if (abfd == NULL) - einfo (_("%P%X: generated")); - else - einfo ("%X%C:", abfd, section, address); + einfo ("%X%C:", abfd, section, address); if (overflow_cutoff_limit >= 0 && overflow_cutoff_limit-- == 0) @@ -1477,11 +1475,8 @@ reloc_dangerous (struct bfd_link_info *i asection *section, bfd_vma address) { - if (abfd == NULL) - einfo (_("%P%X: generated")); - else - einfo ("%X%C:", abfd, section, address); - einfo (_("dangerous relocation: %s\n"), message); + einfo (_("%X%C: dangerous relocation: %s\n"), + abfd, section, address, message); return TRUE; } @@ -1495,11 +1490,8 @@ unattached_reloc (struct bfd_link_info * asection *section, bfd_vma address) { - if (abfd == NULL) - einfo (_("%P%X: generated")); - else - einfo ("%X%C:", abfd, section, address); - einfo (_(" reloc refers to symbol `%T' which is not being output\n"), name); + einfo (_("%X%C: reloc refers to symbol `%T' which is not being output\n"), + abfd, section, address, name); return TRUE; } diff -uprN binutils-2.16.90.0.3/ld/ldmain.h binutils-2.16.91.0.1/ld/ldmain.h --- binutils-2.16.90.0.3/ld/ldmain.h 2005-04-09 12:03:21.000000000 -0700 +++ binutils-2.16.91.0.1/ld/ldmain.h 2005-06-22 13:53:35.537212909 -0700 @@ -16,8 +16,8 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ #ifndef LDMAIN_H #define LDMAIN_H diff -uprN binutils-2.16.90.0.3/ld/ldmisc.c binutils-2.16.91.0.1/ld/ldmisc.c --- binutils-2.16.90.0.3/ld/ldmisc.c 2005-04-09 12:03:21.000000000 -0700 +++ binutils-2.16.91.0.1/ld/ldmisc.c 2005-06-22 13:53:35.538212744 -0700 @@ -18,8 +18,8 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ #include "bfd.h" #include "bfdlink.h" @@ -190,7 +190,7 @@ vfinfo (FILE *fp, const char *fmt, va_li bfd *abfd = va_arg (arg, bfd *); if (abfd == NULL) - fprintf (fp, ""); + fprintf (fp, "%s generated", program_name); else if (abfd->my_archive) fprintf (fp, "%s(%s)", abfd->my_archive->filename, abfd->filename); @@ -275,49 +275,62 @@ vfinfo (FILE *fp, const char *fmt, va_li section = va_arg (arg, asection *); offset = va_arg (arg, bfd_vma); - entry = (lang_input_statement_type *) abfd->usrdata; - if (entry != (lang_input_statement_type *) NULL - && entry->asymbols != (asymbol **) NULL) - asymbols = entry->asymbols; + if (abfd == NULL) + { + entry = NULL; + asymbols = NULL; + } else { - long symsize; - long symbol_count; - - symsize = bfd_get_symtab_upper_bound (abfd); - if (symsize < 0) - einfo (_("%B%F: could not read symbols\n"), abfd); - asymbols = xmalloc (symsize); - symbol_count = bfd_canonicalize_symtab (abfd, asymbols); - if (symbol_count < 0) - einfo (_("%B%F: could not read symbols\n"), abfd); - if (entry != (lang_input_statement_type *) NULL) + entry = (lang_input_statement_type *) abfd->usrdata; + if (entry != (lang_input_statement_type *) NULL + && entry->asymbols != (asymbol **) NULL) + asymbols = entry->asymbols; + else { - entry->asymbols = asymbols; - entry->symbol_count = symbol_count; + long symsize; + long sym_count; + + symsize = bfd_get_symtab_upper_bound (abfd); + if (symsize < 0) + einfo (_("%B%F: could not read symbols\n"), abfd); + asymbols = xmalloc (symsize); + sym_count = bfd_canonicalize_symtab (abfd, asymbols); + if (sym_count < 0) + einfo (_("%B%F: could not read symbols\n"), abfd); + if (entry != (lang_input_statement_type *) NULL) + { + entry->asymbols = asymbols; + entry->symbol_count = sym_count; + } } } - /* The GNU Coding Standard requires that error messages be of the form: + /* The GNU Coding Standard requires that error messages + be of the form: source-file-name:lineno: message - We do not always have a line number available so if we cannot find - them we print out the section name and offset instread. */ + We do not always have a line number available so if + we cannot find them we print out the section name and + offset instread. */ discard_last = TRUE; - if (bfd_find_nearest_line (abfd, section, asymbols, offset, - &filename, &functionname, - &linenumber)) + if (abfd != NULL + && bfd_find_nearest_line (abfd, section, asymbols, offset, + &filename, &functionname, + &linenumber)) { if (functionname != NULL && fmt[-1] == 'C') { - /* Detect the case where we are printing out a message - for the same function as the last call to vinfo ("%C"). - In this situation do not print out the ABFD filename - or the function name again. Note - we do still print - out the source filename, as this will allow programs - that parse the linker's output (eg emacs) to correctly - locate multiple errors in the same source file. */ + /* Detect the case where we are printing out a + message for the same function as the last + call to vinfo ("%C"). In this situation do + not print out the ABFD filename or the + function name again. Note - we do still + print out the source filename, as this will + allow programs that parse the linker's output + (eg emacs) to correctly locate multiple + errors in the same source file. */ if (last_bfd == NULL || last_file == NULL || last_function == NULL diff -uprN binutils-2.16.90.0.3/ld/ldmisc.h binutils-2.16.91.0.1/ld/ldmisc.h --- binutils-2.16.90.0.3/ld/ldmisc.h 2004-09-15 12:05:04.000000000 -0700 +++ binutils-2.16.91.0.1/ld/ldmisc.h 2005-06-22 13:53:35.542212083 -0700 @@ -16,8 +16,8 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. */ + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ #ifndef LDMISC_H #define LDMISC_H diff -uprN binutils-2.16.90.0.3/ld/ld.texinfo binutils-2.16.91.0.1/ld/ld.texinfo --- binutils-2.16.90.0.3/ld/ld.texinfo 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/ld/ld.texinfo 2005-06-22 13:53:35.442228603 -0700 @@ -675,12 +675,40 @@ information about the link, including th @itemize @bullet @item -Where object files and symbols are mapped into memory. +Where object files are mapped into memory. @item How common symbols are allocated. @item All archive members included in the link, with a mention of the symbol which caused the archive member to be brought in. +@item +The values assigned to symbols. + +Note - symbols whose values are computed by an expression which +involves a reference to a previous value of the same symbol may not +have correct result displayed in the link map. This is because the +linker discards intermediate results and only retains the final value +of an expression. Under such circumstances the linker will display +the final value enclosed by square brackets. Thus for example a +linker script containing: + +@smallexample + foo = 1 + foo = foo * 4 + foo = foo + 8 +@end smallexample + +will produce the following output in the link map if the @option{-M} +option is used: + +@smallexample + 0x00000001 foo = 0x1 + [0x0000000c] foo = (foo * 0x4) + [0x0000000c] foo = (foo + 0x8) +@end smallexample + +See @ref{Expressions} for more information about expressions in linker +scripts. @end itemize @kindex -n @@ -1795,6 +1823,7 @@ created. By default, the new dynamic tag those options are only available for ELF systems. @kindex --hash-size=@var{number} +@item --hash-size=@var{number} Set the default size of the linker's hash tables to a prime number close to @var{number}. Increasing this value can reduce the length of time it takes the linker to perform its tasks, at the expense of diff -uprN binutils-2.16.90.0.3/ld/ldver.c binutils-2.16.91.0.1/ld/ldver.c --- binutils-2.16.90.0.3/ld/ldver.c 2005-04-09 12:03:21.000000000 -0700 +++ binutils-2.16.91.0.1/ld/ldver.c 2005-06-22 13:53:35.543211918 -0700 @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "bfd.h" diff -uprN binutils-2.16.90.0.3/ld/ldver.h binutils-2.16.91.0.1/ld/ldver.h --- binutils-2.16.90.0.3/ld/ldver.h 2005-04-09 12:03:21.000000000 -0700 +++ binutils-2.16.91.0.1/ld/ldver.h 2005-06-22 13:53:35.543211918 -0700 @@ -16,6 +16,6 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ void ldversion (int); diff -uprN binutils-2.16.90.0.3/ld/ldwrite.c binutils-2.16.91.0.1/ld/ldwrite.c --- binutils-2.16.90.0.3/ld/ldwrite.c 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/ld/ldwrite.c 2005-06-22 13:53:35.544211753 -0700 @@ -17,7 +17,7 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #include "bfd.h" #include "sysdep.h" diff -uprN binutils-2.16.90.0.3/ld/ldwrite.h binutils-2.16.91.0.1/ld/ldwrite.h --- binutils-2.16.90.0.3/ld/ldwrite.h 2004-01-14 13:07:52.000000000 -0800 +++ binutils-2.16.91.0.1/ld/ldwrite.h 2005-06-22 13:53:35.556209770 -0700 @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + the Free Software Foundation, 51 Franklin Street - Fifth Floor, + Boston, MA 02110-1301, USA. */ void ldwrite (void); diff -uprN binutils-2.16.90.0.3/ld/lexsup.c binutils-2.16.91.0.1/ld/lexsup.c --- binutils-2.16.90.0.3/ld/lexsup.c 2005-04-09 12:03:22.000000000 -0700 +++ binutils-2.16.91.0.1/ld/lexsup.c 2005-06-22 13:53:35.558209440 -0700 @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ #include "config.h" #include "bfd.h" diff -uprN binutils-2.16.90.0.3/ld/Makefile.am binutils-2.16.91.0.1/ld/Makefile.am --- binutils-2.16.90.0.3/ld/Makefile.am 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/ld/Makefile.am 2005-06-22 13:53:35.370240497 -0700 @@ -103,6 +103,9 @@ info_TEXINFOS = ld.texinfo noinst_TEXINFOS = ldint.texinfo man_MANS = ld.1 +AM_MAKEINFOFLAGS = -I $(srcdir) -I $(BFDDIR)/doc +TEXI2DVI = texi2dvi -I $(srcdir) -I $(BFDDIR)/doc + INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) -I$(top_srcdir)/../intl -I../intl $(HDEFINES) $(CFLAGS) -DLOCALEDIR="\"$(datadir)/locale\"" BFDLIB = ../bfd/libbfd.la @@ -176,6 +179,7 @@ ALL_EMULATIONS = \ eelf32lppcsim.o \ eelf32mcore.o \ eelf32mipswindiss.o \ + eelf32ms1.o \ eelf32openrisc.o \ eelf32ppc.o \ eelf32ppc_fbsd.o \ @@ -1529,6 +1533,9 @@ eelf32frvfd.c: $(srcdir)/emulparams/elf3 $(srcdir)/emulparams/elf32frv.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32frvfd "$(tdir_frv)" +eelf32ms1.c: $(srcdir)/emulparams/elf32ms1.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf32ms1 "$(tdir_ms1)" # We need this for automake to use YLWRAP. EXTRA_ld_new_SOURCES = deffilep.y @@ -1630,17 +1637,13 @@ configdoc.texi: ${DOCVER}-doc.texi || ln ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi >/dev/null 2>&1 \ || cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi -ldver.texi: Makefile +ldver.texi: $(srcdir)/../bfd/configure rm -f $@ - echo '@set VERSION $(VERSION)' > $@ - -ld.info: $(srcdir)/ld.texinfo configdoc.texi ldver.texi - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) -I $(BFDDIR)/doc $(srcdir)/ld.texinfo + eval `grep '^ *VERSION=' $(srcdir)/../bfd/configure`; \ + echo "@set VERSION $$VERSION" > $@ +$(srcdir)/ld.info: $(srcdir)/ld.texinfo configdoc.texi ldver.texi ld.dvi: $(srcdir)/ld.texinfo configdoc.texi ldver.texi - TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \ - MAKEINFO="$(MAKEINFO) -I $(srcdir) -I $(BFDDIR)/doc" $(TEXI2DVI) -I $(BFDDIR)/doc $(srcdir)/ld.texinfo # Build the man page from the texinfo file # The sed command removes the no-adjust Nroff command so that @@ -1654,10 +1657,12 @@ ld.1: $(srcdir)/ld.texinfo configdoc.tex (rm -f $@.T$$$$ && exit 1) rm -f ld.pod -MAINTAINERCLEANFILES = ldver.texi +MAINTAINERCLEANFILES = ldver.texi configdoc.texi -# We want to reconfigure if configure.host or configure.tgt changes. -CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host $(srcdir)/configure.tgt +# We want to reconfigure if configure.host or configure.tgt changes. We +# extract version from bfd/configure.in, so we must depend on that also. +CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host $(srcdir)/configure.tgt \ + $(srcdir)/../bfd/configure.in MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \ ldemul-list.h crtbegin.o crtend.o ld.log ld.sum @@ -1690,19 +1695,23 @@ install-data-local: # We want install to imply install-info as per GNU standards, despite the # cygnus option. -install: install-info +install-data-local: install-info # Stuff that should be included in a distribution. The diststuff # target is run by the taz target in ../Makefile.in. EXTRA_DIST = ldgram.c ldgram.h ldlex.c $(man_MANS) diststuff: info $(EXTRA_DIST) +all: info ld.1 + +# Both info (ld.info) and ld.1 depend on configdoc.texi and ldver.texi. +# But info isn't a direct target. Make info-recursive to depend on +# ld.1 to support parallel build. +info-recursive: ld.1 DISTCLEANFILES = tdirs site.exp site.bak stringify.sed distclean-local: rm -rf ldscripts -Makefile: $(BFDDIR)/configure.in - # Targets to rebuild dependencies in this Makefile. # Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES). DEP: dep.sed $(CFILES) $(HFILES) $(GENERATED_CFILES) $(GENERATED_HFILES) config.h diff -uprN binutils-2.16.90.0.3/ld/Makefile.in binutils-2.16.91.0.1/ld/Makefile.in --- binutils-2.16.90.0.3/ld/Makefile.in 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/ld/Makefile.in 2005-06-22 13:53:35.394236533 -0700 @@ -1,6 +1,8 @@ -# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am +# Makefile.in generated by automake 1.9.5 from Makefile.am. +# @configure_input@ -# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -10,151 +12,263 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +@SET_MAKE@ -SHELL = @SHELL@ +SOURCES = $(ld_new_SOURCES) $(EXTRA_ld_new_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ - top_builddir = . - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_alias = @build_alias@ build_triplet = @build@ -host_alias = @host_alias@ host_triplet = @host@ -target_alias = @target_alias@ target_triplet = @target@ -AS = @AS@ +noinst_PROGRAMS = ld-new$(EXEEXT) +DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub NEWS \ + README ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/config.in $(srcdir)/../mkinstalldirs \ + $(top_srcdir)/po/Make-in ldgram.h ldgram.c ldlex.c deffilep.h \ + deffilep.c $(srcdir)/../ylwrap $(srcdir)/../ltmain.sh \ + $(srcdir)/../config.guess $(srcdir)/../config.sub +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/../bfd/acinclude.m4 \ + $(top_srcdir)/../config/acx.m4 $(top_srcdir)/../bfd/bfd.m4 \ + $(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/../libtool.m4 \ + $(top_srcdir)/../gettext.m4 $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno configure.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = po/Makefile.in +PROGRAMS = $(noinst_PROGRAMS) +am_ld_new_OBJECTS = ldgram.$(OBJEXT) ldlex.$(OBJEXT) lexsup.$(OBJEXT) \ + ldlang.$(OBJEXT) mri.$(OBJEXT) ldctor.$(OBJEXT) \ + ldmain.$(OBJEXT) ldwrite.$(OBJEXT) ldexp.$(OBJEXT) \ + ldemul.$(OBJEXT) ldver.$(OBJEXT) ldmisc.$(OBJEXT) \ + ldfile.$(OBJEXT) ldcref.$(OBJEXT) +ld_new_OBJECTS = $(am_ld_new_OBJECTS) +am__DEPENDENCIES_1 = +am__DEPENDENCIES_2 = ../bfd/libbfd.la +am__DEPENDENCIES_3 = ../libiberty/libiberty.a +DEFAULT_INCLUDES = -I. -I$(srcdir) -I. +depcomp = +am__depfiles_maybe = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) +LTLEXCOMPILE = $(LIBTOOL) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS) +YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) +LTYACCCOMPILE = $(LIBTOOL) --mode=compile $(YACC) $(YFLAGS) \ + $(AM_YFLAGS) +YLWRAP = $(top_srcdir)/../ylwrap +SOURCES = $(ld_new_SOURCES) $(EXTRA_ld_new_SOURCES) +INFO_DEPS = $(srcdir)/ld.info +TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex +am__TEXINFO_TEX_DIR = $(top_srcdir)/../texinfo +DVIS = ld.dvi +PDFS = ld.pdf +PSS = ld.ps +HTMLS = ld.html +TEXINFOS = ld.texinfo +TEXI2PDF = $(TEXI2DVI) --pdf --batch +MAKEINFOHTML = $(MAKEINFO) --html +AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) +DVIPS = dvips +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +man1dir = $(mandir)/man1 +am__installdirs = "$(DESTDIR)$(man1dir)" +NROFF = nroff +MANS = $(man_MANS) +ETAGS = etags +CTAGS = ctags +DEJATOOL = $(PACKAGE) +RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir +DIST_SUBDIRS = $(SUBDIRS) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ -CC_FOR_BUILD = @CC_FOR_BUILD@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ CPP = @CPP@ -CXXCPP = @CXXCPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ -DLLTOOL = @DLLTOOL@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EMUL = @EMUL@ EMULATION_LIBPATH = @EMULATION_LIBPATH@ +EMULATION_OFILES = @EMULATION_OFILES@ +EMUL_EXTRA_OFILES = @EMUL_EXTRA_OFILES@ EXEEXT = @EXEEXT@ -EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@ -GCJ = @GCJ@ -GCJFLAGS = @GCJFLAGS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ -GNATBIND = @GNATBIND@ GT_NO = @GT_NO@ GT_YES = @GT_YES@ HDEFINES = @HDEFINES@ + +#stuff for self hosting (can be overridden in config file). +HOSTING_CRT0 = @HOSTING_CRT0@ +HOSTING_LIBS = @HOSTING_LIBS@ INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLDEPS = @INTLDEPS@ +INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ +LDFLAGS = @LDFLAGS@ +LEX = `if [ -f ../flex/flex ]; then echo ../flex/flex; else echo @LEX@; fi` +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LN = @LN@ + +# Search path to override the default search path for -lfoo libraries. +# If LIB_PATH is empty, the ones in the script (if any) are left alone. +# (The default is usually /lib:/usr/lib:/usr/local/lib, unless building +# a cross-linker, in which case the default is empty. See genscripts.sh.) +# Otherwise, they are replaced with the ones given in LIB_PATH, +# which may have the form: LIB_PATH=/lib:/usr/local/lib. This can be set +# when the linker is configured via the --with-lib-path configure switch. +LIB_PATH = @LIB_PATH@ LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ NATIVE_LIB_DIRS = @NATIVE_LIB_DIRS@ -OBJDUMP = @OBJDUMP@ +NO_WERROR = @NO_WERROR@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ STRINGIFY = @STRINGIFY@ STRIP = @STRIP@ TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@ TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@ + +# This is the real libbfd.a created by libtool. +TESTBFDLIB = @TESTBFDLIB@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ -bfdincludedir = @bfdincludedir@ -bfdlibdir = @bfdlibdir@ -build_noncanonical = @build_noncanonical@ -build_subdir = @build_subdir@ -do_compare = @do_compare@ -host_noncanonical = @host_noncanonical@ -host_subdir = @host_subdir@ +WARN_CFLAGS = @WARN_CFLAGS@ +XGETTEXT = @XGETTEXT@ +YACC = `if [ -f ../bison/bison ]; then echo ../bison/bison -y -L$(srcdir)/../bison/; else echo @YACC@; fi` +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ l = @l@ -ncn_cv_ = @ncn_cv_@ -target_noncanonical = @target_noncanonical@ -target_subdir = @target_subdir@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ use_sysroot = @use_sysroot@ - -INTLLIBS = @INTLLIBS@ - AUTOMAKE_OPTIONS = cygnus dejagnu - SUBDIRS = po - tooldir = $(exec_prefix)/$(target_alias) - -YACC = `if [ -f ../bison/bison ]; then echo ../bison/bison -y -L$(srcdir)/../bison/; else echo @YACC@; fi` YFLAGS = -d -LEX = `if [ -f ../flex/flex ]; then echo ../flex/flex; else echo @LEX@; fi` - -WARN_CFLAGS = @WARN_CFLAGS@ -NO_WERROR = @NO_WERROR@ AM_CFLAGS = $(WARN_CFLAGS) # We put the scripts in the directory $(scriptdir)/ldscripts. # We can't put the scripts in $(datadir) because the SEARCH_DIR # directives need to be different for native and cross linkers. scriptdir = $(tooldir)/lib - -EMUL = @EMUL@ -EMULATION_OFILES = @EMULATION_OFILES@ -EMUL_EXTRA_OFILES = @EMUL_EXTRA_OFILES@ - -# Search path to override the default search path for -lfoo libraries. -# If LIB_PATH is empty, the ones in the script (if any) are left alone. -# (The default is usually /lib:/usr/lib:/usr/local/lib, unless building -# a cross-linker, in which case the default is empty. See genscripts.sh.) -# Otherwise, they are replaced with the ones given in LIB_PATH, -# which may have the form: LIB_PATH=/lib:/usr/local/lib. This can be set -# when the linker is configured via the --with-lib-path configure switch. -LIB_PATH = @LIB_PATH@ - BASEDIR = $(srcdir)/.. BFDDIR = $(BASEDIR)/bfd INCDIR = $(BASEDIR)/include @@ -165,16 +279,10 @@ DOCVER = gen # Options to extract the man page from ld.texinfo MANCONF = -Dman - TEXI2POD = perl $(BASEDIR)/etc/texi2pod.pl - POD2MAN = pod2man --center="GNU Development Tools" \ --release="binutils-$(VERSION)" --section=1 - -#stuff for self hosting (can be overridden in config file). -HOSTING_CRT0 = @HOSTING_CRT0@ -HOSTING_LIBS = @HOSTING_LIBS@ HOSTING_EMU = -m $(EMUL) # Setup the testing framework, if you have one @@ -182,14 +290,11 @@ EXPECT = `if [ -f $$r/../expect/expect ] then echo $$r/../expect/expect ; \ else echo expect ; fi` - RUNTEST = `if [ -f $${srcroot}/../dejagnu/runtest ] ; \ then echo $${srcroot}/../dejagnu/runtest ; \ else echo runtest ; fi` - RUNTESTFLAGS = - CC_FOR_TARGET = ` \ if [ -f $$r/../gcc/xgcc ] ; then \ if [ -f $$r/../newlib/Makefile ] ; then \ @@ -205,7 +310,6 @@ CC_FOR_TARGET = ` \ fi; \ fi` - CXX = gcc CXX_FOR_TARGET = ` \ if [ -f $$r/../gcc/xgcc ] ; then \ @@ -222,17 +326,14 @@ CXX_FOR_TARGET = ` \ fi; \ fi` - -noinst_PROGRAMS = ld-new info_TEXINFOS = ld.texinfo noinst_TEXINFOS = ldint.texinfo man_MANS = ld.1 - +AM_MAKEINFOFLAGS = -I $(srcdir) -I $(BFDDIR)/doc +TEXI2DVI = texi2dvi -I $(srcdir) -I $(BFDDIR)/doc INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) -I$(top_srcdir)/../intl -I../intl $(HDEFINES) $(CFLAGS) -DLOCALEDIR="\"$(datadir)/locale\"" - BFDLIB = ../bfd/libbfd.la LIBIBERTY = ../libiberty/libiberty.a - ALL_EMULATIONS = \ ea29k.o \ eaixppc.o \ @@ -301,6 +402,7 @@ ALL_EMULATIONS = \ eelf32lppcsim.o \ eelf32mcore.o \ eelf32mipswindiss.o \ + eelf32ms1.o \ eelf32openrisc.o \ eelf32ppc.o \ eelf32ppc_fbsd.o \ @@ -497,7 +599,6 @@ ALL_EMULATIONS = \ eelf32frvfd.o \ ez8002.o - ALL_64_EMULATIONS = \ eelf64_aix.o \ eelf64_ia64.o \ @@ -524,59 +625,48 @@ ALL_64_EMULATIONS = \ eelf64lppc.o \ ehppa64linux.o - ALL_EMUL_EXTRA_OFILES = \ deffilep.o \ pe-dll.o - CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \ ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \ mri.c ldcref.c pe-dll.c - HFILES = ld.h ldctor.h ldemul.h ldexp.h ldfile.h \ ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \ ldwrite.h mri.h deffile.h pe-dll.h - GENERATED_CFILES = ldgram.c ldlex.c deffilep.c GENERATED_HFILES = ldgram.h ldemul-list.h deffilep.h - OFILES = ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o \ ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o \ ldfile.o ldcref.o ${EMULATION_OFILES} ${EMUL_EXTRA_OFILES} - STAGESTUFF = *.o ldscripts/* e*.c # At the moment this is just a list of those emulation template files # that contain internationalised strings. EMULATION_FILES = emultempl/pe.em emultempl/armcoff.em - POTFILES = $(CFILES) $(HFILES) $(EMULATION_FILES) # These all start with e so 'make clean' can find them. - GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@ GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed # We need this for automake to use YLWRAP. EXTRA_ld_new_SOURCES = deffilep.y - ld_new_SOURCES = ldgram.y ldlex.l lexsup.c ldlang.c mri.c ldctor.c ldmain.c \ ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(INTLDEPS) ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(INTLLIBS) +MAINTAINERCLEANFILES = ldver.texi configdoc.texi -# This is the real libbfd.a created by libtool. -TESTBFDLIB = @TESTBFDLIB@ - -MAINTAINERCLEANFILES = ldver.texi - -# We want to reconfigure if configure.host or configure.tgt changes. -CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host $(srcdir)/configure.tgt +# We want to reconfigure if configure.host or configure.tgt changes. We +# extract version from bfd/configure.in, so we must depend on that also. +CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host $(srcdir)/configure.tgt \ + $(srcdir)/../bfd/configure.in MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \ ldemul-list.h crtbegin.o crtend.o ld.log ld.sum @@ -586,142 +676,107 @@ CLEANFILES = dep.sed DEP DEPA DEP1 DEP2 # Stuff that should be included in a distribution. The diststuff # target is run by the taz target in ../Makefile.in. EXTRA_DIST = ldgram.c ldgram.h ldlex.c $(man_MANS) - DISTCLEANFILES = tdirs site.exp site.bak stringify.sed -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = -noinst_PROGRAMS = ld-new$(EXEEXT) -PROGRAMS = $(noinst_PROGRAMS) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -ld_new_OBJECTS = ldgram.$(OBJEXT) ldlex.$(OBJEXT) lexsup.$(OBJEXT) \ -ldlang.$(OBJEXT) mri.$(OBJEXT) ldctor.$(OBJEXT) ldmain.$(OBJEXT) \ -ldwrite.$(OBJEXT) ldexp.$(OBJEXT) ldemul.$(OBJEXT) ldver.$(OBJEXT) \ -ldmisc.$(OBJEXT) ldfile.$(OBJEXT) ldcref.$(OBJEXT) -ld_new_LDFLAGS = -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LEXLIB = @LEXLIB@ -YLWRAP = $(top_srcdir)/../ylwrap -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then echo $(top_srcdir)/../texinfo/util/texi2dvi; else echo texi2dvi; fi` -TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex -INFO_DEPS = ld.info -DVIS = ld.dvi -TEXINFOS = ld.texinfo -man1dir = $(mandir)/man1 -MANS = $(man_MANS) - -NROFF = nroff -DIST_COMMON = README ./stamp-h.in ChangeLog Makefile.am Makefile.in \ -NEWS TODO acinclude.m4 aclocal.m4 config.in configure configure.in \ -deffilep.c ldgram.c ldlex.c - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = gtar -GZIP_ENV = --best -SOURCES = $(ld_new_SOURCES) $(EXTRA_ld_new_SOURCES) -OBJECTS = $(ld_new_OBJECTS) +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive -all: all-redirect .SUFFIXES: -.SUFFIXES: .S .c .dvi .info .l .lo .o .obj .ps .s .texi .texinfo .txi .y -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 - cd $(srcdir) && $(ACLOCAL) +.SUFFIXES: .c .dvi .html .info .l .lo .o .obj .pdf .ps .texinfo .y +am--refresh: + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ + cd $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; -config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -config.h: stamp-h +config.h: stamp-h1 @if test ! -f $@; then \ - rm -f stamp-h; \ - $(MAKE) stamp-h; \ + rm -f stamp-h1; \ + $(MAKE) stamp-h1; \ else :; fi -stamp-h: $(srcdir)/config.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES= CONFIG_HEADERS=config.h:config.in \ - $(SHELL) ./config.status - @echo timestamp > stamp-h 2> /dev/null -$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in - @if test ! -f $@; then \ - rm -f $(srcdir)/stamp-h.in; \ - $(MAKE) $(srcdir)/stamp-h.in; \ - else :; fi -$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOHEADER) - @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null -mostlyclean-hdr: - -clean-hdr: +stamp-h1: $(srcdir)/config.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ distclean-hdr: - -rm -f config.h - -maintainer-clean-hdr: - -mostlyclean-noinstPROGRAMS: + -rm -f config.h stamp-h1 +po/Makefile.in: $(top_builddir)/config.status $(top_srcdir)/po/Make-in + cd $(top_builddir) && $(SHELL) ./config.status $@ clean-noinstPROGRAMS: - -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) - -distclean-noinstPROGRAMS: - -maintainer-clean-noinstPROGRAMS: - -.c.o: - $(COMPILE) -c $< - -# FIXME: We should only use cygpath when building on Windows, -# and only if it is available. -.c.obj: - $(COMPILE) -c `cygpath -w $<` - -.s.o: - $(COMPILE) -c $< - -.S.o: - $(COMPILE) -c $< + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +ldgram.h: ldgram.c + @if test ! -f $@; then \ + rm -f ldgram.c; \ + $(MAKE) ldgram.c; \ + else :; fi +deffilep.h: deffilep.c + @if test ! -f $@; then \ + rm -f deffilep.c; \ + $(MAKE) deffilep.c; \ + else :; fi +ld-new$(EXEEXT): $(ld_new_OBJECTS) $(ld_new_DEPENDENCIES) + @rm -f ld-new$(EXEEXT) + $(LINK) $(ld_new_LDFLAGS) $(ld_new_OBJECTS) $(ld_new_LDADD) $(LIBS) mostlyclean-compile: - -rm -f *.o core *.core -rm -f *.$(OBJEXT) -clean-compile: - distclean-compile: -rm -f *.tab.c -maintainer-clean-compile: +.c.o: + $(COMPILE) -c $< + +.c.obj: + $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: - $(LIBTOOL) --mode=compile $(COMPILE) -c $< + $(LTCOMPILE) -c -o $@ $< -.s.lo: - $(LIBTOOL) --mode=compile $(COMPILE) -c $< +.l.c: + $(LEXCOMPILE) $< + sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|$@|' $(LEX_OUTPUT_ROOT).c >$@ + rm -f $(LEX_OUTPUT_ROOT).c -.S.lo: - $(LIBTOOL) --mode=compile $(COMPILE) -c $< +.y.c: + $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) mostlyclean-libtool: -rm -f *.lo @@ -730,135 +785,111 @@ clean-libtool: -rm -rf .libs _libs distclean-libtool: - -maintainer-clean-libtool: - -ld-new$(EXEEXT): $(ld_new_OBJECTS) $(ld_new_DEPENDENCIES) - @rm -f ld-new$(EXEEXT) - $(LINK) $(ld_new_LDFLAGS) $(ld_new_OBJECTS) $(ld_new_LDADD) $(LIBS) -.l.c: - $(LEX) $(AM_LFLAGS) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@ -.y.c: - $(SHELL) $(YLWRAP) "$(YACC)" $< y.tab.c $*.c y.tab.h $*.h -- $(AM_YFLAGS) $(YFLAGS) -deffilep.h: deffilep.c -ldgram.h: ldgram.c - - -ld.info: ld.texinfo -ld.dvi: ld.texinfo - - -DVIPS = dvips - -.texi.info: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< - -.texi.dvi: - TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \ - MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< - -.texi: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< + -rm -f libtool .texinfo.info: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< - -.texinfo: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< + restore=: && backupdir="$(am__leading_dot)am$$$$" && \ + am__cwd=`pwd` && cd $(srcdir) && \ + rm -rf $$backupdir && mkdir $$backupdir && \ + for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ + if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ + done; \ + cd "$$am__cwd"; \ + if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $@ $<; \ + then \ + rc=0; \ + cd $(srcdir); \ + else \ + rc=$$?; \ + cd $(srcdir) && \ + $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ + fi; \ + rm -rf $$backupdir; exit $$rc .texinfo.dvi: - TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \ - MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< - -.txi.info: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< - -.txi.dvi: - TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \ - MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< - -.txi: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2DVI) $< + +.texinfo.pdf: + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2PDF) $< + +.texinfo.html: + rm -rf $(@:.html=.htp) + if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $(@:.html=.htp) $<; \ + then \ + rm -rf $@; \ + if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ + mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ + else \ + if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ + rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ + exit 1; \ + fi +ld.pdf: ld.texinfo +ld.html: ld.texinfo .dvi.ps: - $(DVIPS) $< -o $@ + $(DVIPS) -o $@ $< -install-info-am: $(INFO_DEPS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(infodir) - @list='$(INFO_DEPS)'; \ - for file in $$list; do \ - if test -f $$file; then d=.; else d=$(srcdir); fi; \ - for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ - if test -f $$d/$$ifile; then \ - echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \ - $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \ - else : ; fi; \ - done; \ - done - @$(POST_INSTALL) - @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ +uninstall-info-am: + @$(PRE_UNINSTALL) + @if (install-info --version && \ + install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ - echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\ - install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ + install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ done; \ - else : ; fi - -uninstall-info: - $(PRE_UNINSTALL) - @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ - ii=yes; \ - else ii=; fi; \ - list='$(INFO_DEPS)'; \ - for file in $$list; do \ - test -z "$$ii" \ - || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ - done + else :; fi @$(NORMAL_UNINSTALL) - list='$(INFO_DEPS)'; \ + @list='$(INFO_DEPS)'; \ for file in $$list; do \ - (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ + (if cd "$(DESTDIR)$(infodir)"; then \ + echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ + rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ + else :; fi); \ done dist-info: $(INFO_DEPS) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for base in $$list; do \ + case $$base in \ + $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \ - for file in `cd $$d && eval echo $$base*`; do \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file; \ + for file in $$d/$$base*; do \ + relfile=`expr "$$file" : "$$d/\(.*\)"`; \ + test -f $(distdir)/$$relfile || \ + cp -p $$file $(distdir)/$$relfile; \ done; \ done mostlyclean-aminfo: - -rm -f ld.aux ld.cp ld.cps ld.dvi ld.fn ld.fns ld.ky ld.kys ld.ps \ - ld.log ld.pg ld.toc ld.tp ld.tps ld.vr ld.vrs ld.op ld.tr \ - ld.cv ld.cn - -clean-aminfo: - -distclean-aminfo: + -rm -rf ld.aux ld.cp ld.cps ld.fn ld.fns ld.ky ld.log ld.pg ld.pgs ld.tmp \ + ld.toc ld.tp ld.tps ld.vr ld.vrs ld.dvi ld.pdf ld.ps ld.html maintainer-clean-aminfo: - for i in $(INFO_DEPS); do \ - rm -f $$i; \ - if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \ - rm -f $$i-[0-9]*; \ - fi; \ + @list='$(INFO_DEPS)'; for i in $$list; do \ + i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ + echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ + rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done -clean-info: mostlyclean-aminfo -install-man1: - $(mkinstalldirs) $(DESTDIR)$(man1dir) - @list='$(man1_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ +clean-info: mostlyclean-aminfo +install-man1: $(man1_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ @@ -867,32 +898,37 @@ install-man1: if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done - uninstall-man1: - @list='$(man1_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ - rm -f $(DESTDIR)$(man1dir)/$$inst; \ + echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done -install-man: $(MANS) - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-man1 -uninstall-man: - @$(NORMAL_UNINSTALL) - $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -900,13 +936,14 @@ uninstall-man: # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. - -@SET_MAKE@ - -all-recursive install-data-recursive install-exec-recursive \ -installdirs-recursive install-recursive uninstall-recursive install-info-recursive \ -check-recursive installcheck-recursive info-recursive dvi-recursive: - @set fnord $(MAKEFLAGS); amf=$$2; \ +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -918,7 +955,7 @@ check-recursive installcheck-recursive i local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ @@ -926,13 +963,24 @@ check-recursive installcheck-recursive i mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: - @set fnord $(MAKEFLAGS); amf=$$2; \ + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ dot_seen=no; \ - rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ - rev="$$subdir $$rev"; \ - test "$$subdir" != "." || dot_seen=yes; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ done; \ - test "$$dot_seen" = "no" && rev=". $$rev"; \ + rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ @@ -942,163 +990,125 @@ maintainer-clean-recursive: local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $$unique $(LISP) + mkid -fID $$unique +tags: TAGS -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) $(LISP) +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ - fi; \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ done; \ - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ + list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)config.in$$unique$(LISP)$$tags" \ - || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.in $$unique $(LISP) -o $$here/TAGS) - -mostlyclean-tags: - -clean-tags: + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here distclean-tags: - -rm -f TAGS ID - -maintainer-clean-tags: - -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - -rm -rf $(distdir) - GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz - mkdir $(distdir)/=build - mkdir $(distdir)/=inst - dc_install_base=`cd $(distdir)/=inst && pwd`; \ - cd $(distdir)/=build \ - && ../configure --srcdir=.. --prefix=$$dc_install_base \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) dist - -rm -rf $(distdir) - @banner="$(distdir).tar.gz is ready for distribution"; \ - dashes=`echo "$$banner" | sed s/./=/g`; \ - echo "$$dashes"; \ - echo "$$banner"; \ - echo "$$dashes" -dist: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -dist-all: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -distdir: $(DISTFILES) - -rm -rf $(distdir) - mkdir $(distdir) - -chmod 777 $(distdir) - @for file in $(DISTFILES); do \ - if test -f $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done - for subdir in $(SUBDIRS); do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - chmod 777 $(distdir)/$$subdir; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ - || exit 1; \ - fi; \ - done - $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info - -DEJATOOL = $(PACKAGE) - -RUNTESTDEFAULTFLAGS = --tool $(DEJATOOL) --srcdir $$srcdir + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags site.exp: Makefile @echo 'Making a new site.exp file...' - @test ! -f site.bak || rm -f site.bak - @echo '## these variables are automatically generated by make ##' > $@-t - @echo '# Do not edit here. If you wish to override these values' >> $@-t - @echo '# edit the last section' >> $@-t - @echo 'set tool $(DEJATOOL)' >> $@-t - @echo 'set srcdir $(srcdir)' >> $@-t - @echo 'set objdir' `pwd` >> $@-t - @echo 'set host_alias $(host_alias)' >> $@-t - @echo 'set host_triplet $(host_triplet)' >> $@-t - @echo 'set target_alias $(target_alias)' >> $@-t - @echo 'set target_triplet $(target_triplet)' >> $@-t - @echo 'set build_alias $(build_alias)' >> $@-t - @echo 'set build_triplet $(build_triplet)' >> $@-t - @echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t - @test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t + @echo '## these variables are automatically generated by make ##' >site.tmp + @echo '# Do not edit here. If you wish to override these values' >>site.tmp + @echo '# edit the last section' >>site.tmp + @echo 'set srcdir $(srcdir)' >>site.tmp + @echo "set objdir `pwd`" >>site.tmp + @echo 'set build_alias "$(build_alias)"' >>site.tmp + @echo 'set build_triplet $(build_triplet)' >>site.tmp + @echo 'set host_alias "$(host_alias)"' >>site.tmp + @echo 'set host_triplet $(host_triplet)' >>site.tmp + @echo 'set target_alias "$(target_alias)"' >>site.tmp + @echo 'set target_triplet $(target_triplet)' >>site.tmp + @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp + @test ! -f site.exp || \ + sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp + @-rm -f site.bak @test ! -f site.exp || mv site.exp site.bak - @mv $@-t site.exp -info-am: $(INFO_DEPS) -info: info-recursive -dvi-am: $(DVIS) -dvi: dvi-recursive + @mv site.tmp site.exp + +distclean-DEJAGNU: + -rm -f site.exp site.bak + -l='$(DEJATOOL)'; for tool in $$l; do \ + rm -f $$tool.sum $$tool.log; \ + done check-am: $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU check: check-recursive -installcheck-am: -installcheck: installcheck-recursive -install-info-am: -install-info: install-info-recursive -all-recursive-am: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -install-exec-am: install-exec-local +all-am: Makefile $(PROGRAMS) $(MANS) config.h +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-recursive install-exec: install-exec-recursive - -install-data-am: install-man install-data-local install-data: install-data-recursive +uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-recursive -uninstall-am: uninstall-man -uninstall: uninstall-recursive -all-am: Makefile $(PROGRAMS) $(MANS) config.h -all-redirect: all-recursive-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: installdirs-recursive -installdirs-am: - $(mkinstalldirs) $(DESTDIR)$(mandir)/man1 - +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) @@ -1106,65 +1116,126 @@ clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: - -test -z "ldlexcdeffilephdeffilepcldgramhldgramc$(MAINTAINERCLEANFILES)" || rm -f ldlexc deffileph deffilepc ldgramh ldgramc $(MAINTAINERCLEANFILES) -mostlyclean-am: mostlyclean-hdr mostlyclean-noinstPROGRAMS \ - mostlyclean-compile mostlyclean-libtool \ - mostlyclean-aminfo mostlyclean-tags mostlyclean-generic \ - mostlyclean-local + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -rm -f deffilep.c + -rm -f deffilep.h + -rm -f ldgram.c + -rm -f ldgram.h + -rm -f ldlex.c + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-recursive -mostlyclean: mostlyclean-recursive +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-DEJAGNU distclean-compile \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-local distclean-tags -clean-am: clean-hdr clean-noinstPROGRAMS clean-compile clean-libtool \ - clean-aminfo clean-tags clean-generic mostlyclean-am +dvi: dvi-recursive -clean: clean-recursive +dvi-am: $(DVIS) -distclean-am: distclean-hdr distclean-noinstPROGRAMS distclean-compile \ - distclean-libtool distclean-aminfo distclean-tags \ - distclean-generic clean-am distclean-local - -rm -f libtool +html: html-recursive -distclean: distclean-recursive - -rm -f config.status +html-am: $(HTMLS) -maintainer-clean-am: maintainer-clean-hdr \ - maintainer-clean-noinstPROGRAMS \ - maintainer-clean-compile maintainer-clean-libtool \ - maintainer-clean-aminfo maintainer-clean-tags \ - maintainer-clean-generic distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." +info: info-recursive + +info-am: $(INFO_DEPS) + +install-data-am: install-data-local install-man + +install-exec-am: install-exec-local + +install-info: install-info-recursive + +install-info-am: $(INFO_DEPS) + @$(NORMAL_INSTALL) + test -z "$(infodir)" || $(mkdir_p) "$(DESTDIR)$(infodir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ + for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ + $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ + if test -f $$ifile; then \ + relfile=`echo "$$ifile" | sed 's|^.*/||'`; \ + echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \ + $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \ + else : ; fi; \ + done; \ + done + @$(POST_INSTALL) + @if (install-info --version && \ + install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ + install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ + done; \ + else : ; fi +install-man: install-man1 + +installcheck-am: maintainer-clean: maintainer-clean-recursive - -rm -f config.status + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-aminfo \ + maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-aminfo mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool mostlyclean-local + +pdf: pdf-recursive -.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ -mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \ -clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile mostlyclean-libtool distclean-libtool \ -clean-libtool maintainer-clean-libtool install-info-am uninstall-info \ -mostlyclean-aminfo distclean-aminfo clean-aminfo \ -maintainer-clean-aminfo install-man1 uninstall-man1 install-man \ -uninstall-man install-data-recursive uninstall-data-recursive \ -install-exec-recursive uninstall-exec-recursive installdirs-recursive \ -uninstalldirs-recursive all-recursive check-recursive \ -installcheck-recursive info-recursive dvi-recursive \ -mostlyclean-recursive distclean-recursive clean-recursive \ -maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ -distclean-tags clean-tags maintainer-clean-tags distdir check-DEJAGNU \ -info-am info dvi-am dvi check check-am installcheck-am installcheck \ -install-info-am install-info all-recursive-am install-exec-local \ -install-exec-am install-exec install-data-local install-data-am \ -install-data install-am install uninstall-am uninstall all-redirect \ -all-am all installdirs-am installdirs mostlyclean-generic \ -distclean-generic clean-generic maintainer-clean-generic clean \ -mostlyclean distclean maintainer-clean +pdf-am: $(PDFS) + +ps: ps-recursive + +ps-am: $(PSS) + +uninstall-am: uninstall-man + +uninstall-info: uninstall-info-recursive + +uninstall-man: uninstall-man1 + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ + check-DEJAGNU check-am clean clean-generic clean-info \ + clean-libtool clean-noinstPROGRAMS clean-recursive ctags \ + ctags-recursive dist-info distclean distclean-DEJAGNU \ + distclean-compile distclean-generic distclean-hdr \ + distclean-libtool distclean-local distclean-recursive \ + distclean-tags dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-data-local \ + install-exec install-exec-am install-exec-local install-info \ + install-info-am install-man install-man1 install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-aminfo \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-aminfo mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool mostlyclean-local \ + mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-info-am uninstall-man \ + uninstall-man1 # Disable -Werror, if it has been enabled, since old versions of bison/ @@ -2266,6 +2337,9 @@ eelf32frvfd.c: $(srcdir)/emulparams/elf3 $(srcdir)/emulparams/elf32frv.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32frvfd "$(tdir_frv)" +eelf32ms1.c: $(srcdir)/emulparams/elf32ms1.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf32ms1 "$(tdir_ms1)" # The generated emulation files mostly have the same dependencies. $(EMULATION_OFILES): ../bfd/bfd.h sysdep.h config.h $(INCDIR)/bfdlink.h \ @@ -2356,17 +2430,13 @@ configdoc.texi: ${DOCVER}-doc.texi || ln ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi >/dev/null 2>&1 \ || cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi -ldver.texi: Makefile +ldver.texi: $(srcdir)/../bfd/configure rm -f $@ - echo '@set VERSION $(VERSION)' > $@ - -ld.info: $(srcdir)/ld.texinfo configdoc.texi ldver.texi - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) -I $(BFDDIR)/doc $(srcdir)/ld.texinfo + eval `grep '^ *VERSION=' $(srcdir)/../bfd/configure`; \ + echo "@set VERSION $$VERSION" > $@ +$(srcdir)/ld.info: $(srcdir)/ld.texinfo configdoc.texi ldver.texi ld.dvi: $(srcdir)/ld.texinfo configdoc.texi ldver.texi - TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \ - MAKEINFO="$(MAKEINFO) -I $(srcdir) -I $(BFDDIR)/doc" $(TEXI2DVI) -I $(BFDDIR)/doc $(srcdir)/ld.texinfo # Build the man page from the texinfo file # The sed command removes the no-adjust Nroff command so that @@ -2407,13 +2477,17 @@ install-data-local: # We want install to imply install-info as per GNU standards, despite the # cygnus option. -install: install-info +install-data-local: install-info diststuff: info $(EXTRA_DIST) +all: info ld.1 + +# Both info (ld.info) and ld.1 depend on configdoc.texi and ldver.texi. +# But info isn't a direct target. Make info-recursive to depend on +# ld.1 to support parallel build. +info-recursive: ld.1 distclean-local: rm -rf ldscripts -Makefile: $(BFDDIR)/configure.in - # Targets to rebuild dependencies in this Makefile. # Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES). DEP: dep.sed $(CFILES) $(HFILES) $(GENERATED_CFILES) $(GENERATED_HFILES) config.h @@ -2541,7 +2615,6 @@ deffilep.o: deffilep.c $(INCDIR)/libiber sysdep.h config.h $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h \ ldmisc.h deffile.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY - # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff -uprN binutils-2.16.90.0.3/ld/mri.c binutils-2.16.91.0.1/ld/mri.c --- binutils-2.16.90.0.3/ld/mri.c 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/ld/mri.c 2005-06-22 13:53:35.559209275 -0700 @@ -16,8 +16,8 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. +Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA +02110-1301, USA. This bit does the tree decoration when MRI style link scripts are parsed. diff -uprN binutils-2.16.90.0.3/ld/mri.h binutils-2.16.91.0.1/ld/mri.h --- binutils-2.16.90.0.3/ld/mri.h 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/ld/mri.h 2005-06-22 13:53:35.560209110 -0700 @@ -15,7 +15,7 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef MRI_H #define MRI_H diff -uprN binutils-2.16.90.0.3/ld/pe-dll.c binutils-2.16.91.0.1/ld/pe-dll.c --- binutils-2.16.90.0.3/ld/pe-dll.c 2005-04-09 12:03:22.000000000 -0700 +++ binutils-2.16.91.0.1/ld/pe-dll.c 2005-06-22 13:53:35.562208779 -0700 @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ #include "bfd.h" #include "sysdep.h" @@ -2636,14 +2636,13 @@ pe_dll_fill_sections (bfd *abfd, struct bfd_set_section_size (filler_bfd, reloc_s, reloc_sz); /* Resize the sections. */ - lang_size_sections (stat_ptr->head, abs_output_section, - &stat_ptr->head, 0, 0, NULL, TRUE); + lang_size_sections (NULL, TRUE); /* Redo special stuff. */ ldemul_after_allocation (); /* Do the assignments again. */ - lang_do_assignments (stat_ptr->head, abs_output_section, NULL, 0); + lang_do_assignments (); } fill_edata (abfd, info); @@ -2667,14 +2666,13 @@ pe_exe_fill_sections (bfd *abfd, struct bfd_set_section_size (filler_bfd, reloc_s, reloc_sz); /* Resize the sections. */ - lang_size_sections (stat_ptr->head, abs_output_section, - &stat_ptr->head, 0, 0, NULL, TRUE); + lang_size_sections (NULL, TRUE); /* Redo special stuff. */ ldemul_after_allocation (); /* Do the assignments again. */ - lang_do_assignments (stat_ptr->head, abs_output_section, NULL, 0); + lang_do_assignments (); } reloc_s->contents = reloc_d; } diff -uprN binutils-2.16.90.0.3/ld/pe-dll.h binutils-2.16.91.0.1/ld/pe-dll.h --- binutils-2.16.90.0.3/ld/pe-dll.h 2005-04-09 12:03:22.000000000 -0700 +++ binutils-2.16.91.0.1/ld/pe-dll.h 2005-06-22 13:53:35.562208779 -0700 @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ #ifndef PE_DLL_H #define PE_DLL_H diff -uprN binutils-2.16.90.0.3/ld/scripttempl/elf.sc binutils-2.16.91.0.1/ld/scripttempl/elf.sc --- binutils-2.16.90.0.3/ld/scripttempl/elf.sc 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/ld/scripttempl/elf.sc 2005-06-22 13:53:35.640195894 -0700 @@ -101,7 +101,10 @@ if test -n "${COMMONPAGESIZE}"; then DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);" fi INTERP=".interp ${RELOCATING-0} : { *(.interp) }" -PLT=".plt ${RELOCATING-0} : { *(.plt) }" +if test -z "$PLT"; then + PLT=".plt ${RELOCATING-0} : { *(.plt) }" +fi +test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes if test -z "$GOT"; then if test -z "$SEPARATE_GOTPLT"; then GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }" @@ -144,6 +147,16 @@ if test -z "${NO_SMALL_DATA}"; then else NO_SMALL_DATA=" " fi +if test -z "${DATA_GOT}"; then + if test -n "${NO_SMALL_DATA}"; then + DATA_GOT=" " + fi +fi +if test -z "${SDATA_GOT}"; then + if test -z "${NO_SMALL_DATA}"; then + SDATA_GOT=" " + fi +fi test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" " CTOR=".ctors ${CONSTRUCTING-0} : { @@ -290,7 +303,7 @@ cat < + + * ld-cris/libdso-10.d: Adjust for elf.sc .bss change. + * ld-cris/libdso-2.d: Likewise. + * ld-mmix/loc6.d: Likewise. + +2005-06-10 Alan Modra + + * ld-scripts/empty-aligned.t: Adjust alignment expressions so + that no .text? section is kept. Also check setting vma and + lma. + * ld-scripts/empty-aligned.d: Update. + +2005-06-09 Alan Modra + + * ld-scripts/empty-aligned.d: Adjust. + +2005-06-05 H.J. Lu + + * ld-cris/hiddef1.d: Undo the last change. + * ld-cris/libdso-10.d: Likewise. + * ld-cris/libdso-2.d: Likewise. + +2005-06-04 H.J. Lu + + * ld-cris/hiddef1.d: Updated. + * ld-cris/libdso-10.d: Likewise. + * ld-cris/libdso-2.d: Likewise. + +2005-06-02 Alan Modra + + * ld-powerpc/powerpc.exp (ppcelftests): Assemble sda test with -a32. + +2005-05-31 Zack Weinberg + + * ld-scripts/align.exp: Mark align1 XFAIL on PECOFF targets. + * ld-scripts/data.exp: Mark data UNSUPPORTED on a.out targets. + * ld-scripts/provide.exp, ld-scripts/size.exp: Mark all tests + UNSUPPORTED on a.out targets. Tidy. + +2005-05-27 Mark Mitchell + + * config/default.exp (CC): Use find_gcc. + (CFLAGS): Define, if no definition has been provided by the user. + (CXX): Likewise. + (CXXFLAGS): Likewise. + +2005-05-24 H.J. Lu + + * ld-mmix/bpo-6.d: Updated. + * ld-mmix/bpo-19.d: Likewise. + +2005-05-22 Richard Henderson + + * ld-elfweak/dsow.dsym: Adjust for non-zero ST_OTHER. + * ld-elfweak/weak.dsym: Likewise. + + * ld-selective/selective.exp: Don't test alpha. + +2005-05-20 Daniel Jacobowitz + + * ld-powerpc/sdalib.s, ld-powerpc/sdadyn.s, ld-powerpc/sdadyn.d: New + files. + * ld-powerpc/powerpc.exp: Run the new test. + +2005-05-20 Bob Wilson + + * ld-undefined/undefined.exp: Revert xfail for xtensa-*-*. + +2005-05-17 H.J. Lu + + PR 797 + * empty-aligned.d: New file. + * empty-aligned.exp: Likewise. + * empty-aligned.s: Likewise. + * empty-aligned.t: Likewise. + +2005-05-11 Bob Wilson + + * ld-undefined/undefined.exp: xfail xtensa-*-*. + 2005-05-07 Alan Modra * ld-powerpc/tlsexe32.d: Update for changed got layout. @@ -89,7 +170,7 @@ ld-sparc/tlssunpic64.dd, ld-sparc/tlssunpic64.rd, ld-sparc/tlssunpic64.sd, ld-sparc/tlssunpic64.td): Update now that sparc64 ELF does support TLS. - + 2005-04-13 H.J. Lu * ld-elf/empty.d: New file. @@ -127,10 +208,7 @@ * config/default.exp: Do not load libpath.exp if it does not exist. (CC): Provide fallback definition. - (CFLAGS): Likewise. - (CXX): Likewise. - (CXXFLAGS): Likewise. - + 2005-03-24 Eric Christopher * ld-mips-elf/rel32-n32.d: Revert changes. diff -uprN binutils-2.16.90.0.3/ld/testsuite/config/default.exp binutils-2.16.91.0.1/ld/testsuite/config/default.exp --- binutils-2.16.90.0.3/ld/testsuite/config/default.exp 2005-04-09 12:03:25.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/config/default.exp 2005-06-22 13:53:35.647194737 -0700 @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Jeffrey Wheat (cassidy@cygnus.com) # @@ -80,9 +80,18 @@ if {[file exists tmpdir/libpath.exp]} { # The "make check" target in the Makefile passes in # "CC=$(CC_FOR_TARGET)". But, if the user invokes runtest directly -# (as when testing an installed linker), CC may not be set. +# (as when testing an installed linker), these flags may not be set. if {![info exists CC]} { - set CC [transform gcc] + set CC [find_gcc] +} +if {![info exists CFLAGS]} { + set CFLAGS "-g -O2" +} +if {![info exists CXX]} { + set CXX [find_g++] +} +if {![info exists CXXFLAGS]} { + set CXXFLAGS "" } # The mips64-*-linux-gnu compiler defaults to the N32 ABI after diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-alpha/alpha.exp binutils-2.16.91.0.1/ld/testsuite/ld-alpha/alpha.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-alpha/alpha.exp 2003-03-19 09:19:17.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-alpha/alpha.exp 2005-06-22 13:53:35.653193746 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Test Alpha ELF linking; all types of relocs. This tests the diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-arm/arm-elf.exp binutils-2.16.91.0.1/ld/testsuite/ld-arm/arm-elf.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-arm/arm-elf.exp 2005-04-09 12:03:25.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-arm/arm-elf.exp 2005-06-22 13:53:35.657193085 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Exclude non-ARM-ELF targets. diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-arm/mixed-app.d binutils-2.16.91.0.1/ld/testsuite/ld-arm/mixed-app.d --- binutils-2.16.90.0.3/ld/testsuite/ld-arm/mixed-app.d 2005-04-09 12:03:25.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-arm/mixed-app.d 2005-06-22 13:53:35.657193085 -0700 @@ -49,7 +49,7 @@ Disassembly of section .text: .* : .*: b500 push {lr} - .*: (ffc.f7ff|f7ffffc.) bl .* <_start-0x..> + .*: f7ff ffc. bl .* <_start-0x..> .*: bd00 pop {pc} .*: 4770 bx lr .*: 46c0 nop \(mov r8, r8\) diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-auto-import/auto-import.exp binutils-2.16.91.0.1/ld/testsuite/ld-auto-import/auto-import.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-auto-import/auto-import.exp 2003-01-21 10:21:34.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-auto-import/auto-import.exp 2005-06-22 13:53:35.663192094 -0700 @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Ralf.Habacker@freenet.de # Based on ls-shared/shared.exp by Ian Lance Taylor (ian@cygnus.com) diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-bootstrap/bootstrap.exp binutils-2.16.91.0.1/ld/testsuite/ld-bootstrap/bootstrap.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-bootstrap/bootstrap.exp 2005-04-09 12:03:26.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-bootstrap/bootstrap.exp 2005-06-22 13:53:35.667191433 -0700 @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Jeffrey Wheat (cassidy@cygnus.com) # Rewritten by Ian Lance Taylor (ian@cygnus.com) diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-cdtest/cdtest.exp binutils-2.16.91.0.1/ld/testsuite/ld-cdtest/cdtest.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-cdtest/cdtest.exp 2005-04-09 12:03:26.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-cdtest/cdtest.exp 2005-06-22 13:53:35.667191433 -0700 @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Jeffrey Wheat (cassidy@cygnus.com) # Rewritten by Ian Lance Taylor (ian@cygnus.com) diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-checks/checks.exp binutils-2.16.91.0.1/ld/testsuite/ld-checks/checks.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-checks/checks.exp 2005-04-09 12:03:26.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-checks/checks.exp 2005-06-22 13:53:35.667191433 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Nick Clifton (nickc@cygnus.com) diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-cris/cris.exp binutils-2.16.91.0.1/ld/testsuite/ld-cris/cris.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-cris/cris.exp 2002-02-03 11:22:33.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-cris/cris.exp 2005-06-22 13:53:35.672190607 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Hans-Peter Nilsson (hp@axis.com) # diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-cris/libdso-10.d binutils-2.16.91.0.1/ld/testsuite/ld-cris/libdso-10.d --- binutils-2.16.90.0.3/ld/testsuite/ld-cris/libdso-10.d 2005-04-09 12:03:26.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-cris/libdso-10.d 2005-06-22 13:53:35.679189451 -0700 @@ -11,7 +11,7 @@ Program Header: LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 filesz 0x0+188 memsz 0x0+188 flags r-x LOAD off 0x0+188 vaddr 0x0+2188 paddr 0x0+2188 align 2\*\*13 - filesz 0x0+64 memsz 0x0+78 flags rw- + filesz 0x0+64 memsz 0x0+64 flags rw- DYNAMIC off 0x0+188 vaddr 0x0+2188 paddr 0x0+2188 align 2\*\*2 filesz 0x0+58 memsz 0x0+58 flags rw- Dynamic Section: @@ -35,5 +35,3 @@ Idx Name Size VMA LM CONTENTS, ALLOC, LOAD, DATA 5 \.got 0+c 0+21e0 0+21e0 0+1e0 2\*\*2 CONTENTS, ALLOC, LOAD, DATA - 6 \.bss 0+14 0+21ec 0+21ec 0+1ec 2\*\*0 - ALLOC diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-cris/libdso-2.d binutils-2.16.91.0.1/ld/testsuite/ld-cris/libdso-2.d --- binutils-2.16.90.0.3/ld/testsuite/ld-cris/libdso-2.d 2005-04-09 12:03:26.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-cris/libdso-2.d 2005-06-22 13:53:35.684188625 -0700 @@ -10,7 +10,7 @@ # entries. This formerly SEGV:ed because .rela.got was created # too late to have it mapped to an output section. -There are 14 section headers.* +There are 13 section headers.* #... \[ 1\] \.hash HASH .* \[ 2\] \.dynsym DYNSYM .* @@ -21,10 +21,9 @@ There are 14 section headers.* \[ 7\] \.text PROGBITS .* \[ 8\] \.dynamic DYNAMIC .* \[ 9\] \.got PROGBITS .* - \[10\] \.bss NOBITS .* - \[11\] \.shstrtab STRTAB .* - \[12\] \.symtab SYMTAB .* - \[13\] \.strtab STRTAB .* + \[10\] \.shstrtab STRTAB .* + \[11\] \.symtab SYMTAB .* + \[12\] \.strtab STRTAB .* #... Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 1 entries: #... @@ -35,11 +34,11 @@ Symbol table '\.dynsym' contains 6 entri 0: 0+ 0 NOTYPE LOCAL DEFAULT UND 1: [0-9a-f]+ 0 SECTION LOCAL DEFAULT 7 2: [0-9a-f]+ 0 NOTYPE LOCAL DEFAULT UND - 3: [0-9a-f]+ 0 SECTION LOCAL DEFAULT 10 + 3: [0-9a-f]+ 0 NOTYPE LOCAL DEFAULT UND 4: 0+ 0 OBJECT GLOBAL DEFAULT ABS TST1 5: 0+188 0 FUNC GLOBAL DEFAULT 7 export_1@@TST1 -Symbol table '\.symtab' contains 22 entries: +Symbol table '\.symtab' contains 21 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0+ 0 NOTYPE LOCAL DEFAULT UND 1: [0-9a-f]+ 0 SECTION LOCAL DEFAULT 1 @@ -54,12 +53,11 @@ Symbol table '\.symtab' contains 22 entr 10: [0-9a-f]+ 0 SECTION LOCAL DEFAULT 10 11: [0-9a-f]+ 0 SECTION LOCAL DEFAULT 11 12: [0-9a-f]+ 0 SECTION LOCAL DEFAULT 12 - 13: [0-9a-f]+ 0 SECTION LOCAL DEFAULT 13 - 14: 0+2198 0 OBJECT LOCAL DEFAULT ABS _DYNAMIC - 15: 0+2230 0 NOTYPE LOCAL DEFAULT ABS __bss_start - 16: 0+2230 0 NOTYPE LOCAL DEFAULT ABS _edata - 17: 0+2220 0 OBJECT LOCAL HIDDEN ABS _GLOBAL_OFFSET_TABLE_ - 18: 0+2240 0 NOTYPE LOCAL DEFAULT ABS _end - 19: 0+184 0 FUNC LOCAL DEFAULT 7 dsofn - 20: 0+ 0 OBJECT GLOBAL DEFAULT ABS TST1 - 21: 0+188 0 FUNC GLOBAL DEFAULT 7 export_1 + 13: 0+2198 0 OBJECT LOCAL DEFAULT ABS _DYNAMIC + 14: 0+2230 0 NOTYPE LOCAL DEFAULT ABS __bss_start + 15: 0+2230 0 NOTYPE LOCAL DEFAULT ABS _edata + 16: 0+2220 0 OBJECT LOCAL HIDDEN ABS _GLOBAL_OFFSET_TABLE_ + 17: 0+2240 0 NOTYPE LOCAL DEFAULT ABS _end + 18: 0+184 0 FUNC LOCAL DEFAULT 7 dsofn + 19: 0+ 0 OBJECT GLOBAL DEFAULT ABS TST1 + 20: 0+188 0 FUNC GLOBAL DEFAULT 7 export_1 diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-crx/crx.exp binutils-2.16.91.0.1/ld/testsuite/ld-crx/crx.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-crx/crx.exp 2004-09-15 12:05:04.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-crx/crx.exp 2005-06-22 13:53:35.689187799 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Tomer Levi, Tomer.Levi@nsc.com # diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-cygwin/exe-export.exp binutils-2.16.91.0.1/ld/testsuite/ld-cygwin/exe-export.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-cygwin/exe-export.exp 2004-01-14 13:07:53.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-cygwin/exe-export.exp 2005-06-22 13:53:35.692187303 -0700 @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Fabrizio Gennari # Based on auto-import.exp by Ralf.Habacker@freenet.de diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-d10v/d10v.exp binutils-2.16.91.0.1/ld/testsuite/ld-d10v/d10v.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-d10v/d10v.exp 2002-06-18 21:41:59.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-d10v/d10v.exp 2005-06-22 13:53:35.696186643 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Tom Rix, trix@redhat.com # diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-discard/discard.exp binutils-2.16.91.0.1/ld/testsuite/ld-discard/discard.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-discard/discard.exp 2002-09-27 08:33:09.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-discard/discard.exp 2005-06-22 13:53:35.697186477 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Hans-Peter Nilsson (hp@axis.com) # H.J. Lu (hjl@gnu.org) diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-elf/elf.exp binutils-2.16.91.0.1/ld/testsuite/ld-elf/elf.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-elf/elf.exp 2005-04-09 12:03:26.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-elf/elf.exp 2005-06-22 13:53:35.700185982 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Exclude non-ELF targets. diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-elf/exclude.exp binutils-2.16.91.0.1/ld/testsuite/ld-elf/exclude.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-elf/exclude.exp 2004-11-22 12:33:33.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-elf/exclude.exp 2005-06-22 13:53:35.704185321 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # Make sure that ld can hide symbols from libraries when building a shared # library. diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-elf/frame.exp binutils-2.16.91.0.1/ld/testsuite/ld-elf/frame.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-elf/frame.exp 2004-07-27 21:36:11.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-elf/frame.exp 2005-06-22 13:53:35.710184330 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by H.J. Lu (hongjiu.lu@intel.com) # diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-elf/sec64k.exp binutils-2.16.91.0.1/ld/testsuite/ld-elf/sec64k.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-elf/sec64k.exp 2005-04-09 12:03:27.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-elf/sec64k.exp 2005-06-22 13:53:35.712183999 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Hans-Peter Nilsson (hp@axis.com) # diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-elfcomm/elfcomm.exp binutils-2.16.91.0.1/ld/testsuite/ld-elfcomm/elfcomm.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-elfcomm/elfcomm.exp 2005-04-09 12:03:27.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-elfcomm/elfcomm.exp 2005-06-22 13:53:35.716183339 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by H.J. Lu (hjl@gnu.org) # diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-elfvers/vers.exp binutils-2.16.91.0.1/ld/testsuite/ld-elfvers/vers.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-elfvers/vers.exp 2005-04-09 12:03:27.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-elfvers/vers.exp 2005-06-22 13:53:35.722182347 -0700 @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Eric Youngdale (eric@andante.jic.com) diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-elfvsb/elfvsb.exp binutils-2.16.91.0.1/ld/testsuite/ld-elfvsb/elfvsb.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-elfvsb/elfvsb.exp 2005-04-09 12:03:27.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-elfvsb/elfvsb.exp 2005-06-22 13:53:35.723182182 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Ian Lance Taylor (ian@cygnus.com) # and H.J. Lu (hjl@gnu.org) diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-elfweak/dsow.dsym binutils-2.16.91.0.1/ld/testsuite/ld-elfweak/dsow.dsym --- binutils-2.16.90.0.3/ld/testsuite/ld-elfweak/dsow.dsym 2001-10-01 15:25:26.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-elfweak/dsow.dsym 2005-06-22 13:53:35.725181852 -0700 @@ -1 +1 @@ -[0-9a-f]*[ ]+w[ ]+DF[ ]+.text[ ]+[0-9a-f]*[ ]+(Base[ ]+|[ ]*)foo +[0-9a-f]*[ ]+w[ ]+DF[ ]+.text[ ]+[0-9a-f]*[ ]+(Base[ ]+|[ ]*)(0x[0-9a-f]+|)[ ]*foo diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-elfweak/elfweak.exp binutils-2.16.91.0.1/ld/testsuite/ld-elfweak/elfweak.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-elfweak/elfweak.exp 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-elfweak/elfweak.exp 2005-06-22 13:53:35.728181356 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by H.J. Lu (hjl@gnu.org) # Eric Youngdale (eric@andante.jic.com) diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-elfweak/weak.dsym binutils-2.16.91.0.1/ld/testsuite/ld-elfweak/weak.dsym --- binutils-2.16.90.0.3/ld/testsuite/ld-elfweak/weak.dsym 2001-10-01 15:25:26.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-elfweak/weak.dsym 2005-06-22 13:53:35.732180695 -0700 @@ -1 +1 @@ -[0-9a-f]*[ ]+w[ ]+DF[ ]+.text[ ]+[0-9a-f]*[ ]+(Base[ ]+|[ ]*)foo +[0-9a-f]*[ ]+w[ ]+DF[ ]+.text[ ]+[0-9a-f]*[ ]+(Base[ ]+|[ ]*)(0x[0-9a-f]+|)[ ]*foo diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-fastcall/fastcall.exp binutils-2.16.91.0.1/ld/testsuite/ld-fastcall/fastcall.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-fastcall/fastcall.exp 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-fastcall/fastcall.exp 2005-06-22 13:53:35.733180530 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. set testname "ld (fastcall symbols)" diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-frv/fdpic.exp binutils-2.16.91.0.1/ld/testsuite/ld-frv/fdpic.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-frv/fdpic.exp 2005-04-09 12:03:27.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-frv/fdpic.exp 2005-06-22 13:53:35.737179869 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # if {![istarget frv*-*-*] || ![is_elf_format]} { diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-frv/tls.exp binutils-2.16.91.0.1/ld/testsuite/ld-frv/tls.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-frv/tls.exp 2005-04-09 12:03:27.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-frv/tls.exp 2005-06-22 13:53:35.741179209 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # if {![istarget frv*-*-*] || ![is_elf_format]} { diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-h8300/h8300.exp binutils-2.16.91.0.1/ld/testsuite/ld-h8300/h8300.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-h8300/h8300.exp 2004-09-15 12:05:04.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-h8300/h8300.exp 2005-06-22 13:53:35.741179209 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Nick Clifton # diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-i386/i386.exp binutils-2.16.91.0.1/ld/testsuite/ld-i386/i386.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-i386/i386.exp 2002-10-10 09:16:57.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-i386/i386.exp 2005-06-22 13:53:35.752177391 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Test i386 linking; all types of relocs. This tests the assembler and diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-ia64/ia64.exp binutils-2.16.91.0.1/ld/testsuite/ld-ia64/ia64.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-ia64/ia64.exp 2005-04-09 12:03:27.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-ia64/ia64.exp 2005-06-22 13:53:35.753177226 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Test ia64 linking; all types of relocs. This tests the assembler and diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-linkonce/linkonce.exp binutils-2.16.91.0.1/ld/testsuite/ld-linkonce/linkonce.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-linkonce/linkonce.exp 2002-08-14 10:35:11.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-linkonce/linkonce.exp 2005-06-22 13:53:35.769174583 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Hans-Peter Nilsson (hp@axis.com) # diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-m68hc11/m68hc11.exp binutils-2.16.91.0.1/ld/testsuite/ld-m68hc11/m68hc11.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-m68hc11/m68hc11.exp 2002-10-29 20:09:13.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-m68hc11/m68hc11.exp 2005-06-22 13:53:35.769174583 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Adapted from ld-sh/rd-sh.exp diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-maxq/maxq.exp binutils-2.16.91.0.1/ld/testsuite/ld-maxq/maxq.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-maxq/maxq.exp 2004-11-22 12:33:33.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-maxq/maxq.exp 2005-06-22 13:53:35.789171279 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by inderpreetb@noida.hcltech.com diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-mips-elf/mips-elf.exp binutils-2.16.91.0.1/ld/testsuite/ld-mips-elf/mips-elf.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-mips-elf/mips-elf.exp 2005-04-09 12:03:27.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-mips-elf/mips-elf.exp 2005-06-22 13:53:35.801169297 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # if {![istarget mips*-*-*] || ![is_elf_format]} { diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-mips-elf/mips-elf-flags.exp binutils-2.16.91.0.1/ld/testsuite/ld-mips-elf/mips-elf-flags.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-mips-elf/mips-elf-flags.exp 2004-01-14 13:07:54.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-mips-elf/mips-elf-flags.exp 2005-06-22 13:53:35.796170123 -0700 @@ -12,7 +12,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. if {![istarget mips*-*-*] || ![is_elf_format]} { return diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-mmix/bpo-19.d binutils-2.16.91.0.1/ld/testsuite/ld-mmix/bpo-19.d --- binutils-2.16.90.0.3/ld/testsuite/ld-mmix/bpo-19.d 2005-04-09 12:03:28.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-mmix/bpo-19.d 2005-06-22 13:53:35.803168966 -0700 @@ -15,7 +15,6 @@ SYMBOL TABLE: 0+ l d \*ABS\* 0+ (|\.shstrtab) 0+ l d \*ABS\* 0+ (|\.symtab) 0+ l d \*ABS\* 0+ (|\.strtab) -0+37c l \*ABS\* 0+ i 0+ g \.text 0+ _start #... diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-mmix/bpo-6.d binutils-2.16.91.0.1/ld/testsuite/ld-mmix/bpo-6.d --- binutils-2.16.90.0.3/ld/testsuite/ld-mmix/bpo-6.d 2005-04-09 12:03:28.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-mmix/bpo-6.d 2005-06-22 13:53:35.809167975 -0700 @@ -14,7 +14,6 @@ SYMBOL TABLE: 0+ l d \*ABS\* 0+ (|\.shstrtab) 0+ l d \*ABS\* 0+ (|\.symtab) 0+ l d \*ABS\* 0+ (|\.strtab) -0+df l \*ABS\* 0+ i 0+ g \.text 0+ _start #... diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-mmix/loc6.d binutils-2.16.91.0.1/ld/testsuite/ld-mmix/loc6.d --- binutils-2.16.90.0.3/ld/testsuite/ld-mmix/loc6.d 2005-04-09 12:03:28.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-mmix/loc6.d 2005-06-22 13:53:35.813167314 -0700 @@ -10,7 +10,6 @@ SYMBOL TABLE: 0+ l d \.text 0+ (|\.text) 2000000000000200 l d \.data 0+ (|\.data) -200000000000020c l d \.bss 0+ (|\.bss) 0+ l d \*ABS\* 0+ (|\.shstrtab) 0+ l d \*ABS\* 0+ (|\.symtab) 0+ l d \*ABS\* 0+ (|\.strtab) diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-mmix/mmix.exp binutils-2.16.91.0.1/ld/testsuite/ld-mmix/mmix.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-mmix/mmix.exp 2001-11-16 14:05:55.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-mmix/mmix.exp 2005-06-22 13:53:35.820166158 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Hans-Peter Nilsson (hp@bitrange.com) # diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-pe/pe.exp binutils-2.16.91.0.1/ld/testsuite/ld-pe/pe.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-pe/pe.exp 2004-05-27 11:26:06.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-pe/pe.exp 2005-06-22 13:53:35.824165497 -0700 @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # This test can only be run on i386 PE/COFF platforms. diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-powerpc/powerpc.exp binutils-2.16.91.0.1/ld/testsuite/ld-powerpc/powerpc.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-powerpc/powerpc.exp 2005-04-09 12:03:28.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-powerpc/powerpc.exp 2005-06-22 13:53:35.830164506 -0700 @@ -1,5 +1,5 @@ # Expect script for ld-powerpc tests -# Copyright 2002, 2003 Free Software Foundation +# Copyright 2002, 2003, 2005 Free Software Foundation # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # if { ![istarget "powerpc*-*-*"] } { @@ -69,6 +69,10 @@ set ppcelftests { {{readelf -WSsrl tlsso32.r} {objdump -dr tlsso32.d} {objdump -sj.got tlsso32.g} {objdump -sj.tdata tlsso32.t}} "tls32.so"} + {"Shared library with global symbol" "-shared -melf32ppc" "-a32" {sdalib.s} + {} "sdalib.so"} + {"Dynamic application with SDA" "-melf32ppc tmpdir/sdalib.so" "-a32" {sdadyn.s} + {{objdump -R sdadyn.d}} "sdadyn"} } set ppc64elftests { diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-powerpc/sdadyn.d binutils-2.16.91.0.1/ld/testsuite/ld-powerpc/sdadyn.d --- binutils-2.16.90.0.3/ld/testsuite/ld-powerpc/sdadyn.d 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-powerpc/sdadyn.d 2005-06-22 13:53:35.830164506 -0700 @@ -0,0 +1,8 @@ + +.*: +file format elf32-powerpc + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +#... +.* R_PPC_COPY lib_var +#pass diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-powerpc/sdadyn.s binutils-2.16.91.0.1/ld/testsuite/ld-powerpc/sdadyn.s --- binutils-2.16.90.0.3/ld/testsuite/ld-powerpc/sdadyn.s 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-powerpc/sdadyn.s 2005-06-22 13:53:35.830164506 -0700 @@ -0,0 +1,3 @@ + .globl _start +_start: + lwz 3,lib_var@sda21(0) diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-powerpc/sdalib.s binutils-2.16.91.0.1/ld/testsuite/ld-powerpc/sdalib.s --- binutils-2.16.90.0.3/ld/testsuite/ld-powerpc/sdalib.s 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-powerpc/sdalib.s 2005-06-22 13:53:35.830164506 -0700 @@ -0,0 +1,4 @@ + .globl lib_var + .type lib_var, @object +lib_var: + .word 1 diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-s390/s390.exp binutils-2.16.91.0.1/ld/testsuite/ld-s390/s390.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-s390/s390.exp 2003-03-19 09:19:17.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-s390/s390.exp 2005-06-22 13:53:35.835163680 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Test s390 linking; all types of relocs. This tests the assembler and diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-scripts/align.exp binutils-2.16.91.0.1/ld/testsuite/ld-scripts/align.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-scripts/align.exp 2005-04-09 12:03:29.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-scripts/align.exp 2005-06-22 13:53:35.837163350 -0700 @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. if [istarget "rs6000-*-aix*"] { # Target maps .text and .data to other sections. @@ -29,6 +29,12 @@ if ![ld_assemble $as $srcdir/$subdir/ali return } +# Doesn't work on PECOFF, appears to be a genuine bug +if [is_pecoff_format] { + global target_triplet + setup_xfail $target_triplet +} + if ![ld_simple_link $ld tmpdir/align "-T $srcdir/$subdir/align.t tmpdir/align.o"] { fail $testname } else { diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-scripts/assert.exp binutils-2.16.91.0.1/ld/testsuite/ld-scripts/assert.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-scripts/assert.exp 2004-03-03 12:24:34.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-scripts/assert.exp 2005-06-22 13:53:35.840162854 -0700 @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. set testname "ASSERT" diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-scripts/crossref.exp binutils-2.16.91.0.1/ld/testsuite/ld-scripts/crossref.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-scripts/crossref.exp 2005-04-09 12:03:29.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-scripts/crossref.exp 2005-06-22 13:53:35.843162358 -0700 @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. set test1 "NOCROSSREFS 1" set test2 "NOCROSSREFS 2" diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-scripts/data.exp binutils-2.16.91.0.1/ld/testsuite/ld-scripts/data.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-scripts/data.exp 2004-03-03 12:24:34.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-scripts/data.exp 2005-06-22 13:53:35.843162358 -0700 @@ -15,6 +15,13 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + +# An a.out "objdump -s -j .text" has the file header visible inside the +# text segment, confusing run_dump_test. +if {[is_aout_format]} { + unsupported data + return +} run_dump_test data diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-scripts/defined.exp binutils-2.16.91.0.1/ld/testsuite/ld-scripts/defined.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-scripts/defined.exp 2005-04-09 12:03:29.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-scripts/defined.exp 2005-06-22 13:53:35.857160046 -0700 @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. set testname "DEFINED" set prms_id 5699 diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-scripts/empty-aligned.d binutils-2.16.91.0.1/ld/testsuite/ld-scripts/empty-aligned.d --- binutils-2.16.90.0.3/ld/testsuite/ld-scripts/empty-aligned.d 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-scripts/empty-aligned.d 2005-06-22 13:53:35.857160046 -0700 @@ -0,0 +1,12 @@ +#source: empty-aligned.s +#ld: -T empty-aligned.t +#readelf: -l --wide + +#... +Program Headers: + +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg +Align + +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ [RWE ]+ +0x[0-9a-f]+ + + Section to Segment mapping: + +Segment Sections\.\.\. + +00.*\.text.*\.data.* diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-scripts/empty-aligned.exp binutils-2.16.91.0.1/ld/testsuite/ld-scripts/empty-aligned.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-scripts/empty-aligned.exp 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-scripts/empty-aligned.exp 2005-06-22 13:53:35.857160046 -0700 @@ -0,0 +1,26 @@ +# Make sure empty aligned sections do not change output layout. +# Copyright 2005 +# Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + +# PHDRS is only meaningful for ELF. +if ![is_elf_format] { + return +} + +set testname "empty-aligned" + +run_dump_test empty-aligned diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-scripts/empty-aligned.s binutils-2.16.91.0.1/ld/testsuite/ld-scripts/empty-aligned.s --- binutils-2.16.90.0.3/ld/testsuite/ld-scripts/empty-aligned.s 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-scripts/empty-aligned.s 2005-06-22 13:53:35.857160046 -0700 @@ -0,0 +1,4 @@ + .text + .long 123 + .data + .long 123 diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-scripts/empty-aligned.t binutils-2.16.91.0.1/ld/testsuite/ld-scripts/empty-aligned.t --- binutils-2.16.90.0.3/ld/testsuite/ld-scripts/empty-aligned.t 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-scripts/empty-aligned.t 2005-06-22 13:53:35.858159880 -0700 @@ -0,0 +1,30 @@ +SECTIONS +{ + .text : { *(.text) } + /* Alignment at beginning shouldn't result in empty section being kept. */ + .text1 ALIGN (4096) : + { + *(.text1) + } + /* Same for alignment at beginning and end. */ + .text2 ALIGN (4096) : + { + *(.text2) + . = ALIGN (4096); + } + /* Same for alignment just at end, although we need to be careful in + the expression used to align. */ + .text3 : + { + *(.text3) + . = ALIGN (. != 0 ? 4096 : 1); + } + /* Same when setting vma and lma. This also shouldn't result in + .text3 being kept. */ + .text4 ADDR (.text3) + SIZEOF (.text3) + 8192 : AT (LOADADDR (.text3)) + { + *(.text4) + } + .data : { *(.data) } + .bss : { *(.bss) } +} diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-scripts/empty-orphan.exp binutils-2.16.91.0.1/ld/testsuite/ld-scripts/empty-orphan.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-scripts/empty-orphan.exp 2005-04-09 12:03:29.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-scripts/empty-orphan.exp 2005-06-22 13:53:35.858159880 -0700 @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # PHDRS is only meaningful for ELF. if ![is_elf_format] { diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-scripts/map-address.exp binutils-2.16.91.0.1/ld/testsuite/ld-scripts/map-address.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-scripts/map-address.exp 2002-05-23 15:10:11.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-scripts/map-address.exp 2005-06-22 13:53:35.862159220 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. set testname "map addresses" diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-scripts/overlay-size.exp binutils-2.16.91.0.1/ld/testsuite/ld-scripts/overlay-size.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-scripts/overlay-size.exp 2002-05-23 15:10:11.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-scripts/overlay-size.exp 2005-06-22 13:53:35.862159220 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. if ![is_elf_format] { return diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-scripts/phdrs2.exp binutils-2.16.91.0.1/ld/testsuite/ld-scripts/phdrs2.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-scripts/phdrs2.exp 2002-08-01 17:49:32.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-scripts/phdrs2.exp 2005-06-22 13:53:35.876156907 -0700 @@ -12,7 +12,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # PHDRS2 is only meaningful for ELF. if { ![istarget *-*-sysv4*] \ diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-scripts/phdrs.exp binutils-2.16.91.0.1/ld/testsuite/ld-scripts/phdrs.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-scripts/phdrs.exp 2005-04-09 12:03:29.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-scripts/phdrs.exp 2005-06-22 13:53:35.863159054 -0700 @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # PHDRS is only meaningful for ELF. if ![is_elf_format] { diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-scripts/provide.exp binutils-2.16.91.0.1/ld/testsuite/ld-scripts/provide.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-scripts/provide.exp 2004-04-12 12:56:37.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-scripts/provide.exp 2005-06-22 13:53:35.879156411 -0700 @@ -15,15 +15,20 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, +# USA. -if [istarget "rs6000-*-aix*"] { - # Target maps .text and .data to other sections. +# AIX maps .text and .data to other sections. +# a.out objdump displays the file header inside the text segment, +# confusing run_dump_test. + +if {[istarget "rs6000-*-aix*"] || [is_aout_format]} { + unsupported provide-1 + unsupported provide-2 + unsupported provide-3 return } -set testname "provide" - run_dump_test provide-1 run_dump_test provide-2 setup_xfail *-*-* diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-scripts/script.exp binutils-2.16.91.0.1/ld/testsuite/ld-scripts/script.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-scripts/script.exp 2005-04-09 12:03:29.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-scripts/script.exp 2005-06-22 13:53:35.880156246 -0700 @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. set testname "script" diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-scripts/size.exp binutils-2.16.91.0.1/ld/testsuite/ld-scripts/size.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-scripts/size.exp 2004-04-12 12:56:37.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-scripts/size.exp 2005-06-22 13:53:35.893154098 -0700 @@ -13,22 +13,25 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # -if [istarget "rs6000-*-aix*"] { - # Target maps .text and .data to other sections. +# AIX maps .text and .data to other sections. +# a.out objdump displays the file header inside the text segment, +# confusing run_dump_test. + +if {[istarget "rs6000-*-aix*"] || [is_aout_format]} { + unsupported size-1 + unsupported size-2 return } run_dump_test size-1 -if ![is_elf_format] { - return -} - -if [istarget "mips*-*-*"] { - # MIPS inserts a REGINFO PHDR +# size-2 only works on ELF targets. +# MIPS inserts a REGINFO PHDR +if {![is_elf_format] || [istarget "mips*-*-*"]} { + unsupported size-2 return } diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-scripts/sizeof.exp binutils-2.16.91.0.1/ld/testsuite/ld-scripts/sizeof.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-scripts/sizeof.exp 2001-07-26 18:02:55.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-scripts/sizeof.exp 2005-06-22 13:53:35.897153438 -0700 @@ -16,7 +16,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. set testname "SIZEOF" diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-scripts/sort.exp binutils-2.16.91.0.1/ld/testsuite/ld-scripts/sort.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-scripts/sort.exp 2004-11-22 12:33:33.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-scripts/sort.exp 2005-06-22 13:53:35.904152281 -0700 @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # FIXME: The expected outputs are correct only for ELF. if ![is_elf_format] { diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-scripts/weak.exp binutils-2.16.91.0.1/ld/testsuite/ld-scripts/weak.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-scripts/weak.exp 2005-04-09 12:03:29.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-scripts/weak.exp 2005-06-22 13:53:35.905152116 -0700 @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. set testname "weak symbols" diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-selective/sel-dump.exp binutils-2.16.91.0.1/ld/testsuite/ld-selective/sel-dump.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-selective/sel-dump.exp 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-selective/sel-dump.exp 2005-06-22 13:53:35.923149143 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # Test for ELF here, so we don't have to qualify on ELF specifically # in every .d-file. diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-selective/selective.exp binutils-2.16.91.0.1/ld/testsuite/ld-selective/selective.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-selective/selective.exp 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-selective/selective.exp 2005-06-22 13:53:35.929148151 -0700 @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Catherine Moore (clm@cygnus.com) # Make sure that constructors are handled correctly. @@ -24,8 +24,8 @@ if ![is_elf_format] { return } -# IA64 does not support selective linking -if {[istarget "ia64-*-*"]} { +# Alpha and IA64 do not support selective linking +if {[istarget "alpha*-*-*"] || [istarget "ia64-*-*"]} { return } @@ -84,7 +84,7 @@ foreach testitem $seltests { foreach xfail_target $xfails { setup_xfail $xfail_target } - setup_xfail "alpha*-*" "arc*-*" "d30v*-*" "dlx*-*" "i370*-*" "i860*-*" + setup_xfail "arc*-*" "d30v*-*" "dlx*-*" "i370*-*" "i860*-*" setup_xfail "i960*-*" "mn10200-*" "or32-*" "pj-*" # It's either C or C++ at the moment. diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-sh/arch/arch.exp binutils-2.16.91.0.1/ld/testsuite/ld-sh/arch/arch.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-sh/arch/arch.exp 2005-04-09 12:03:29.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-sh/arch/arch.exp 2005-06-22 13:53:35.930147986 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # Please email any bugs, comments, and/or additions to this file to: # binutils@sources.redhat.com diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-sh/rd-sh.exp binutils-2.16.91.0.1/ld/testsuite/ld-sh/rd-sh.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-sh/rd-sh.exp 2005-04-09 12:03:29.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-sh/rd-sh.exp 2005-06-22 13:53:35.929148151 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Hans-Peter Nilsson (hp@bitrange.com) # diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-sh/sh64/rd-sh64.exp binutils-2.16.91.0.1/ld/testsuite/ld-sh/sh64/rd-sh64.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-sh/sh64/rd-sh64.exp 2005-04-09 12:03:30.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-sh/sh64/rd-sh64.exp 2005-06-22 13:53:35.930147986 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Stephen Clarke (stephen.clarke@superh.com) # diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-sh/sh64/relax.exp binutils-2.16.91.0.1/ld/testsuite/ld-sh/sh64/relax.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-sh/sh64/relax.exp 2005-04-09 12:03:30.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-sh/sh64/relax.exp 2005-06-22 13:53:35.931147821 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Test SH relaxing - that is, that it's disabled when SHmedia sections diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-sh/sh64/relfail.exp binutils-2.16.91.0.1/ld/testsuite/ld-sh/sh64/relfail.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-sh/sh64/relfail.exp 2005-04-09 12:03:30.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-sh/sh64/relfail.exp 2005-06-22 13:53:35.931147821 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Test SH reloc failures - that is, cases that ld must not allow. diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-sh/sh64/sh64.exp binutils-2.16.91.0.1/ld/testsuite/ld-sh/sh64/sh64.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-sh/sh64/sh64.exp 2005-04-09 12:03:30.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-sh/sh64/sh64.exp 2005-06-22 13:53:35.932147656 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Test SH linking; all types of relocs. This tests the assembler and diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-shared/shared.exp binutils-2.16.91.0.1/ld/testsuite/ld-shared/shared.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-shared/shared.exp 2005-04-09 12:03:30.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-shared/shared.exp 2005-06-22 13:53:35.948145013 -0700 @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Ian Lance Taylor (ian@cygnus.com) # diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-sparc/sparc.exp binutils-2.16.91.0.1/ld/testsuite/ld-sparc/sparc.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-sparc/sparc.exp 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-sparc/sparc.exp 2005-06-22 13:53:35.951144517 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Test SPARC linking; all types of relocs. This tests the assembler and diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-undefined/undefined.exp binutils-2.16.91.0.1/ld/testsuite/ld-undefined/undefined.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-undefined/undefined.exp 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-undefined/undefined.exp 2005-06-22 13:53:35.952144352 -0700 @@ -16,7 +16,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. set testund "undefined" set testfn "undefined function" diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-undefined/weak-undef.exp binutils-2.16.91.0.1/ld/testsuite/ld-undefined/weak-undef.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-undefined/weak-undef.exp 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-undefined/weak-undef.exp 2005-06-22 13:53:35.972141048 -0700 @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. set testname "weak undefined symbols" diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-versados/versados.exp binutils-2.16.91.0.1/ld/testsuite/ld-versados/versados.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-versados/versados.exp 2001-03-15 14:57:32.000000000 -0800 +++ binutils-2.16.91.0.1/ld/testsuite/ld-versados/versados.exp 2005-06-22 13:53:35.973140883 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Written by Steve Chamberlain (sac@cygnus.com) # diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-x86-64/x86-64.exp binutils-2.16.91.0.1/ld/testsuite/ld-x86-64/x86-64.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-x86-64/x86-64.exp 2002-10-02 10:17:20.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-x86-64/x86-64.exp 2005-06-22 13:53:35.989138239 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Test x86_64 linking; all types of relocs. This tests the assembler and diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-xstormy16/xstormy16.exp binutils-2.16.91.0.1/ld/testsuite/ld-xstormy16/xstormy16.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-xstormy16/xstormy16.exp 2003-05-05 14:46:50.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-xstormy16/xstormy16.exp 2005-06-22 13:53:35.992137744 -0700 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # Test xstormy16 linking of pc-relative relocs. This tests the assembler and diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-xtensa/coalesce.exp binutils-2.16.91.0.1/ld/testsuite/ld-xtensa/coalesce.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-xtensa/coalesce.exp 2003-05-05 14:46:50.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-xtensa/coalesce.exp 2005-06-22 13:53:35.993137579 -0700 @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. if ![istarget "xtensa-*-*"] { return diff -uprN binutils-2.16.90.0.3/ld/testsuite/ld-xtensa/lcall.exp binutils-2.16.91.0.1/ld/testsuite/ld-xtensa/lcall.exp --- binutils-2.16.90.0.3/ld/testsuite/ld-xtensa/lcall.exp 2003-05-05 14:46:50.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/ld-xtensa/lcall.exp 2005-06-22 13:53:35.993137579 -0700 @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. if ![istarget "xtensa-*-*"] { return diff -uprN binutils-2.16.90.0.3/ld/testsuite/lib/ld-lib.exp binutils-2.16.91.0.1/ld/testsuite/lib/ld-lib.exp --- binutils-2.16.90.0.3/ld/testsuite/lib/ld-lib.exp 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/ld/testsuite/lib/ld-lib.exp 2005-06-22 13:53:35.998136753 -0700 @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. # # # default_ld_version diff -uprN binutils-2.16.90.0.3/libiberty/alloca.c binutils-2.16.91.0.1/libiberty/alloca.c --- binutils-2.16.90.0.3/libiberty/alloca.c 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/alloca.c 2005-06-22 13:53:36.029131631 -0700 @@ -57,9 +57,15 @@ the possibility of a GCC built-in functi /* These variables are used by the ASTRDUP implementation that relies on C_alloca. */ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ const char *libiberty_optr; char *libiberty_nptr; unsigned long libiberty_len; +#ifdef __cplusplus +} +#endif /* __cplusplus */ /* If your stack is a linked list of frames, you have to provide an "address metric" ADDRESS_FUNCTION macro. */ @@ -191,20 +197,20 @@ C_alloca (size_t size) /* Allocate combined header + user data storage. */ { - register PTR new = xmalloc (sizeof (header) + size); + register void *new_storage = XNEWVEC (char, sizeof (header) + size); /* Address of header. */ - if (new == 0) + if (new_storage == 0) abort(); - ((header *) new)->h.next = last_alloca_header; - ((header *) new)->h.deep = depth; + ((header *) new_storage)->h.next = last_alloca_header; + ((header *) new_storage)->h.deep = depth; - last_alloca_header = (header *) new; + last_alloca_header = (header *) new_storage; /* User storage begins just after header. */ - return (PTR) ((char *) new + sizeof (header)); + return (PTR) ((char *) new_storage + sizeof (header)); } } diff -uprN binutils-2.16.90.0.3/libiberty/argv.c binutils-2.16.91.0.1/libiberty/argv.c --- binutils-2.16.90.0.3/libiberty/argv.c 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/argv.c 2005-06-22 13:53:36.030131466 -0700 @@ -15,8 +15,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Create and destroy argument vectors. An argument vector is simply an diff -uprN binutils-2.16.90.0.3/libiberty/asprintf.c binutils-2.16.91.0.1/libiberty/asprintf.c --- binutils-2.16.90.0.3/libiberty/asprintf.c 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/asprintf.c 2005-06-22 13:53:36.030131466 -0700 @@ -16,8 +16,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" diff -uprN binutils-2.16.90.0.3/libiberty/ChangeLog binutils-2.16.91.0.1/libiberty/ChangeLog --- binutils-2.16.90.0.3/libiberty/ChangeLog 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/ChangeLog 2005-06-22 13:53:36.018133449 -0700 @@ -1,3 +1,157 @@ +2005-06-20 Geoffrey Keating + + * strverscmp.c: New. + * Makefile.in (CFILES): Add strverscmp.c. + (CONFIGURED_OFILES): Add strverscmp.o. + (strverscmp.o): New rule. + (stamp-functions): Add $(srcdir) to files in source directory. + * configure.ac (funcs): Add strverscmp. + (AC_CHECK_FUNCS): Add strverscmp. + * configure: Regenerate. + * functions.texi: Regenerate. + +2005-05-28 Eli Zaretskii + + * configure.ac: Add snprintf and vsnprintf to AC_CHEK_DECLS. + * config.in, configure: Regenerate. + +2005-05-25 Richard Henderson + + * cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_HIDDEN_ALIAS. + (d_make_comp, d_print_comp): Likewise. + (d_special_name): Generate one. + * testsuite/demangle-expected: Add a hidden alias test. + +2005-05-24 Gabriel Dos Reis + + * configure.ac: Check declarations for calloc(), getenv(), + malloc(), realloc() and sbrk(). + * config.in: Regenerate. + * configure: Likewise. + + * alloca.c (C_alloca): Change "new" to "new_storage". Use XNEWVEC + instead of xmalloc. + * choose-temp.c (choose_temp_base): Use XNEWVEC instea od xmalloc. + * concat.c (liiberty_concat_ptr): Surround definition with an + extern "C" block, if __cplusplus. + (concat): Use XNEWVEC instead of xmalloc. + (reconcat): Likewise. + * cp-demangle.c (struct d_print_template): Rename member + "template" to "template_decl". Adjust use throughout the file. + (d_print_resize): Properly cast return value of realloc(). + (cplus_demangle_print): Same for malloc(). + (d_demangle): Likewise. + * cp-demint.c (cplus_demangle_fill_builtin_type): Rename parameter + "typename" to "type_name". + * cplus-dem.c (grow_vect): Use XRESIZEVEC instead of xrealloc(). + (work_stuff_copy_to_from): Use XNEWVEC insteand of xmalloc(). + (demangle_template_value_parm): Likewise. + (demangle_template): Likewise. + (recursively_demangle): Likewise. + (do_hpacc_template_literal): Likewise. + (do_arg): Likewise. + (remember_type): Likewise. + (remember_Ktype): Likewise. + (register_Btype): Likewise. + (string_need): Use XRESIZEVEC instead of xrealloc(). + * dyn-string.c (dyn_string_init): Use XNEWVEC. + (dyn_string_new): Use XNEW. + (dyn_string_resize): Use XRESIZEVEC. + * fnmatch.c (fnmatch): Rename local variable "not" to "negate". + * getopt.c (getenv): Declare only if !__cplusplus and !getenv. + Otherwise include . + (exchange): Cast return value of malloc(). + * hashtab.c (htab_size): Define as both macro and non-inline + function. + (htab_elements): Likewise. + * getpwd.c (getpwd): Use XNEWVEC. + (htab_create_alloc_ex): Use C90 prototype-style. + * lrealpath.c (lrealpath): Appropriately cast return value of + malloc(). + * make-relative-prefix.c (save_string): Likewise. + * make-temp-file.c (try_dir): Rename from "try". Adjust use in + the file. + (choose_tmpdir): Use XNEWVEC. + * mkstemps.c (mkstemps): Rename parameter "template" to "pattern". + * pex-common.c (pex_init_common): Use XNEW. + (pex_add_remove): Use XRESIZEVEC. + (pex_run): Likewise. + (pex_get_status_and_time): Likewise. + * pex-djgpp.c (pex_djgpp_exec_child): Likewise. + * pex-msdos.c (pex_init): Use XNEW. + (pex_msdos_exec_child): Likewise. + (pex_msdos_exec_child): Use XRESIZEVEC. + * pex-unix.c (pex_wait): Use XNEW. + * pex-win32.c (fix_argv): Use XNEWVEC. + * pexecute.c (pwait): Likewise. + * setenv.c (setenv): Properly cast return value of malloc(). + * sigsetmask.c (sigsetmask): Rename local variables "old" and + "new" to "old_sig" and "new_sig". + * sort.c (main): Use XNEWVEC. + * spaces.c (spaces): Cast return value of malloc(). + * strndup.c (strndup): Likewise. + * ternary.c (ternary_insert): Use XNEW. + * xmalloc.c (malloc, realloc, calloc, sbrk): Surround declaration + with an extern "C" block if __cplusplus. + * xstrdup.c (xstrdup): Cast return value of memcpy(). + * xstrerror.c (strerror): Enclose declaration in an extern "C" + block if __cplusplus. + * xstrndup.c (xstrndup): Use XNEW. Cast return value of memcpy(). + +2005-05-16 Andreas Jaeger + + * getpwd.c: Remove unneeded prototype getcwd and move getwd so + that it's only declared if needed. + + * getopt1.c: Change order of includes so that __GNU_LIBRARY__ is + defined. + +2005-05-15 Andreas Jaeger + + * functions.texi: Regenerated. + +2005-05-15 Eli Zaretskii + + * pexecute.txh: Enclose multi-word data types in @deftypefn in + braces. Minor wording fixes. Use --- for em-dash. Use + @enumerate in enumerated lists. + + * fopen_unlocked.c: Enclose multi-word data types in @deftypefn in + braces. + +2005-05-11 Eli Zaretskii + + * pex-djgpp.c: Include string.h, fcntl.h, unistd.h, and + sys/stat.h. + (pex_init): Fix last argument to pex_init_common. + (pex_djgpp_exec_child): Remove leading underscore from _open, + _dup, _dup2, _close, and _spawnv/_spawnvp. Replace `program', + which is undeclared, with `executable', which was unused. Remove + unused variable `e'. Fix casting of last arg to spawnv/spawnvp. + (pex_djgpp_wait): Declare arguments with ATTRIBUTE_UNUSED. + +2005-05-11 Paul Brook + + * Makefile.in: Regenerate dependencies. + +2005-05-10 Nick Clifton + + * Update the address and phone number of the FSF organization in + the GPL notices in the following files: + COPYING.LIB, Makefile.in, _doprnt.c, argv.c, asprintf.c, + choose-temp.c, clock.c, concat.c, copying-lib.texi, cp-demangle.c, + cp-demangle.h, cp-demint.c, cplus-dem.c, dyn-string.c, fdmatch.c, + fibheap.c, floatformat.c, fnmatch.c, fopen_unlocked.c, + gather-docs, getopt.c, getopt1.c, getruntime.c, hashtab.c, hex.c, + lbasename.c, lrealpath.c, maint-tool, make-relative-prefix.c, + make-temp-file.c, md5.c, mempcpy.c, mkstemps.c, objalloc.c, + obstack.c, partition.c, pex-common.c, pex-common.h, pex-djgpp.c, + pex-msdos.c, pex-one.c, pex-unix.c, pex-win32.c, pexecute.c, + physmem.c, putenv.c, regex.c, safe-ctype.c, setenv.c, snprintf.c, + sort.c, spaces.c, splay-tree.c, stpcpy.c, stpncpy.c, strndup.c, + strtod.c, ternary.c, unlink-if-ordinary.c, vasprintf.c, + vsnprintf.c, vsprintf.c, xexit.c, xmalloc.c, xstrndup.c + 2005-05-06 Kelley Cook * aclocal.m4 (AC_DEFINE_NOAUTOHEADER): Remove. @@ -14,7 +168,7 @@ 2005-04-25 Kaveh R. Ghazi * fopen_unlocked.c (unlock_std_streams): New. - + * functions.texi: Regenerate. 2005-04-16 Kaveh R. Ghazi @@ -33,19 +187,19 @@ * lbasename.c: Likewise. * spaces.c: Likewise. * xatexit.c:Likewise. - * configure.ac: Do check declarations for basename, ffs, asprintf + * configure.ac: Do check declarations for basename, ffs, asprintf and vasprintf for real. * configure: Regenerate. 2005-04-13 Gabriel Dos Reis - * argv.c (dupargv): Allocate space of argv[argc], not + * argv.c (dupargv): Allocate space of argv[argc], not sizeof(char *) of that amount. Cast result to char *. 2005-04-12 Gabriel Dos Reis * regex.c (wcs_re_match_2_internal, byte_re_match_2_internal): - Replace not with negate. + Replace not with negate. 2005-04-12 Gabriel Dos Reis @@ -119,7 +273,7 @@ * configure: Rebuild. 2005-03-28 Mark Kettenis - + * unlink-if-ordinary.c: Include . 2005-03-27 Gabriel Dos Reis @@ -127,19 +281,19 @@ Convert libiberty to use ISO C prototype style 7/n. * regex.c (PARAMS): Remove definition. (PREFIX): Unconditionaly define using ISO C ## operator. - (init_syntax_once, extract_number, extract_number_and_incr, + (init_syntax_once, extract_number, extract_number_and_incr, print_fastmap, print_partial_compiled_pattern, - print_compiled_pattern, print_double_string, printchar, + print_compiled_pattern, print_double_string, printchar, convert_mbs_to_wcs, re_set_syntax, regex_grow_registers, regex_compile, store_op1, store_op2, insert_op1, insert_op2, - at_begline_loc_p, at_endline_p, group_in_compile_stack, - insert_space, wcs_compile_range, byte_compile_range, - truncate_wchar, re_compile_fastmap, re_compile_fastmap, - re_set_registers, re_search, re_search_2, re_search_3, re_match, + at_begline_loc_p, at_endline_p, group_in_compile_stack, + insert_space, wcs_compile_range, byte_compile_range, + truncate_wchar, re_compile_fastmap, re_compile_fastmap, + re_set_registers, re_search, re_search_2, re_search_3, re_match, re_match_2, count_mbs_length, wcs_re_match_2_internal, byte_re_match_2_internal, group_match_null_string_p, alt_match_null_string_p, common_op_match_null_string_p, - bcmp_translate, re_compile_pattern, re_comp, re_exec, regcomp, + bcmp_translate, re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror, regfree): Use ISO C prototype style. * partition.c: (elem_compare): Likewise. * cp-demangle.c (print_usage): Likewise. @@ -148,21 +302,21 @@ Convert libiberty to use ISO C prototype style 5/n. * random.c (srandom, initstate, setstate, random): Use ISO C - prototypes. + prototypes. * putenv.c (putenv): Likewise. * physmem.c (physmem_available, physmem_total, main): Likewise. * pex-win32.c (fix_argv, pexecute, pwait): Likewise. * pex-unix.c (pexecute, pwait): Likewise. * pex-msdos.c (pexecute, pwait): Likewise. * pex-djgpp.c (pexecute, pwait): Likewise. - * partition.c (partition_new, partition_delete, partition_union) + * partition.c (partition_new, partition_delete, partition_union) (elem_compare, partition_print): Likewise. - * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk, - _obstack_allocated_p, _obstack_free, obstack_free, + * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk, + _obstack_allocated_p, _obstack_free, obstack_free, _obstack_memory_used, print_and_abort, obstack_next_free, obstack_object_size, obstack_base): Likewise. Remove codes predicated on !defined(__STDC__). - * objalloc.c (objalloc_create, _objalloc_alloc, objalloc_free, + * objalloc.c (objalloc_create, _objalloc_alloc, objalloc_free, objalloc_free_block): Use ISO C prototypes. * mkstemps.c (mkstemps): Likewise. * memset.c (memset): Likewise. @@ -172,16 +326,16 @@ * setenv.c (setenv, unsetenv): Likewise. * sigsetmask.c (sigsetmask): Likewise. * snprintf.c (snprintf): Likewise. - * sort.c (sort_pointers, xmalloc): Likewise. + * sort.c (sort_pointers, xmalloc): Likewise. * spaces.c (spaces): Likewise. - * splay-tree.c (splay_tree_delete_helper, - splay_tree_splay_helper, splay_tree_splay, + * splay-tree.c (splay_tree_delete_helper, + splay_tree_splay_helper, splay_tree_splay, splay_tree_foreach_helper, splay_tree_xmalloc_allocate, - splay_tree_new, splay_tree_xmalloc_allocate, + splay_tree_new, splay_tree_xmalloc_allocate, splay_tree_new_with_allocator, splay_tree_delete, - splay_tree_insert, splay_tree_remove, splay_tree_lookup, - splay_tree_max, splay_tree_min, splay_tree_predecessor, - splay_tree_successor, splay_tree_foreach, + splay_tree_insert, splay_tree_remove, splay_tree_lookup, + splay_tree_max, splay_tree_min, splay_tree_predecessor, + splay_tree_successor, splay_tree_foreach, splay_tree_compare_ints, splay_tree_compare_pointers): Likewise. * stpcpy.c (stpcpy): Likewise. * stpncpy.c (stpncpy): Likewise. @@ -192,19 +346,19 @@ 2005-03-27 Gabriel Dos Reis Convert libiberty to use ISO C prototype style 6/n. - * strerror.c (init_error_tables, errno_max, strerror, strerrno, + * strerror.c (init_error_tables, errno_max, strerror, strerrno, strtoerrno, main): Use ISO C prototype style. * strncasecmp.c (strncasecmp): Likewise. * strncmp.c (strncmp): Likewise. * strndup.c (strndup): Likewise. * strrchr.c (strrchr): Likewise. - * strsignal.c (init_signal_tables, signo_max, strsignal, + * strsignal.c (init_signal_tables, signo_max, strsignal, strsigno, strtosigno, psignal, main): Likewise. * strstr.c (strstr): Likewise. * strtod.c (strtod, atof): Likewise. * strtol.c (strtol): Likewise. * strtoul.c (strtoul): Likewise. - * ternary.c (ternary_insert, ternary_cleanup, ternary_search, + * ternary.c (ternary_insert, ternary_cleanup, ternary_search, ternary_recursivesearch): Likewise. * tmpnam.c (tmpnam): Likewise. * unlink-if-ordinary.c (unlink_if_ordinary): Likewise. @@ -217,7 +371,7 @@ * waitpid.c (waitpid): Likewise. * xatexit.c (xatexit, xatexit_cleanup): Likewise. * xexit.c (xexit): Likewise. - * xmalloc.c (xmalloc_set_program_name, xmalloc_failed, xmalloc, + * xmalloc.c (xmalloc_set_program_name, xmalloc_failed, xmalloc, xcalloc, xrealloc): Likewise. * xmemdup.c (xmemdup): Likewise. * xstrdup.c (xstrdup): Likewise. diff -uprN binutils-2.16.90.0.3/libiberty/choose-temp.c binutils-2.16.91.0.1/libiberty/choose-temp.c --- binutils-2.16.90.0.3/libiberty/choose-temp.c 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/choose-temp.c 2005-06-22 13:53:36.043129319 -0700 @@ -14,8 +14,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If not, -write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -61,7 +61,7 @@ choose_temp_base (void) int len; len = strlen (base); - temp_filename = xmalloc (len + TEMP_FILE_LEN + 1); + temp_filename = XNEWVEC (char, len + TEMP_FILE_LEN + 1); strcpy (temp_filename, base); strcpy (temp_filename + len, TEMP_FILE); diff -uprN binutils-2.16.90.0.3/libiberty/clock.c binutils-2.16.91.0.1/libiberty/clock.c --- binutils-2.16.90.0.3/libiberty/clock.c 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/clock.c 2005-06-22 13:53:36.044129154 -0700 @@ -14,7 +14,7 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, if you link this library with files compiled with a GNU compiler to produce an executable, this does not cause diff -uprN binutils-2.16.90.0.3/libiberty/concat.c binutils-2.16.91.0.1/libiberty/concat.c --- binutils-2.16.90.0.3/libiberty/concat.c 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/concat.c 2005-06-22 13:53:36.044129154 -0700 @@ -15,8 +15,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ /* @@ -127,7 +127,13 @@ concat_copy (char *dst, const char *firs return save_dst; } +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ char *libiberty_concat_ptr; +#ifdef __cplusplus +} +#endif /* __cplusplus */ /* @undocumented concat_copy2 */ @@ -150,7 +156,7 @@ concat (const char *first, ...) /* First compute the size of the result and get sufficient memory. */ VA_OPEN (args, first); VA_FIXEDARG (args, const char *, first); - newstr = (char *) xmalloc (vconcat_length (first, args) + 1); + newstr = XNEWVEC (char, vconcat_length (first, args) + 1); VA_CLOSE (args); /* Now copy the individual pieces to the result string. */ @@ -188,7 +194,7 @@ reconcat (char *optr, const char *first, VA_OPEN (args, first); VA_FIXEDARG (args, char *, optr); VA_FIXEDARG (args, const char *, first); - newstr = (char *) xmalloc (vconcat_length (first, args) + 1); + newstr = XNEWVEC (char, vconcat_length (first, args) + 1); VA_CLOSE (args); /* Now copy the individual pieces to the result string. */ diff -uprN binutils-2.16.90.0.3/libiberty/config.in binutils-2.16.91.0.1/libiberty/config.in --- binutils-2.16.90.0.3/libiberty/config.in 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/config.in 2005-06-22 13:53:36.048128493 -0700 @@ -45,13 +45,41 @@ don't. */ #undef HAVE_DECL_BASENAME +/* Define to 1 if you have the declaration of `calloc', and to 0 if you don't. + */ +#undef HAVE_DECL_CALLOC + /* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */ #undef HAVE_DECL_FFS +/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't. + */ +#undef HAVE_DECL_GETENV + +/* Define to 1 if you have the declaration of `malloc', and to 0 if you don't. + */ +#undef HAVE_DECL_MALLOC + +/* Define to 1 if you have the declaration of `realloc', and to 0 if you + don't. */ +#undef HAVE_DECL_REALLOC + +/* Define to 1 if you have the declaration of `sbrk', and to 0 if you don't. + */ +#undef HAVE_DECL_SBRK + +/* Define to 1 if you have the declaration of `snprintf', and to 0 if you + don't. */ +#undef HAVE_DECL_SNPRINTF + /* Define to 1 if you have the declaration of `vasprintf', and to 0 if you don't. */ #undef HAVE_DECL_VASPRINTF +/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you + don't. */ +#undef HAVE_DECL_VSNPRINTF + /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H diff -uprN binutils-2.16.90.0.3/libiberty/configure binutils-2.16.91.0.1/libiberty/configure --- binutils-2.16.90.0.3/libiberty/configure 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/configure 2005-06-22 13:53:36.058126841 -0700 @@ -5038,6 +5038,7 @@ funcs="$funcs strstr" funcs="$funcs strtod" funcs="$funcs strtol" funcs="$funcs strtoul" +funcs="$funcs strverscmp" funcs="$funcs tmpnam" funcs="$funcs vasprintf" funcs="$funcs vfprintf" @@ -5125,11 +5126,12 @@ if test "x" = "y"; then + for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock \ getcwd getpagesize gettimeofday index insque mkstemps memchr memcmp memcpy \ memmove mempcpy memset putenv random rename rindex sigsetmask \ strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strndup strrchr strstr \ - strtod strtol strtoul tmpnam vasprintf vfprintf vprintf \ + strtod strtol strtoul strverscmp tmpnam vasprintf vfprintf vprintf \ vsprintf waitpid getrusage on_exit psignal strerror strsignal \ sysconf times sbrk gettimeofday ffs snprintf vsnprintf \ pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl wait3 wait4 \ @@ -5513,6 +5515,146 @@ _ACEOF fi +echo "$as_me:$LINENO: checking whether snprintf is declared" >&5 +echo $ECHO_N "checking whether snprintf is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_snprintf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef snprintf + char *p = (char *) snprintf; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_snprintf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_snprintf=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_snprintf" >&5 +echo "${ECHO_T}$ac_cv_have_decl_snprintf" >&6 +if test $ac_cv_have_decl_snprintf = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SNPRINTF 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SNPRINTF 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether vsnprintf is declared" >&5 +echo $ECHO_N "checking whether vsnprintf is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_vsnprintf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef vsnprintf + char *p = (char *) vsnprintf; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_vsnprintf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_vsnprintf=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_vsnprintf" >&5 +echo "${ECHO_T}$ac_cv_have_decl_vsnprintf" >&6 +if test $ac_cv_have_decl_vsnprintf = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VSNPRINTF 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VSNPRINTF 0 +_ACEOF + + +fi @@ -7428,6 +7570,570 @@ _ACEOF fi +echo "$as_me:$LINENO: checking whether snprintf is declared" >&5 +echo $ECHO_N "checking whether snprintf is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_snprintf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef snprintf + char *p = (char *) snprintf; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_snprintf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_snprintf=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_snprintf" >&5 +echo "${ECHO_T}$ac_cv_have_decl_snprintf" >&6 +if test $ac_cv_have_decl_snprintf = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SNPRINTF 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SNPRINTF 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether vsnprintf is declared" >&5 +echo $ECHO_N "checking whether vsnprintf is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_vsnprintf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef vsnprintf + char *p = (char *) vsnprintf; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_vsnprintf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_vsnprintf=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_vsnprintf" >&5 +echo "${ECHO_T}$ac_cv_have_decl_vsnprintf" >&6 +if test $ac_cv_have_decl_vsnprintf = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VSNPRINTF 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VSNPRINTF 0 +_ACEOF + + +fi + + + echo "$as_me:$LINENO: checking whether calloc is declared" >&5 +echo $ECHO_N "checking whether calloc is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_calloc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef calloc + char *p = (char *) calloc; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_calloc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_calloc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_calloc" >&5 +echo "${ECHO_T}$ac_cv_have_decl_calloc" >&6 +if test $ac_cv_have_decl_calloc = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CALLOC 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CALLOC 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether getenv is declared" >&5 +echo $ECHO_N "checking whether getenv is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_getenv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef getenv + char *p = (char *) getenv; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_getenv=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_getenv=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6 +if test $ac_cv_have_decl_getenv = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETENV 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETENV 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether malloc is declared" >&5 +echo $ECHO_N "checking whether malloc is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_malloc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef malloc + char *p = (char *) malloc; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_malloc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_malloc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_malloc" >&5 +echo "${ECHO_T}$ac_cv_have_decl_malloc" >&6 +if test $ac_cv_have_decl_malloc = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_MALLOC 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_MALLOC 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether realloc is declared" >&5 +echo $ECHO_N "checking whether realloc is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_realloc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef realloc + char *p = (char *) realloc; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_realloc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_realloc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_realloc" >&5 +echo "${ECHO_T}$ac_cv_have_decl_realloc" >&6 +if test $ac_cv_have_decl_realloc = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_REALLOC 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_REALLOC 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether sbrk is declared" >&5 +echo $ECHO_N "checking whether sbrk is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_sbrk+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef sbrk + char *p = (char *) sbrk; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_sbrk=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_sbrk=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_sbrk" >&5 +echo "${ECHO_T}$ac_cv_have_decl_sbrk" >&6 +if test $ac_cv_have_decl_sbrk = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SBRK 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SBRK 0 +_ACEOF + + +fi + + + echo "$as_me:$LINENO: checking whether strverscmp is declared" >&5 +echo $ECHO_N "checking whether strverscmp is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_strverscmp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef strverscmp + char *p = (char *) strverscmp; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_strverscmp=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_strverscmp=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_strverscmp" >&5 +echo "${ECHO_T}$ac_cv_have_decl_strverscmp" >&6 +if test $ac_cv_have_decl_strverscmp = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRVERSCMP 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRVERSCMP 0 +_ACEOF + + +fi echo "$as_me:$LINENO: checking whether canonicalize_file_name must be declared" >&5 @@ -7523,7 +8229,7 @@ if test x$gcc_no_link = xyes; then ac_cv_func_mmap_fixed_mapped=no fi fi -if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then +if test "x${ac_cv_func_mmap_fixed_mapped}" != xno; then for ac_header in stdlib.h unistd.h diff -uprN binutils-2.16.90.0.3/libiberty/configure.ac binutils-2.16.91.0.1/libiberty/configure.ac --- binutils-2.16.90.0.3/libiberty/configure.ac 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/configure.ac 2005-06-22 13:53:36.059126676 -0700 @@ -265,6 +265,7 @@ funcs="$funcs strstr" funcs="$funcs strtod" funcs="$funcs strtol" funcs="$funcs strtoul" +funcs="$funcs strverscmp" funcs="$funcs tmpnam" funcs="$funcs vasprintf" funcs="$funcs vfprintf" @@ -288,12 +289,12 @@ if test "x" = "y"; then getcwd getpagesize gettimeofday index insque mkstemps memchr memcmp memcpy \ memmove mempcpy memset putenv random rename rindex sigsetmask \ strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strndup strrchr strstr \ - strtod strtol strtoul tmpnam vasprintf vfprintf vprintf \ + strtod strtol strtoul strverscmp tmpnam vasprintf vfprintf vprintf \ vsprintf waitpid getrusage on_exit psignal strerror strsignal \ sysconf times sbrk gettimeofday ffs snprintf vsnprintf \ pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl wait3 wait4 \ realpath canonicalize_file_name __fsetlocking) - AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf]) + AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf, snprintf, vsnprintf]) AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if you have the sys_errlist variable.]) AC_DEFINE(HAVE_SYS_NERR, 1, [Define if you have the sys_nerr variable.]) AC_DEFINE(HAVE_SYS_SIGLIST, 1, [Define if you have the sys_siglist variable.]) @@ -529,7 +530,9 @@ if test -z "${setobjs}"; then [AC_MSG_RESULT([no])]) AC_CHECK_FUNCS($checkfuncs) - AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf]) + AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf, snprintf, vsnprintf]) + AC_CHECK_DECLS([calloc, getenv, malloc, realloc, sbrk]) + AC_CHECK_DECLS([strverscmp]) libiberty_NEED_DECLARATION(canonicalize_file_name) fi diff -uprN binutils-2.16.90.0.3/libiberty/COPYING.LIB binutils-2.16.91.0.1/libiberty/COPYING.LIB --- binutils-2.16.90.0.3/libiberty/COPYING.LIB 2001-02-03 14:52:37.000000000 -0800 +++ binutils-2.16.91.0.1/libiberty/COPYING.LIB 2005-06-22 13:53:36.006135431 -0700 @@ -2,7 +2,7 @@ Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -485,7 +485,7 @@ convey the exclusion of warranty; and ea You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. diff -uprN binutils-2.16.90.0.3/libiberty/copying-lib.texi binutils-2.16.91.0.1/libiberty/copying-lib.texi --- binutils-2.16.90.0.3/libiberty/copying-lib.texi 2001-10-01 15:25:26.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/copying-lib.texi 2005-06-22 13:53:36.064125850 -0700 @@ -6,7 +6,7 @@ @display Copyright @copyright{} 1991, 1999 Free Software Foundation, Inc. -59 Temple Place -- Suite 330, Boston, MA 02111-1307, USA +51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -544,7 +544,7 @@ Lesser General Public License for more d You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @end smallexample diff -uprN binutils-2.16.90.0.3/libiberty/cp-demangle.c binutils-2.16.91.0.1/libiberty/cp-demangle.c --- binutils-2.16.90.0.3/libiberty/cp-demangle.c 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/cp-demangle.c 2005-06-22 13:53:36.066125519 -0700 @@ -25,7 +25,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* This code implements a demangler for the g++ V3 ABI. The ABI is @@ -210,7 +210,7 @@ struct d_print_template /* Next template on the list. */ struct d_print_template *next; /* This template. */ - const struct demangle_component *template; + const struct demangle_component *template_decl; }; /* A list of type modifiers. This is used while printing. */ @@ -520,6 +520,9 @@ d_dump (struct demangle_component *dc, i case DEMANGLE_COMPONENT_REFTEMP: printf ("reference temporary\n"); break; + case DEMANGLE_COMPONENT_HIDDEN_ALIAS: + printf ("hidden alias\n"); + break; case DEMANGLE_COMPONENT_RESTRICT: printf ("restrict\n"); break; @@ -733,6 +736,7 @@ d_make_comp (struct d_info *di, enum dem case DEMANGLE_COMPONENT_JAVA_CLASS: case DEMANGLE_COMPONENT_GUARD: case DEMANGLE_COMPONENT_REFTEMP: + case DEMANGLE_COMPONENT_HIDDEN_ALIAS: case DEMANGLE_COMPONENT_POINTER: case DEMANGLE_COMPONENT_REFERENCE: case DEMANGLE_COMPONENT_COMPLEX: @@ -1439,6 +1443,7 @@ d_operator_name (struct d_info *di) ::= TF ::= TJ ::= GR + ::= GA */ static struct demangle_component * @@ -1529,6 +1534,10 @@ d_special_name (struct d_info *di) return d_make_comp (di, DEMANGLE_COMPONENT_REFTEMP, d_name (di), NULL); + case 'A': + return d_make_comp (di, DEMANGLE_COMPONENT_HIDDEN_ALIAS, + d_encoding (di, 0), NULL); + default: return NULL; } @@ -2551,7 +2560,7 @@ d_print_resize (struct d_print_info *dpi char *newbuf; newalc = dpi->alc * 2; - newbuf = realloc (dpi->buf, newalc); + newbuf = (char *) realloc (dpi->buf, newalc); if (newbuf == NULL) { free (dpi->buf); @@ -2629,7 +2638,7 @@ cplus_demangle_print (int options, const dpi.options = options; dpi.alc = estimate + 1; - dpi.buf = malloc (dpi.alc); + dpi.buf = (char *) malloc (dpi.alc); if (dpi.buf == NULL) { *palc = 1; @@ -2730,7 +2739,7 @@ d_print_comp (struct d_print_info *dpi, { dpt.next = dpi->templates; dpi->templates = &dpt; - dpt.template = typed_name; + dpt.template_decl = typed_name; } /* If typed_name is a DEMANGLE_COMPONENT_LOCAL_NAME, then @@ -2826,7 +2835,7 @@ d_print_comp (struct d_print_info *dpi, return; } i = dc->u.s_number.number; - for (a = d_right (dpi->templates->template); + for (a = d_right (dpi->templates->template_decl); a != NULL; a = d_right (a)) { @@ -2931,6 +2940,11 @@ d_print_comp (struct d_print_info *dpi, d_print_comp (dpi, d_left (dc)); return; + case DEMANGLE_COMPONENT_HIDDEN_ALIAS: + d_append_string_constant (dpi, "hidden alias for "); + d_print_comp (dpi, d_left (dc)); + return; + case DEMANGLE_COMPONENT_SUB_STD: d_append_buffer (dpi, dc->u.s_string.string, dc->u.s_string.len); return; @@ -3683,7 +3697,7 @@ d_print_cast (struct d_print_info *dpi, dpt.next = dpi->templates; dpi->templates = &dpt; - dpt.template = d_left (dc); + dpt.template_decl = d_left (dc); d_print_comp (dpi, d_left (d_left (dc))); @@ -3764,7 +3778,7 @@ d_demangle (const char* mangled, int opt { char *r; - r = malloc (40 + len - 11); + r = (char *) malloc (40 + len - 11); if (r == NULL) *palc = 1; else diff -uprN binutils-2.16.90.0.3/libiberty/cp-demangle.h binutils-2.16.91.0.1/libiberty/cp-demangle.h --- binutils-2.16.90.0.3/libiberty/cp-demangle.h 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/cp-demangle.h 2005-06-22 13:53:36.084122546 -0700 @@ -25,7 +25,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file provides some definitions shared by cp-demangle.c and diff -uprN binutils-2.16.90.0.3/libiberty/cp-demint.c binutils-2.16.91.0.1/libiberty/cp-demint.c --- binutils-2.16.90.0.3/libiberty/cp-demint.c 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/cp-demint.c 2005-06-22 13:53:36.085122380 -0700 @@ -25,7 +25,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file implements a few interface functions which are provided @@ -130,18 +130,18 @@ cplus_demangle_fill_component (struct de int cplus_demangle_fill_builtin_type (struct demangle_component *p, - const char *typename) + const char *type_name) { int len; unsigned int i; - if (p == NULL || typename == NULL) + if (p == NULL || type_name == NULL) return 0; - len = strlen (typename); + len = strlen (type_name); for (i = 0; i < D_BUILTIN_TYPE_COUNT; ++i) { if (len == cplus_demangle_builtin_types[i].len - && strcmp (typename, cplus_demangle_builtin_types[i].name) == 0) + && strcmp (type_name, cplus_demangle_builtin_types[i].name) == 0) { p->type = DEMANGLE_COMPONENT_BUILTIN_TYPE; p->u.s_builtin.type = &cplus_demangle_builtin_types[i]; diff -uprN binutils-2.16.90.0.3/libiberty/cplus-dem.c binutils-2.16.91.0.1/libiberty/cplus-dem.c --- binutils-2.16.90.0.3/libiberty/cplus-dem.c 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/cplus-dem.c 2005-06-22 13:53:36.088121885 -0700 @@ -27,8 +27,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ /* This file exports two functions; cplus_mangle_opname and cplus_demangle. @@ -925,7 +925,7 @@ grow_vect (char **old_vect, size_t *size *size *= 2; if (*size < min_size) *size = min_size; - *old_vect = (void *) xrealloc (*old_vect, *size * element_size); + *old_vect = XRESIZEVAR (char, *old_vect, *size * element_size); } } @@ -1320,56 +1320,52 @@ work_stuff_copy_to_from (struct work_stu /* Deep-copy dynamic storage. */ if (from->typevec_size) - to->typevec - = (char **) xmalloc (from->typevec_size * sizeof (to->typevec[0])); + to->typevec = XNEWVEC (char *, from->typevec_size); for (i = 0; i < from->ntypes; i++) { int len = strlen (from->typevec[i]) + 1; - to->typevec[i] = xmalloc (len); + to->typevec[i] = XNEWVEC (char, len); memcpy (to->typevec[i], from->typevec[i], len); } if (from->ksize) - to->ktypevec - = (char **) xmalloc (from->ksize * sizeof (to->ktypevec[0])); + to->ktypevec = XNEWVEC (char *, from->ksize); for (i = 0; i < from->numk; i++) { int len = strlen (from->ktypevec[i]) + 1; - to->ktypevec[i] = xmalloc (len); + to->ktypevec[i] = XNEWVEC (char, len); memcpy (to->ktypevec[i], from->ktypevec[i], len); } if (from->bsize) - to->btypevec - = (char **) xmalloc (from->bsize * sizeof (to->btypevec[0])); + to->btypevec = XNEWVEC (char *, from->bsize); for (i = 0; i < from->numb; i++) { int len = strlen (from->btypevec[i]) + 1; - to->btypevec[i] = xmalloc (len); + to->btypevec[i] = XNEWVEC (char , len); memcpy (to->btypevec[i], from->btypevec[i], len); } if (from->ntmpl_args) - to->tmpl_argvec - = (char **) xmalloc (from->ntmpl_args * sizeof (to->tmpl_argvec[0])); + to->tmpl_argvec = XNEWVEC (char *, from->ntmpl_args); for (i = 0; i < from->ntmpl_args; i++) { int len = strlen (from->tmpl_argvec[i]) + 1; - to->tmpl_argvec[i] = xmalloc (len); + to->tmpl_argvec[i] = XNEWVEC (char, len); memcpy (to->tmpl_argvec[i], from->tmpl_argvec[i], len); } if (from->previous_argument) { - to->previous_argument = (string*) xmalloc (sizeof (string)); + to->previous_argument = XNEW (string); string_init (to->previous_argument); string_appends (to->previous_argument, from->previous_argument); } @@ -2113,7 +2109,7 @@ demangle_template_value_parm (struct wor string_appendn (s, "0", 1); else { - char *p = xmalloc (symbol_len + 1), *q; + char *p = XNEWVEC (char, symbol_len + 1), *q; strncpy (p, *mangled, symbol_len); p [symbol_len] = '\0'; /* We use cplus_demangle here, rather than @@ -2219,7 +2215,7 @@ demangle_template (struct work_stuff *wo if (!is_type) { /* Create an array for saving the template argument values. */ - work->tmpl_argvec = (char**) xmalloc (r * sizeof (char *)); + work->tmpl_argvec = XNEWVEC (char *, r); work->ntmpl_args = r; for (i = 0; i < r; i++) work->tmpl_argvec[i] = 0; @@ -2244,7 +2240,7 @@ demangle_template (struct work_stuff *wo { /* Save the template argument. */ int len = temp.p - temp.b; - work->tmpl_argvec[i] = xmalloc (len + 1); + work->tmpl_argvec[i] = XNEWVEC (char, len + 1); memcpy (work->tmpl_argvec[i], temp.b, len); work->tmpl_argvec[i][len] = '\0'; } @@ -2272,7 +2268,7 @@ demangle_template (struct work_stuff *wo { /* Save the template argument. */ int len = r2; - work->tmpl_argvec[i] = xmalloc (len + 1); + work->tmpl_argvec[i] = XNEWVEC (char, len + 1); memcpy (work->tmpl_argvec[i], *mangled, len); work->tmpl_argvec[i][len] = '\0'; } @@ -2318,7 +2314,7 @@ demangle_template (struct work_stuff *wo if (!is_type) { int len = s->p - s->b; - work->tmpl_argvec[i] = xmalloc (len + 1); + work->tmpl_argvec[i] = XNEWVEC (char, len + 1); memcpy (work->tmpl_argvec[i], s->b, len); work->tmpl_argvec[i][len] = '\0'; @@ -3216,7 +3212,7 @@ recursively_demangle(struct work_stuff * char * recurse = (char *)NULL; char * recurse_dem = (char *)NULL; - recurse = (char *) xmalloc (namelength + 1); + recurse = XNEWVEC (char, namelength + 1); memcpy (recurse, *mangled, namelength); recurse[namelength] = '\000'; @@ -4187,7 +4183,7 @@ do_hpacc_template_literal (struct work_s string_append (result, "&"); /* Now recursively demangle the literal name */ - recurse = (char *) xmalloc (literal_len + 1); + recurse = XNEWVEC (char, literal_len + 1); memcpy (recurse, *mangled, literal_len); recurse[literal_len] = '\000'; @@ -4289,7 +4285,7 @@ do_arg (struct work_stuff *work, const c if (work->previous_argument) string_delete (work->previous_argument); else - work->previous_argument = (string*) xmalloc (sizeof (string)); + work->previous_argument = XNEW (string); if (!do_type (work, mangled, work->previous_argument)) return 0; @@ -4313,18 +4309,16 @@ remember_type (struct work_stuff *work, if (work -> typevec_size == 0) { work -> typevec_size = 3; - work -> typevec - = (char **) xmalloc (sizeof (char *) * work -> typevec_size); + work -> typevec = XNEWVEC (char *, work->typevec_size); } else { work -> typevec_size *= 2; work -> typevec - = (char **) xrealloc ((char *)work -> typevec, - sizeof (char *) * work -> typevec_size); + = XRESIZEVEC (char *, work->typevec, work->typevec_size); } } - tem = xmalloc (len + 1); + tem = XNEWVEC (char, len + 1); memcpy (tem, start, len); tem[len] = '\0'; work -> typevec[work -> ntypes++] = tem; @@ -4342,18 +4336,16 @@ remember_Ktype (struct work_stuff *work, if (work -> ksize == 0) { work -> ksize = 5; - work -> ktypevec - = (char **) xmalloc (sizeof (char *) * work -> ksize); + work -> ktypevec = XNEWVEC (char *, work->ksize); } else { work -> ksize *= 2; work -> ktypevec - = (char **) xrealloc ((char *)work -> ktypevec, - sizeof (char *) * work -> ksize); + = XRESIZEVEC (char *, work->ktypevec, work->ksize); } } - tem = xmalloc (len + 1); + tem = XNEWVEC (char, len + 1); memcpy (tem, start, len); tem[len] = '\0'; work -> ktypevec[work -> numk++] = tem; @@ -4373,15 +4365,13 @@ register_Btype (struct work_stuff *work) if (work -> bsize == 0) { work -> bsize = 5; - work -> btypevec - = (char **) xmalloc (sizeof (char *) * work -> bsize); + work -> btypevec = XNEWVEC (char *, work->bsize); } else { work -> bsize *= 2; work -> btypevec - = (char **) xrealloc ((char *)work -> btypevec, - sizeof (char *) * work -> bsize); + = XRESIZEVEC (char *, work->btypevec, work->bsize); } } ret = work -> numb++; @@ -4397,7 +4387,7 @@ remember_Btype (struct work_stuff *work, { char *tem; - tem = xmalloc (len + 1); + tem = XNEWVEC (char, len + 1); memcpy (tem, start, len); tem[len] = '\0'; work -> btypevec[index] = tem; @@ -4818,7 +4808,7 @@ string_need (string *s, int n) { n = 32; } - s->p = s->b = xmalloc (n); + s->p = s->b = XNEWVEC (char, n); s->e = s->b + n; } else if (s->e - s->p < n) @@ -4826,7 +4816,7 @@ string_need (string *s, int n) tem = s->p - s->b; n += tem; n *= 2; - s->b = xrealloc (s->b, n); + s->b = XRESIZEVEC (char, s->b, n); s->p = s->b + tem; s->e = s->b + n; } diff -uprN binutils-2.16.90.0.3/libiberty/_doprnt.c binutils-2.16.91.0.1/libiberty/_doprnt.c --- binutils-2.16.90.0.3/libiberty/_doprnt.c 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/_doprnt.c 2005-06-22 13:53:36.028131797 -0700 @@ -14,7 +14,7 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include "ansidecl.h" diff -uprN binutils-2.16.90.0.3/libiberty/dyn-string.c binutils-2.16.91.0.1/libiberty/dyn-string.c --- binutils-2.16.90.0.3/libiberty/dyn-string.c 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/dyn-string.c 2005-06-22 13:53:36.089121720 -0700 @@ -25,8 +25,8 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +the Free Software Foundation, 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -67,7 +67,7 @@ dyn_string_init (struct dyn_string *ds_s if (ds_struct_ptr->s == NULL) return 0; #else - ds_struct_ptr->s = (char *) xmalloc (space); + ds_struct_ptr->s = XNEWVEC (char, space); #endif ds_struct_ptr->allocated = space; ds_struct_ptr->length = 0; @@ -96,7 +96,7 @@ dyn_string_new (int space) return NULL; } #else - result = (dyn_string_t) xmalloc (sizeof (struct dyn_string)); + result = XNEW (struct dyn_string); dyn_string_init (result, space); #endif return result; @@ -159,7 +159,7 @@ dyn_string_resize (dyn_string_t ds, int return NULL; } #else - ds->s = (char *) xrealloc (ds->s, ds->allocated); + ds->s = XRESIZEVEC (char, ds->s, ds->allocated); #endif } diff -uprN binutils-2.16.90.0.3/libiberty/fdmatch.c binutils-2.16.91.0.1/libiberty/fdmatch.c --- binutils-2.16.90.0.3/libiberty/fdmatch.c 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/fdmatch.c 2005-06-22 13:53:36.103119407 -0700 @@ -14,8 +14,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ /* diff -uprN binutils-2.16.90.0.3/libiberty/fibheap.c binutils-2.16.91.0.1/libiberty/fibheap.c --- binutils-2.16.90.0.3/libiberty/fibheap.c 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/fibheap.c 2005-06-22 13:53:36.105119076 -0700 @@ -16,8 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +the Free Software Foundation, 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" diff -uprN binutils-2.16.90.0.3/libiberty/floatformat.c binutils-2.16.91.0.1/libiberty/floatformat.c --- binutils-2.16.90.0.3/libiberty/floatformat.c 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/floatformat.c 2005-06-22 13:53:36.106118911 -0700 @@ -15,7 +15,7 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* This is needed to pick up the NAN macro on some systems. */ #define _GNU_SOURCE diff -uprN binutils-2.16.90.0.3/libiberty/fnmatch.c binutils-2.16.91.0.1/libiberty/fnmatch.c --- binutils-2.16.90.0.3/libiberty/fnmatch.c 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/fnmatch.c 2005-06-22 13:53:36.106118911 -0700 @@ -15,8 +15,8 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +Foundation, 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #if defined (CONFIG_BROKETS) @@ -124,7 +124,7 @@ fnmatch (const char *pattern, const char case '[': { /* Nonzero if the sense of the character class is inverted. */ - register int not; + register int negate; if (*n == '\0') return FNM_NOMATCH; @@ -133,8 +133,8 @@ fnmatch (const char *pattern, const char (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) return FNM_NOMATCH; - not = (*p == '!' || *p == '^'); - if (not) + negate = (*p == '!' || *p == '^'); + if (negate) ++p; c = *p++; @@ -177,7 +177,7 @@ fnmatch (const char *pattern, const char if (c == ']') break; } - if (!not) + if (!negate) return FNM_NOMATCH; break; @@ -194,7 +194,7 @@ fnmatch (const char *pattern, const char /* XXX 1003.2d11 is unclear if this is right. */ ++p; } - if (not) + if (negate) return FNM_NOMATCH; } break; diff -uprN binutils-2.16.90.0.3/libiberty/fopen_unlocked.c binutils-2.16.91.0.1/libiberty/fopen_unlocked.c --- binutils-2.16.90.0.3/libiberty/fopen_unlocked.c 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/fopen_unlocked.c 2005-06-22 13:53:36.122116268 -0700 @@ -15,8 +15,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ /* @@ -36,7 +36,7 @@ multi-threaded locking. Otherwise do no @end deftypefn -@deftypefn Extension FILE * fopen_unlocked (const char *@var{path}, const char * @var{mode}) +@deftypefn Extension {FILE *} fopen_unlocked (const char *@var{path}, const char * @var{mode}) Opens and returns a @code{FILE} pointer via @code{fopen}. If the operating system supports it, ensure that the stream is setup to avoid @@ -45,7 +45,7 @@ unchanged. @end deftypefn -@deftypefn Extension FILE * fdopen_unlocked (int @var{fildes}, const char * @var{mode}) +@deftypefn Extension {FILE *} fdopen_unlocked (int @var{fildes}, const char * @var{mode}) Opens and returns a @code{FILE} pointer via @code{fdopen}. If the operating system supports it, ensure that the stream is setup to avoid @@ -54,7 +54,7 @@ unchanged. @end deftypefn -@deftypefn Extension FILE * freopen_unlocked (const char * @var{path}, const char * @var{mode}, FILE * @var{stream}) +@deftypefn Extension {FILE *} freopen_unlocked (const char * @var{path}, const char * @var{mode}, FILE * @var{stream}) Opens and returns a @code{FILE} pointer via @code{freopen}. If the operating system supports it, ensure that the stream is setup to avoid diff -uprN binutils-2.16.90.0.3/libiberty/functions.texi binutils-2.16.91.0.1/libiberty/functions.texi --- binutils-2.16.90.0.3/libiberty/functions.texi 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/functions.texi 2005-06-22 13:53:36.128115277 -0700 @@ -25,139 +25,6 @@ nineteen EBCDIC varying characters is te @end ftable @end defvr -@c pexecute.txh:1 -@deftypefn Extension struct pex_obj *pex_init (int @var{flags}, const char *@var{pname}, const char *@var{tempbase}) - -Prepare to execute one or more programs, with standard output of each -program fed to standard input of the next. This is a system -independent interface to execute a pipeline. - -@var{flags} is a bitwise combination of the following: - -@table @code - -@vindex PEX_RECORD_TIMES -@item PEX_RECORD_TIMES -Record subprocess times if possible. - -@vindex PEX_USE_PIPES -@item PEX_USE_PIPES -Use pipes for communication between processes, if possible. - -@vindex PEX_SAVE_TEMPS -@item PEX_SAVE_TEMPS -Don't delete temporary files used for communication between -processes. - -@end table - -@var{pname} is the name of program to be executed, used in error -messages. @var{tempbase} is a base name to use for any required -temporary files; it may be @code{NULL} to use a randomly chosen name. - -@end deftypefn - -@c pexecute.txh:161 -@deftypefn Extension const char *pex_one (int @var{flags}, const char *@var{executable}, char * const *@var{argv}, const char *@var{pname}, const char *@var{outname}, const char *@var{errname}, int *@var{status}, int *@var{err}) - -An interface to @code{pex_init} to permit the easy execution of a -single program. The return value and most of the parameters are as -for a call to @code{pex_run}. @var{flags} is restricted to a -combination of @code{PEX_SEARCH}, @code{PEX_STDERR_TO_STDOUT}, and -@code{PEX_BINARY_OUTPUT}. @var{outname} is interpreted as if -@code{PEX_LAST} were set. On a successful return, *@var{status} will -be set to the exit status of the program. - -@end deftypefn - -@c pexecute.txh:32 -@deftypefn Extension const char *pex_run (struct pex_obj *@var{obj}, int @var{flags}, const char *@var{executable}, char * const *@var{argv}, const char *@var{outname}, const char *@var{errname}, int *@var{err}) - -Execute one program in a pipeline. On success this returns -@code{NULL}. On failure it returns an error message, a statically -allocated string. - -@var{obj} is returned by a previous call to @code{pex_init}. - -@var{flags} is a bitwise combination of the following: - -@table @code - -@vindex PEX_LAST -@item PEX_LAST -This must be set on the last program in the pipeline. In particular, -it should be set when executing a single program. The standard output -of the program will be sent to @var{outname}, or, if @var{outname} is -@code{NULL}, to the standard output of the calling program. This -should not be set if you want to call @code{pex_read_output} -(described below). After a call to @code{pex_run} with this bit set, -@var{pex_run} may no longer be called with the same @var{obj}. - -@vindex PEX_SEARCH -@item PEX_SEARCH -Search for the program using the user's executable search path. - -@vindex PEX_SUFFIX -@item PEX_SUFFIX -@var{outname} is a suffix. See the description of @var{outname}, -below. - -@vindex PEX_STDERR_TO_STDOUT -@item PEX_STDERR_TO_STDOUT -Send the program's standard error to standard output, if possible. - -@vindex PEX_BINARY_INPUT -@vindex PEX_BINARY_OUTPUT -@item PEX_BINARY_INPUT -@itemx PEX_BINARY_OUTPUT -The standard input (output) of the program should be read (written) in -binary mode rather than text mode. These flags are ignored on systems -which do not distinguish binary mode and text mode, such as Unix. For -proper behavior these flags should match appropriately--a call to -@code{pex_run} using @code{PEX_BINARY_OUTPUT} should be followed by a -call using @code{PEX_BINARY_INPUT}. -@end table - -@var{executable} is the program to execute. @var{argv} is the set of -arguments to pass to the program; normally @code{@var{argv}[0]} will -be a copy of @var{executable}. - -@var{outname} is used to set the name of the file to use for standard -output. There are two cases in which no output file will be used: 1) -if @code{PEX_LAST} is not set in @var{flags}, and @code{PEX_USE_PIPES} -was set in the call to @code{pex_init}, and the system supports pipes; -2) if @code{PEX_LAST} is set in @var{flags}, and @var{outname} is -@code{NULL}. Otherwise the code will use a file to hold standard -output. If @code{PEX_LAST} is not set, this file is considered to be -a temporary file, and it will be removed when no longer needed, unless -@code{PEX_SAVE_TEMPS} was set in the call to @code{pex_init}. - -There are two cases to consider when setting the name of the file to -hold standard output. - -First case: @code{PEX_SUFFIX} is set in @var{flags}. In this case -@var{outname} may not be @code{NULL}. If the @var{tempbase} parameter -to @code{pex_init} was not @code{NULL}, then the output file name is -the concatenation of @var{tempbase} and @var{outname}. If -@var{tempbase} was @code{NULL}, then the output file name is a random -file name ending in @var{outname}. - -Second case: @code{PEX_SUFFIX} was not set in @var{flags}. In this -case, if @var{outname} is not @code{NULL}, it is used as the output -file name. If @var{outname} is @code{NULL}, and @var{tempbase} was -not NULL, the output file name is randomly chosen using -@var{tempbase}. Otherwise the output file name is chosen completely -at random. - -@var{errname} is the file name to use for standard error output. If -it is @code{NULL}, standard error is the same as the caller. -Otherwise, standard error is written to the named file. - -On an error return, the code sets @code{*@var{err}} to an @code{errno} -value, or to 0 if there is no relevant @code{errno}. - -@end deftypefn - @c alloca.c:26 @deftypefn Replacement void* alloca (size_t @var{size}) @@ -363,7 +230,7 @@ and inode numbers. @end deftypefn @c fopen_unlocked.c:48 -@deftypefn Extension FILE * fdopen_unlocked (int @var{fildes}, const char * @var{mode}) +@deftypefn Extension {FILE *} fdopen_unlocked (int @var{fildes}, const char * @var{mode}) Opens and returns a @code{FILE} pointer via @code{fdopen}. If the operating system supports it, ensure that the stream is setup to avoid @@ -432,7 +299,7 @@ Ignores case when performing the compari @end deftypefn @c fopen_unlocked.c:39 -@deftypefn Extension FILE * fopen_unlocked (const char *@var{path}, const char * @var{mode}) +@deftypefn Extension {FILE *} fopen_unlocked (const char *@var{path}, const char * @var{mode}) Opens and returns a @code{FILE} pointer via @code{fopen}. If the operating system supports it, ensure that the stream is setup to avoid @@ -452,7 +319,7 @@ itself. @end deftypefn @c fopen_unlocked.c:57 -@deftypefn Extension FILE * freopen_unlocked (const char * @var{path}, const char * @var{mode}, FILE * @var{stream}) +@deftypefn Extension {FILE *} freopen_unlocked (const char * @var{path}, const char * @var{mode}, FILE * @var{stream}) Opens and returns a @code{FILE} pointer via @code{freopen}. If the operating system supports it, ensure that the stream is setup to avoid @@ -764,31 +631,31 @@ Sets the first @var{count} bytes of @var @end deftypefn @c mkstemps.c:54 -@deftypefn Replacement int mkstemps (char *@var{template}, int @var{suffix_len}) +@deftypefn Replacement int mkstemps (char *@var{pattern}, int @var{suffix_len}) -Generate a unique temporary file name from @var{template}. -@var{template} has the form: +Generate a unique temporary file name from @var{pattern}. +@var{pattern} has the form: @example @var{path}/ccXXXXXX@var{suffix} @end example @var{suffix_len} tells us how long @var{suffix} is (it can be zero -length). The last six characters of @var{template} before @var{suffix} +length). The last six characters of @var{pattern} before @var{suffix} must be @samp{XXXXXX}; they are replaced with a string that makes the filename unique. Returns a file descriptor open on the file for reading and writing. @end deftypefn -@c pexecute.txh:155 +@c pexecute.txh:169 @deftypefn Extension void pex_free (struct pex_obj @var{obj}) Clean up and free all data associated with @var{obj}. @end deftypefn -@c pexecute.txh:131 +@c pexecute.txh:144 @deftypefn Extension int pex_get_status (struct pex_obj *@var{obj}, int @var{count}, int *@var{vector}) Returns the exit status of all programs run using @var{obj}. @@ -798,7 +665,7 @@ to @code{pex_run}. Returns 0 on error, @end deftypefn -@c pexecute.txh:140 +@c pexecute.txh:153 @deftypefn Extension int pex_get_times (struct pex_obj *@var{obj}, int @var{count}, struct pex_time *@var{vector}) Returns the process execution times of all programs run using @@ -807,15 +674,61 @@ results will be placed into @var{vector} order of the calls to @code{pex_run}. Returns 0 on error, 1 on success. -@code{struct pex_time} has the following fields: @code{user_seconds}, +@code{struct pex_time} has the following fields of the type +@code{unsigned long}: @code{user_seconds}, @code{user_microseconds}, @code{system_seconds}, @code{system_microseconds}. On systems which do not support reporting process times, all the fields will be set to @code{0}. @end deftypefn -@c pexecute.txh:119 -@deftypefn Extension FILE * pex_read_output (struct pex_obj *@var{obj}, int @var{binary}) +@c pexecute.txh:1 +@deftypefn Extension {struct pex_obj *} pex_init (int @var{flags}, const char *@var{pname}, const char *@var{tempbase}) + +Prepare to execute one or more programs, with standard output of each +program fed to standard input of the next. This is a system +independent interface to execute a pipeline. + +@var{flags} is a bitwise combination of the following: + +@table @code + +@vindex PEX_RECORD_TIMES +@item PEX_RECORD_TIMES +Record subprocess times if possible. + +@vindex PEX_USE_PIPES +@item PEX_USE_PIPES +Use pipes for communication between processes, if possible. + +@vindex PEX_SAVE_TEMPS +@item PEX_SAVE_TEMPS +Don't delete temporary files used for communication between +processes. + +@end table + +@var{pname} is the name of program to be executed, used in error +messages. @var{tempbase} is a base name to use for any required +temporary files; it may be @code{NULL} to use a randomly chosen name. + +@end deftypefn + +@c pexecute.txh:175 +@deftypefn Extension {const char *} pex_one (int @var{flags}, const char *@var{executable}, char * const *@var{argv}, const char *@var{pname}, const char *@var{outname}, const char *@var{errname}, int *@var{status}, int *@var{err}) + +An interface to permit the easy execution of a +single program. The return value and most of the parameters are as +for a call to @code{pex_run}. @var{flags} is restricted to a +combination of @code{PEX_SEARCH}, @code{PEX_STDERR_TO_STDOUT}, and +@code{PEX_BINARY_OUTPUT}. @var{outname} is interpreted as if +@code{PEX_LAST} were set. On a successful return, @code{*@var{status}} will +be set to the exit status of the program. + +@end deftypefn + +@c pexecute.txh:132 +@deftypefn Extension {FILE *} pex_read_output (struct pex_obj *@var{obj}, int @var{binary}) Returns a @code{FILE} pointer which may be used to read the standard output of the last program in the pipeline. When this is used, @@ -827,7 +740,108 @@ it will be closed by @code{pex_free}. @end deftypefn -@c pexecute.txh:173 +@c pexecute.txh:32 +@deftypefn Extension {const char *} pex_run (struct pex_obj *@var{obj}, int @var{flags}, const char *@var{executable}, char * const *@var{argv}, const char *@var{outname}, const char *@var{errname}, int *@var{err}) + +Execute one program in a pipeline. On success this returns +@code{NULL}. On failure it returns an error message, a statically +allocated string. + +@var{obj} is returned by a previous call to @code{pex_init}. + +@var{flags} is a bitwise combination of the following: + +@table @code + +@vindex PEX_LAST +@item PEX_LAST +This must be set on the last program in the pipeline. In particular, +it should be set when executing a single program. The standard output +of the program will be sent to @var{outname}, or, if @var{outname} is +@code{NULL}, to the standard output of the calling program. Do @emph{not} +set this bit if you want to call @code{pex_read_output} +(described below). After a call to @code{pex_run} with this bit set, +@var{pex_run} may no longer be called with the same @var{obj}. + +@vindex PEX_SEARCH +@item PEX_SEARCH +Search for the program using the user's executable search path. + +@vindex PEX_SUFFIX +@item PEX_SUFFIX +@var{outname} is a suffix. See the description of @var{outname}, +below. + +@vindex PEX_STDERR_TO_STDOUT +@item PEX_STDERR_TO_STDOUT +Send the program's standard error to standard output, if possible. + +@vindex PEX_BINARY_INPUT +@vindex PEX_BINARY_OUTPUT +@item PEX_BINARY_INPUT +@itemx PEX_BINARY_OUTPUT +The standard input (output) of the program should be read (written) in +binary mode rather than text mode. These flags are ignored on systems +which do not distinguish binary mode and text mode, such as Unix. For +proper behavior these flags should match appropriately---a call to +@code{pex_run} using @code{PEX_BINARY_OUTPUT} should be followed by a +call using @code{PEX_BINARY_INPUT}. +@end table + +@var{executable} is the program to execute. @var{argv} is the set of +arguments to pass to the program; normally @code{@var{argv}[0]} will +be a copy of @var{executable}. + +@var{outname} is used to set the name of the file to use for standard +output. There are two cases in which no output file will be used: + +@enumerate +@item +if @code{PEX_LAST} is not set in @var{flags}, and @code{PEX_USE_PIPES} +was set in the call to @code{pex_init}, and the system supports pipes + +@item +if @code{PEX_LAST} is set in @var{flags}, and @var{outname} is +@code{NULL} +@end enumerate + +@noindent +Otherwise the code will use a file to hold standard +output. If @code{PEX_LAST} is not set, this file is considered to be +a temporary file, and it will be removed when no longer needed, unless +@code{PEX_SAVE_TEMPS} was set in the call to @code{pex_init}. + +There are two cases to consider when setting the name of the file to +hold standard output. + +@enumerate +@item +@code{PEX_SUFFIX} is set in @var{flags}. In this case +@var{outname} may not be @code{NULL}. If the @var{tempbase} parameter +to @code{pex_init} was not @code{NULL}, then the output file name is +the concatenation of @var{tempbase} and @var{outname}. If +@var{tempbase} was @code{NULL}, then the output file name is a random +file name ending in @var{outname}. + +@item +@code{PEX_SUFFIX} was not set in @var{flags}. In this +case, if @var{outname} is not @code{NULL}, it is used as the output +file name. If @var{outname} is @code{NULL}, and @var{tempbase} was +not NULL, the output file name is randomly chosen using +@var{tempbase}. Otherwise the output file name is chosen completely +at random. +@end enumerate + +@var{errname} is the file name to use for standard error output. If +it is @code{NULL}, standard error is the same as the caller's. +Otherwise, standard error is written to the named file. + +On an error return, the code sets @code{*@var{err}} to an @code{errno} +value, or to 0 if there is no relevant @code{errno}. + +@end deftypefn + +@c pexecute.txh:187 @deftypefn Extension int pexecute (const char *@var{program}, char * const *@var{argv}, const char *@var{this_pname}, const char *@var{temp_base}, char **@var{errmsg_fmt}, char **@var{errmsg_arg}, int flags) This is the old interface to execute one or more programs. It is @@ -855,7 +869,7 @@ name is unset/removed. @end deftypefn -@c pexecute.txh:181 +@c pexecute.txh:195 @deftypefn Extension int pwait (int @var{pid}, int *@var{status}, int @var{flags}) Another part of the old execution interface. @@ -877,7 +891,7 @@ control over the state of the random num @end deftypefn -@c concat.c:167 +@c concat.c:173 @deftypefn Extension char* reconcat (char *@var{optr}, const char *@var{s1}, @dots{}, @code{NULL}) Same as @code{concat}, except that if @var{optr} is not @code{NULL} it @@ -1180,6 +1194,53 @@ translation is found, returns 0. @end deftypefn +@c strverscmp.c:24 +@deftypefun int strverscmp (const char *@var{s1}, const char *@var{s2}) +The @code{strverscmp} function compares the string @var{s1} against +@var{s2}, considering them as holding indices/version numbers. Return +value follows the same conventions as found in the @code{strverscmp} +function. In fact, if @var{s1} and @var{s2} contain no digits, +@code{strverscmp} behaves like @code{strcmp}. + +Basically, we compare strings normally (character by character), until +we find a digit in each string - then we enter a special comparison +mode, where each sequence of digits is taken as a whole. If we reach the +end of these two parts without noticing a difference, we return to the +standard comparison mode. There are two types of numeric parts: +"integral" and "fractional" (those begin with a '0'). The types +of the numeric parts affect the way we sort them: + +@itemize @bullet +@item +integral/integral: we compare values as you would expect. + +@item +fractional/integral: the fractional part is less than the integral one. +Again, no surprise. + +@item +fractional/fractional: the things become a bit more complex. +If the common prefix contains only leading zeroes, the longest part is less +than the other one; else the comparison behaves normally. +@end itemize + +@smallexample +strverscmp ("no digit", "no digit") + @result{} 0 // @r{same behavior as strcmp.} +strverscmp ("item#99", "item#100") + @result{} <0 // @r{same prefix, but 99 < 100.} +strverscmp ("alpha1", "alpha001") + @result{} >0 // @r{fractional part inferior to integral one.} +strverscmp ("part1_f012", "part1_f01") + @result{} >0 // @r{two fractional parts.} +strverscmp ("foo.009", "foo.0") + @result{} <0 // @r{idem, but with leading zeroes only.} +@end smallexample + +This function is especially useful when dealing with filename sorting, +because filenames frequently hold indices/version numbers. +@end deftypefun + @c tmpnam.c:3 @deftypefn Supplemental char* tmpnam (char *@var{s}) diff -uprN binutils-2.16.90.0.3/libiberty/gather-docs binutils-2.16.91.0.1/libiberty/gather-docs --- binutils-2.16.90.0.3/libiberty/gather-docs 2001-10-01 15:25:26.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/gather-docs 2005-06-22 13:53:36.129115112 -0700 @@ -17,8 +17,8 @@ # # You should have received a copy of the GNU Library General Public # License along with libiberty; see the file COPYING.LIB. If not, -# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. +# write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +# Boston, MA 02110-1301, USA. # # Originally written by DJ Delorie diff -uprN binutils-2.16.90.0.3/libiberty/getopt1.c binutils-2.16.91.0.1/libiberty/getopt1.c --- binutils-2.16.90.0.3/libiberty/getopt1.c 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/getopt1.c 2005-06-22 13:53:36.130114946 -0700 @@ -1,5 +1,5 @@ /* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 + Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2005 Free Software Foundation, Inc. NOTE: This source is derived from an old version taken from the GNU C @@ -17,15 +17,13 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include #endif -#include "getopt.h" - #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ @@ -36,6 +34,8 @@ #include +#include "getopt.h" + /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling diff -uprN binutils-2.16.90.0.3/libiberty/getopt.c binutils-2.16.91.0.1/libiberty/getopt.c --- binutils-2.16.90.0.3/libiberty/getopt.c 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/getopt.c 2005-06-22 13:53:36.130114946 -0700 @@ -21,7 +21,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* This tells Alpha OSF/1 not to define a getopt prototype in . @@ -212,8 +212,16 @@ static char *posixly_correct; /* Avoid depending on library functions or files whose names are inconsistent. */ -#ifndef getenv -extern char *getenv (); +#if HAVE_STDLIB_H && HAVE_DECL_GETENV +# include +#elif !defined(getenv) +# ifdef __cplusplus +extern "C" { +# endif /* __cplusplus */ +extern char *getenv (const char *); +# ifdef __cplusplus +} +# endif /* __cplusplus */ #endif static char * @@ -325,7 +333,7 @@ exchange (char **argv) { /* We must extend the array. The user plays games with us and presents new arguments. */ - char *new_str = malloc (top + 1); + char *new_str = (char *) malloc (top + 1); if (new_str == NULL) nonoption_flags_len = nonoption_flags_max_len = 0; else diff -uprN binutils-2.16.90.0.3/libiberty/getpwd.c binutils-2.16.91.0.1/libiberty/getpwd.c --- binutils-2.16.90.0.3/libiberty/getpwd.c 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/getpwd.c 2005-06-22 13:53:36.131114781 -0700 @@ -39,10 +39,6 @@ extern int errno; #include #endif -/* Prototype these in case the system headers don't provide them. */ -extern char *getpwd (); -extern char *getwd (); - #include "libiberty.h" /* Virtually every UN*X system now in common use (except for pre-4.3-tahoe @@ -50,6 +46,8 @@ extern char *getwd (); the few exceptions to the general rule here. */ #if !defined(HAVE_GETCWD) && defined(HAVE_GETWD) +/* Prototype in case the system headers doesn't provide it. */ +extern char *getwd (); #define getcwd(buf,len) getwd(buf) #endif @@ -86,7 +84,7 @@ getpwd (void) && dotstat.st_dev == pwdstat.st_dev)) /* The shortcut didn't work. Try the slow, ``sure'' way. */ - for (s = GUESSPATHLEN; ! getcwd (p = xmalloc (s), s); s *= 2) + for (s = GUESSPATHLEN; !getcwd (p = XNEWVEC (char, s), s); s *= 2) { int e = errno; free (p); @@ -119,7 +117,7 @@ getpwd (void) static char *pwd = 0; if (!pwd) - pwd = getcwd (xmalloc (MAXPATHLEN + 1), MAXPATHLEN + 1 + pwd = getcwd (XNEWVEC (char, MAXPATHLEN + 1), MAXPATHLEN + 1 #ifdef VMS , 0 #endif diff -uprN binutils-2.16.90.0.3/libiberty/getruntime.c binutils-2.16.91.0.1/libiberty/getruntime.c --- binutils-2.16.90.0.3/libiberty/getruntime.c 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/getruntime.c 2005-06-22 13:53:36.131114781 -0700 @@ -14,8 +14,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "config.h" diff -uprN binutils-2.16.90.0.3/libiberty/hashtab.c binutils-2.16.91.0.1/libiberty/hashtab.c --- binutils-2.16.90.0.3/libiberty/hashtab.c 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/hashtab.c 2005-06-22 13:53:36.132114616 -0700 @@ -16,8 +16,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ /* This package implements basic hash table functionality. It is possible to search for an entry, create an entry and destroy an entry. @@ -216,20 +216,30 @@ eq_pointer (const PTR p1, const PTR p2) return p1 == p2; } -/* Return the current size of given hash table. */ -inline size_t -htab_size (htab_t htab) +/* The parens around the function names in the next two definitions + are essential in order to prevent macro expansions of the name. + The bodies, however, are expanded as expected, so they are not + recursive definitions. */ + +/* Return the current size of given hash table. */ + +#define htab_size(htab) ((htab)->size) + +size_t +(htab_size) (htab_t htab) { - return htab->size; + return htab_size (htab); } /* Return the current number of elements in given hash table. */ -inline size_t -htab_elements (htab_t htab) +#define htab_elements(htab) ((htab)->n_elements - (htab)->n_deleted) + +size_t +(htab_elements) (htab_t htab) { - return htab->n_elements - htab->n_deleted; + return htab_elements (htab); } /* Return X % Y. */ @@ -317,15 +327,10 @@ htab_create_alloc (size_t size, htab_has an extra argument. */ htab_t -htab_create_alloc_ex (size, hash_f, eq_f, del_f, alloc_arg, alloc_f, - free_f) - size_t size; - htab_hash hash_f; - htab_eq eq_f; - htab_del del_f; - PTR alloc_arg; - htab_alloc_with_arg alloc_f; - htab_free_with_arg free_f; +htab_create_alloc_ex (size_t size, htab_hash hash_f, htab_eq eq_f, + htab_del del_f, void *alloc_arg, + htab_alloc_with_arg alloc_f, + htab_free_with_arg free_f) { htab_t result; unsigned int size_prime_index; diff -uprN binutils-2.16.90.0.3/libiberty/hex.c binutils-2.16.91.0.1/libiberty/hex.c --- binutils-2.16.90.0.3/libiberty/hex.c 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/hex.c 2005-06-22 13:53:36.132114616 -0700 @@ -14,8 +14,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ #include /* for EOF */ #ifdef HAVE_CONFIG_H diff -uprN binutils-2.16.90.0.3/libiberty/lbasename.c binutils-2.16.91.0.1/libiberty/lbasename.c --- binutils-2.16.90.0.3/libiberty/lbasename.c 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/lbasename.c 2005-06-22 13:53:36.133114451 -0700 @@ -15,8 +15,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ /* diff -uprN binutils-2.16.90.0.3/libiberty/lrealpath.c binutils-2.16.91.0.1/libiberty/lrealpath.c --- binutils-2.16.90.0.3/libiberty/lrealpath.c 2005-04-09 12:03:31.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/lrealpath.c 2005-06-22 13:53:36.133114451 -0700 @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street - Fifth Floor, + Boston, MA 02110-1301, USA. */ /* @@ -117,7 +117,7 @@ lrealpath (const char *filename) { /* PATH_MAX is bounded. */ char *buf, *rp, *ret; - buf = malloc (path_max); + buf = (char *) malloc (path_max); if (buf == NULL) return NULL; rp = realpath (filename, buf); diff -uprN binutils-2.16.90.0.3/libiberty/maint-tool binutils-2.16.91.0.1/libiberty/maint-tool --- binutils-2.16.90.0.3/libiberty/maint-tool 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/maint-tool 2005-06-22 13:53:36.134114286 -0700 @@ -17,8 +17,8 @@ # # You should have received a copy of the GNU Library General Public # License along with libiberty; see the file COPYING.LIB. If not, -# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. +# write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +# Boston, MA 02110-1301, USA. # # Originally written by DJ Delorie diff -uprN binutils-2.16.90.0.3/libiberty/Makefile.in binutils-2.16.91.0.1/libiberty/Makefile.in --- binutils-2.16.90.0.3/libiberty/Makefile.in 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/Makefile.in 2005-06-22 13:53:36.019133283 -0700 @@ -1,6 +1,6 @@ # # Makefile -# Copyright (C) 1990, 91-99, 2000, 2001, 2002, 2003, 2004 +# Copyright (C) 1990, 91-99, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation # # This file is part of the libiberty library. @@ -16,8 +16,8 @@ # # You should have received a copy of the GNU Library General Public # License along with libiberty; see the file COPYING.LIB. If not, -# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. +# write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +# Boston, MA 02110-1301, USA. # # This file was written by K. Richard Pixley . @@ -152,7 +152,7 @@ CFILES = alloca.c argv.c asprintf.c atex safe-ctype.c setenv.c sigsetmask.c snprintf.c sort.c spaces.c \ splay-tree.c stpcpy.c stpncpy.c strcasecmp.c strchr.c strdup.c \ strerror.c strncasecmp.c strncmp.c strrchr.c strsignal.c \ - strstr.c strtod.c strtol.c strtoul.c strndup.c \ + strstr.c strtod.c strtol.c strtoul.c strndup.c strverscmp.c \ ternary.c tmpnam.c \ unlink-if-ordinary.c \ vasprintf.c vfork.c vfprintf.c vprintf.c vsnprintf.c vsprintf.c \ @@ -201,7 +201,7 @@ CONFIGURED_OFILES = ./asprintf.o ./atexi ./setenv.o ./sigsetmask.o ./snprintf.o ./stpcpy.o ./stpncpy.o \ ./strcasecmp.o ./strchr.o ./strdup.o ./strncasecmp.o \ ./strncmp.o ./strndup.o ./strrchr.o ./strstr.o \ - ./strtod.o ./strtol.o ./strtoul.o \ + ./strtod.o ./strtol.o ./strtoul.o ./strverscmp.o \ ./tmpnam.o \ ./vasprintf.o ./vfork.o ./vfprintf.o ./vprintf.o ./vsnprintf.o \ ./vsprintf.o \ @@ -271,7 +271,7 @@ libiberty.html : $(srcdir)/libiberty.tex @MAINT@$(srcdir)/functions.texi : stamp-functions @MAINT@ @true -@MAINT@stamp-functions : $(CFILES) $(TEXIFILES) $(srcdir)/gather-docs Makefile +@MAINT@stamp-functions : $(CFILES:%=$(srcdir)/%) $(TEXIFILES:%=$(srcdir)/%) $(srcdir)/gather-docs Makefile @MAINT@@HAVE_PERL@ $(PERL) $(srcdir)/gather-docs $(srcdir) $(srcdir)/functions.texi $(CFILES) $(TEXIFILES) @MAINT@ echo stamp > stamp-functions @@ -442,13 +442,14 @@ $(CONFIGURED_OFILES): stamp-picdir else true; fi $(COMPILE.c) $(srcdir)/alloca.c $(OUTPUT_OPTION) -./argv.o: $(srcdir)/argv.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +./argv.o: $(srcdir)/argv.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h if [ x"$(PICFLAG)" != x ]; then \ $(COMPILE.c) $(PICFLAG) $(srcdir)/argv.c -o pic/$@; \ else true; fi $(COMPILE.c) $(srcdir)/argv.c $(OUTPUT_OPTION) -./asprintf.o: $(srcdir)/asprintf.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +./asprintf.o: $(srcdir)/asprintf.c config.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/libiberty.h if [ x"$(PICFLAG)" != x ]; then \ $(COMPILE.c) $(PICFLAG) $(srcdir)/asprintf.c -o pic/$@; \ else true; fi @@ -460,8 +461,8 @@ $(CONFIGURED_OFILES): stamp-picdir else true; fi $(COMPILE.c) $(srcdir)/atexit.c $(OUTPUT_OPTION) -./basename.o: $(srcdir)/basename.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ - $(INCDIR)/safe-ctype.h +./basename.o: $(srcdir)/basename.c config.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h if [ x"$(PICFLAG)" != x ]; then \ $(COMPILE.c) $(PICFLAG) $(srcdir)/basename.c -o pic/$@; \ else true; fi @@ -554,7 +555,8 @@ $(CONFIGURED_OFILES): stamp-picdir else true; fi $(COMPILE.c) $(srcdir)/dyn-string.c $(OUTPUT_OPTION) -./fdmatch.o: $(srcdir)/fdmatch.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +./fdmatch.o: $(srcdir)/fdmatch.c config.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/libiberty.h if [ x"$(PICFLAG)" != x ]; then \ $(COMPILE.c) $(PICFLAG) $(srcdir)/fdmatch.c -o pic/$@; \ else true; fi @@ -646,7 +648,7 @@ $(CONFIGURED_OFILES): stamp-picdir else true; fi $(COMPILE.c) $(srcdir)/hashtab.c $(OUTPUT_OPTION) -./hex.o: $(srcdir)/hex.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ +./hex.o: $(srcdir)/hex.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ $(INCDIR)/safe-ctype.h if [ x"$(PICFLAG)" != x ]; then \ $(COMPILE.c) $(PICFLAG) $(srcdir)/hex.c -o pic/$@; \ @@ -665,8 +667,9 @@ $(CONFIGURED_OFILES): stamp-picdir else true; fi $(COMPILE.c) $(srcdir)/insque.c $(OUTPUT_OPTION) -./lbasename.o: $(srcdir)/lbasename.c $(INCDIR)/ansidecl.h $(INCDIR)/filenames.h \ - $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h +./lbasename.o: $(srcdir)/lbasename.c config.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/safe-ctype.h if [ x"$(PICFLAG)" != x ]; then \ $(COMPILE.c) $(PICFLAG) $(srcdir)/lbasename.c -o pic/$@; \ else true; fi @@ -887,7 +890,8 @@ $(CONFIGURED_OFILES): stamp-picdir else true; fi $(COMPILE.c) $(srcdir)/sort.c $(OUTPUT_OPTION) -./spaces.o: $(srcdir)/spaces.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +./spaces.o: $(srcdir)/spaces.c config.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/libiberty.h if [ x"$(PICFLAG)" != x ]; then \ $(COMPILE.c) $(PICFLAG) $(srcdir)/spaces.c -o pic/$@; \ else true; fi @@ -993,6 +997,13 @@ $(CONFIGURED_OFILES): stamp-picdir else true; fi $(COMPILE.c) $(srcdir)/strtoul.c $(OUTPUT_OPTION) +./strverscmp.o: $(srcdir)/strverscmp.c $(INCDIR)/safe-ctype.h \ + $(INCDIR)/libiberty.h + if [ x"$(PICFLAG)" != x ]; then \ + $(COMPILE.c) $(PICFLAG) $(srcdir)/strverscmp.c -o pic/$@; \ + else true; fi + $(COMPILE.c) $(srcdir)/strverscmp.c $(OUTPUT_OPTION) + ./ternary.o: $(srcdir)/ternary.c config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h $(INCDIR)/ternary.h if [ x"$(PICFLAG)" != x ]; then \ @@ -1057,7 +1068,8 @@ $(CONFIGURED_OFILES): stamp-picdir else true; fi $(COMPILE.c) $(srcdir)/waitpid.c $(OUTPUT_OPTION) -./xatexit.o: $(srcdir)/xatexit.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +./xatexit.o: $(srcdir)/xatexit.c config.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/libiberty.h if [ x"$(PICFLAG)" != x ]; then \ $(COMPILE.c) $(PICFLAG) $(srcdir)/xatexit.c -o pic/$@; \ else true; fi diff -uprN binutils-2.16.90.0.3/libiberty/make-relative-prefix.c binutils-2.16.91.0.1/libiberty/make-relative-prefix.c --- binutils-2.16.90.0.3/libiberty/make-relative-prefix.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/make-relative-prefix.c 2005-06-22 13:53:36.134114286 -0700 @@ -16,8 +16,8 @@ for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ +Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA +02110-1301, USA. */ /* @@ -102,7 +102,7 @@ static void free_split_directories (char static char * save_string (const char *s, int len) { - char *result = malloc (len + 1); + char *result = (char *) malloc (len + 1); memcpy (result, s, len); result[len] = 0; diff -uprN binutils-2.16.90.0.3/libiberty/make-temp-file.c binutils-2.16.91.0.1/libiberty/make-temp-file.c --- binutils-2.16.90.0.3/libiberty/make-temp-file.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/make-temp-file.c 2005-06-22 13:53:36.135114120 -0700 @@ -14,8 +14,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If not, -write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -61,10 +61,10 @@ extern int mkstemps (char *, int); If success, DIR is returned. Otherwise NULL is returned. */ -static inline const char *try (const char *, const char *); +static inline const char *try_dir (const char *, const char *); static inline const char * -try (const char *dir, const char *base) +try_dir (const char *dir, const char *base) { if (base != 0) return base; @@ -103,18 +103,18 @@ choose_tmpdir (void) if (memoized_tmpdir) return memoized_tmpdir; - base = try (getenv ("TMPDIR"), base); - base = try (getenv ("TMP"), base); - base = try (getenv ("TEMP"), base); + base = try_dir (getenv ("TMPDIR"), base); + base = try_dir (getenv ("TMP"), base); + base = try_dir (getenv ("TEMP"), base); #ifdef P_tmpdir - base = try (P_tmpdir, base); + base = try_dir (P_tmpdir, base); #endif /* Try /var/tmp, /usr/tmp, then /tmp. */ - base = try (vartmp, base); - base = try (usrtmp, base); - base = try (tmp, base); + base = try_dir (vartmp, base); + base = try_dir (usrtmp, base); + base = try_dir (tmp, base); /* If all else fails, use the current directory! */ if (base == 0) @@ -123,7 +123,7 @@ choose_tmpdir (void) /* Append DIR_SEPARATOR to the directory we've chosen and return it. */ len = strlen (base); - tmpdir = xmalloc (len + 2); + tmpdir = XNEWVEC (char, len + 2); strcpy (tmpdir, base); tmpdir[len] = DIR_SEPARATOR; tmpdir[len+1] = '\0'; @@ -158,7 +158,7 @@ make_temp_file (const char *suffix) base_len = strlen (base); suffix_len = strlen (suffix); - temp_filename = xmalloc (base_len + temp_filename = XNEWVEC (char, base_len + TEMP_FILE_LEN + suffix_len + 1); strcpy (temp_filename, base); diff -uprN binutils-2.16.90.0.3/libiberty/md5.c binutils-2.16.91.0.1/libiberty/md5.c --- binutils-2.16.90.0.3/libiberty/md5.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/md5.c 2005-06-22 13:53:36.135114120 -0700 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Ulrich Drepper , 1995. */ diff -uprN binutils-2.16.90.0.3/libiberty/mempcpy.c binutils-2.16.91.0.1/libiberty/mempcpy.c --- binutils-2.16.90.0.3/libiberty/mempcpy.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/mempcpy.c 2005-06-22 13:53:36.135114120 -0700 @@ -15,8 +15,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ /* diff -uprN binutils-2.16.90.0.3/libiberty/mkstemps.c binutils-2.16.91.0.1/libiberty/mkstemps.c --- binutils-2.16.90.0.3/libiberty/mkstemps.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/mkstemps.c 2005-06-22 13:53:36.144112634 -0700 @@ -13,8 +13,8 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, + Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -51,17 +51,17 @@ typedef unsigned long gcc_uint64_t; /* -@deftypefn Replacement int mkstemps (char *@var{template}, int @var{suffix_len}) +@deftypefn Replacement int mkstemps (char *@var{pattern}, int @var{suffix_len}) -Generate a unique temporary file name from @var{template}. -@var{template} has the form: +Generate a unique temporary file name from @var{pattern}. +@var{pattern} has the form: @example @var{path}/ccXXXXXX@var{suffix} @end example @var{suffix_len} tells us how long @var{suffix} is (it can be zero -length). The last six characters of @var{template} before @var{suffix} +length). The last six characters of @var{pattern} before @var{suffix} must be @samp{XXXXXX}; they are replaced with a string that makes the filename unique. Returns a file descriptor open on the file for reading and writing. @@ -71,7 +71,7 @@ reading and writing. */ int -mkstemps (char *template, int suffix_len) +mkstemps (char *pattern, int suffix_len) { static const char letters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; @@ -83,15 +83,15 @@ mkstemps (char *template, int suffix_len size_t len; int count; - len = strlen (template); + len = strlen (pattern); if ((int) len < 6 + suffix_len - || strncmp (&template[len - 6 - suffix_len], "XXXXXX", 6)) + || strncmp (&pattern[len - 6 - suffix_len], "XXXXXX", 6)) { return -1; } - XXXXXX = &template[len - 6 - suffix_len]; + XXXXXX = &pattern[len - 6 - suffix_len]; #ifdef HAVE_GETTIMEOFDAY /* Get some more or less random data. */ @@ -119,7 +119,7 @@ mkstemps (char *template, int suffix_len v /= 62; XXXXXX[5] = letters[v % 62]; - fd = open (template, O_RDWR|O_CREAT|O_EXCL, 0600); + fd = open (pattern, O_RDWR|O_CREAT|O_EXCL, 0600); if (fd >= 0) /* The file does not exist. */ return fd; @@ -131,6 +131,6 @@ mkstemps (char *template, int suffix_len } /* We return the null string if we can't find a unique file name. */ - template[0] = '\0'; + pattern[0] = '\0'; return -1; } diff -uprN binutils-2.16.90.0.3/libiberty/objalloc.c binutils-2.16.91.0.1/libiberty/objalloc.c --- binutils-2.16.90.0.3/libiberty/objalloc.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/objalloc.c 2005-06-22 13:53:36.144112634 -0700 @@ -14,8 +14,8 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +Foundation, 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "config.h" #include "ansidecl.h" diff -uprN binutils-2.16.90.0.3/libiberty/obstack.c binutils-2.16.91.0.1/libiberty/obstack.c --- binutils-2.16.90.0.3/libiberty/obstack.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/obstack.c 2005-06-22 13:53:36.145112468 -0700 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff -uprN binutils-2.16.90.0.3/libiberty/partition.c binutils-2.16.91.0.1/libiberty/partition.c --- binutils-2.16.90.0.3/libiberty/partition.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/partition.c 2005-06-22 13:53:36.145112468 -0700 @@ -16,8 +16,8 @@ You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + the Free Software Foundation, 51 Franklin Street - Fifth Floor, + Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" diff -uprN binutils-2.16.90.0.3/libiberty/pex-common.c binutils-2.16.91.0.1/libiberty/pex-common.c --- binutils-2.16.90.0.3/libiberty/pex-common.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/pex-common.c 2005-06-22 13:53:36.146112303 -0700 @@ -15,8 +15,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If not, -write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "config.h" #include "libiberty.h" @@ -55,7 +55,7 @@ pex_init_common (int flags, const char * { struct pex_obj *obj; - obj = xmalloc (sizeof (*obj)); + obj = XNEW (struct pex_obj); obj->flags = flags; obj->pname = pname; obj->tempbase = tempbase; @@ -83,7 +83,7 @@ pex_add_remove (struct pex_obj *obj, con char *add; ++obj->remove_count; - obj->remove = xrealloc (obj->remove, obj->remove_count * sizeof (char *)); + obj->remove = XRESIZEVEC (char *, obj->remove, obj->remove_count); if (allocated) add = (char *) name; else @@ -280,7 +280,7 @@ pex_run (struct pex_obj *obj, int flags, goto error_exit; ++obj->count; - obj->children = xrealloc (obj->children, obj->count * sizeof (long)); + obj->children = XRESIZEVEC (long, obj->children, obj->count); obj->children[obj->count - 1] = pid; return NULL; @@ -352,9 +352,9 @@ pex_get_status_and_time (struct pex_obj if (obj->number_waited == obj->count) return 1; - obj->status = xrealloc (obj->status, obj->count * sizeof (int)); + obj->status = XRESIZEVEC (int, obj->status, obj->count); if ((obj->flags & PEX_RECORD_TIMES) != 0) - obj->time = xrealloc (obj->time, obj->count * sizeof (struct pex_time)); + obj->time = XRESIZEVEC (struct pex_time, obj->time, obj->count); ret = 1; for (i = obj->number_waited; i < obj->count; ++i) diff -uprN binutils-2.16.90.0.3/libiberty/pex-common.h binutils-2.16.91.0.1/libiberty/pex-common.h --- binutils-2.16.90.0.3/libiberty/pex-common.h 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/pex-common.h 2005-06-22 13:53:36.146112303 -0700 @@ -16,8 +16,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If not, -write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ #ifndef PEX_COMMON_H #define PEX_COMMON_H diff -uprN binutils-2.16.90.0.3/libiberty/pex-djgpp.c binutils-2.16.91.0.1/libiberty/pex-djgpp.c --- binutils-2.16.90.0.3/libiberty/pex-djgpp.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/pex-djgpp.c 2005-06-22 13:53:36.147112138 -0700 @@ -16,8 +16,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If not, -write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "pex-common.h" @@ -29,6 +29,10 @@ extern int errno; #ifdef HAVE_STDLIB_H #include #endif +#include +#include +#include +#include #include /* Use ECHILD if available, otherwise use EINVAL. */ @@ -68,7 +72,7 @@ pex_init (int flags, const char *pname, { /* DJGPP does not support pipes. */ flags &= ~ PEX_USE_PIPES; - return pex_init_common (flags, pname, tempbase, funcs); + return pex_init_common (flags, pname, tempbase, &funcs); } /* Open a file for reading. */ @@ -119,46 +123,46 @@ pex_djgpp_exec_child (struct pex_obj *ob if (in != STDIN_FILE_NO) { - org_in = _dup (STDIN_FILE_NO); + org_in = dup (STDIN_FILE_NO); if (org_in < 0) { *err = errno; - *errmsg = "_dup"; + *errmsg = "dup"; return -1; } - if (_dup2 (in, STDIN_FILE_NO) < 0) + if (dup2 (in, STDIN_FILE_NO) < 0) { *err = errno; - *errmsg = "_dup2"; + *errmsg = "dup2"; return -1; } - if (_close (in) < 0) + if (close (in) < 0) { *err = errno; - *errmsg = "_close"; + *errmsg = "close"; return -1; } } if (out != STDOUT_FILE_NO) { - org_out = _dup (STDOUT_FILE_NO); + org_out = dup (STDOUT_FILE_NO); if (org_out < 0) { *err = errno; - *errmsg = "_dup"; + *errmsg = "dup"; return -1; } - if (_dup2 (out, STDOUT_FILE_NO) < 0) + if (dup2 (out, STDOUT_FILE_NO) < 0) { *err = errno; - *errmsg = "_dup2"; + *errmsg = "dup2"; return -1; } - if (_close (out) < 0) + if (close (out) < 0) { *err = errno; - *errmsg = "_close"; + *errmsg = "close"; return -1; } } @@ -166,70 +170,68 @@ pex_djgpp_exec_child (struct pex_obj *ob if (errdes != STDERR_FILE_NO || (flags & PEX_STDERR_TO_STDOUT) != 0) { - int e; - - org_errdes = _dup (STDERR_FILE_NO); + org_errdes = dup (STDERR_FILE_NO); if (org_errdes < 0) { *err = errno; - *errmsg = "_dup"; + *errmsg = "dup"; return -1; } - if (_dup2 ((flags & PEX_STDERR_TO_STDOUT) != 0 ? STDOUT_FILE_NO : errdes, + if (dup2 ((flags & PEX_STDERR_TO_STDOUT) != 0 ? STDOUT_FILE_NO : errdes, STDERR_FILE_NO) < 0) { *err = errno; - *errmsg = "_dup2"; + *errmsg = "dup2"; return -1; } if (errdes != STDERR_FILE_NO) { - if (_close (errdes) < 0) + if (close (errdes) < 0) { *err = errno; - *errmsg = "_close"; + *errmsg = "close"; return -1; } } } - status = (((flags & PEX_SEARCH) != 0 ? _spawnvp : _spawnv) - (P_WAIT, program, (const char **) argv)); + status = (((flags & PEX_SEARCH) != 0 ? spawnvp : spawnv) + (P_WAIT, executable, (char * const *) argv)); if (status == -1) { *err = errno; - *errmsg = ((flags & PEX_SEARCH) != 0) ? "_spawnvp" : "_spawnv"; + *errmsg = ((flags & PEX_SEARCH) != 0) ? "spawnvp" : "spawnv"; } if (in != STDIN_FILE_NO) { - if (_dup2 (org_in, STDIN_FILE_NO) < 0) + if (dup2 (org_in, STDIN_FILE_NO) < 0) { *err = errno; - *errmsg = "_dup2"; + *errmsg = "dup2"; return -1; } - if (_close (org_in) < 0) + if (close (org_in) < 0) { *err = errno; - *errmsg = "_close"; + *errmsg = "close"; return -1; } } if (out != STDOUT_FILE_NO) { - if (_dup2 (org_out, STDOUT_FILE_NO) < 0) + if (dup2 (org_out, STDOUT_FILE_NO) < 0) { *err = errno; - *errmsg = "_dup2"; + *errmsg = "dup2"; return -1; } - if (_close (org_out) < 0) + if (close (org_out) < 0) { *err = errno; - *errmsg = "_close"; + *errmsg = "close"; return -1; } } @@ -237,16 +239,16 @@ pex_djgpp_exec_child (struct pex_obj *ob if (errdes != STDERR_FILE_NO || (flags & PEX_STDERR_TO_STDOUT) != 0) { - if (_dup2 (org_errdes, STDERR_FILE_NO) < 0) + if (dup2 (org_errdes, STDERR_FILE_NO) < 0) { *err = errno; - *errmsg = "_dup2"; + *errmsg = "dup2"; return -1; } - if (_close (org_errdes) < 0) + if (close (org_errdes) < 0) { *err = errno; - *errmsg = "_close"; + *errmsg = "close"; return -1; } } @@ -255,7 +257,7 @@ pex_djgpp_exec_child (struct pex_obj *ob is the number of children which have executed before this one. */ statuses = (int *) obj->sysdep; - statuses = xrealloc (statuses, (obj->count + 1) * sizeof (int)); + statuses = XRESIZEVEC (int, statuses, obj->count + 1); statuses[obj->count] = status; obj->sysdep = (void *) statuses; @@ -268,8 +270,9 @@ pex_djgpp_exec_child (struct pex_obj *ob static int pex_djgpp_wait (struct pex_obj *obj, long pid, int *status, - struct pex_time *time, int done, const char **errmsg, - int *err) + struct pex_time *time, int done ATTRIBUTE_UNUSED, + const char **errmsg ATTRIBUTE_UNUSED, + int *err ATTRIBUTE_UNUSED) { int *statuses; diff -uprN binutils-2.16.90.0.3/libiberty/pexecute.c binutils-2.16.91.0.1/libiberty/pexecute.c --- binutils-2.16.90.0.3/libiberty/pexecute.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/pexecute.c 2005-06-22 13:53:36.149111808 -0700 @@ -15,8 +15,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If not, -write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ /* pexecute is an old routine. This implementation uses the newer pex_init/pex_run/pex_get_status/pex_free routines. Don't use @@ -99,7 +99,7 @@ pwait (int pid, int *status, int flags A { int *vector; - vector = xmalloc (idx * sizeof (int)); + vector = XNEWVEC (int, idx); if (!pex_get_status (pex, idx, vector)) return -1; *status = vector[pid]; diff -uprN binutils-2.16.90.0.3/libiberty/pexecute.txh binutils-2.16.91.0.1/libiberty/pexecute.txh --- binutils-2.16.90.0.3/libiberty/pexecute.txh 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/pexecute.txh 2005-06-22 13:53:36.159110156 -0700 @@ -1,4 +1,4 @@ -@deftypefn Extension struct pex_obj *pex_init (int @var{flags}, const char *@var{pname}, const char *@var{tempbase}) +@deftypefn Extension {struct pex_obj *} pex_init (int @var{flags}, const char *@var{pname}, const char *@var{tempbase}) Prepare to execute one or more programs, with standard output of each program fed to standard input of the next. This is a system @@ -29,7 +29,7 @@ temporary files; it may be @code{NULL} t @end deftypefn -@deftypefn Extension const char *pex_run (struct pex_obj *@var{obj}, int @var{flags}, const char *@var{executable}, char * const *@var{argv}, const char *@var{outname}, const char *@var{errname}, int *@var{err}) +@deftypefn Extension {const char *} pex_run (struct pex_obj *@var{obj}, int @var{flags}, const char *@var{executable}, char * const *@var{argv}, const char *@var{outname}, const char *@var{errname}, int *@var{err}) Execute one program in a pipeline. On success this returns @code{NULL}. On failure it returns an error message, a statically @@ -46,8 +46,8 @@ allocated string. This must be set on the last program in the pipeline. In particular, it should be set when executing a single program. The standard output of the program will be sent to @var{outname}, or, if @var{outname} is -@code{NULL}, to the standard output of the calling program. This -should not be set if you want to call @code{pex_read_output} +@code{NULL}, to the standard output of the calling program. Do @emph{not} +set this bit if you want to call @code{pex_read_output} (described below). After a call to @code{pex_run} with this bit set, @var{pex_run} may no longer be called with the same @var{obj}. @@ -71,7 +71,7 @@ Send the program's standard error to sta The standard input (output) of the program should be read (written) in binary mode rather than text mode. These flags are ignored on systems which do not distinguish binary mode and text mode, such as Unix. For -proper behavior these flags should match appropriately--a call to +proper behavior these flags should match appropriately---a call to @code{pex_run} using @code{PEX_BINARY_OUTPUT} should be followed by a call using @code{PEX_BINARY_INPUT}. @end table @@ -81,11 +81,20 @@ arguments to pass to the program; normal be a copy of @var{executable}. @var{outname} is used to set the name of the file to use for standard -output. There are two cases in which no output file will be used: 1) +output. There are two cases in which no output file will be used: + +@enumerate +@item if @code{PEX_LAST} is not set in @var{flags}, and @code{PEX_USE_PIPES} -was set in the call to @code{pex_init}, and the system supports pipes; -2) if @code{PEX_LAST} is set in @var{flags}, and @var{outname} is -@code{NULL}. Otherwise the code will use a file to hold standard +was set in the call to @code{pex_init}, and the system supports pipes + +@item +if @code{PEX_LAST} is set in @var{flags}, and @var{outname} is +@code{NULL} +@end enumerate + +@noindent +Otherwise the code will use a file to hold standard output. If @code{PEX_LAST} is not set, this file is considered to be a temporary file, and it will be removed when no longer needed, unless @code{PEX_SAVE_TEMPS} was set in the call to @code{pex_init}. @@ -93,22 +102,26 @@ a temporary file, and it will be removed There are two cases to consider when setting the name of the file to hold standard output. -First case: @code{PEX_SUFFIX} is set in @var{flags}. In this case +@enumerate +@item +@code{PEX_SUFFIX} is set in @var{flags}. In this case @var{outname} may not be @code{NULL}. If the @var{tempbase} parameter to @code{pex_init} was not @code{NULL}, then the output file name is the concatenation of @var{tempbase} and @var{outname}. If @var{tempbase} was @code{NULL}, then the output file name is a random file name ending in @var{outname}. -Second case: @code{PEX_SUFFIX} was not set in @var{flags}. In this +@item +@code{PEX_SUFFIX} was not set in @var{flags}. In this case, if @var{outname} is not @code{NULL}, it is used as the output file name. If @var{outname} is @code{NULL}, and @var{tempbase} was not NULL, the output file name is randomly chosen using @var{tempbase}. Otherwise the output file name is chosen completely at random. +@end enumerate @var{errname} is the file name to use for standard error output. If -it is @code{NULL}, standard error is the same as the caller. +it is @code{NULL}, standard error is the same as the caller's. Otherwise, standard error is written to the named file. On an error return, the code sets @code{*@var{err}} to an @code{errno} @@ -116,7 +129,7 @@ value, or to 0 if there is no relevant @ @end deftypefn -@deftypefn Extension FILE * pex_read_output (struct pex_obj *@var{obj}, int @var{binary}) +@deftypefn Extension {FILE *} pex_read_output (struct pex_obj *@var{obj}, int @var{binary}) Returns a @code{FILE} pointer which may be used to read the standard output of the last program in the pipeline. When this is used, @@ -145,7 +158,8 @@ results will be placed into @var{vector} order of the calls to @code{pex_run}. Returns 0 on error, 1 on success. -@code{struct pex_time} has the following fields: @code{user_seconds}, +@code{struct pex_time} has the following fields of the type +@code{unsigned long}: @code{user_seconds}, @code{user_microseconds}, @code{system_seconds}, @code{system_microseconds}. On systems which do not support reporting process times, all the fields will be set to @code{0}. @@ -158,14 +172,14 @@ Clean up and free all data associated wi @end deftypefn -@deftypefn Extension const char *pex_one (int @var{flags}, const char *@var{executable}, char * const *@var{argv}, const char *@var{pname}, const char *@var{outname}, const char *@var{errname}, int *@var{status}, int *@var{err}) +@deftypefn Extension {const char *} pex_one (int @var{flags}, const char *@var{executable}, char * const *@var{argv}, const char *@var{pname}, const char *@var{outname}, const char *@var{errname}, int *@var{status}, int *@var{err}) -An interface to @code{pex_init} to permit the easy execution of a +An interface to permit the easy execution of a single program. The return value and most of the parameters are as for a call to @code{pex_run}. @var{flags} is restricted to a combination of @code{PEX_SEARCH}, @code{PEX_STDERR_TO_STDOUT}, and @code{PEX_BINARY_OUTPUT}. @var{outname} is interpreted as if -@code{PEX_LAST} were set. On a successful return, *@var{status} will +@code{PEX_LAST} were set. On a successful return, @code{*@var{status}} will be set to the exit status of the program. @end deftypefn diff -uprN binutils-2.16.90.0.3/libiberty/pex-msdos.c binutils-2.16.91.0.1/libiberty/pex-msdos.c --- binutils-2.16.90.0.3/libiberty/pex-msdos.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/pex-msdos.c 2005-06-22 13:53:36.147112138 -0700 @@ -16,8 +16,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If not, -write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "pex-common.h" @@ -89,7 +89,7 @@ pex_init (int flags, const char *pname, ret = pex_init_common (flags, pname, tempbase, funcs); - ret->sysdep = xmalloc (sizeof (struct pex_msdos)); + ret->sysdep = XNEW (struct pex_msdos); for (i = 0; i < PEX_MSDOS_FILE_COUNT; ++i) ret->files[i] = NULL; ret->statuses = NULL; @@ -210,7 +210,7 @@ pex_msdos_exec_child (struct pex_obj *ob outfile = ms->files[outindex]; } - scmd = xmalloc (strlen (program) + scmd = XNEWVEC (char, strlen (program) + ((flags & PEXECUTE_SEARCH) != 0 ? 4 : 0) + strlen (rf) + strlen (infile) @@ -269,7 +269,7 @@ pex_msdos_exec_child (struct pex_obj *ob /* Save the exit status for later. When we are called, obj->count is the number of children which have executed before this one. */ - ms->statuses = xrealloc (ms->statuses, (obj->count + 1) * sizeof (int)); + ms->statuses = XRESIZEVEC(int, ms->statuses, obj->count + 1); ms->statuses[obj->count] = status; return obj->count; diff -uprN binutils-2.16.90.0.3/libiberty/pex-one.c binutils-2.16.91.0.1/libiberty/pex-one.c --- binutils-2.16.90.0.3/libiberty/pex-one.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/pex-one.c 2005-06-22 13:53:36.148111973 -0700 @@ -14,8 +14,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If not, -write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "config.h" #include "libiberty.h" diff -uprN binutils-2.16.90.0.3/libiberty/pex-unix.c binutils-2.16.91.0.1/libiberty/pex-unix.c --- binutils-2.16.90.0.3/libiberty/pex-unix.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/pex-unix.c 2005-06-22 13:53:36.148111973 -0700 @@ -17,8 +17,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If not, -write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "config.h" #include "libiberty.h" @@ -252,7 +252,7 @@ pex_wait (struct pex_obj *obj, pid_t pid return cpid; } - psl = xmalloc (sizeof (struct status_list)); + psl = XNEW (struct status_list); psl->pid = cpid; psl->status = *status; if (time != NULL) diff -uprN binutils-2.16.90.0.3/libiberty/pex-win32.c binutils-2.16.91.0.1/libiberty/pex-win32.c --- binutils-2.16.90.0.3/libiberty/pex-win32.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/pex-win32.c 2005-06-22 13:53:36.149111808 -0700 @@ -16,8 +16,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If not, -write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "pex-common.h" @@ -79,7 +79,7 @@ fix_argv (char * const *argvec) for (i = 0; argvec[i] != NULL; i++) ; - argv = xmalloc ((i + 1) * sizeof (char *)); + argv = XNEWVEC (char *, i + 1); for (i = 0; argvec[i] != NULL; i++) argv[i] = xstrdup (argvec[i]); argv[i] = NULL; @@ -105,7 +105,7 @@ fix_argv (char * const *argvec) { if (temp[j] == '"') { - newtemp = xmalloc (len + 2); + newtemp = XNEWVEC (char, len + 2); strncpy (newtemp, temp, j); newtemp [j] = '\\'; strncpy (&newtemp [j+1], &temp [j], len-j); @@ -150,7 +150,7 @@ fix_argv (char * const *argvec) len += 2; /* and for the enclosing quotes. */ - temp = xmalloc (len + 1); + temp = XNEWVEC (char, len + 1); temp[0] = '"'; strcpy (temp + 1, argv[i]); if (trailing_backslash) diff -uprN binutils-2.16.90.0.3/libiberty/physmem.c binutils-2.16.91.0.1/libiberty/physmem.c --- binutils-2.16.90.0.3/libiberty/physmem.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/physmem.c 2005-06-22 13:53:36.159110156 -0700 @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Paul Eggert. */ diff -uprN binutils-2.16.90.0.3/libiberty/putenv.c binutils-2.16.91.0.1/libiberty/putenv.c --- binutils-2.16.90.0.3/libiberty/putenv.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/putenv.c 2005-06-22 13:53:36.160109990 -0700 @@ -13,8 +13,8 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, + Boston, MA 02110-1301, USA. */ /* diff -uprN binutils-2.16.90.0.3/libiberty/regex.c binutils-2.16.91.0.1/libiberty/regex.c --- binutils-2.16.90.0.3/libiberty/regex.c 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/regex.c 2005-06-22 13:53:36.172108008 -0700 @@ -17,8 +17,8 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. */ /* This file has been modified for usage in libiberty. It includes "xregex.h" instead of . The "xregex.h" header file renames all external diff -uprN binutils-2.16.90.0.3/libiberty/safe-ctype.c binutils-2.16.91.0.1/libiberty/safe-ctype.c --- binutils-2.16.90.0.3/libiberty/safe-ctype.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/safe-ctype.c 2005-06-22 13:53:36.173107843 -0700 @@ -17,8 +17,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ /* diff -uprN binutils-2.16.90.0.3/libiberty/setenv.c binutils-2.16.91.0.1/libiberty/setenv.c --- binutils-2.16.90.0.3/libiberty/setenv.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/setenv.c 2005-06-22 13:53:36.173107843 -0700 @@ -13,8 +13,8 @@ You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, + Boston, MA 02110-1301, USA. */ /* @@ -115,7 +115,7 @@ setenv (const char *name, const char *va return -1; } - new_environ[size] = malloc (namelen + 1 + vallen); + new_environ[size] = (char *) malloc (namelen + 1 + vallen); if (new_environ[size] == NULL) { free ((char *) new_environ); @@ -142,13 +142,13 @@ setenv (const char *name, const char *va if (len + 1 < namelen + 1 + vallen) { /* The existing string is too short; malloc a new one. */ - char *new = malloc (namelen + 1 + vallen); - if (new == NULL) + char *new_string = (char *) malloc (namelen + 1 + vallen); + if (new_string == NULL) { UNLOCK; return -1; } - *ep = new; + *ep = new_string; } memcpy (*ep, name, namelen); (*ep)[namelen] = '='; diff -uprN binutils-2.16.90.0.3/libiberty/sigsetmask.c binutils-2.16.91.0.1/libiberty/sigsetmask.c --- binutils-2.16.90.0.3/libiberty/sigsetmask.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/sigsetmask.c 2005-06-22 13:53:36.173107843 -0700 @@ -27,14 +27,14 @@ extern void abort (void) ATTRIBUTE_NORET int sigsetmask (int set) { - sigset_t new; - sigset_t old; + sigset_t new_sig; + sigset_t old_sig; - sigemptyset (&new); + sigemptyset (&new_sig); if (set != 0) { abort(); /* FIXME, we don't know how to translate old mask to new */ } - sigprocmask(SIG_SETMASK, &new, &old); + sigprocmask(SIG_SETMASK, &new_sig, &old_sig); return 1; /* FIXME, we always return 1 as old value. */ } #endif diff -uprN binutils-2.16.90.0.3/libiberty/snprintf.c binutils-2.16.91.0.1/libiberty/snprintf.c --- binutils-2.16.90.0.3/libiberty/snprintf.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/snprintf.c 2005-06-22 13:53:36.174107678 -0700 @@ -15,7 +15,7 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, if you link this library with files compiled with a GNU compiler to produce an executable, this does not cause diff -uprN binutils-2.16.90.0.3/libiberty/sort.c binutils-2.16.91.0.1/libiberty/sort.c --- binutils-2.16.90.0.3/libiberty/sort.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/sort.c 2005-06-22 13:53:36.174107678 -0700 @@ -16,8 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +the Free Software Foundation, 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -155,8 +155,8 @@ int main (int argc, char **argv) else k = 10; - pointers = xmalloc (k * sizeof (void *)); - work = xmalloc (k * sizeof (void *)); + pointers = XNEWVEC (void*, k); + work = XNEWVEC (void*, k); for (i = 0; i < k; ++i) { diff -uprN binutils-2.16.90.0.3/libiberty/spaces.c binutils-2.16.91.0.1/libiberty/spaces.c --- binutils-2.16.90.0.3/libiberty/spaces.c 2005-04-29 10:50:30.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/spaces.c 2005-06-22 13:53:36.179106852 -0700 @@ -14,8 +14,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ /* @@ -57,7 +57,7 @@ spaces (int count) { free (buf); } - buf = malloc (count + 1); + buf = (char *) malloc (count + 1); if (buf == (char *) 0) return 0; for (t = buf + count ; t != buf ; ) diff -uprN binutils-2.16.90.0.3/libiberty/splay-tree.c binutils-2.16.91.0.1/libiberty/splay-tree.c --- binutils-2.16.90.0.3/libiberty/splay-tree.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/splay-tree.c 2005-06-22 13:53:36.179106852 -0700 @@ -16,8 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +the Free Software Foundation, 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ /* For an easily readable description of splay-trees, see: diff -uprN binutils-2.16.90.0.3/libiberty/stpcpy.c binutils-2.16.91.0.1/libiberty/stpcpy.c --- binutils-2.16.90.0.3/libiberty/stpcpy.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/stpcpy.c 2005-06-22 13:53:36.183106191 -0700 @@ -15,8 +15,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ /* diff -uprN binutils-2.16.90.0.3/libiberty/stpncpy.c binutils-2.16.91.0.1/libiberty/stpncpy.c --- binutils-2.16.90.0.3/libiberty/stpncpy.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/stpncpy.c 2005-06-22 13:53:36.183106191 -0700 @@ -15,8 +15,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ /* diff -uprN binutils-2.16.90.0.3/libiberty/strndup.c binutils-2.16.91.0.1/libiberty/strndup.c --- binutils-2.16.90.0.3/libiberty/strndup.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/strndup.c 2005-06-22 13:53:36.183106191 -0700 @@ -15,8 +15,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ /* @@ -46,10 +46,10 @@ strndup (const char *s, size_t n) if (n < len) len = n; - result = malloc (len + 1); + result = (char *) malloc (len + 1); if (!result) return 0; result[len] = '\0'; - return memcpy (result, s, len); + return (char *) memcpy (result, s, len); } diff -uprN binutils-2.16.90.0.3/libiberty/strtod.c binutils-2.16.91.0.1/libiberty/strtod.c --- binutils-2.16.90.0.3/libiberty/strtod.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/strtod.c 2005-06-22 13:53:36.198103713 -0700 @@ -14,7 +14,7 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, if you link this library with files compiled with a GNU compiler to produce an executable, this does not cause diff -uprN binutils-2.16.90.0.3/libiberty/strverscmp.c binutils-2.16.91.0.1/libiberty/strverscmp.c --- binutils-2.16.90.0.3/libiberty/strverscmp.c 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/libiberty/strverscmp.c 2005-06-22 13:53:36.198103713 -0700 @@ -0,0 +1,157 @@ +/* Compare strings while treating digits characters numerically. + Copyright (C) 1997, 2002, 2005 Free Software Foundation, Inc. + This file is part of the libiberty library. + Contributed by Jean-François Bignolles , 1997. + + Libiberty is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + Libiberty is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include "libiberty.h" +#include "safe-ctype.h" + +/* +@deftypefun int strverscmp (const char *@var{s1}, const char *@var{s2}) +The @code{strverscmp} function compares the string @var{s1} against +@var{s2}, considering them as holding indices/version numbers. Return +value follows the same conventions as found in the @code{strverscmp} +function. In fact, if @var{s1} and @var{s2} contain no digits, +@code{strverscmp} behaves like @code{strcmp}. + +Basically, we compare strings normally (character by character), until +we find a digit in each string - then we enter a special comparison +mode, where each sequence of digits is taken as a whole. If we reach the +end of these two parts without noticing a difference, we return to the +standard comparison mode. There are two types of numeric parts: +"integral" and "fractional" (those begin with a '0'). The types +of the numeric parts affect the way we sort them: + +@itemize @bullet +@item +integral/integral: we compare values as you would expect. + +@item +fractional/integral: the fractional part is less than the integral one. +Again, no surprise. + +@item +fractional/fractional: the things become a bit more complex. +If the common prefix contains only leading zeroes, the longest part is less +than the other one; else the comparison behaves normally. +@end itemize + +@smallexample +strverscmp ("no digit", "no digit") + @result{} 0 // @r{same behavior as strcmp.} +strverscmp ("item#99", "item#100") + @result{} <0 // @r{same prefix, but 99 < 100.} +strverscmp ("alpha1", "alpha001") + @result{} >0 // @r{fractional part inferior to integral one.} +strverscmp ("part1_f012", "part1_f01") + @result{} >0 // @r{two fractional parts.} +strverscmp ("foo.009", "foo.0") + @result{} <0 // @r{idem, but with leading zeroes only.} +@end smallexample + +This function is especially useful when dealing with filename sorting, +because filenames frequently hold indices/version numbers. +@end deftypefun + +*/ + +/* states: S_N: normal, S_I: comparing integral part, S_F: comparing + fractional parts, S_Z: idem but with leading Zeroes only */ +#define S_N 0x0 +#define S_I 0x4 +#define S_F 0x8 +#define S_Z 0xC + +/* result_type: CMP: return diff; LEN: compare using len_diff/diff */ +#define CMP 2 +#define LEN 3 + + +/* Compare S1 and S2 as strings holding indices/version numbers, + returning less than, equal to or greater than zero if S1 is less than, + equal to or greater than S2 (for more info, see the Glibc texinfo doc). */ + +int +strverscmp (const char *s1, const char *s2) +{ + const unsigned char *p1 = (const unsigned char *) s1; + const unsigned char *p2 = (const unsigned char *) s2; + unsigned char c1, c2; + int state; + int diff; + + /* Symbol(s) 0 [1-9] others (padding) + Transition (10) 0 (01) d (00) x (11) - */ + static const unsigned int next_state[] = + { + /* state x d 0 - */ + /* S_N */ S_N, S_I, S_Z, S_N, + /* S_I */ S_N, S_I, S_I, S_I, + /* S_F */ S_N, S_F, S_F, S_F, + /* S_Z */ S_N, S_F, S_Z, S_Z + }; + + static const int result_type[] = + { + /* state x/x x/d x/0 x/- d/x d/d d/0 d/- + 0/x 0/d 0/0 0/- -/x -/d -/0 -/- */ + + /* S_N */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP, + CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, + /* S_I */ CMP, -1, -1, CMP, +1, LEN, LEN, CMP, + +1, LEN, LEN, CMP, CMP, CMP, CMP, CMP, + /* S_F */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP, + CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, + /* S_Z */ CMP, +1, +1, CMP, -1, CMP, CMP, CMP, + -1, CMP, CMP, CMP + }; + + if (p1 == p2) + return 0; + + c1 = *p1++; + c2 = *p2++; + /* Hint: '0' is a digit too. */ + state = S_N | ((c1 == '0') + (ISDIGIT (c1) != 0)); + + while ((diff = c1 - c2) == 0 && c1 != '\0') + { + state = next_state[state]; + c1 = *p1++; + c2 = *p2++; + state |= (c1 == '0') + (ISDIGIT (c1) != 0); + } + + state = result_type[state << 2 | (((c2 == '0') + (ISDIGIT (c2) != 0)))]; + + switch (state) + { + case CMP: + return diff; + + case LEN: + while (ISDIGIT (*p1++)) + if (!ISDIGIT (*p2++)) + return 1; + + return ISDIGIT (*p2) ? -1 : diff; + + default: + return state; + } +} diff -uprN binutils-2.16.90.0.3/libiberty/ternary.c binutils-2.16.91.0.1/libiberty/ternary.c --- binutils-2.16.90.0.3/libiberty/ternary.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/ternary.c 2005-06-22 13:53:36.199103548 -0700 @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -74,7 +74,7 @@ ternary_insert (ternary_tree *root, cons for (;;) { /* Allocate the memory for the node, and fill it in */ - *pcurr = (ternary_tree) xmalloc (sizeof (ternary_node)); + *pcurr = XNEW (ternary_node); curr = *pcurr; curr->splitchar = *s; curr->lokid = curr->hikid = curr->eqkid = 0; diff -uprN binutils-2.16.90.0.3/libiberty/testsuite/demangle-expected binutils-2.16.91.0.1/libiberty/testsuite/demangle-expected --- binutils-2.16.90.0.3/libiberty/testsuite/demangle-expected 2004-07-27 21:36:11.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/testsuite/demangle-expected 2005-06-22 13:53:36.225099253 -0700 @@ -3771,3 +3771,7 @@ _Z1ZZ2Z::__CPR212____ct__Q3_3std141list_ _test_array__L_1__B23b___clean.6 _test_array__L_1__B23b___clean.6 _test_array__L_1__B23b___clean.6 +# +--format=java +_ZGAN4java4lang5Class7forNameEPNS0_6StringE +hidden alias for java.lang.Class.forName(java.lang.String) diff -uprN binutils-2.16.90.0.3/libiberty/unlink-if-ordinary.c binutils-2.16.91.0.1/libiberty/unlink-if-ordinary.c --- binutils-2.16.90.0.3/libiberty/unlink-if-ordinary.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/unlink-if-ordinary.c 2005-06-22 13:53:36.199103548 -0700 @@ -14,7 +14,7 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, if you link this library with files compiled with a GNU compiler to produce an executable, this does not cause diff -uprN binutils-2.16.90.0.3/libiberty/vasprintf.c binutils-2.16.91.0.1/libiberty/vasprintf.c --- binutils-2.16.90.0.3/libiberty/vasprintf.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/vasprintf.c 2005-06-22 13:53:36.213101235 -0700 @@ -15,8 +15,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" diff -uprN binutils-2.16.90.0.3/libiberty/vsnprintf.c binutils-2.16.91.0.1/libiberty/vsnprintf.c --- binutils-2.16.90.0.3/libiberty/vsnprintf.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/vsnprintf.c 2005-06-22 13:53:36.213101235 -0700 @@ -15,7 +15,7 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, if you link this library with files compiled with a GNU compiler to produce an executable, this does not cause diff -uprN binutils-2.16.90.0.3/libiberty/vsprintf.c binutils-2.16.91.0.1/libiberty/vsprintf.c --- binutils-2.16.90.0.3/libiberty/vsprintf.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/vsprintf.c 2005-06-22 13:53:36.214101070 -0700 @@ -18,7 +18,7 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, if you link this library with files compiled with a GNU compiler to produce an executable, this does not cause diff -uprN binutils-2.16.90.0.3/libiberty/xexit.c binutils-2.16.91.0.1/libiberty/xexit.c --- binutils-2.16.90.0.3/libiberty/xexit.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/xexit.c 2005-06-22 13:53:36.214101070 -0700 @@ -14,8 +14,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If not, write -to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ /* diff -uprN binutils-2.16.90.0.3/libiberty/xmalloc.c binutils-2.16.91.0.1/libiberty/xmalloc.c --- binutils-2.16.90.0.3/libiberty/xmalloc.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/xmalloc.c 2005-06-22 13:53:36.215100905 -0700 @@ -14,8 +14,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ /* @@ -75,11 +75,23 @@ function will be called to print an erro #include #else /* For systems with larger pointers than ints, these must be declared. */ -PTR malloc (size_t); -PTR realloc (PTR, size_t); -PTR calloc (size_t, size_t); -PTR sbrk (ptrdiff_t); -#endif +# if HAVE_STDLIB_H && HAVE_UNISTD_H && HAVE_DECL_MALLOC \ + && HAVE_DECL_REALLOC && HAVE_DECL_CALLOC && HAVE_DECL_SBRK +# include +# include +# else +# ifdef __cplusplus +extern "C" { +# endif /* __cplusplus */ +void *malloc (size_t); +void *realloc (void *, size_t); +void *calloc (size_t, size_t); +void *sbrk (ptrdiff_t); +# ifdef __cplusplus +} +# endif /* __cplusplus */ +# endif /* HAVE_STDLIB_H ... */ +#endif /* VMS */ /* The program name if set. */ static const char *name = ""; diff -uprN binutils-2.16.90.0.3/libiberty/xstrdup.c binutils-2.16.91.0.1/libiberty/xstrdup.c --- binutils-2.16.90.0.3/libiberty/xstrdup.c 2005-04-09 12:03:32.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/xstrdup.c 2005-06-22 13:53:36.215100905 -0700 @@ -31,6 +31,6 @@ char * xstrdup (const char *s) { register size_t len = strlen (s) + 1; - register char *ret = xmalloc (len); + register char *ret = XNEWVEC (char, len); return (char *) memcpy (ret, s, len); } diff -uprN binutils-2.16.90.0.3/libiberty/xstrerror.c binutils-2.16.91.0.1/libiberty/xstrerror.c --- binutils-2.16.90.0.3/libiberty/xstrerror.c 2005-04-09 12:03:33.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/xstrerror.c 2005-06-22 13:53:36.215100905 -0700 @@ -19,15 +19,28 @@ will never return a @code{NULL} pointer. #include "libiberty.h" #ifdef VMS -#include -#if !defined (__STRICT_ANSI__) && !defined (__HIDE_FORBIDDEN_NAMES) +# include +# if !defined (__STRICT_ANSI__) && !defined (__HIDE_FORBIDDEN_NAMES) +# ifdef __cplusplus +extern "C" { +# endif /* __cplusplus */ extern char *strerror (int,...); -#define DONT_DECLARE_STRERROR -#endif -#endif /* VMS */ +# define DONT_DECLARE_STRERROR +# ifdef __cplusplus +} +# endif /* __cplusplus */ +# endif +#endif /* VMS */ + #ifndef DONT_DECLARE_STRERROR +# ifdef __cplusplus +extern "C" { +# endif /* __cplusplus */ extern char *strerror (int); +# ifdef __cplusplus +} +# endif /* __cplusplus */ #endif /* If strerror returns NULL, we'll format the number into a static buffer. */ diff -uprN binutils-2.16.90.0.3/libiberty/xstrndup.c binutils-2.16.91.0.1/libiberty/xstrndup.c --- binutils-2.16.90.0.3/libiberty/xstrndup.c 2005-04-09 12:03:33.000000000 -0700 +++ binutils-2.16.91.0.1/libiberty/xstrndup.c 2005-06-22 13:53:36.216100739 -0700 @@ -15,8 +15,8 @@ Library General Public License for more You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ /* @@ -53,8 +53,8 @@ xstrndup (const char *s, size_t n) if (n < len) len = n; - result = xmalloc (len + 1); + result = XNEWVEC (char, len + 1); result[len] = '\0'; - return memcpy (result, s, len); + return (char *) memcpy (result, s, len); } diff -uprN binutils-2.16.90.0.3/Makefile.def binutils-2.16.91.0.1/Makefile.def --- binutils-2.16.90.0.3/Makefile.def 2005-04-09 12:02:55.000000000 -0700 +++ binutils-2.16.91.0.1/Makefile.def 2005-06-22 13:53:34.007465663 -0700 @@ -242,9 +242,9 @@ dependencies = { module=all-build-fixinc // Host modules specific to gcc. dependencies = { module=configure-gcc; on=configure-intl; }; -dependencies = { module=configure-gcc; on=configure-binutils; }; -dependencies = { module=configure-gcc; on=configure-gas; }; -dependencies = { module=configure-gcc; on=configure-ld; }; +dependencies = { module=configure-gcc; on=all-binutils; }; +dependencies = { module=configure-gcc; on=all-gas; }; +dependencies = { module=configure-gcc; on=all-ld; }; dependencies = { module=all-gcc; on=all-libiberty; hard=true; }; dependencies = { module=all-gcc; on=all-intl; }; dependencies = { module=all-gcc; on=all-build-texinfo; }; @@ -253,9 +253,6 @@ dependencies = { module=all-gcc; on=all- dependencies = { module=all-gcc; on=all-build-flex; }; dependencies = { module=all-gcc; on=all-build-libiberty; }; dependencies = { module=all-gcc; on=all-build-fixincludes; }; -dependencies = { module=all-gcc; on=all-binutils; }; -dependencies = { module=all-gcc; on=all-gas; }; -dependencies = { module=all-gcc; on=all-ld; }; dependencies = { module=all-gcc; on=all-zlib; }; dependencies = { module=all-gcc; on=all-libcpp; hard=true; }; dependencies = { module=all-gcc; on=all-libiberty; }; diff -uprN binutils-2.16.90.0.3/Makefile.in binutils-2.16.91.0.1/Makefile.in --- binutils-2.16.90.0.3/Makefile.in 2005-05-10 15:46:40.000000000 -0700 +++ binutils-2.16.91.0.1/Makefile.in 2005-06-22 13:53:34.054457898 -0700 @@ -33414,7 +33414,7 @@ stage1-start:: @[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \ echo stage1 > stage_current ; \ echo stage1 > stage_last; \ - $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) $(TARGET_SUBDIR) @if bfd @cd $(HOST_SUBDIR); [ -d stage1-bfd ] || \ mkdir stage1-bfd; \ @@ -33557,7 +33557,7 @@ stage2-start:: @[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \ echo stage2 > stage_current ; \ echo stage2 > stage_last; \ - $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) $(TARGET_SUBDIR) @if bfd @cd $(HOST_SUBDIR); [ -d stage2-bfd ] || \ mkdir stage2-bfd; \ @@ -33743,7 +33743,7 @@ stage3-start:: @[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \ echo stage3 > stage_current ; \ echo stage3 > stage_last; \ - $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) $(TARGET_SUBDIR) @if bfd @cd $(HOST_SUBDIR); [ -d stage3-bfd ] || \ mkdir stage3-bfd; \ @@ -33960,7 +33960,7 @@ stage4-start:: @[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \ echo stage4 > stage_current ; \ echo stage4 > stage_last; \ - $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) $(TARGET_SUBDIR) @if bfd @cd $(HOST_SUBDIR); [ -d stage4-bfd ] || \ mkdir stage4-bfd; \ @@ -34174,7 +34174,7 @@ stageprofile-start:: @[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \ echo stageprofile > stage_current ; \ echo stageprofile > stage_last; \ - $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) $(TARGET_SUBDIR) @if bfd @cd $(HOST_SUBDIR); [ -d stageprofile-bfd ] || \ mkdir stageprofile-bfd; \ @@ -34357,7 +34357,7 @@ stagefeedback-start:: @[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \ echo stagefeedback > stage_current ; \ echo stagefeedback > stage_last; \ - $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) $(TARGET_SUBDIR) @if bfd @cd $(HOST_SUBDIR); [ -d stagefeedback-bfd ] || \ mkdir stagefeedback-bfd; \ @@ -34654,6 +34654,7 @@ configure-target-qthreads: maybe-all-tar + # With all the machinery above in place, it is pretty easy to generate # dependencies. Host dependencies are a bit more complex because we have # to check for bootstrap/prebootstrap dependencies. To resolve @@ -34676,30 +34677,30 @@ configure-stage3-gcc: maybe-configure-st configure-stage4-gcc: maybe-configure-stage4-intl configure-stageprofile-gcc: maybe-configure-stageprofile-intl configure-stagefeedback-gcc: maybe-configure-stagefeedback-intl -configure-gcc: maybe-configure-binutils +configure-gcc: maybe-all-binutils -configure-stage1-gcc: maybe-configure-stage1-binutils -configure-stage2-gcc: maybe-configure-stage2-binutils -configure-stage3-gcc: maybe-configure-stage3-binutils -configure-stage4-gcc: maybe-configure-stage4-binutils -configure-stageprofile-gcc: maybe-configure-stageprofile-binutils -configure-stagefeedback-gcc: maybe-configure-stagefeedback-binutils -configure-gcc: maybe-configure-gas - -configure-stage1-gcc: maybe-configure-stage1-gas -configure-stage2-gcc: maybe-configure-stage2-gas -configure-stage3-gcc: maybe-configure-stage3-gas -configure-stage4-gcc: maybe-configure-stage4-gas -configure-stageprofile-gcc: maybe-configure-stageprofile-gas -configure-stagefeedback-gcc: maybe-configure-stagefeedback-gas -configure-gcc: maybe-configure-ld - -configure-stage1-gcc: maybe-configure-stage1-ld -configure-stage2-gcc: maybe-configure-stage2-ld -configure-stage3-gcc: maybe-configure-stage3-ld -configure-stage4-gcc: maybe-configure-stage4-ld -configure-stageprofile-gcc: maybe-configure-stageprofile-ld -configure-stagefeedback-gcc: maybe-configure-stagefeedback-ld +configure-stage1-gcc: maybe-all-stage1-binutils +configure-stage2-gcc: maybe-all-stage2-binutils +configure-stage3-gcc: maybe-all-stage3-binutils +configure-stage4-gcc: maybe-all-stage4-binutils +configure-stageprofile-gcc: maybe-all-stageprofile-binutils +configure-stagefeedback-gcc: maybe-all-stagefeedback-binutils +configure-gcc: maybe-all-gas + +configure-stage1-gcc: maybe-all-stage1-gas +configure-stage2-gcc: maybe-all-stage2-gas +configure-stage3-gcc: maybe-all-stage3-gas +configure-stage4-gcc: maybe-all-stage4-gas +configure-stageprofile-gcc: maybe-all-stageprofile-gas +configure-stagefeedback-gcc: maybe-all-stagefeedback-gas +configure-gcc: maybe-all-ld + +configure-stage1-gcc: maybe-all-stage1-ld +configure-stage2-gcc: maybe-all-stage2-ld +configure-stage3-gcc: maybe-all-stage3-ld +configure-stage4-gcc: maybe-all-stage4-ld +configure-stageprofile-gcc: maybe-all-stageprofile-ld +configure-stagefeedback-gcc: maybe-all-stagefeedback-ld all-gcc: all-libiberty all-stage1-gcc: all-stage1-libiberty @@ -34770,30 +34771,6 @@ all-stage4-gcc: maybe-all-build-fixinclu all-stageprofile-gcc: maybe-all-build-fixincludes all-stagefeedback-gcc: maybe-all-build-fixincludes all-prebootstrap: maybe-all-build-fixincludes -all-gcc: maybe-all-binutils - -all-stage1-gcc: maybe-all-stage1-binutils -all-stage2-gcc: maybe-all-stage2-binutils -all-stage3-gcc: maybe-all-stage3-binutils -all-stage4-gcc: maybe-all-stage4-binutils -all-stageprofile-gcc: maybe-all-stageprofile-binutils -all-stagefeedback-gcc: maybe-all-stagefeedback-binutils -all-gcc: maybe-all-gas - -all-stage1-gcc: maybe-all-stage1-gas -all-stage2-gcc: maybe-all-stage2-gas -all-stage3-gcc: maybe-all-stage3-gas -all-stage4-gcc: maybe-all-stage4-gas -all-stageprofile-gcc: maybe-all-stageprofile-gas -all-stagefeedback-gcc: maybe-all-stagefeedback-gas -all-gcc: maybe-all-ld - -all-stage1-gcc: maybe-all-stage1-ld -all-stage2-gcc: maybe-all-stage2-ld -all-stage3-gcc: maybe-all-stage3-ld -all-stage4-gcc: maybe-all-stage4-ld -all-stageprofile-gcc: maybe-all-stageprofile-ld -all-stagefeedback-gcc: maybe-all-stagefeedback-ld all-gcc: maybe-all-zlib all-stage1-gcc: maybe-all-stage1-zlib diff -uprN binutils-2.16.90.0.3/Makefile.tpl binutils-2.16.91.0.1/Makefile.tpl --- binutils-2.16.90.0.3/Makefile.tpl 2005-05-10 15:46:40.000000000 -0700 +++ binutils-2.16.91.0.1/Makefile.tpl 2005-06-22 13:53:34.059457073 -0700 @@ -1340,7 +1340,7 @@ stage[+id+]-start:: @[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \ echo stage[+id+] > stage_current ; \ echo stage[+id+] > stage_last; \ - $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)[+ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) $(TARGET_SUBDIR)[+ FOR host_modules +][+ IF bootstrap +] @if [+ module +] @cd $(HOST_SUBDIR); [ -d stage[+id+]-[+module+] ] || \ @@ -1349,7 +1349,16 @@ stage[+id+]-start:: @CREATE_LINK_TO_DIR@ [+ IF prev +] ; \ set stage[+prev+]-[+module+] prev-[+module+] ; \ @CREATE_LINK_TO_DIR@ [+ ENDIF prev +] -@endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +] +@endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +][+ + FOR target_modules +][+ IF bootstrap +] +@if target-[+ module +] + @cd $(TARGET_SUBDIR); [ -d stage[+id+]-[+module+] ] || \ + mkdir stage[+id+]-[+module+]; \ + set stage[+id+]-[+module+] [+module+] ; \ + @CREATE_LINK_TO_DIR@ [+ IF prev +] ; \ + set stage[+prev+]-[+module+] prev-[+module+] ; \ + @CREATE_LINK_TO_DIR@ [+ ENDIF prev +] +@endif target-[+ module +][+ ENDIF bootstrap +][+ ENDFOR target_modules +] stage[+id+]-end:: @rm -f stage_current[+ FOR host_modules +][+ IF bootstrap +] @@ -1358,7 +1367,14 @@ stage[+id+]-end:: @UNDO_LINK_TO_DIR@ [+ IF prev +] ; \ set prev-[+module+] stage[+prev+]-[+module+] ; \ @UNDO_LINK_TO_DIR@ [+ ENDIF prev +] -@endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +] +@endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +][+ + FOR target_modules +][+ IF bootstrap +] +@if target-[+ module +] + @cd $(HOST_SUBDIR); set [+module+] stage[+id+]-[+module+] ; \ + @UNDO_LINK_TO_DIR@ [+ IF prev +] ; \ + set prev-[+module+] stage[+prev+]-[+module+] ; \ + @UNDO_LINK_TO_DIR@ [+ ENDIF prev +] +@endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR target_modules +] # Bubble a bugfix through all the stages up to stage [+id+]. They # are remade, but not reconfigured. The next stage (if any) will not @@ -1467,7 +1483,10 @@ do-distclean: distclean-stage1 # -------------------------------------- # Generic dependencies for target modules on host stuff, especially gcc -[+ FOR target_modules +] +[+ FOR target_modules +][+ IF bootstrap +] +@if gcc-bootstrap[+ FOR bootstrap_stage +] +configure-stage[+id+]-target-[+module+]: maybe-all-stage[+id+]-gcc[+ ENDFOR +] +@endif gcc-bootstrap[+ ENDIF bootstrap +] configure-target-[+module+]: maybe-all-gcc [+ ENDFOR target_modules +] @@ -1535,7 +1554,6 @@ configure-target-[+module+]: maybe-all-t "prebootstrap" (if (or (= (dep-subtarget "on") "install-") - (=* (dep-module "on") "target-") (not (hash-ref boot-modules (dep-module "module"))) (not (hash-ref boot-modules (dep-module "on")))) "normal" @@ -1549,6 +1567,10 @@ configure-target-[+module+]: maybe-all-t (if (exist? "bootstrap") (hash-create-handle! boot-modules (get "module") #t)) "" +][+ ENDFOR host_modules +] +[+ FOR target_modules +][+ + (if (exist? "bootstrap") + (hash-create-handle! boot-modules (string-append "target-" (get "module")) #t)) + "" +][+ ENDFOR target_modules +] # With all the machinery above in place, it is pretty easy to generate # dependencies. Host dependencies are a bit more complex because we have diff -uprN binutils-2.16.90.0.3/opcodes/arm-dis.c binutils-2.16.91.0.1/opcodes/arm-dis.c --- binutils-2.16.90.0.3/opcodes/arm-dis.c 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/opcodes/arm-dis.c 2005-06-22 13:53:36.254094462 -0700 @@ -24,21 +24,17 @@ #include "dis-asm.h" #include "opcode/arm.h" -#include "arm-opc.h" -#include "coff/internal.h" -#include "libcoff.h" #include "opintl.h" #include "safe-ctype.h" /* FIXME: This shouldn't be done here. */ +#include "coff/internal.h" +#include "libcoff.h" #include "elf-bfd.h" #include "elf/internal.h" #include "elf/arm.h" -#ifndef streq -#define streq(a,b) (strcmp ((a), (b)) == 0) -#endif - +/* FIXME: Belongs in global header. */ #ifndef strneq #define strneq(a,b,n) (strncmp ((a), (b), (n)) == 0) #endif @@ -47,69 +43,73 @@ #define NUM_ELEM(a) (sizeof (a) / sizeof (a)[0]) #endif -#define WORD_ADDRESS(pc) ((pc) & ~0x3) +struct opcode32 +{ + unsigned long arch; /* Architecture defining this insn. */ + unsigned long value, mask; /* Recognise insn if (op&mask)==value. */ + const char *assembler; /* How to disassemble this insn. */ +}; + +struct opcode16 +{ + unsigned long arch; /* Architecture defining this insn. */ + unsigned short value, mask; /* Recognise insn if (op&mask)==value. */ + const char *assembler; /* How to disassemble this insn. */ +}; + +/* Opcode tables: ARM, 16-bit Thumb, 32-bit Thumb. All three are partially + ordered: they must be searched linearly from the top to obtain a correct + match. */ + +/* print_insn_arm recognizes the following format control codes: -/* Format of the disassembler control string : - %% % + + %a print address for ldr/str instruction + %s print address for ldr/str halfword/signextend instruction + %b print branch destination + %c print condition code (always bits 28-31) + %m print register mask for ldm/stm instruction + %o print operand2 (immediate or register + shift) + %p print 'p' iff bits 12-15 are 15 + %t print 't' iff bit 21 set and bit 24 clear + %A print address for ldc/stc/ldf/stf instruction + %B print arm BLX(1) destination + %I print cirrus signed shift immediate: bits 0..3|4..6 + %C print the PSR sub type. + %F print the COUNT field of a LFM/SFM instruction. + %P print floating point precision in arithmetic insn + %Q print floating point precision in ldf/stf insn + %R print floating point rounding mode + + %r print as an ARM register %d print the bitfield in decimal + %W print the bitfield plus one in decimal %x print the bitfield in hex %X print the bitfield as 1 hex digit without leading "0x" - %W print the bitfield plus one in decimal - %r print as an ARM register %f print a floating point constant if >7 else a floating point register + %w print as an iWMMXt width field - [bhwd]ss/us + %g print as an iWMMXt 64-bit register + %G print as an iWMMXt general purpose or control register + %y print a single precision VFP reg. Codes: 0=>Sm, 1=>Sd, 2=>Sn, 3=>multi-list, 4=>Sm pair %z print a double precision VFP reg Codes: 0=>Dm, 1=>Dd, 2=>Dn, 3=>multi-list - %c print condition code (always bits 28-31) - %P print floating point precision in arithmetic insn - %Q print floating point precision in ldf/stf insn - %R print floating point rounding mode %'c print specified char iff bit is one %`c print specified char iff bit is zero %?ab print a if bit is one else print b - %p print 'p' iff bits 12-15 are 15 - %t print 't' iff bit 21 set and bit 24 clear - %o print operand2 (immediate or register + shift) - %a print address for ldr/str instruction - %s print address for ldr/str halfword/signextend instruction - %b print branch destination - %B print arm BLX(1) destination - %A print address for ldc/stc/ldf/stf instruction - %m print register mask for ldm/stm instruction - %C print the PSR sub type. - %F print the COUNT field of a LFM/SFM instruction. - %E print the LSB and WIDTH fields of a BFI or BFC instruction. - %V print the 16-bit immediate field of a MOVT or MOVW instruction. -IWMMXT specific format options: - %g print as an iWMMXt 64-bit register - %G print as an iWMMXt general purpose or control register - %w print as an iWMMXt width field - [bhwd]ss/us - %Z print the Immediate of a WSHUFH instruction. + %L print as an iWMMXt N/M width field. - %l like 'A' except use byte offsets for 'B' & 'H' versions -Thumb specific format options: - %D print Thumb register (bits 0..2 as high number if bit 7 set) - %S print Thumb register (bits 3..5 as high number if bit 6 set) - %I print bitfield as a signed decimal - (top bit of range being the sign bit) - %M print Thumb register mask - %N print Thumb register mask (with LR) - %O print Thumb register mask (with PC) - %T print Thumb condition code (always bits 8-11) - %I print cirrus signed shift immediate: bits 0..3|4..6 - %B print Thumb branch destination (signed displacement) - %W print (bitfield * 4) as a decimal - %H print (bitfield * 2) as a decimal - %a print (bitfield * 4) as a pc-rel offset + decoded symbol - %e print arm SMI operand (bits 0..7,8..19). */ + %Z print the Immediate of a WSHUFH instruction. + %l like 'A' except use byte offsets for 'B' & 'H' versions. -/* Note: There is a partial ordering in this table - it must be searched from - the top to obtain a correct match. */ + %e print arm SMI operand (bits 0..7,8..19). + %E print the LSB and WIDTH fields of a BFI or BFC instruction. + %V print the 16-bit immediate field of a MOVT or MOVW instruction. */ -static const struct arm_opcode arm_opcodes[] = +static const struct opcode32 arm_opcodes[] = { /* ARM instructions. */ {ARM_EXT_V1, 0xe1a00000, 0xffffffff, "nop\t\t\t(mov r0,r0)"}, @@ -631,7 +631,28 @@ static const struct arm_opcode arm_opcod {0, 0x00000000, 0x00000000, 0} }; -static const struct thumb_opcode thumb_opcodes[] = +/* print_insn_thumb16 recognizes the following format control codes: + + %S print Thumb register (bits 3..5 as high number if bit 6 set) + %D print Thumb register (bits 0..2 as high number if bit 7 set) + %I print bitfield as a signed decimal + (top bit of range being the sign bit) + %N print Thumb register mask (with LR) + %O print Thumb register mask (with PC) + %M print Thumb register mask + %b print CZB's 6-bit unsigned branch destination + %s print Thumb right-shift immediate (6..10; 0 == 32). + %r print bitfield as an ARM register + %d print bitfield as a decimal + %H print (bitfield * 2) as a decimal + %W print (bitfield * 4) as a decimal + %a print (bitfield * 4) as a pc-rel offset + decoded symbol + %B print Thumb branch destination (signed displacement) + %c print bitfield as a condition code + %'c print specified char iff bit is one + %?ab print a if bit is one else print b. */ + +static const struct opcode16 thumb_opcodes[] = { /* Thumb instructions. */ @@ -641,11 +662,23 @@ static const struct thumb_opcode thumb_o {ARM_EXT_V6K, 0xbf20, 0xffff, "wfe"}, {ARM_EXT_V6K, 0xbf30, 0xffff, "wfi"}, {ARM_EXT_V6K, 0xbf40, 0xffff, "sev"}, + {ARM_EXT_V6K, 0xbf00, 0xff0f, "nop\t{%4-7d}"}, + + /* ARM V6T2 instructions. */ + {ARM_EXT_V6T2, 0xb900, 0xfd00, "cbnz\t%0-2r, %b"}, + {ARM_EXT_V6T2, 0xb100, 0xfd00, "cbz\t%0-2r, %b"}, + {ARM_EXT_V6T2, 0xbf08, 0xff0f, "it\t%4-7c"}, + {ARM_EXT_V6T2, 0xbf14, 0xff17, "it%3?te\t%4-7c"}, + {ARM_EXT_V6T2, 0xbf04, 0xff17, "it%3?et\t%4-7c"}, + {ARM_EXT_V6T2, 0xbf12, 0xff13, "it%3?te%2?te\t%4-7c"}, + {ARM_EXT_V6T2, 0xbf02, 0xff13, "it%3?et%2?et\t%4-7c"}, + {ARM_EXT_V6T2, 0xbf11, 0xff11, "it%3?te%2?te%1?te\t%4-7c"}, + {ARM_EXT_V6T2, 0xbf01, 0xff11, "it%3?et%2?et%1?et\t%4-7c"}, /* ARM V6. */ {ARM_EXT_V6, 0xb660, 0xfff8, "cpsie\t%2'a%1'i%0'f"}, {ARM_EXT_V6, 0xb670, 0xfff8, "cpsid\t%2'a%1'i%0'f"}, - {ARM_EXT_V6, 0x4600, 0xffc0, "cpy\t%0-2r, %3-5r"}, + {ARM_EXT_V6, 0x4600, 0xffc0, "mov\t%0-2r, %3-5r"}, {ARM_EXT_V6, 0xba00, 0xffc0, "rev\t%0-2r, %3-5r"}, {ARM_EXT_V6, 0xba40, 0xffc0, "rev16\t%0-2r, %3-5r"}, {ARM_EXT_V6, 0xbac0, 0xffc0, "revsh\t%0-2r, %3-5r"}, @@ -657,34 +690,27 @@ static const struct thumb_opcode thumb_o /* ARM V5 ISA extends Thumb. */ {ARM_EXT_V5T, 0xbe00, 0xff00, "bkpt\t%0-7x"}, - /* Note: this is BLX(2). BLX(1) is done in arm-dis.c/print_insn_thumb() - as an extension of the special processing there for Thumb BL. - BL and BLX(1) involve 2 successive 16-bit instructions, which must - always appear together in the correct order. So, the empty - string is put in this table, and the string interpreter takes - to mean it has a pair of BL-ish instructions. */ + /* This is BLX(2). BLX(1) is a 32-bit instruction. */ {ARM_EXT_V5T, 0x4780, 0xff87, "blx\t%3-6r"}, /* note: 4 bit register number. */ /* ARM V4T ISA (Thumb v1). */ {ARM_EXT_V4T, 0x46C0, 0xFFFF, "nop\t\t\t(mov r8, r8)"}, - /* Format 5 instructions do not update the PSR. */ - {ARM_EXT_V4T, 0x1C00, 0xFFC0, "mov\t%0-2r, %3-5r\t\t(add %0-2r, %3-5r, #%6-8d)"}, /* Format 4. */ - {ARM_EXT_V4T, 0x4000, 0xFFC0, "and\t%0-2r, %3-5r"}, - {ARM_EXT_V4T, 0x4040, 0xFFC0, "eor\t%0-2r, %3-5r"}, - {ARM_EXT_V4T, 0x4080, 0xFFC0, "lsl\t%0-2r, %3-5r"}, - {ARM_EXT_V4T, 0x40C0, 0xFFC0, "lsr\t%0-2r, %3-5r"}, - {ARM_EXT_V4T, 0x4100, 0xFFC0, "asr\t%0-2r, %3-5r"}, - {ARM_EXT_V4T, 0x4140, 0xFFC0, "adc\t%0-2r, %3-5r"}, - {ARM_EXT_V4T, 0x4180, 0xFFC0, "sbc\t%0-2r, %3-5r"}, - {ARM_EXT_V4T, 0x41C0, 0xFFC0, "ror\t%0-2r, %3-5r"}, + {ARM_EXT_V4T, 0x4000, 0xFFC0, "ands\t%0-2r, %3-5r"}, + {ARM_EXT_V4T, 0x4040, 0xFFC0, "eors\t%0-2r, %3-5r"}, + {ARM_EXT_V4T, 0x4080, 0xFFC0, "lsls\t%0-2r, %3-5r"}, + {ARM_EXT_V4T, 0x40C0, 0xFFC0, "lsrs\t%0-2r, %3-5r"}, + {ARM_EXT_V4T, 0x4100, 0xFFC0, "asrs\t%0-2r, %3-5r"}, + {ARM_EXT_V4T, 0x4140, 0xFFC0, "adcs\t%0-2r, %3-5r"}, + {ARM_EXT_V4T, 0x4180, 0xFFC0, "sbcs\t%0-2r, %3-5r"}, + {ARM_EXT_V4T, 0x41C0, 0xFFC0, "rors\t%0-2r, %3-5r"}, {ARM_EXT_V4T, 0x4200, 0xFFC0, "tst\t%0-2r, %3-5r"}, - {ARM_EXT_V4T, 0x4240, 0xFFC0, "neg\t%0-2r, %3-5r"}, + {ARM_EXT_V4T, 0x4240, 0xFFC0, "negs\t%0-2r, %3-5r"}, {ARM_EXT_V4T, 0x4280, 0xFFC0, "cmp\t%0-2r, %3-5r"}, {ARM_EXT_V4T, 0x42C0, 0xFFC0, "cmn\t%0-2r, %3-5r"}, - {ARM_EXT_V4T, 0x4300, 0xFFC0, "orr\t%0-2r, %3-5r"}, - {ARM_EXT_V4T, 0x4340, 0xFFC0, "mul\t%0-2r, %3-5r"}, - {ARM_EXT_V4T, 0x4380, 0xFFC0, "bic\t%0-2r, %3-5r"}, - {ARM_EXT_V4T, 0x43C0, 0xFFC0, "mvn\t%0-2r, %3-5r"}, + {ARM_EXT_V4T, 0x4300, 0xFFC0, "orrs\t%0-2r, %3-5r"}, + {ARM_EXT_V4T, 0x4340, 0xFFC0, "muls\t%0-2r, %3-5r"}, + {ARM_EXT_V4T, 0x4380, 0xFFC0, "bics\t%0-2r, %3-5r"}, + {ARM_EXT_V4T, 0x43C0, 0xFFC0, "mvns\t%0-2r, %3-5r"}, /* format 13 */ {ARM_EXT_V4T, 0xB000, 0xFF80, "add\tsp, #%0-6W"}, {ARM_EXT_V4T, 0xB080, 0xFF80, "sub\tsp, #%0-6W"}, @@ -697,9 +723,9 @@ static const struct thumb_opcode thumb_o {ARM_EXT_V4T, 0xB400, 0xFE00, "push\t%N"}, {ARM_EXT_V4T, 0xBC00, 0xFE00, "pop\t%O"}, /* format 2 */ - {ARM_EXT_V4T, 0x1800, 0xFE00, "add\t%0-2r, %3-5r, %6-8r"}, + {ARM_EXT_V4T, 0x1800, 0xFE00, "adds\t%0-2r, %3-5r, %6-8r"}, {ARM_EXT_V4T, 0x1A00, 0xFE00, "sub\t%0-2r, %3-5r, %6-8r"}, - {ARM_EXT_V4T, 0x1C00, 0xFE00, "add\t%0-2r, %3-5r, #%6-8d"}, + {ARM_EXT_V4T, 0x1C00, 0xFE00, "adds\t%0-2r, %3-5r, #%6-8d"}, {ARM_EXT_V4T, 0x1E00, 0xFE00, "sub\t%0-2r, %3-5r, #%6-8d"}, /* format 8 */ {ARM_EXT_V4T, 0x5200, 0xFE00, "strh\t%0-2r, [%3-5r, %6-8r]"}, @@ -709,14 +735,14 @@ static const struct thumb_opcode thumb_o {ARM_EXT_V4T, 0x5000, 0xFA00, "str%10'b\t%0-2r, [%3-5r, %6-8r]"}, {ARM_EXT_V4T, 0x5800, 0xFA00, "ldr%10'b\t%0-2r, [%3-5r, %6-8r]"}, /* format 1 */ - {ARM_EXT_V4T, 0x0000, 0xF800, "lsl\t%0-2r, %3-5r, #%6-10d"}, - {ARM_EXT_V4T, 0x0800, 0xF800, "lsr\t%0-2r, %3-5r, #%6-10d"}, - {ARM_EXT_V4T, 0x1000, 0xF800, "asr\t%0-2r, %3-5r, #%6-10d"}, + {ARM_EXT_V4T, 0x0000, 0xF800, "lsls\t%0-2r, %3-5r, #%6-10d"}, + {ARM_EXT_V4T, 0x0800, 0xF800, "lsrs\t%0-2r, %3-5r, %s"}, + {ARM_EXT_V4T, 0x1000, 0xF800, "asrs\t%0-2r, %3-5r, %s"}, /* format 3 */ - {ARM_EXT_V4T, 0x2000, 0xF800, "mov\t%8-10r, #%0-7d"}, + {ARM_EXT_V4T, 0x2000, 0xF800, "movs\t%8-10r, #%0-7d"}, {ARM_EXT_V4T, 0x2800, 0xF800, "cmp\t%8-10r, #%0-7d"}, - {ARM_EXT_V4T, 0x3000, 0xF800, "add\t%8-10r, #%0-7d"}, - {ARM_EXT_V4T, 0x3800, 0xF800, "sub\t%8-10r, #%0-7d"}, + {ARM_EXT_V4T, 0x3000, 0xF800, "adds\t%8-10r, #%0-7d"}, + {ARM_EXT_V4T, 0x3800, 0xF800, "subs\t%8-10r, #%0-7d"}, /* format 6 */ {ARM_EXT_V4T, 0x4800, 0xF800, "ldr\t%8-10r, [pc, #%0-7W]\t(%0-7a)"}, /* TODO: Disassemble PC relative "LDR rD,=" */ /* format 9 */ @@ -734,55 +760,291 @@ static const struct thumb_opcode thumb_o {ARM_EXT_V4T, 0xA000, 0xF800, "add\t%8-10r, pc, #%0-7W\t(adr %8-10r,%0-7a)"}, {ARM_EXT_V4T, 0xA800, 0xF800, "add\t%8-10r, sp, #%0-7W"}, /* format 15 */ - {ARM_EXT_V4T, 0xC000, 0xF800, "stmia\t%8-10r!,%M"}, - {ARM_EXT_V4T, 0xC800, 0xF800, "ldmia\t%8-10r!,%M"}, - /* format 18 */ - {ARM_EXT_V4T, 0xE000, 0xF800, "b\t%0-10B"}, - {ARM_EXT_V4T, 0xE800, 0xF800, "undefined"}, - /* format 19 */ - {ARM_EXT_V4T, 0xF000, 0xF800, ""}, /* special processing required in disassembler */ - {ARM_EXT_V4T, 0xF800, 0xF800, "second half of BL instruction %0-15x"}, - /* format 16 */ - {ARM_EXT_V4T, 0xD000, 0xFF00, "beq\t%0-7B"}, - {ARM_EXT_V4T, 0xD100, 0xFF00, "bne\t%0-7B"}, - {ARM_EXT_V4T, 0xD200, 0xFF00, "bcs\t%0-7B"}, - {ARM_EXT_V4T, 0xD300, 0xFF00, "bcc\t%0-7B"}, - {ARM_EXT_V4T, 0xD400, 0xFF00, "bmi\t%0-7B"}, - {ARM_EXT_V4T, 0xD500, 0xFF00, "bpl\t%0-7B"}, - {ARM_EXT_V4T, 0xD600, 0xFF00, "bvs\t%0-7B"}, - {ARM_EXT_V4T, 0xD700, 0xFF00, "bvc\t%0-7B"}, - {ARM_EXT_V4T, 0xD800, 0xFF00, "bhi\t%0-7B"}, - {ARM_EXT_V4T, 0xD900, 0xFF00, "bls\t%0-7B"}, - {ARM_EXT_V4T, 0xDA00, 0xFF00, "bge\t%0-7B"}, - {ARM_EXT_V4T, 0xDB00, 0xFF00, "blt\t%0-7B"}, - {ARM_EXT_V4T, 0xDC00, 0xFF00, "bgt\t%0-7B"}, - {ARM_EXT_V4T, 0xDD00, 0xFF00, "ble\t%0-7B"}, + {ARM_EXT_V4T, 0xC000, 0xF800, "stmia\t%8-10r!, %M"}, + {ARM_EXT_V4T, 0xC800, 0xF800, "ldmia\t%8-10r!, %M"}, /* format 17 */ - {ARM_EXT_V4T, 0xDE00, 0xFF00, "bal\t%0-7B"}, {ARM_EXT_V4T, 0xDF00, 0xFF00, "swi\t%0-7d"}, - /* format 9 */ - {ARM_EXT_V4T, 0x6000, 0xF800, "str\t%0-2r, [%3-5r, #%6-10W]"}, - {ARM_EXT_V4T, 0x6800, 0xF800, "ldr\t%0-2r, [%3-5r, #%6-10W]"}, - {ARM_EXT_V4T, 0x7000, 0xF800, "strb\t%0-2r, [%3-5r, #%6-10d]"}, - {ARM_EXT_V4T, 0x7800, 0xF800, "ldrb\t%0-2r, [%3-5r, #%6-10d]"}, - /* the rest */ - {ARM_EXT_V1, 0x0000, 0x0000, "undefined instruction %0-15x"}, - {0, 0x0000, 0x0000, 0} + /* format 16 */ + {ARM_EXT_V4T, 0xD000, 0xF000, "b%8-11c.n\t%0-7B"}, + /* format 18 */ + {ARM_EXT_V4T, 0xE000, 0xF800, "b.n\t%0-10B"}, + + /* The E800 .. FFFF range is unconditionally redirected to the + 32-bit table, because even in pre-V6T2 ISAs, BL and BLX(1) pairs + are processed via that table. Thus, we can never encounter a + bare "second half of BL/BLX(1)" instruction here. */ + {ARM_EXT_V1, 0x0000, 0x0000, "undefined"}, + {0, 0, 0, 0} }; -static char * arm_conditional[] = +/* Thumb32 opcodes use the same table structure as the ARM opcodes. + We adopt the convention that hw1 is the high 16 bits of .value and + .mask, hw2 the low 16 bits. + + print_insn_thumb32 recognizes the following format control codes: + + %% % + + %I print a 12-bit immediate from hw1[10],hw2[14:12,7:0] + %M print a modified 12-bit immediate (same location) + %J print a 16-bit immediate from hw1[3:0,10],hw2[14:12,7:0] + %K print a 16-bit immediate from hw2[3:0],hw1[3:0],hw2[11:4] + %S print a possibly-shifted Rm + + %a print the address of a plain load/store + %A print the address of a coprocessor load/store + %w print the width and signedness of a core load/store + %m print register mask for ldm/stm + + %E print the lsb and width fields of a bfc/bfi instruction + %F print the lsb and width fields of a sbfx/ubfx instruction + %b print a conditional branch offset + %B print an unconditional branch offset + %s print the shift field of an SSAT instruction + %R print the rotation field of an SXT instruction + + %d print bitfield in decimal + %W print bitfield*4 in decimal + %r print bitfield as an ARM register + %c print bitfield as a condition code + + %'c print "c" iff bit is one + %`c print "c" iff bit is zero + %?ab print "a" if bit is one, else "b" + + With one exception at the bottom (done because BL and BLX(1) need + to come dead last), this table was machine-sorted first in + decreasing order of number of bits set in the mask, then in + increasing numeric order of mask, then in increasing numeric order + of opcode. This order is not the clearest for a human reader, but + is guaranteed never to catch a special-case bit pattern with a more + general mask, which is important, because this instruction encoding + makes heavy use of special-case bit patterns. */ +static const struct opcode32 thumb32_opcodes[] = +{ + /* Instructions defined in the basic V6T2 set. */ + {ARM_EXT_V6T2, 0xf3af8000, 0xffffffff, "nop.w"}, + {ARM_EXT_V6T2, 0xf3af8001, 0xffffffff, "yield.w"}, + {ARM_EXT_V6T2, 0xf3af8002, 0xffffffff, "wfe.w"}, + {ARM_EXT_V6T2, 0xf3af8003, 0xffffffff, "wfi.w"}, + {ARM_EXT_V6T2, 0xf3af9004, 0xffffffff, "sev.w"}, + {ARM_EXT_V6T2, 0xf3af8000, 0xffffff00, "nop.w\t{%0-7d}"}, + + {ARM_EXT_V6T2, 0xf3bf8f2f, 0xffffffff, "clrex"}, + {ARM_EXT_V6T2, 0xf3af8400, 0xffffff1f, "cpsie.w\t%7'a%6'i%5'f"}, + {ARM_EXT_V6T2, 0xf3af8600, 0xffffff1f, "cpsid.w\t%7'a%6'i%5'f"}, + {ARM_EXT_V6T2, 0xf3c08f00, 0xfff0ffff, "bxj\t%16-19r"}, + {ARM_EXT_V6T2, 0xe810c000, 0xffd0ffff, "rfedb\t%16-19r%21'!"}, + {ARM_EXT_V6T2, 0xe990c000, 0xffd0ffff, "rfeia\t%16-19r%21'!"}, + {ARM_EXT_V6T2, 0xf3ef8000, 0xffeff0ff, "mrs\t%8-11r, %20?CSPSR"}, + {ARM_EXT_V6T2, 0xf3af8100, 0xffffffe0, "cps\t#%0-4d"}, + {ARM_EXT_V6T2, 0xe8d0f000, 0xfff0fff0, "tbb\t[%16-19r, %0-3r]"}, + {ARM_EXT_V6T2, 0xe8d0f010, 0xfff0fff0, "tbh\t[%16-19r, %0-3r]"}, + {ARM_EXT_V6T2, 0xf3af8500, 0xffffff00, "cpsie\t%7'a%6'i%5'f, #%0-4d"}, + {ARM_EXT_V6T2, 0xf3af8700, 0xffffff00, "cpsid\t%7'a%6'i%5'f, #%0-4d"}, + {ARM_EXT_V6T2, 0xf3de8f00, 0xffffff00, "subs\tpc, lr, #%0-7d"}, + {ARM_EXT_V6T2, 0xf3808000, 0xffe0f0ff, "msr\t%20?CSPSR_%8'c%9'x%10's%11'f, %16-19r"}, + {ARM_EXT_V6T2, 0xe8500f00, 0xfff00fff, "ldrex\t%12-15r, [%16-19r]"}, + {ARM_EXT_V6T2, 0xe8d00f4f, 0xfff00fef, "ldrex%4?hb\t%12-15r, [%16-19r]"}, + {ARM_EXT_V6T2, 0xe800c000, 0xffd0ffe0, "srsdb\t#%0-4d%21'!"}, + {ARM_EXT_V6T2, 0xe980c000, 0xffd0ffe0, "srsia\t#%0-4d%21'!"}, + {ARM_EXT_V6T2, 0xfa0ff080, 0xfffff0c0, "sxth.w\t%8-11r, %0-3r%R"}, + {ARM_EXT_V6T2, 0xfa1ff080, 0xfffff0c0, "uxth.w\t%8-11r, %0-3r%R"}, + {ARM_EXT_V6T2, 0xfa2ff080, 0xfffff0c0, "sxtb16\t%8-11r, %0-3r%R"}, + {ARM_EXT_V6T2, 0xfa3ff080, 0xfffff0c0, "uxtb16\t%8-11r, %0-3r%R"}, + {ARM_EXT_V6T2, 0xfa4ff080, 0xfffff0c0, "sxtb.w\t%8-11r, %0-3r%R"}, + {ARM_EXT_V6T2, 0xfa5ff080, 0xfffff0c0, "uxtb.w\t%8-11r, %0-3r%R"}, + {ARM_EXT_V6T2, 0xe8400000, 0xfff000ff, "strex\t%8-11r, %12-15r, [%16-19r]"}, + {ARM_EXT_V6T2, 0xe8d0007f, 0xfff000ff, "ldrexd\t%12-15r, %8-11r, [%16-19r]"}, + {ARM_EXT_V6T2, 0xfa80f000, 0xfff0f0f0, "sadd8\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfa80f010, 0xfff0f0f0, "qadd8\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfa80f020, 0xfff0f0f0, "shadd8\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfa80f040, 0xfff0f0f0, "uadd8\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfa80f050, 0xfff0f0f0, "uqadd8\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfa80f060, 0xfff0f0f0, "uhadd8\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfa80f080, 0xfff0f0f0, "qadd\t%8-11r, %0-3r, %16-19r"}, + {ARM_EXT_V6T2, 0xfa80f090, 0xfff0f0f0, "qdadd\t%8-11r, %0-3r, %16-19r"}, + {ARM_EXT_V6T2, 0xfa80f0a0, 0xfff0f0f0, "qsub\t%8-11r, %0-3r, %16-19r"}, + {ARM_EXT_V6T2, 0xfa80f0b0, 0xfff0f0f0, "qdsub\t%8-11r, %0-3r, %16-19r"}, + {ARM_EXT_V6T2, 0xfa90f000, 0xfff0f0f0, "sadd16\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfa90f010, 0xfff0f0f0, "qadd16\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfa90f020, 0xfff0f0f0, "shadd16\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfa90f040, 0xfff0f0f0, "uadd16\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfa90f050, 0xfff0f0f0, "uqadd16\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfa90f060, 0xfff0f0f0, "uhadd16\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfa90f080, 0xfff0f0f0, "rev.w\t%8-11r, %16-19r"}, + {ARM_EXT_V6T2, 0xfa90f090, 0xfff0f0f0, "rev16.w\t%8-11r, %16-19r"}, + {ARM_EXT_V6T2, 0xfa90f0a0, 0xfff0f0f0, "rbit\t%8-11r, %16-19r"}, + {ARM_EXT_V6T2, 0xfa90f0b0, 0xfff0f0f0, "revsh.w\t%8-11r, %16-19r"}, + {ARM_EXT_V6T2, 0xfaa0f000, 0xfff0f0f0, "saddsubx\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfaa0f010, 0xfff0f0f0, "qaddsubx\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfaa0f020, 0xfff0f0f0, "shaddsubx\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfaa0f040, 0xfff0f0f0, "uaddsubx\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfaa0f050, 0xfff0f0f0, "uqaddsubx\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfaa0f060, 0xfff0f0f0, "uhaddsubx\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfaa0f080, 0xfff0f0f0, "sel\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfab0f080, 0xfff0f0f0, "clz\t%8-11r, %16-19r"}, + {ARM_EXT_V6T2, 0xfac0f000, 0xfff0f0f0, "ssub8\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfac0f010, 0xfff0f0f0, "qsub8\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfac0f020, 0xfff0f0f0, "shsub8\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfac0f040, 0xfff0f0f0, "usub8\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfac0f050, 0xfff0f0f0, "uqsub8\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfac0f060, 0xfff0f0f0, "uhsub8\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfad0f000, 0xfff0f0f0, "ssub16\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfad0f010, 0xfff0f0f0, "qsub16\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfad0f020, 0xfff0f0f0, "shsub16\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfad0f040, 0xfff0f0f0, "usub16\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfad0f050, 0xfff0f0f0, "uqsub16\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfad0f060, 0xfff0f0f0, "uhsub16\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfae0f000, 0xfff0f0f0, "ssubaddx\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfae0f010, 0xfff0f0f0, "qsubaddx\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfae0f020, 0xfff0f0f0, "shsubaddx\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfae0f040, 0xfff0f0f0, "usubaddx\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfae0f050, 0xfff0f0f0, "uqsubaddx\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfae0f060, 0xfff0f0f0, "uhsubaddx\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfb00f000, 0xfff0f0f0, "mul.w\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfb70f000, 0xfff0f0f0, "usad8\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfa00f000, 0xffe0f0f0, "lsl%20's.w\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfa20f000, 0xffe0f0f0, "lsr%20's.w\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfa40f000, 0xffe0f0f0, "asr%20's.w\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfa60f000, 0xffe0f0f0, "ror%20's.w\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xe8c00f40, 0xfff00fe0, "strex%4?hb\t%0-3r, %12-15r, [%16-19r]"}, + {ARM_EXT_V6T2, 0xf3200000, 0xfff0f0e0, "ssat16\t%8-11r, #%0-4d, %16-19r"}, + {ARM_EXT_V6T2, 0xf3a00000, 0xfff0f0e0, "usat16\t%8-11r, #%0-4d, %16-19r"}, + {ARM_EXT_V6T2, 0xfb20f000, 0xfff0f0e0, "smuad%4'x\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfb30f000, 0xfff0f0e0, "smulw%4?tb\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfb40f000, 0xfff0f0e0, "smusd%4'x\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfb50f000, 0xfff0f0e0, "smmul%4'r\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfa00f080, 0xfff0f0c0, "sxtah\t%8-11r, %16-19r, %0-3r%R"}, + {ARM_EXT_V6T2, 0xfa10f080, 0xfff0f0c0, "uxtah\t%8-11r, %16-19r, %0-3r%R"}, + {ARM_EXT_V6T2, 0xfa20f080, 0xfff0f0c0, "sxtab16\t%8-11r, %16-19r, %0-3r%R"}, + {ARM_EXT_V6T2, 0xfa30f080, 0xfff0f0c0, "uxtab16\t%8-11r, %16-19r, %0-3r%R"}, + {ARM_EXT_V6T2, 0xfa40f080, 0xfff0f0c0, "sxtab\t%8-11r, %16-19r, %0-3r%R"}, + {ARM_EXT_V6T2, 0xfa50f080, 0xfff0f0c0, "uxtab\t%8-11r, %16-19r, %0-3r%R"}, + {ARM_EXT_V6T2, 0xfb10f000, 0xfff0f0c0, "smul%5?tb%4?tb\t%8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xf36f0000, 0xffff8020, "bfc\t%8-11r, %E"}, + {ARM_EXT_V6T2, 0xea100f00, 0xfff08f00, "tst.w\t%16-19r, %S"}, + {ARM_EXT_V6T2, 0xea900f00, 0xfff08f00, "teq\t%16-19r, %S"}, + {ARM_EXT_V6T2, 0xeb100f00, 0xfff08f00, "cmn.w\t%16-19r, %S"}, + {ARM_EXT_V6T2, 0xebb00f00, 0xfff08f00, "cmp.w\t%16-19r, %S"}, + {ARM_EXT_V6T2, 0xf0100f00, 0xfbf08f00, "tst.w\t%16-19r, %M"}, + {ARM_EXT_V6T2, 0xf0900f00, 0xfbf08f00, "teq\t%16-19r, %M"}, + {ARM_EXT_V6T2, 0xf1100f00, 0xfbf08f00, "cmn.w\t%16-19r, %M"}, + {ARM_EXT_V6T2, 0xf1b00f00, 0xfbf08f00, "cmp.w\t%16-19r, %M"}, + {ARM_EXT_V6T2, 0xea4f0000, 0xffef8000, "mov%20's.w\t%8-11r, %S"}, + {ARM_EXT_V6T2, 0xea6f0000, 0xffef8000, "mvn%20's.w\t%8-11r, %S"}, + {ARM_EXT_V6T2, 0xe8c00070, 0xfff000f0, "strexd\t%0-3r, %12-15r, %8-11r, [%16-19r]"}, + {ARM_EXT_V6T2, 0xfb000000, 0xfff000f0, "mla\t%8-11r, %16-19r, %0-3r, %12-15r"}, + {ARM_EXT_V6T2, 0xfb000010, 0xfff000f0, "mls\t%8-11r, %16-19r, %0-3r, %12-15r"}, + {ARM_EXT_V6T2, 0xfb700000, 0xfff000f0, "usada8\t%8-11r, %16-19r, %0-3r, %12-15r"}, + {ARM_EXT_V6T2, 0xfb800000, 0xfff000f0, "smull\t%12-15r, %8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfba00000, 0xfff000f0, "umull\t%12-15r, %8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfbc00000, 0xfff000f0, "smlal\t%12-15r, %8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfbe00000, 0xfff000f0, "umlal\t%12-15r, %8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfbe00060, 0xfff000f0, "umaal\t%12-15r, %8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xe8500f00, 0xfff00f00, "ldrex\t%12-15r, [%16-19r, #%0-7W]"}, + {ARM_EXT_V6T2, 0xf7f08000, 0xfff0f000, "smi\t%K"}, + {ARM_EXT_V6T2, 0xf04f0000, 0xfbef8000, "mov%20's.w\t%8-11r, %M"}, + {ARM_EXT_V6T2, 0xf06f0000, 0xfbef8000, "mvn%20's.w\t%8-11r, %M"}, + {ARM_EXT_V6T2, 0xf810f000, 0xff70f000, "pld\t%a"}, + {ARM_EXT_V6T2, 0xfb200000, 0xfff000e0, "smlad%4'x\t%8-11r, %16-19r, %0-3r, %12-15r"}, + {ARM_EXT_V6T2, 0xfb300000, 0xfff000e0, "smlaw%4?tb\t%8-11r, %16-19r, %0-3r, %12-15r"}, + {ARM_EXT_V6T2, 0xfb400000, 0xfff000e0, "smlsd%4'x\t%8-11r, %16-19r, %0-3r, %12-15r"}, + {ARM_EXT_V6T2, 0xfb500000, 0xfff000e0, "smmla%4'r\t%8-11r, %16-19r, %0-3r, %12-15r"}, + {ARM_EXT_V6T2, 0xfb600000, 0xfff000e0, "smmls%4'r\t%8-11r, %16-19r, %0-3r, %12-15r"}, + {ARM_EXT_V6T2, 0xfbc000c0, 0xfff000e0, "smlald%4'x\t%12-15r, %8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xfbd000c0, 0xfff000e0, "smlsld%4'x\t%12-15r, %8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xeac00000, 0xfff08030, "pkhbt\t%8-11r, %16-19r, %S"}, + {ARM_EXT_V6T2, 0xeac00020, 0xfff08030, "pkhtb\t%8-11r, %16-19r, %S"}, + {ARM_EXT_V6T2, 0xf3400000, 0xfff08020, "sbfx\t%8-11r, %16-19r, %F"}, + {ARM_EXT_V6T2, 0xf3c00000, 0xfff08020, "ubfx\t%8-11r, %16-19r, %F"}, + {ARM_EXT_V6T2, 0xf8000e00, 0xff900f00, "str%wt\t%12-15r, %a"}, + {ARM_EXT_V6T2, 0xfb100000, 0xfff000c0, "smla%5?tb%4?tb\t%8-11r, %16-19r, %0-3r, %12-15r"}, + {ARM_EXT_V6T2, 0xfbc00080, 0xfff000c0, "smlal%5?tb%4?tb\t%12-15r, %8-11r, %16-19r, %0-3r"}, + {ARM_EXT_V6T2, 0xf3600000, 0xfff08020, "bfi\t%8-11r, %16-19r, %E"}, + {ARM_EXT_V6T2, 0xf8100e00, 0xfe900f00, "ldr%wt\t%12-15r, %a"}, + {ARM_EXT_V6T2, 0xf3000000, 0xffd08020, "ssat\t%8-11r, #%0-4d, %16-19r%s"}, + {ARM_EXT_V6T2, 0xf3800000, 0xffd08020, "usat\t%8-11r, #%0-4d, %16-19r%s"}, + {ARM_EXT_V6T2, 0xee000010, 0xef1000f0, "mcr%28'2\tp%8-11d, %21-23d, %12-15r, cr%16-19d, cr%0-3d"}, + {ARM_EXT_V6T2, 0xee100010, 0xef1000f0, "mrc%28'2\tp%8-11d, %21-23d, %12-15r, cr%16-19d, cr%0-3d"}, + {ARM_EXT_V6T2, 0xf2000000, 0xfbf08000, "addw\t%8-11r, %16-19r, %I"}, + {ARM_EXT_V6T2, 0xf2400000, 0xfbf08000, "movw\t%8-11r, %J"}, + {ARM_EXT_V6T2, 0xf2a00000, 0xfbf08000, "subw\t%8-11r, %16-19r, %I"}, + {ARM_EXT_V6T2, 0xf2c00000, 0xfbf08000, "movt\t%8-11r, %J"}, + {ARM_EXT_V6T2, 0xea000000, 0xffe08000, "and%20's.w\t%8-11r, %16-19r, %S"}, + {ARM_EXT_V6T2, 0xea200000, 0xffe08000, "bic%20's.w\t%8-11r, %16-19r, %S"}, + {ARM_EXT_V6T2, 0xea400000, 0xffe08000, "orr%20's.w\t%8-11r, %16-19r, %S"}, + {ARM_EXT_V6T2, 0xea600000, 0xffe08000, "orn%20's\t%8-11r, %16-19r, %S"}, + {ARM_EXT_V6T2, 0xea800000, 0xffe08000, "eor%20's.w\t%8-11r, %16-19r, %S"}, + {ARM_EXT_V6T2, 0xeb000000, 0xffe08000, "add%20's.w\t%8-11r, %16-19r, %S"}, + {ARM_EXT_V6T2, 0xeb400000, 0xffe08000, "adc%20's.w\t%8-11r, %16-19r, %S"}, + {ARM_EXT_V6T2, 0xeb600000, 0xffe08000, "sbc%20's.w\t%8-11r, %16-19r, %S"}, + {ARM_EXT_V6T2, 0xeba00000, 0xffe08000, "sub%20's.w\t%8-11r, %16-19r, %S"}, + {ARM_EXT_V6T2, 0xebc00000, 0xffe08000, "rsb%20's\t%8-11r, %16-19r, %S"}, + {ARM_EXT_V6T2, 0xe8400000, 0xfff00000, "strex\t%8-11r, %12-15r, [%16-19r, #%0-7W]"}, + {ARM_EXT_V6T2, 0xee000000, 0xef0000f0, "cdp%28'2\tp%8-11d, %20-23d, cr%12-15d, cr%16-19d, cr%0-3d"}, + {ARM_EXT_V6T2, 0xec400000, 0xeff00000, "mcrr%28'2\tp%8-11d, %4-7d, %12-15r, %16-19r, cr%0-3d"}, + {ARM_EXT_V6T2, 0xec500000, 0xeff00000, "mrrc%28'2\tp%8-11d, %4-7d, %12-15r, %16-19r, cr%0-3d"}, + {ARM_EXT_V6T2, 0xf0000000, 0xfbe08000, "and%20's.w\t%8-11r, %16-19r, %M"}, + {ARM_EXT_V6T2, 0xf0200000, 0xfbe08000, "bic%20's.w\t%8-11r, %16-19r, %M"}, + {ARM_EXT_V6T2, 0xf0400000, 0xfbe08000, "orr%20's.w\t%8-11r, %16-19r, %M"}, + {ARM_EXT_V6T2, 0xf0600000, 0xfbe08000, "orn%20's\t%8-11r, %16-19r, %M"}, + {ARM_EXT_V6T2, 0xf0800000, 0xfbe08000, "eor%20's.w\t%8-11r, %16-19r, %M"}, + {ARM_EXT_V6T2, 0xf1000000, 0xfbe08000, "add%20's.w\t%8-11r, %16-19r, %M"}, + {ARM_EXT_V6T2, 0xf1400000, 0xfbe08000, "adc%20's.w\t%8-11r, %16-19r, %M"}, + {ARM_EXT_V6T2, 0xf1600000, 0xfbe08000, "sbc%20's.w\t%8-11r, %16-19r, %M"}, + {ARM_EXT_V6T2, 0xf1a00000, 0xfbe08000, "sub%20's.w\t%8-11r, %16-19r, %M"}, + {ARM_EXT_V6T2, 0xf1c00000, 0xfbe08000, "rsb%20's\t%8-11r, %16-19r, %M"}, + {ARM_EXT_V6T2, 0xe8800000, 0xffd00000, "stmia.w\t%16-19r%21'!, %m"}, + {ARM_EXT_V6T2, 0xe8900000, 0xffd00000, "ldmia.w\t%16-19r%21'!, %m"}, + {ARM_EXT_V6T2, 0xe9000000, 0xffd00000, "stmdb\t%16-19r%21'!, %m"}, + {ARM_EXT_V6T2, 0xe9100000, 0xffd00000, "ldmdb\t%16-19r%21'!, %m"}, + {ARM_EXT_V6T2, 0xe9c00000, 0xffd000ff, "strd\t%12-15r, %8-11r, [%16-19r]"}, + {ARM_EXT_V6T2, 0xe9d00000, 0xffd000ff, "ldrd\t%12-15r, %8-11r, [%16-19r]"}, + {ARM_EXT_V6T2, 0xe9400000, 0xff500000, "strd\t%12-15r, %8-11r, [%16-19r, #%23`-%0-7W]"}, + {ARM_EXT_V6T2, 0xe9500000, 0xff500000, "ldrd\t%12-15r, %8-11r, [%16-19r, #%23`-%0-7W]"}, + {ARM_EXT_V6T2, 0xee000010, 0xef100010, "mcr%28'2\tp%8-11d, %21-23d, %12-15r, cr%16-19d, cr%0-3d, %5-7d"}, + {ARM_EXT_V6T2, 0xee100010, 0xef100010, "mrc%28'2\tp%8-11d, %21-23d, %12-15r, cr%16-19d, cr%0-3d, %5-7d"}, + {ARM_EXT_V6T2, 0xf8000000, 0xff100000, "str%w.w\t%12-15r, %a"}, + {ARM_EXT_V6T2, 0xf8100000, 0xfe100000, "ldr%w.w\t%12-15r, %a"}, + {ARM_EXT_V6T2, 0xec000000, 0xee100000, "stc%28'2%22'l\tp%8-11d, cr%12-15d, %A"}, + {ARM_EXT_V6T2, 0xec100000, 0xee100000, "ldc%28'2%22'l\tp%8-11d, cr%12-15d, %A"}, + {ARM_EXT_V6T2, 0xee000000, 0xef000010, "cdp%28'2\tp%8-11d, %20-23d, cr%12-15d, cr%16-19d, cr%0-3d, %5-7d"}, + + /* Filter out Bcc with cond=E or F, which are used for other instructions. */ + {ARM_EXT_V6T2, 0xf3c08000, 0xfbc0d000, "undefined (bcc, cond=0xF)"}, + {ARM_EXT_V6T2, 0xf3808000, 0xfbc0d000, "undefined (bcc, cond=0xE)"}, + {ARM_EXT_V6T2, 0xf0008000, 0xf800d000, "b%22-25c.w\t%b"}, + {ARM_EXT_V6T2, 0xf0009000, 0xf800d000, "b.w\t%B"}, + + /* These have been 32-bit since the invention of Thumb. */ + {ARM_EXT_V4T, 0xf000c000, 0xf800d000, "blx\t%B"}, + {ARM_EXT_V4T, 0xf000d000, 0xf800d000, "bl\t%B"}, + + /* Fallback. */ + {ARM_EXT_V1, 0x00000000, 0x00000000, "undefined"}, + {0, 0, 0, 0} +}; + +static const char *const arm_conditional[] = {"eq", "ne", "cs", "cc", "mi", "pl", "vs", "vc", - "hi", "ls", "ge", "lt", "gt", "le", "", "nv"}; + "hi", "ls", "ge", "lt", "gt", "le", "", ""}; + +static const char *const arm_fp_const[] = +{"0.0", "1.0", "2.0", "3.0", "4.0", "5.0", "0.5", "10.0"}; + +static const char *const arm_shift[] = +{"lsl", "lsr", "asr", "ror"}; typedef struct { - const char * name; - const char * description; - const char * reg_names[16]; + const char *name; + const char *description; + const char *reg_names[16]; } arm_regname; -static arm_regname regnames[] = +static const arm_regname regnames[] = { { "raw" , "Select raw register names", { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"}}, @@ -796,22 +1058,28 @@ static arm_regname regnames[] = { "a1", "a2", "a3", "a4", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "IP", "SP", "LR", "PC" }}, { "special-atpcs", "Select special register names used in the ATPCS", { "a1", "a2", "a3", "a4", "v1", "v2", "v3", "WR", "v5", "SB", "SL", "FP", "IP", "SP", "LR", "PC" }}, - { "iwmmxt_regnames", "Select register names used on the Intel Wireless MMX technology coprocessor", - { "wr0", "wr1", "wr2", "wr3", "wr4", "wr5", "wr6", "wr7", "wr8", "wr9", "wr10", "wr11", "wr12", "wr13", "wr14", "wr15"}}, - { "iwmmxt_Cregnames", "Select control register names used on the Intel Wireless MMX technology coprocessor", - {"wcid", "wcon", "wcssf", "wcasf", "reserved", "reserved", "reserved", "reserved", "wcgr0", "wcgr1", "wcgr2", "wcgr3", "reserved", "reserved", "reserved", "reserved"}} }; -static char * iwmmxt_wwnames[] = +static const char *const iwmmxt_wwnames[] = {"b", "h", "w", "d"}; -static char * iwmmxt_wwssnames[] = +static const char *const iwmmxt_wwssnames[] = {"b", "bus", "b", "bss", "h", "hus", "h", "hss", "w", "wus", "w", "wss", "d", "dus", "d", "dss" }; +static const char *const iwmmxt_regnames[] = +{ "wr0", "wr1", "wr2", "wr3", "wr4", "wr5", "wr6", "wr7", + "wr8", "wr9", "wr10", "wr11", "wr12", "wr13", "wr14", "wr15" +}; + +static const char *const iwmmxt_cregnames[] = +{ "wcid", "wcon", "wcssf", "wcasf", "reserved", "reserved", "reserved", "reserved", + "wcgr0", "wcgr1", "wcgr2", "wcgr3", "reserved", "reserved", "reserved", "reserved" +}; + /* Default to GCC register name set. */ static unsigned int regname_selected = 1; @@ -820,43 +1088,16 @@ static unsigned int regname_selected = 1 static bfd_boolean force_thumb = FALSE; -static char * arm_fp_const[] = -{"0.0", "1.0", "2.0", "3.0", "4.0", "5.0", "0.5", "10.0"}; - -static char * arm_shift[] = -{"lsl", "lsr", "asr", "ror"}; - -/* Forward declarations. */ -static void arm_decode_shift - PARAMS ((long, fprintf_ftype, void *)); -static int print_insn_arm - PARAMS ((bfd_vma, struct disassemble_info *, long)); -static int print_insn_thumb - PARAMS ((bfd_vma, struct disassemble_info *, long)); -static void parse_disassembler_options - PARAMS ((char *)); -static int print_insn - PARAMS ((bfd_vma, struct disassemble_info *, bfd_boolean)); -static int set_iwmmxt_regnames - PARAMS ((void)); - -int get_arm_regname_num_options - PARAMS ((void)); -int set_arm_regname_option - PARAMS ((int)); -int get_arm_regnames - PARAMS ((int, const char **, const char **, const char ***)); /* Functions. */ int -get_arm_regname_num_options () +get_arm_regname_num_options (void) { return NUM_ARM_REGNAMES; } int -set_arm_regname_option (option) - int option; +set_arm_regname_option (int option) { int old = regname_selected; regname_selected = option; @@ -864,11 +1105,8 @@ set_arm_regname_option (option) } int -get_arm_regnames (option, setname, setdescription, register_names) - int option; - const char **setname; - const char **setdescription; - const char ***register_names; +get_arm_regnames (int option, const char **setname, const char **setdescription, + const char *const **register_names) { *setname = regnames[option].name; *setdescription = regnames[option].description; @@ -877,10 +1115,7 @@ get_arm_regnames (option, setname, setde } static void -arm_decode_shift (given, func, stream) - long given; - fprintf_ftype func; - void * stream; +arm_decode_shift (long given, fprintf_ftype func, void *stream) { func (stream, "%s", arm_regnames[given & 0xf]); @@ -910,37 +1145,14 @@ arm_decode_shift (given, func, stream) } } -static int -set_iwmmxt_regnames () -{ - const char * setname; - const char * setdesc; - const char ** regnames; - int iwmmxt_regnames = 0; - int num_regnames = get_arm_regname_num_options (); - - get_arm_regnames (iwmmxt_regnames, &setname, - &setdesc, ®names); - while ((strcmp ("iwmmxt_regnames", setname)) - && (iwmmxt_regnames < num_regnames)) - get_arm_regnames (++iwmmxt_regnames, &setname, &setdesc, ®names); - - return iwmmxt_regnames; -} - -/* Print one instruction from PC on INFO->STREAM. - Return the size of the instruction (always 4 on ARM). */ +/* Print one ARM instruction from PC on INFO->STREAM. */ -static int -print_insn_arm (pc, info, given) - bfd_vma pc; - struct disassemble_info *info; - long given; +static void +print_insn_arm (bfd_vma pc, struct disassemble_info *info, long given) { - const struct arm_opcode *insn; + const struct opcode32 *insn; void *stream = info->stream; - fprintf_ftype func = info->fprintf_func; - static int iwmmxt_regnames = 0; + fprintf_ftype func = info->fprintf_func; for (insn = arm_opcodes; insn->assembler; insn++) { @@ -957,7 +1169,7 @@ print_insn_arm (pc, info, given) || (insn->mask & 0xF0000000) == 0xF0000000 || (insn->mask == 0 && insn->value == 0))) { - char * c; + const char *c; for (c = insn->assembler; *c; c++) { @@ -1064,9 +1276,7 @@ print_insn_arm (pc, info, given) offset = -offset; func (stream, "[pc, #%d]\t; ", offset); - - (*info->print_address_func) - (offset + pc + 8, info); + info->print_address_func (offset + pc + 8, info); } else { @@ -1123,8 +1333,10 @@ print_insn_arm (pc, info, given) break; case 'b': - (*info->print_address_func) - (BDISP (given) * 4 + pc + 8, info); + { + int disp = (((given & 0xffffff) ^ 0x800000) - 0x800000); + info->print_address_func (disp*4 + pc + 8, info); + } break; case 'c': @@ -1446,34 +1658,18 @@ print_insn_arm (pc, info, given) case 'g': { long reg; - int current_regnames; - - if (! iwmmxt_regnames) - iwmmxt_regnames = set_iwmmxt_regnames (); - current_regnames = set_arm_regname_option - (iwmmxt_regnames); - reg = given >> bitstart; reg &= (2 << (bitend - bitstart)) - 1; - func (stream, "%s", arm_regnames[reg]); - set_arm_regname_option (current_regnames); + func (stream, "%s", iwmmxt_regnames[reg]); } break; case 'G': { long reg; - int current_regnames; - - if (! iwmmxt_regnames) - iwmmxt_regnames = set_iwmmxt_regnames (); - current_regnames = set_arm_regname_option - (iwmmxt_regnames + 1); - reg = given >> bitstart; reg &= (2 << (bitend - bitstart)) - 1; - func (stream, "%s", arm_regnames[reg]); - set_arm_regname_option (current_regnames); + func (stream, "%s", iwmmxt_cregnames[reg]); } break; @@ -1673,248 +1869,640 @@ print_insn_arm (pc, info, given) else func (stream, "%c", *c); } - return 4; + return; } } abort (); } -/* Print one instruction from PC on INFO->STREAM. - Return the size of the instruction. */ +/* Print one 16-bit Thumb instruction from PC on INFO->STREAM. */ -static int -print_insn_thumb (pc, info, given) - bfd_vma pc; - struct disassemble_info *info; - long given; +static void +print_insn_thumb16 (bfd_vma pc, struct disassemble_info *info, long given) { - const struct thumb_opcode *insn; + const struct opcode16 *insn; void *stream = info->stream; fprintf_ftype func = info->fprintf_func; for (insn = thumb_opcodes; insn->assembler; insn++) - { - if ((given & insn->mask) == insn->value) - { - char * c = insn->assembler; + if ((given & insn->mask) == insn->value) + { + const char *c = insn->assembler; + for (; *c; c++) + { + int domaskpc = 0; + int domasklr = 0; - /* Special processing for Thumb 2 instruction BL sequence: */ - if (!*c) /* Check for empty (not NULL) assembler string. */ - { - long offset; + if (*c != '%') + { + func (stream, "%c", *c); + continue; + } - info->bytes_per_chunk = 4; - info->bytes_per_line = 4; + switch (*++c) + { + case '%': + func (stream, "%%"); + break; - offset = BDISP23 (given); - offset = offset * 2 + pc + 4; + case 'S': + { + long reg; + + reg = (given >> 3) & 0x7; + if (given & (1 << 6)) + reg += 8; + + func (stream, "%s", arm_regnames[reg]); + } + break; - if ((given & 0x10000000) == 0) + case 'D': { - func (stream, "blx\t"); - offset &= 0xfffffffc; + long reg; + + reg = given & 0x7; + if (given & (1 << 7)) + reg += 8; + + func (stream, "%s", arm_regnames[reg]); } - else - func (stream, "bl\t"); + break; - info->print_address_func (offset, info); - return 4; - } - else - { - info->bytes_per_chunk = 2; - info->bytes_per_line = 4; - - given &= 0xffff; - - for (; *c; c++) - { - if (*c == '%') - { - int domaskpc = 0; - int domasklr = 0; - - switch (*++c) - { - case '%': - func (stream, "%%"); - break; - - case 'S': - { - long reg; - - reg = (given >> 3) & 0x7; - if (given & (1 << 6)) - reg += 8; - - func (stream, "%s", arm_regnames[reg]); - } - break; - - case 'D': - { - long reg; - - reg = given & 0x7; - if (given & (1 << 7)) - reg += 8; - - func (stream, "%s", arm_regnames[reg]); - } - break; - - case 'T': - func (stream, "%s", - arm_conditional [(given >> 8) & 0xf]); - break; - - case 'N': - if (given & (1 << 8)) - domasklr = 1; - /* Fall through. */ - case 'O': - if (*c == 'O' && (given & (1 << 8))) - domaskpc = 1; - /* Fall through. */ - case 'M': - { - int started = 0; - int reg; - - func (stream, "{"); - - /* It would be nice if we could spot - ranges, and generate the rS-rE format: */ - for (reg = 0; (reg < 8); reg++) - if ((given & (1 << reg)) != 0) - { - if (started) - func (stream, ", "); - started = 1; - func (stream, "%s", arm_regnames[reg]); - } - - if (domasklr) - { - if (started) - func (stream, ", "); - started = 1; - func (stream, arm_regnames[14] /* "lr" */); - } - - if (domaskpc) - { - if (started) - func (stream, ", "); - func (stream, arm_regnames[15] /* "pc" */); - } - - func (stream, "}"); - } - break; - - - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - { - int bitstart = *c++ - '0'; - int bitend = 0; - - while (*c >= '0' && *c <= '9') - bitstart = (bitstart * 10) + *c++ - '0'; - - switch (*c) - { - case '-': - { - long reg; - - c++; - while (*c >= '0' && *c <= '9') - bitend = (bitend * 10) + *c++ - '0'; - if (!bitend) - abort (); - reg = given >> bitstart; - reg &= (2 << (bitend - bitstart)) - 1; - switch (*c) - { - case 'r': - func (stream, "%s", arm_regnames[reg]); - break; - - case 'd': - func (stream, "%d", reg); - break; - - case 'H': - func (stream, "%d", reg << 1); - break; - - case 'W': - func (stream, "%d", reg << 2); - break; - - case 'a': - /* PC-relative address -- the bottom two - bits of the address are dropped - before the calculation. */ - info->print_address_func - (((pc + 4) & ~3) + (reg << 2), info); - break; - - case 'x': - func (stream, "0x%04x", reg); - break; - - case 'I': - reg = ((reg ^ (1 << bitend)) - (1 << bitend)); - func (stream, "%d", reg); - break; - - case 'B': - reg = ((reg ^ (1 << bitend)) - (1 << bitend)); - (*info->print_address_func) - (reg * 2 + pc + 4, info); - break; - - default: - abort (); - } - } - break; - - case '\'': - c++; - if ((given & (1 << bitstart)) != 0) - func (stream, "%c", *c); - break; - - case '?': - ++c; - if ((given & (1 << bitstart)) != 0) - func (stream, "%c", *c++); - else - func (stream, "%c", *++c); - break; - - default: - abort (); - } - } - break; - - default: - abort (); - } - } - else - func (stream, "%c", *c); - } - } - return 2; - } - } + case 'N': + if (given & (1 << 8)) + domasklr = 1; + /* Fall through. */ + case 'O': + if (*c == 'O' && (given & (1 << 8))) + domaskpc = 1; + /* Fall through. */ + case 'M': + { + int started = 0; + int reg; + + func (stream, "{"); + + /* It would be nice if we could spot + ranges, and generate the rS-rE format: */ + for (reg = 0; (reg < 8); reg++) + if ((given & (1 << reg)) != 0) + { + if (started) + func (stream, ", "); + started = 1; + func (stream, "%s", arm_regnames[reg]); + } + + if (domasklr) + { + if (started) + func (stream, ", "); + started = 1; + func (stream, arm_regnames[14] /* "lr" */); + } + + if (domaskpc) + { + if (started) + func (stream, ", "); + func (stream, arm_regnames[15] /* "pc" */); + } + + func (stream, "}"); + } + break; + + case 'b': + /* Print ARM V6T2 CZB address: pc+4+6 bits. */ + { + bfd_vma address = (pc + 4 + + ((given & 0x00f8) >> 2) + + ((given & 0x0200) >> 3)); + info->print_address_func (address, info); + } + break; + + case 's': + /* Right shift immediate -- bits 6..10; 1-31 print + as themselves, 0 prints as 32. */ + { + long imm = (given & 0x07c0) >> 6; + if (imm == 0) + imm = 32; + func (stream, "#%d", imm); + } + break; + + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + { + int bitstart = *c++ - '0'; + int bitend = 0; + + while (*c >= '0' && *c <= '9') + bitstart = (bitstart * 10) + *c++ - '0'; + + switch (*c) + { + case '-': + { + long reg; + + c++; + while (*c >= '0' && *c <= '9') + bitend = (bitend * 10) + *c++ - '0'; + if (!bitend) + abort (); + reg = given >> bitstart; + reg &= (2 << (bitend - bitstart)) - 1; + switch (*c) + { + case 'r': + func (stream, "%s", arm_regnames[reg]); + break; + + case 'd': + func (stream, "%d", reg); + break; + + case 'H': + func (stream, "%d", reg << 1); + break; + + case 'W': + func (stream, "%d", reg << 2); + break; + + case 'a': + /* PC-relative address -- the bottom two + bits of the address are dropped + before the calculation. */ + info->print_address_func + (((pc + 4) & ~3) + (reg << 2), info); + break; + + case 'x': + func (stream, "0x%04x", reg); + break; + + case 'B': + reg = ((reg ^ (1 << bitend)) - (1 << bitend)); + info->print_address_func (reg * 2 + pc + 4, info); + break; + + case 'c': + { + /* Must print 0xE as 'al' to distinguish + unconditional B from conditional BAL. */ + if (reg == 0xE) + func (stream, "al"); + else + func (stream, "%s", arm_conditional [reg]); + } + break; + + default: + abort (); + } + } + break; + + case '\'': + c++; + if ((given & (1 << bitstart)) != 0) + func (stream, "%c", *c); + break; + + case '?': + ++c; + if ((given & (1 << bitstart)) != 0) + func (stream, "%c", *c++); + else + func (stream, "%c", *++c); + break; + + default: + abort (); + } + } + break; + + default: + abort (); + } + } + return; + } + + /* No match. */ + abort (); +} + +/* Print one 32-bit Thumb instruction from PC on INFO->STREAM. */ + +static void +print_insn_thumb32 (bfd_vma pc, struct disassemble_info *info, long given) +{ + const struct opcode32 *insn; + void *stream = info->stream; + fprintf_ftype func = info->fprintf_func; + + for (insn = thumb32_opcodes; insn->assembler; insn++) + if ((given & insn->mask) == insn->value) + { + const char *c = insn->assembler; + for (; *c; c++) + { + if (*c != '%') + { + func (stream, "%c", *c); + continue; + } + + switch (*++c) + { + case '%': + func (stream, "%%"); + break; + + case 'I': + { + unsigned int imm12 = 0; + imm12 |= (given & 0x000000ffu); + imm12 |= (given & 0x00007000u) >> 4; + imm12 |= (given & 0x04000000u) >> 12; + func (stream, "#%u\t; 0x%x", imm12, imm12); + } + break; + + case 'M': + { + unsigned int bits = 0, imm, imm8, mod; + bits |= (given & 0x000000ffu); + bits |= (given & 0x00007000u) >> 4; + bits |= (given & 0x04000000u) >> 15; + imm8 = (bits & 0x0ff); + mod = (bits & 0xf00) >> 8; + switch (mod) + { + case 0: imm = imm8; break; + case 1: imm = ((imm8<<16) | imm8); break; + case 2: imm = ((imm8<<24) | (imm8 << 8)); break; + case 3: imm = ((imm8<<24) | (imm8 << 16) | (imm8 << 8) | imm8); break; + default: + mod = (bits & 0xf80) >> 7; + imm8 = (bits & 0x07f) | 0x80; + imm = (((imm8 << (32 - mod)) | (imm8 >> mod)) & 0xffffffff); + } + func (stream, "#%u\t; 0x%x", imm, imm); + } + break; + + case 'J': + { + unsigned int imm = 0; + imm |= (given & 0x000000ffu); + imm |= (given & 0x00007000u) >> 4; + imm |= (given & 0x04000000u) >> 15; + imm |= (given & 0x000f0000u) >> 4; + func (stream, "#%u\t; 0x%x", imm, imm); + } + break; + + case 'K': + { + unsigned int imm = 0; + imm |= (given & 0x000f0000u) >> 16; + imm |= (given & 0x00000ff0u) >> 0; + imm |= (given & 0x0000000fu) << 12; + func (stream, "#%u\t; 0x%x", imm, imm); + } + break; + + case 'S': + { + unsigned int reg = (given & 0x0000000fu); + unsigned int stp = (given & 0x00000030u) >> 4; + unsigned int imm = 0; + imm |= (given & 0x000000c0u) >> 6; + imm |= (given & 0x00007000u) >> 10; + + func (stream, "%s", arm_regnames[reg]); + switch (stp) + { + case 0: + if (imm > 0) + func (stream, ", lsl #%u", imm); + break; + + case 1: + if (imm == 0) + imm = 32; + func (stream, ", lsr #%u", imm); + break; + + case 2: + if (imm == 0) + imm = 32; + func (stream, ", asr #%u", imm); + break; + + case 3: + if (imm == 0) + func (stream, ", rrx"); + else + func (stream, ", ror #%u", imm); + } + } + break; + + case 'a': + { + unsigned int Rn = (given & 0x000f0000) >> 16; + unsigned int U = (given & 0x00800000) >> 23; + unsigned int op = (given & 0x00000f00) >> 8; + unsigned int i12 = (given & 0x00000fff); + unsigned int i8 = (given & 0x000000ff); + bfd_boolean writeback = FALSE, postind = FALSE; + int offset = 0; + + func (stream, "[%s", arm_regnames[Rn]); + if (U) /* 12-bit positive immediate offset */ + offset = i12; + else if (Rn == 15) /* 12-bit negative immediate offset */ + offset = -(int)i12; + else if (op == 0x0) /* shifted register offset */ + { + unsigned int Rm = (i8 & 0x0f); + unsigned int sh = (i8 & 0x30) >> 4; + func (stream, ", %s", arm_regnames[Rm]); + if (sh) + func (stream, ", lsl #%u", sh); + func (stream, "]"); + break; + } + else switch (op) + { + case 0xE: /* 8-bit positive immediate offset */ + offset = i8; + break; + + case 0xC: /* 8-bit negative immediate offset */ + offset = -i8; + break; + + case 0xB: /* 8-bit + preindex with wb */ + offset = i8; + writeback = TRUE; + break; + + case 0x9: /* 8-bit - preindex with wb */ + offset = -i8; + writeback = TRUE; + break; + + case 0xF: /* 8-bit + postindex */ + offset = i8; + postind = TRUE; + break; + + case 0xD: /* 8-bit - postindex */ + offset = -i8; + postind = TRUE; + break; + + default: + func (stream, ", ]"); + goto skip; + } + + if (postind) + func (stream, "], #%d", offset); + else + { + if (offset) + func (stream, ", #%d", offset); + func (stream, writeback ? "]!" : "]"); + } + + if (Rn == 15) + { + func (stream, "\t; "); + info->print_address_func (((pc + 4) & ~3) + offset, info); + } + } + skip: + break; + + case 'A': + { + unsigned int P = (given & 0x01000000) >> 24; + unsigned int U = (given & 0x00800000) >> 23; + unsigned int W = (given & 0x00400000) >> 21; + unsigned int Rn = (given & 0x000f0000) >> 16; + unsigned int off = (given & 0x000000ff); + + func (stream, "[%s", arm_regnames[Rn]); + if (P) + { + if (off || !U) + func (stream, ", #%c%u", U ? '+' : '-', off * 4); + func (stream, "]"); + if (W) + func (stream, "!"); + } + else + { + func (stream, "], "); + if (W) + func (stream, "#%c%u", U ? '+' : '-', off * 4); + else + func (stream, "{%u}", off); + } + } + break; + + case 'w': + { + unsigned int Sbit = (given & 0x01000000) >> 24; + unsigned int type = (given & 0x00600000) >> 21; + switch (type) + { + case 0: func (stream, Sbit ? "sb" : "b"); break; + case 1: func (stream, Sbit ? "sh" : "h"); break; + case 2: + if (Sbit) + func (stream, "??"); + break; + case 3: + func (stream, "??"); + break; + } + } + break; + + case 'm': + { + int started = 0; + int reg; + + func (stream, "{"); + for (reg = 0; reg < 16; reg++) + if ((given & (1 << reg)) != 0) + { + if (started) + func (stream, ", "); + started = 1; + func (stream, "%s", arm_regnames[reg]); + } + func (stream, "}"); + } + break; + + case 'E': + { + unsigned int msb = (given & 0x0000001f); + unsigned int lsb = 0; + lsb |= (given & 0x000000c0u) >> 6; + lsb |= (given & 0x00007000u) >> 10; + func (stream, "#%u, #%u", lsb, msb - lsb + 1); + } + break; + + case 'F': + { + unsigned int width = (given & 0x0000001f) + 1; + unsigned int lsb = 0; + lsb |= (given & 0x000000c0u) >> 6; + lsb |= (given & 0x00007000u) >> 10; + func (stream, "#%u, #%u", lsb, width); + } + break; + + case 'b': + { + unsigned int S = (given & 0x04000000u) >> 26; + unsigned int J1 = (given & 0x00002000u) >> 13; + unsigned int J2 = (given & 0x00000800u) >> 11; + int offset = 0; + + offset |= !S << 20; + offset |= J2 << 19; + offset |= J1 << 18; + offset |= (given & 0x003f0000) >> 4; + offset |= (given & 0x000007ff) << 1; + offset -= (1 << 20); + + info->print_address_func (pc + 4 + offset, info); + } + break; + + case 'B': + { + unsigned int S = (given & 0x04000000u) >> 26; + unsigned int I1 = (given & 0x00002000u) >> 13; + unsigned int I2 = (given & 0x00000800u) >> 11; + int offset = 0; + + offset |= !S << 24; + offset |= !(I1 ^ S) << 23; + offset |= !(I2 ^ S) << 22; + offset |= (given & 0x03ff0000u) >> 4; + offset |= (given & 0x000007ffu) << 1; + offset -= (1 << 24); + + info->print_address_func (pc + 4 + offset, info); + } + break; + + case 's': + { + unsigned int shift = 0; + shift |= (given & 0x000000c0u) >> 6; + shift |= (given & 0x00007000u) >> 10; + if (given & 0x00200000u) + func (stream, ", asr #%u", shift); + else if (shift) + func (stream, ", lsl #%u", shift); + /* else print nothing - lsl #0 */ + } + break; + + case 'R': + { + unsigned int rot = (given & 0x00000030) >> 4; + if (rot) + func (stream, ", ror #%u", rot * 8); + } + break; + + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + { + int bitstart = *c++ - '0'; + int bitend = 0; + unsigned int val; + while (*c >= '0' && *c <= '9') + bitstart = (bitstart * 10) + *c++ - '0'; + + if (*c == '-') + { + c++; + while (*c >= '0' && *c <= '9') + bitend = (bitend * 10) + *c++ - '0'; + if (!bitend) + abort (); + + val = given >> bitstart; + val &= (2 << (bitend - bitstart)) - 1; + } + else + val = (given >> bitstart) & 1; + + switch (*c) + { + case 'd': func (stream, "%u", val); break; + case 'W': func (stream, "%u", val * 4); break; + case 'r': func (stream, "%s", arm_regnames[val]); break; + + case 'c': + if (val == 0xE) + func (stream, "al"); + else + func (stream, "%s", arm_conditional[val]); + break; + + case '\'': + if (val) + func (stream, "%c", c[1]); + c++; + break; + + case '`': + if (!val) + func (stream, "%c", c[1]); + c++; + break; + + case '?': + func (stream, "%c", val ? c[1] : c[2]); + c += 2; + break; + + default: + abort (); + } + } + break; + + default: + abort (); + } + } + return; + } /* No match. */ abort (); @@ -1940,8 +2528,7 @@ arm_symbol_is_valid (asymbol * sym, /* Parse an individual disassembler option. */ void -parse_arm_disassembler_option (option) - char * option; +parse_arm_disassembler_option (char *option) { if (option == NULL) return; @@ -1978,8 +2565,7 @@ parse_arm_disassembler_option (option) or commas. (Whitespace separators supported for backwards compatibility). */ static void -parse_disassembler_options (options) - char * options; +parse_disassembler_options (char *options) { if (options == NULL) return; @@ -2001,15 +2587,14 @@ parse_disassembler_options (options) the relevant number of data bytes exist. */ static int -print_insn (pc, info, little) - bfd_vma pc; - struct disassemble_info * info; - bfd_boolean little; -{ - unsigned char b[4]; - long given; - int status; - int is_thumb, second_half_valid = 1; +print_insn (bfd_vma pc, struct disassemble_info *info, bfd_boolean little) +{ + unsigned char b[4]; + long given; + int status; + int is_thumb; + int size; + void (*printer) (bfd_vma, struct disassemble_info *, long); if (info->disassembler_options) { @@ -2046,59 +2631,64 @@ print_insn (pc, info, little) } } - info->bytes_per_chunk = 4; info->display_endian = little ? BFD_ENDIAN_LITTLE : BFD_ENDIAN_BIG; + info->bytes_per_line = 4; - if (little) + if (!is_thumb) { - status = info->read_memory_func (pc, (bfd_byte *) &b[0], 4, info); - if (status != 0 && is_thumb) - { - info->bytes_per_chunk = 2; - second_half_valid = 0; - - status = info->read_memory_func (pc, (bfd_byte *) b, 2, info); - b[3] = b[2] = 0; - } - - if (status != 0) - { - info->memory_error_func (status, pc, info); - return -1; - } - - given = (b[0]) | (b[1] << 8) | (b[2] << 16) | (b[3] << 24); + /* In ARM mode endianness is a straightforward issue: the instruction + is four bytes long and is either ordered 0123 or 3210. */ + printer = print_insn_arm; + info->bytes_per_chunk = 4; + size = 4; + + status = info->read_memory_func (pc, (bfd_byte *)b, 4, info); + if (little) + given = (b[0]) | (b[1] << 8) | (b[2] << 16) | (b[3] << 24); + else + given = (b[3]) | (b[2] << 8) | (b[1] << 16) | (b[0] << 24); } else { - status = info->read_memory_func - (WORD_ADDRESS (pc), (bfd_byte *) &b[0], 4, info); - if (status != 0) - { - info->memory_error_func (status, WORD_ADDRESS (pc), info); - return -1; - } + /* In Thumb mode we have the additional wrinkle of two + instruction lengths. Fortunately, the bits that determine + the length of the current instruction are always to be found + in the first two bytes. */ + printer = print_insn_thumb16; + info->bytes_per_chunk = 2; + size = 2; - if (is_thumb) + status = info->read_memory_func (pc, (bfd_byte *)b, 2, info); + if (!status) { - if (pc & 0x2) - { - given = (b[2] << 8) | b[3]; + if (little) + given = (b[0]) | (b[1] << 8); + else + given = (b[1]) | (b[0] << 8); - status = info->read_memory_func - (WORD_ADDRESS (pc + 4), (bfd_byte *) b, 4, info); - if (status != 0) - second_half_valid = 0; + /* These bit patterns signal a four-byte Thumb + instruction. */ + if ((given & 0xF800) == 0xF800 + || (given & 0xF800) == 0xF000 + || (given & 0xF800) == 0xE800) + { + status = info->read_memory_func (pc + 2, (bfd_byte *)b, 2, info); + if (little) + given = (b[0]) | (b[1] << 8) | (given << 16); else - given |= (b[0] << 24) | (b[1] << 16); + given = (b[1]) | (b[0] << 8) | (given << 16); + + printer = print_insn_thumb32; + size = 4; } - else - given = (b[0] << 8) | b[1] | (b[2] << 24) | (b[3] << 16); } - else - given = (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | (b[3]); } + if (status) + { + info->memory_error_func (status, pc, info); + return -1; + } if (info->flags & INSN_HAS_RELOC) /* If the instruction has a reloc associated with it, then the offset field in the instruction will actually be the @@ -2107,38 +2697,24 @@ print_insn (pc, info, little) addresses, since the addend is not currently pc-relative. */ pc = 0; - if (is_thumb) - status = print_insn_thumb (pc, info, given); - else - status = print_insn_arm (pc, info, given); - - if (is_thumb && status == 4 && second_half_valid == 0) - { - info->memory_error_func (status, WORD_ADDRESS (pc + 4), info); - return -1; - } - - return status; + printer (pc, info, given); + return size; } int -print_insn_big_arm (pc, info) - bfd_vma pc; - struct disassemble_info * info; +print_insn_big_arm (bfd_vma pc, struct disassemble_info *info) { return print_insn (pc, info, FALSE); } int -print_insn_little_arm (pc, info) - bfd_vma pc; - struct disassemble_info * info; +print_insn_little_arm (bfd_vma pc, struct disassemble_info *info) { return print_insn (pc, info, TRUE); } void -print_arm_disassembler_options (FILE * stream) +print_arm_disassembler_options (FILE *stream) { int i; diff -uprN binutils-2.16.90.0.3/opcodes/arm-opc.h binutils-2.16.91.0.1/opcodes/arm-opc.h --- binutils-2.16.90.0.3/opcodes/arm-opc.h 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/opcodes/arm-opc.h 1969-12-31 16:00:00.000000000 -0800 @@ -1,40 +0,0 @@ -/* Disassembler definitions for ARM. - - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004 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 - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ - - -struct arm_opcode -{ - unsigned long arch; /* Architecture defining this insn. */ - unsigned long value, mask; /* Recognise insn if (op&mask)==value. */ - char *assembler; /* How to disassemble this insn. */ -}; - -struct thumb_opcode -{ - unsigned long arch; /* Architecture defining this insn. */ - unsigned short value, mask; /* Recognise insn if (op&mask)==value. */ - char * assembler; /* How to disassemble this insn. */ -}; - - -#define BDISP(x) ((((x) & 0xffffff) ^ 0x800000) - 0x800000) /* 26 bit */ - -#define BDISP23(x) ((((((x) & 0x07ff) << 11) | (((x) & 0x07ff0000) >> 16)) \ - ^ 0x200000) - 0x200000) /* 23bit */ - diff -uprN binutils-2.16.90.0.3/opcodes/ChangeLog binutils-2.16.91.0.1/opcodes/ChangeLog --- binutils-2.16.90.0.3/opcodes/ChangeLog 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/opcodes/ChangeLog 2005-06-22 13:53:36.233097931 -0700 @@ -1,3 +1,100 @@ +2005-06-16 David Ung + + * mips16-opc.c (mips16_opcodes): Add the following MIPS16e + instructions to the table; seb/seh/sew/zeb/zeh/zew. + +2005-06-15 Dave Brolley + + Contribute Morpho ms1 on behalf of Red Hat + * ms1-asm.c, ms1-desc.c, ms1-dis.c, ms1-ibld.c, ms1-opc.c, + ms1-opc.h: New files, Morpho ms1 target. + + 2004-05-14 Stan Cox + + * disassemble.c (ARCH_ms1): Define. + (disassembler): Handle bfd_arch_ms1 + + 2004-05-13 Michael Snyder + + * Makefile.am, Makefile.in: Add ms1 target. + * configure.in: Ditto. + +2005-06-08 Zack Weinberg + + * arm-opc.h: Delete; fold contents into ... + * arm-dis.c: ... here. Move includes of internal COFF headers + next to includes of internal ELF headers. + (streq, WORD_ADDRESS, BDISP, BDISP23): Delete, unused. + (struct arm_opcode): Rename struct opcode32. Make 'assembler' const. + (struct thumb_opcode): Rename struct opcode16. Make 'assembler' const. + (arm_conditional, arm_fp_const, arm_shift, arm_regname, regnames) + (iwmmxt_wwnames, iwmmxt_wwssnames): + Make const. + (regnames): Remove iWMMXt coprocessor register sets. + (iwmmxt_regnames, iwmmxt_cregnames): New statics. + (get_arm_regnames): Adjust fourth argument to match above changes. + (set_iwmmxt_regnames): Delete. + (print_insn_arm): Constify 'c'. Use ISO syntax for function + pointer calls. Expand sole use of BDISP. Use iwmmxt_regnames + and iwmmxt_cregnames, not set_iwmmxt_regnames. + (print_insn_thumb16, print_insn_thumb32): Constify 'c'. Use + ISO syntax for function pointer calls. + +2005-06-07 Zack Weinberg + + * arm-dis.c: Split up the comments describing the format codes, so + that the ARM and 16-bit Thumb opcode tables each have comments + preceding them that describe all the codes, and only the codes, + valid in those tables. (32-bit Thumb table is already like this.) + Reorder the lists in all three comments to match the order in + which the codes are implemented. + Remove all forward declarations of static functions. Convert all + function definitions to ISO C format. + (print_insn_arm, print_insn_thumb16, print_insn_thumb32): + Return nothing. + (print_insn_thumb16): Remove unused case 'I'. + (print_insn): Update for changed calling convention of subroutines. + +2005-05-25 Jan Beulich + + * i386-dis.c (OP_E): In Intel mode, display 32-bit displacements in + hex (but retain it being displayed as signed). Remove redundant + checks. Add handling of displacements for 16-bit addressing in Intel + mode. + +2005-05-25 Jan Beulich + + * i386-dis.c (prefix_name): Remove pointless mode_64bit check. + (OP_E): Remove redundant REX_EXTZ handling. Remove pointless + masking of 'rm' in 16-bit memory address handling. + +2005-05-19 Anton Blanchard + + * ppc-dis.c (powerpc_dialect): Handle "-Mpower5". + (print_ppc_disassembler_options): Document it. + * ppc-opc.c (SVC_LEV): Define. + (LEV): Allow optional operand. + (POWER5): Define. + (powerpc_opcodes): Extend "sc". Adjust "svc" and "svcl". Add + "hrfid", "popcntb", "fsqrtes", "fsqrtes.", "fre" and "fre.". + +2005-05-19 Kelley Cook + + * Makefile.in: Regenerate. + +2005-05-17 Zack Weinberg + + * arm-dis.c (thumb_opcodes): Add disassembly for V6T2 16-bit + instructions. Adjust disassembly of some opcodes to match + unified syntax. + (thumb32_opcodes): New table. + (print_insn_thumb): Rename print_insn_thumb16; don't handle + two-halfword branches here. + (print_insn_thumb32): New function. + (print_insn): Choose among print_insn_arm, print_insn_thumb16, + and print_insn_thumb32. Be consistent about order of + halfwords when printing 32-bit instructions. + 2005-05-07 H.J. Lu PR 843 @@ -124,11 +221,11 @@ 2005-03-21 Jan-Benedict Glaw Nick Clifton - + * vax-dis.c: (entry_addr): New varible: An array of user supplied function entry mask addresses. (entry_addr_occupied_slots): New variable: The number of occupied - elements in entry_addr. + elements in entry_addr. (entry_addr_total_slots): New variable: The total number of elements in entry_addr. (parse_disassembler_options): New function. Fills in the entry_addr diff -uprN binutils-2.16.90.0.3/opcodes/configure binutils-2.16.91.0.1/opcodes/configure --- binutils-2.16.90.0.3/opcodes/configure 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/opcodes/configure 2005-06-22 13:53:36.262093140 -0700 @@ -8727,6 +8727,7 @@ if test x${all_targets} = xfalse ; then bfd_mmix_arch) ta="$ta mmix-dis.lo mmix-opc.lo" ;; bfd_mn10200_arch) ta="$ta m10200-dis.lo m10200-opc.lo" ;; bfd_mn10300_arch) ta="$ta m10300-dis.lo m10300-opc.lo" ;; + bfd_ms1_arch) ta="$ta ms1-asm.lo ms1-desc.lo ms1-dis.lo ms1-ibld.lo ms1-opc.lo" using_cgen=yes ;; bfd_msp430_arch) ta="$ta msp430-dis.lo" ;; bfd_ns32k_arch) ta="$ta ns32k-dis.lo" ;; bfd_openrisc_arch) ta="$ta openrisc-asm.lo openrisc-desc.lo openrisc-dis.lo openrisc-ibld.lo openrisc-opc.lo" using_cgen=yes ;; diff -uprN binutils-2.16.90.0.3/opcodes/configure.in binutils-2.16.91.0.1/opcodes/configure.in --- binutils-2.16.90.0.3/opcodes/configure.in 2005-05-10 15:46:53.000000000 -0700 +++ binutils-2.16.91.0.1/opcodes/configure.in 2005-06-22 13:53:36.263092975 -0700 @@ -187,6 +187,7 @@ if test x${all_targets} = xfalse ; then bfd_mmix_arch) ta="$ta mmix-dis.lo mmix-opc.lo" ;; bfd_mn10200_arch) ta="$ta m10200-dis.lo m10200-opc.lo" ;; bfd_mn10300_arch) ta="$ta m10300-dis.lo m10300-opc.lo" ;; + bfd_ms1_arch) ta="$ta ms1-asm.lo ms1-desc.lo ms1-dis.lo ms1-ibld.lo ms1-opc.lo" using_cgen=yes ;; bfd_msp430_arch) ta="$ta msp430-dis.lo" ;; bfd_ns32k_arch) ta="$ta ns32k-dis.lo" ;; bfd_openrisc_arch) ta="$ta openrisc-asm.lo openrisc-desc.lo openrisc-dis.lo openrisc-ibld.lo openrisc-opc.lo" using_cgen=yes ;; diff -uprN binutils-2.16.90.0.3/opcodes/disassemble.c binutils-2.16.91.0.1/opcodes/disassemble.c --- binutils-2.16.90.0.3/opcodes/disassemble.c 2005-05-10 15:46:54.000000000 -0700 +++ binutils-2.16.91.0.1/opcodes/disassemble.c 2005-06-22 13:53:36.267092314 -0700 @@ -51,6 +51,7 @@ #define ARCH_mmix #define ARCH_mn10200 #define ARCH_mn10300 +#define ARCH_ms1 #define ARCH_msp430 #define ARCH_ns32k #define ARCH_openrisc @@ -233,6 +234,11 @@ disassembler (abfd) disassemble = print_insn_maxq_little; break; #endif +#ifdef ARCH_ms1 + case bfd_arch_ms1: + disassemble = print_insn_ms1; + break; +#endif #ifdef ARCH_msp430 case bfd_arch_msp430: disassemble = print_insn_msp430; diff -uprN binutils-2.16.90.0.3/opcodes/i386-dis.c binutils-2.16.91.0.1/opcodes/i386-dis.c --- binutils-2.16.90.0.3/opcodes/i386-dis.c 2005-05-10 15:46:54.000000000 -0700 +++ binutils-2.16.91.0.1/opcodes/i386-dis.c 2005-06-22 13:53:36.276090827 -0700 @@ -1895,7 +1895,7 @@ prefix_name (int pref, int sizeflag) if (mode_64bit) return (sizeflag & AFLAG) ? "addr32" : "addr64"; else - return ((sizeflag & AFLAG) && !mode_64bit) ? "addr16" : "addr32"; + return (sizeflag & AFLAG) ? "addr16" : "addr32"; case FWAIT_OPCODE: return "fwait"; default: @@ -3214,13 +3214,11 @@ OP_E (int bytemode, int sizeflag) scale = (*codep >> 6) & 3; base = *codep & 7; USED_REX (REX_EXTY); - USED_REX (REX_EXTZ); if (rex & REX_EXTY) index += 8; - if (rex & REX_EXTZ) - base += 8; codep++; } + base += add; switch (mod) { @@ -3316,9 +3314,6 @@ OP_E (int bytemode, int sizeflag) if (intel_syntax && riprel) oappend ("rip + "); *obufp = '\0'; - USED_REX (REX_EXTZ); - if (!havesib && (rex & REX_EXTZ)) - base += 8; if (havebase) oappend (mode_64bit && (sizeflag & AFLAG) ? names64[base] : names32[base]); @@ -3342,22 +3337,23 @@ OP_E (int bytemode, int sizeflag) oappend (scratchbuf); } } - if (intel_syntax) - if (mod != 0 || (base & 7) == 5) - { - /* Don't print zero displacements. */ - if (disp != 0) - { - if ((bfd_signed_vma) disp > 0) - { - *obufp++ = '+'; - *obufp = '\0'; - } - - print_operand_value (scratchbuf, 0, disp); - oappend (scratchbuf); - } - } + if (intel_syntax && disp) + { + if ((bfd_signed_vma) disp > 0) + { + *obufp++ = '+'; + *obufp = '\0'; + } + else if (mod != 1) + { + *obufp++ = '-'; + *obufp = '\0'; + disp = - (bfd_signed_vma) disp; + } + + print_operand_value (scratchbuf, mod != 1, disp); + oappend (scratchbuf); + } *obufp++ = close_char; *obufp = '\0'; @@ -3384,7 +3380,7 @@ OP_E (int bytemode, int sizeflag) switch (mod) { case 0: - if ((rm & 7) == 6) + if (rm == 6) { disp = get16 (); if ((disp & 0x8000) != 0) @@ -3405,20 +3401,51 @@ OP_E (int bytemode, int sizeflag) } if (!intel_syntax) - if (mod != 0 || (rm & 7) == 6) + if (mod != 0 || rm == 6) { print_operand_value (scratchbuf, 0, disp); oappend (scratchbuf); } - if (mod != 0 || (rm & 7) != 6) + if (mod != 0 || rm != 6) { *obufp++ = open_char; *obufp = '\0'; - oappend (index16[rm + add]); + oappend (index16[rm]); + if (intel_syntax && disp) + { + if ((bfd_signed_vma) disp > 0) + { + *obufp++ = '+'; + *obufp = '\0'; + } + else if (mod != 1) + { + *obufp++ = '-'; + *obufp = '\0'; + disp = - (bfd_signed_vma) disp; + } + + print_operand_value (scratchbuf, mod != 1, disp); + oappend (scratchbuf); + } + *obufp++ = close_char; *obufp = '\0'; } + else if (intel_syntax) + { + if (prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS + | PREFIX_ES | PREFIX_FS | PREFIX_GS)) + ; + else + { + oappend (names_seg[ds_reg - es_reg]); + oappend (":"); + } + print_operand_value (scratchbuf, 1, disp & 0xffff); + oappend (scratchbuf); + } } } diff -uprN binutils-2.16.90.0.3/opcodes/Makefile.am binutils-2.16.91.0.1/opcodes/Makefile.am --- binutils-2.16.90.0.3/opcodes/Makefile.am 2005-04-29 10:50:31.000000000 -0700 +++ binutils-2.16.91.0.1/opcodes/Makefile.am 2005-06-22 13:53:36.234097766 -0700 @@ -25,7 +25,6 @@ LIBIBERTY = ../libiberty/libiberty.a # Header files. HFILES = \ - arm-opc.h \ fr30-desc.h fr30-opc.h \ frv-desc.h frv-opc.h \ h8500-opc.h \ @@ -35,6 +34,7 @@ HFILES = \ iq2000-desc.h iq2000-opc.h \ m32r-desc.h m32r-opc.h \ mcore-opc.h \ + ms1-desc.h ms1-opc.h \ openrisc-desc.h openrisc-opc.h \ sh-opc.h \ sh64-opc.h \ @@ -128,6 +128,11 @@ CFILES = \ m10300-opc.c \ mmix-dis.c \ mmix-opc.c \ + ms1-asm.c \ + ms1-desc.c \ + ms1-dis.c \ + ms1-ibld.c \ + ms1-opc.c \ ns32k-dis.c \ openrisc-asm.c \ openrisc-desc.c \ @@ -242,6 +247,11 @@ ALL_MACHINES = \ mips16-opc.lo \ mmix-dis.lo \ mmix-opc.lo \ + ms1-asm.lo \ + ms1-desc.lo \ + ms1-dis.lo \ + ms1-ibld.lo \ + ms1-opc.lo \ msp430-dis.lo \ ns32k-dis.lo \ openrisc-asm.lo \ @@ -352,7 +362,7 @@ uninstall_libopcodes: CLEANFILES = \ stamp-ip2k stamp-m32r stamp-fr30 stamp-frv stamp-openrisc \ - stamp-iq2000 stamp-xstormy16 \ + stamp-iq2000 stamp-ms1 stamp-xstormy16 \ libopcodes.a stamp-lib dep.sed DEP DEPA DEP1 DEP2 @@ -368,13 +378,14 @@ CGENDEPS = \ $(CGENDIR)/opc-opinst.scm \ cgen-asm.in cgen-dis.in cgen-ibld.in -CGEN_CPUS = fr30 frv ip2k m32r openrisc xstormy16 +CGEN_CPUS = fr30 frv ip2k m32r ms1 openrisc xstormy16 if CGEN_MAINT IP2K_DEPS = stamp-ip2k M32R_DEPS = stamp-m32r FR30_DEPS = stamp-fr30 FRV_DEPS = stamp-frv +MS1_DEPS = stamp-ms1 OPENRISC_DEPS = stamp-openrisc IQ2000_DEPS = stamp-iq2000 XSTORMY16_DEPS = stamp-xstormy16 @@ -383,6 +394,7 @@ IP2K_DEPS = M32R_DEPS = FR30_DEPS = FRV_DEPS = +MS1_DEPS = OPENRISC_DEPS = IQ2000_DEPS = XSTORMY16_DEPS = @@ -424,12 +436,16 @@ stamp-fr30: $(CGENDEPS) $(CPUDIR)/fr30.c $(srcdir)/frv-desc.h $(srcdir)/frv-desc.c $(srcdir)/frv-opc.h $(srcdir)/frv-opc.c $(srcdir)/frv-ibld.c $(srcdir)/frv-asm.c $(srcdir)/frv-dis.c: $(FRV_DEPS) @true -# .cpu and .opc files for frv are kept in a different directory, but cgen has no switch to specify that location, so -# copy those file to the regular place. stamp-frv: $(CGENDEPS) $(srcdir)/../cpu/frv.cpu $(srcdir)/../cpu/frv.opc $(MAKE) run-cgen arch=frv prefix=frv options= \ archfile=$(srcdir)/../cpu/frv.cpu opcfile=$(srcdir)/../cpu/frv.opc extrafiles= +$(srcdir)/ms1-desc.h $(srcdir)/ms1-desc.c $(srcdir)/ms1-opc.h $(srcdir)/ms1-opc.c $(srcdir)/ms1-ibld.c $(srcdir)/ms1-asm.c $(srcdir)/ms1-dis.c: $(MS1_DEPS) + @true +stamp-ms1: $(CGENDEPS) $(CPUDIR)/ms1.cpu $(CPUDIR)/ms1.opc + $(MAKE) run-cgen arch=ms1 prefix=ms1 options= \ + archfile=$(CPUDIR)/ms1.cpu opcfile=$(CPUDIR)/ms1.opc extrafiles= + $(srcdir)/openrisc-desc.h $(srcdir)/openrisc-desc.c $(srcdir)/openrisc-opc.h $(srcdir)/openrisc-opc.c $(srcdir)/openrisc-ibld.c $(srcdir)/openrisc-asm.c $(srcdir)/openrisc-dis.c: $(OPENRISC_DEPS) @true stamp-openrisc: $(CGENDEPS) $(CPUDIR)/openrisc.cpu $(CPUDIR)/openrisc.opc @@ -533,10 +549,10 @@ arc-ext.lo: arc-ext.c sysdep.h config.h $(BFD_H) $(INCDIR)/symcat.h arc-ext.h $(INCDIR)/libiberty.h arm-dis.lo: arm-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/arm.h \ - arm-opc.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h opintl.h $(INCDIR)/safe-ctype.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h + opintl.h $(INCDIR)/safe-ctype.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h avr-dis.lo: avr-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h opintl.h \ $(INCDIR)/libiberty.h $(INCDIR)/opcode/avr.h @@ -643,8 +659,8 @@ ia64-opc-i.lo: ia64-opc-i.c ia64-opc.h $ ia64-opc-m.lo: ia64-opc-m.c ia64-opc.h $(INCDIR)/opcode/ia64.h \ $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h ia64-opc-d.lo: ia64-opc-d.c -ia64-opc.lo: ia64-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ - sysdep.h config.h ia64-asmtab.h $(INCDIR)/opcode/ia64.h \ +ia64-opc.lo: ia64-opc.c $(INCDIR)/ansidecl.h sysdep.h \ + config.h $(INCDIR)/libiberty.h ia64-asmtab.h $(INCDIR)/opcode/ia64.h \ $(BFD_H) $(INCDIR)/symcat.h ia64-asmtab.c ia64-gen.lo: ia64-gen.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ $(INCDIR)/safe-ctype.h sysdep.h config.h $(INCDIR)/getopt.h \ @@ -747,6 +763,25 @@ mmix-dis.lo: mmix-dis.c $(INCDIR)/opcode $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ opintl.h mmix-opc.lo: mmix-opc.c $(INCDIR)/opcode/mmix.h $(INCDIR)/symcat.h +ms1-asm.lo: ms1-asm.c sysdep.h config.h \ + $(INCDIR)/ansidecl.h $(BFD_H) $(INCDIR)/symcat.h ms1-desc.h \ + $(INCDIR)/opcode/cgen.h ms1-opc.h opintl.h $(INCDIR)/xregex.h \ + $(INCDIR)/xregex2.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h +ms1-desc.lo: ms1-desc.c sysdep.h config.h \ + $(INCDIR)/ansidecl.h $(BFD_H) $(INCDIR)/symcat.h ms1-desc.h \ + $(INCDIR)/opcode/cgen.h ms1-opc.h opintl.h $(INCDIR)/libiberty.h \ + $(INCDIR)/xregex.h $(INCDIR)/xregex2.h +ms1-dis.lo: ms1-dis.c sysdep.h config.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h \ + $(INCDIR)/libiberty.h ms1-desc.h $(INCDIR)/opcode/cgen.h \ + ms1-opc.h opintl.h +ms1-ibld.lo: ms1-ibld.c sysdep.h config.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h \ + ms1-desc.h $(INCDIR)/opcode/cgen.h ms1-opc.h \ + opintl.h $(INCDIR)/safe-ctype.h +ms1-opc.lo: ms1-opc.c sysdep.h config.h \ + $(INCDIR)/ansidecl.h $(BFD_H) $(INCDIR)/symcat.h ms1-desc.h \ + $(INCDIR)/opcode/cgen.h ms1-opc.h $(INCDIR)/libiberty.h ns32k-dis.lo: ns32k-dis.c $(BFD_H) $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/dis-asm.h \ $(INCDIR)/opcode/ns32k.h opintl.h diff -uprN binutils-2.16.90.0.3/opcodes/Makefile.in binutils-2.16.91.0.1/opcodes/Makefile.in --- binutils-2.16.90.0.3/opcodes/Makefile.in 2005-04-29 10:50:31.000000000 -0700 +++ binutils-2.16.91.0.1/opcodes/Makefile.in 2005-06-22 13:53:36.250095123 -0700 @@ -50,7 +50,6 @@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/../bfd/acinclude.m4 \ - $(top_srcdir)/../config/accross.m4 \ $(top_srcdir)/../config/acx.m4 $(top_srcdir)/../bfd/bfd.m4 \ $(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/../libtool.m4 \ $(top_srcdir)/../gettext.m4 $(top_srcdir)/configure.in @@ -247,7 +246,6 @@ LIBIBERTY = ../libiberty/libiberty.a # Header files. HFILES = \ - arm-opc.h \ fr30-desc.h fr30-opc.h \ frv-desc.h frv-opc.h \ h8500-opc.h \ @@ -257,6 +255,7 @@ HFILES = \ iq2000-desc.h iq2000-opc.h \ m32r-desc.h m32r-opc.h \ mcore-opc.h \ + ms1-desc.h ms1-opc.h \ openrisc-desc.h openrisc-opc.h \ sh-opc.h \ sh64-opc.h \ @@ -351,6 +350,11 @@ CFILES = \ m10300-opc.c \ mmix-dis.c \ mmix-opc.c \ + ms1-asm.c \ + ms1-desc.c \ + ms1-dis.c \ + ms1-ibld.c \ + ms1-opc.c \ ns32k-dis.c \ openrisc-asm.c \ openrisc-desc.c \ @@ -465,6 +469,11 @@ ALL_MACHINES = \ mips16-opc.lo \ mmix-dis.lo \ mmix-opc.lo \ + ms1-asm.lo \ + ms1-desc.lo \ + ms1-dis.lo \ + ms1-ibld.lo \ + ms1-opc.lo \ msp430-dis.lo \ ns32k-dis.lo \ openrisc-asm.lo \ @@ -529,7 +538,7 @@ noinst_LIBRARIES = libopcodes.a POTFILES = $(HFILES) $(CFILES) CLEANFILES = \ stamp-ip2k stamp-m32r stamp-fr30 stamp-frv stamp-openrisc \ - stamp-iq2000 stamp-xstormy16 \ + stamp-iq2000 stamp-ms1 stamp-xstormy16 \ libopcodes.a stamp-lib dep.sed DEP DEPA DEP1 DEP2 CGENDIR = @cgendir@ @@ -543,7 +552,7 @@ CGENDEPS = \ $(CGENDIR)/opc-opinst.scm \ cgen-asm.in cgen-dis.in cgen-ibld.in -CGEN_CPUS = fr30 frv ip2k m32r openrisc xstormy16 +CGEN_CPUS = fr30 frv ip2k m32r ms1 openrisc xstormy16 @CGEN_MAINT_FALSE@IP2K_DEPS = @CGEN_MAINT_TRUE@IP2K_DEPS = stamp-ip2k @CGEN_MAINT_FALSE@M32R_DEPS = @@ -552,6 +561,8 @@ CGEN_CPUS = fr30 frv ip2k m32r openrisc @CGEN_MAINT_TRUE@FR30_DEPS = stamp-fr30 @CGEN_MAINT_FALSE@FRV_DEPS = @CGEN_MAINT_TRUE@FRV_DEPS = stamp-frv +@CGEN_MAINT_FALSE@MS1_DEPS = +@CGEN_MAINT_TRUE@MS1_DEPS = stamp-ms1 @CGEN_MAINT_FALSE@OPENRISC_DEPS = @CGEN_MAINT_TRUE@OPENRISC_DEPS = stamp-openrisc @CGEN_MAINT_FALSE@IQ2000_DEPS = @@ -955,12 +966,16 @@ stamp-fr30: $(CGENDEPS) $(CPUDIR)/fr30.c $(srcdir)/frv-desc.h $(srcdir)/frv-desc.c $(srcdir)/frv-opc.h $(srcdir)/frv-opc.c $(srcdir)/frv-ibld.c $(srcdir)/frv-asm.c $(srcdir)/frv-dis.c: $(FRV_DEPS) @true -# .cpu and .opc files for frv are kept in a different directory, but cgen has no switch to specify that location, so -# copy those file to the regular place. stamp-frv: $(CGENDEPS) $(srcdir)/../cpu/frv.cpu $(srcdir)/../cpu/frv.opc $(MAKE) run-cgen arch=frv prefix=frv options= \ archfile=$(srcdir)/../cpu/frv.cpu opcfile=$(srcdir)/../cpu/frv.opc extrafiles= +$(srcdir)/ms1-desc.h $(srcdir)/ms1-desc.c $(srcdir)/ms1-opc.h $(srcdir)/ms1-opc.c $(srcdir)/ms1-ibld.c $(srcdir)/ms1-asm.c $(srcdir)/ms1-dis.c: $(MS1_DEPS) + @true +stamp-ms1: $(CGENDEPS) $(srcdir)/../cpu/ms1.cpu $(srcdir)/../cpu/ms1.opc + $(MAKE) run-cgen arch=ms1 prefix=ms1 options= \ + archfile=$(srcdir)/../cpu/ms1.cpu opcfile=$(srcdir)/../cpu/ms1.opc extrafiles= + $(srcdir)/openrisc-desc.h $(srcdir)/openrisc-desc.c $(srcdir)/openrisc-opc.h $(srcdir)/openrisc-opc.c $(srcdir)/openrisc-ibld.c $(srcdir)/openrisc-asm.c $(srcdir)/openrisc-dis.c: $(OPENRISC_DEPS) @true stamp-openrisc: $(CGENDEPS) $(CPUDIR)/openrisc.cpu $(CPUDIR)/openrisc.opc @@ -1064,10 +1079,10 @@ arc-ext.lo: arc-ext.c sysdep.h config.h $(BFD_H) $(INCDIR)/symcat.h arc-ext.h $(INCDIR)/libiberty.h arm-dis.lo: arm-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/arm.h \ - arm-opc.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h opintl.h $(INCDIR)/safe-ctype.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h + opintl.h $(INCDIR)/safe-ctype.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h avr-dis.lo: avr-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h opintl.h \ $(INCDIR)/libiberty.h $(INCDIR)/opcode/avr.h @@ -1174,8 +1189,8 @@ ia64-opc-i.lo: ia64-opc-i.c ia64-opc.h $ ia64-opc-m.lo: ia64-opc-m.c ia64-opc.h $(INCDIR)/opcode/ia64.h \ $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h ia64-opc-d.lo: ia64-opc-d.c -ia64-opc.lo: ia64-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ - sysdep.h config.h ia64-asmtab.h $(INCDIR)/opcode/ia64.h \ +ia64-opc.lo: ia64-opc.c $(INCDIR)/ansidecl.h sysdep.h \ + config.h $(INCDIR)/libiberty.h ia64-asmtab.h $(INCDIR)/opcode/ia64.h \ $(BFD_H) $(INCDIR)/symcat.h ia64-asmtab.c ia64-gen.lo: ia64-gen.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ $(INCDIR)/safe-ctype.h sysdep.h config.h $(INCDIR)/getopt.h \ @@ -1278,6 +1293,25 @@ mmix-dis.lo: mmix-dis.c $(INCDIR)/opcode $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ opintl.h mmix-opc.lo: mmix-opc.c $(INCDIR)/opcode/mmix.h $(INCDIR)/symcat.h +ms1-asm.lo: ms1-asm.c sysdep.h config.h \ + $(INCDIR)/ansidecl.h $(BFD_H) $(INCDIR)/symcat.h ms1-desc.h \ + $(INCDIR)/opcode/cgen.h ms1-opc.h opintl.h $(INCDIR)/xregex.h \ + $(INCDIR)/xregex2.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h +ms1-desc.lo: ms1-desc.c sysdep.h config.h \ + $(INCDIR)/ansidecl.h $(BFD_H) $(INCDIR)/symcat.h ms1-desc.h \ + $(INCDIR)/opcode/cgen.h ms1-opc.h opintl.h $(INCDIR)/libiberty.h \ + $(INCDIR)/xregex.h $(INCDIR)/xregex2.h +ms1-dis.lo: ms1-dis.c sysdep.h config.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h \ + $(INCDIR)/libiberty.h ms1-desc.h $(INCDIR)/opcode/cgen.h \ + ms1-opc.h opintl.h +ms1-ibld.lo: ms1-ibld.c sysdep.h config.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h \ + ms1-desc.h $(INCDIR)/opcode/cgen.h ms1-opc.h \ + opintl.h $(INCDIR)/safe-ctype.h +ms1-opc.lo: ms1-opc.c sysdep.h config.h \ + $(INCDIR)/ansidecl.h $(BFD_H) $(INCDIR)/symcat.h ms1-desc.h \ + $(INCDIR)/opcode/cgen.h ms1-opc.h $(INCDIR)/libiberty.h ns32k-dis.lo: ns32k-dis.c $(BFD_H) $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/dis-asm.h \ $(INCDIR)/opcode/ns32k.h opintl.h diff -uprN binutils-2.16.90.0.3/opcodes/mips16-opc.c binutils-2.16.91.0.1/opcodes/mips16-opc.c --- binutils-2.16.90.0.3/opcodes/mips16-opc.c 2005-05-10 15:46:54.000000000 -0700 +++ binutils-2.16.91.0.1/opcodes/mips16-opc.c 2005-06-22 13:53:36.279090332 -0700 @@ -221,6 +221,13 @@ const struct mips_opcode mips16_opcodes[ {"sw", "x,V(S)", 0xd000, 0xf800, RD_x|RD_SP, 0, 0 }, {"sw", "R,V(S)", 0x6200, 0xff00, RD_31|RD_SP, 0, 0 }, {"xor", "x,y", 0xe80e, 0xf81f, WR_x|RD_x|RD_y, 0, 0 }, + /* MIPS16e additions */ +{"seb", "x", 0xe891, 0xf8ff, WR_x|RD_x, 0, 0 }, +{"seh", "x", 0xe8b1, 0xf8ff, WR_x|RD_x, 0, 0 }, +{"sew", "x", 0xe8d1, 0xf8ff, WR_x|RD_x, 0, I3 }, +{"zeb", "x", 0xe811, 0xf8ff, WR_x|RD_x, 0, 0 }, +{"zeh", "x", 0xe831, 0xf8ff, WR_x|RD_x, 0, 0 }, +{"zew", "x", 0xe851, 0xf8ff, WR_x|RD_x, 0, I3 }, }; const int bfd_mips16_num_opcodes = diff -uprN binutils-2.16.90.0.3/opcodes/ms1-asm.c binutils-2.16.91.0.1/opcodes/ms1-asm.c --- binutils-2.16.90.0.3/opcodes/ms1-asm.c 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/opcodes/ms1-asm.c 2005-06-22 13:53:36.280090167 -0700 @@ -0,0 +1,978 @@ +/* Assembler interface for targets using CGEN. -*- C -*- + CGEN: Cpu tools GENerator + +THIS FILE IS MACHINE GENERATED WITH CGEN. +- the resultant file is machine generated, cgen-asm.in isn't + +Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + +This file is part of the GNU Binutils and GDB, the GNU debugger. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* ??? Eventually more and more of this stuff can go to cpu-independent files. + Keep that in mind. */ + +#include "sysdep.h" +#include +#include "ansidecl.h" +#include "bfd.h" +#include "symcat.h" +#include "ms1-desc.h" +#include "ms1-opc.h" +#include "opintl.h" +#include "xregex.h" +#include "libiberty.h" +#include "safe-ctype.h" + +#undef min +#define min(a,b) ((a) < (b) ? (a) : (b)) +#undef max +#define max(a,b) ((a) > (b) ? (a) : (b)) + +static const char * parse_insn_normal + (CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *); + +/* -- assembler routines inserted here. */ + +/* -- asm.c */ +static int signed_out_of_bounds (long); +static const char * parse_imm16 (CGEN_CPU_DESC, const char **, int, long *); +static const char * parse_dup (CGEN_CPU_DESC, const char **, int, long *); +static const char * parse_ball (CGEN_CPU_DESC, const char **, int, long *); +static const char * parse_xmode (CGEN_CPU_DESC, const char **, int, long *); +static const char * parse_rc (CGEN_CPU_DESC, const char **, int, long *); +static const char * parse_cbrb (CGEN_CPU_DESC, const char **, int, long *); +static const char * parse_rbbc (CGEN_CPU_DESC, const char **, int, long *); +static const char * parse_type (CGEN_CPU_DESC, const char **, int, long *); + +/* Range checking for signed numbers. Returns 0 if acceptable + and 1 if the value is out of bounds for a signed quantity. */ + +static int +signed_out_of_bounds (long val) +{ + if ((val < -32768) || (val > 32767)) + return 1; + return 0; +} + +static const char * +parse_imm16 (CGEN_CPU_DESC cd, + const char **strp, + int opindex, + long *valuep) +{ + const char *errmsg; + enum cgen_parse_operand_result result_type; + bfd_reloc_code_real_type code = BFD_RELOC_NONE; + bfd_vma value; + + /* Is it a control transfer instructions? */ + if (opindex == (CGEN_OPERAND_TYPE) MS1_OPERAND_IMM16O) + { + code = BFD_RELOC_16_PCREL; + errmsg = cgen_parse_address (cd, strp, opindex, code, + & result_type, & value); + if (errmsg == NULL) + { + if (signed_out_of_bounds (value)) + errmsg = _("Operand out of range. Must be between -32768 and 32767."); + } + *valuep = value; + return errmsg; + } + + /* If it's not a control transfer instruction, then + we have to check for %OP relocating operators. */ + if (strncmp (*strp, "%hi16", 5) == 0) + { + *strp += 5; + code = BFD_RELOC_HI16; + } + else if (strncmp (*strp, "%lo16", 5) == 0) + { + *strp += 5; + code = BFD_RELOC_LO16; + } + + /* If we found a %OP relocating operator, then parse it as an address. + If not, we need to parse it as an integer, either signed or unsigned + depending on which operand type we have. */ + if (code != BFD_RELOC_NONE) + { + /* %OP relocating operator found. */ + errmsg = cgen_parse_address (cd, strp, opindex, code, + & result_type, & value); + if (errmsg == NULL) + { + switch (result_type) + { + case (CGEN_PARSE_OPERAND_RESULT_NUMBER): + if (code == BFD_RELOC_HI16) + value = (value >> 16) & 0xFFFF; + else if (code == BFD_RELOC_LO16) + value = value & 0xFFFF; + else + errmsg = _("Biiiig Trouble in parse_imm16!"); + break; + + case (CGEN_PARSE_OPERAND_RESULT_QUEUED): + /* No special processing for this case. */ + break; + + default: + errmsg = _("%operator operand is not a symbol"); + break; + } + } + *valuep = value; + } + else + { + /* Parse hex values like 0xffff as unsigned, and sign extend + them manually. */ + int parse_signed = (opindex == (CGEN_OPERAND_TYPE)MS1_OPERAND_IMM16); + + if ((*strp)[0] == '0' + && ((*strp)[1] == 'x' || (*strp)[1] == 'X')) + parse_signed = 0; + + /* No relocating operator. Parse as an number. */ + if (parse_signed) + { + /* Parse as as signed integer. */ + + errmsg = cgen_parse_signed_integer (cd, strp, opindex, valuep); + + if (errmsg == NULL) + { +#if 0 + /* Manual range checking is needed for the signed case. */ + if (*valuep & 0x8000) + value = 0xffff0000 | *valuep; + else + value = *valuep; + + if (signed_out_of_bounds (value)) + errmsg = _("Operand out of range. Must be between -32768 and 32767."); + /* Truncate to 16 bits. This is necessary + because cgen will have sign extended *valuep. */ + *valuep &= 0xFFFF; +#endif + } + } + else + { + /* MS1_OPERAND_IMM16Z. Parse as an unsigned integer. */ + errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, valuep); + + if (opindex == (CGEN_OPERAND_TYPE)MS1_OPERAND_IMM16 + && *valuep >= 0x8000 + && *valuep <= 0xffff) + *valuep -= 0x10000; + } + } + + return errmsg; +} + + +static const char * +parse_dup (CGEN_CPU_DESC cd, + const char **strp, + int opindex, + long *valuep) +{ + const char *errmsg = NULL; + + if (strncmp (*strp, "dup", 3) == 0 || strncmp (*strp, "DUP", 3) == 0) + { + *strp += 3; + *valuep = 1; + } + else if (strncmp (*strp, "xx", 2) == 0 || strncmp (*strp, "XX", 2) == 0) + { + *strp += 2; + *valuep = 0; + } + else + errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, valuep); + + return errmsg; +} + + +static const char * +parse_ball (CGEN_CPU_DESC cd, + const char **strp, + int opindex, + long *valuep) +{ + const char *errmsg = NULL; + + if (strncmp (*strp, "all", 3) == 0 || strncmp (*strp, "ALL", 3) == 0) + { + *strp += 3; + *valuep = 1; + } + else if (strncmp (*strp, "one", 3) == 0 || strncmp (*strp, "ONE", 3) == 0) + { + *strp += 3; + *valuep = 0; + } + else + errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, valuep); + + return errmsg; +} + +static const char * +parse_xmode (CGEN_CPU_DESC cd, + const char **strp, + int opindex, + long *valuep) +{ + const char *errmsg = NULL; + + if (strncmp (*strp, "pm", 2) == 0 || strncmp (*strp, "PM", 2) == 0) + { + *strp += 2; + *valuep = 1; + } + else if (strncmp (*strp, "xm", 2) == 0 || strncmp (*strp, "XM", 2) == 0) + { + *strp += 2; + *valuep = 0; + } + else + errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, valuep); + + return errmsg; +} + +static const char * +parse_rc (CGEN_CPU_DESC cd, + const char **strp, + int opindex, + long *valuep) +{ + const char *errmsg = NULL; + + if (strncmp (*strp, "r", 1) == 0 || strncmp (*strp, "R", 1) == 0) + { + *strp += 1; + *valuep = 1; + } + else if (strncmp (*strp, "c", 1) == 0 || strncmp (*strp, "C", 1) == 0) + { + *strp += 1; + *valuep = 0; + } + else + errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, valuep); + + return errmsg; +} + +static const char * +parse_cbrb (CGEN_CPU_DESC cd, + const char **strp, + int opindex, + long *valuep) +{ + const char *errmsg = NULL; + + if (strncmp (*strp, "rb", 2) == 0 || strncmp (*strp, "RB", 2) == 0) + { + *strp += 2; + *valuep = 1; + } + else if (strncmp (*strp, "cb", 2) == 0 || strncmp (*strp, "CB", 2) == 0) + { + *strp += 2; + *valuep = 0; + } + else + errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, valuep); + + return errmsg; +} + +static const char * +parse_rbbc (CGEN_CPU_DESC cd, + const char **strp, + int opindex, + long *valuep) +{ + const char *errmsg = NULL; + + if (strncmp (*strp, "rt", 2) == 0 || strncmp (*strp, "RT", 2) == 0) + { + *strp += 2; + *valuep = 0; + } + else if (strncmp (*strp, "br1", 3) == 0 || strncmp (*strp, "BR1", 3) == 0) + { + *strp += 3; + *valuep = 1; + } + else if (strncmp (*strp, "br2", 3) == 0 || strncmp (*strp, "BR2", 3) == 0) + { + *strp += 3; + *valuep = 2; + } + else if (strncmp (*strp, "cs", 2) == 0 || strncmp (*strp, "CS", 2) == 0) + { + *strp += 2; + *valuep = 3; + } + else + errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, valuep); + + return errmsg; +} + +static const char * +parse_type (CGEN_CPU_DESC cd, + const char **strp, + int opindex, + long *valuep) +{ + const char *errmsg = NULL; + + if (strncmp (*strp, "odd", 3) == 0 || strncmp (*strp, "ODD", 3) == 0) + { + *strp += 3; + *valuep = 0; + } + else if (strncmp (*strp, "even", 4) == 0 || strncmp (*strp, "EVEN", 4) == 0) + { + *strp += 4; + *valuep = 1; + } + else if (strncmp (*strp, "oe", 2) == 0 || strncmp (*strp, "OE", 2) == 0) + { + *strp += 2; + *valuep = 2; + } + else + errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, valuep); + + if ((errmsg == NULL) && (*valuep == 3)) + errmsg = _("invalid operand. type may have values 0,1,2 only."); + + return errmsg; +} + +/* -- dis.c */ + +const char * ms1_cgen_parse_operand + PARAMS ((CGEN_CPU_DESC, int, const char **, CGEN_FIELDS *)); + +/* Main entry point for operand parsing. + + This function is basically just a big switch statement. Earlier versions + used tables to look up the function to use, but + - if the table contains both assembler and disassembler functions then + the disassembler contains much of the assembler and vice-versa, + - there's a lot of inlining possibilities as things grow, + - using a switch statement avoids the function call overhead. + + This function could be moved into `parse_insn_normal', but keeping it + separate makes clear the interface between `parse_insn_normal' and each of + the handlers. */ + +const char * +ms1_cgen_parse_operand (cd, opindex, strp, fields) + CGEN_CPU_DESC cd; + int opindex; + const char ** strp; + CGEN_FIELDS * fields; +{ + const char * errmsg = NULL; + /* Used by scalar operands that still need to be parsed. */ + long junk ATTRIBUTE_UNUSED; + + switch (opindex) + { + case MS1_OPERAND_A23 : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_A23, (unsigned long *) (& fields->f_a23)); + break; + case MS1_OPERAND_BALL : + errmsg = parse_ball (cd, strp, MS1_OPERAND_BALL, (unsigned long *) (& fields->f_ball)); + break; + case MS1_OPERAND_BALL2 : + errmsg = parse_ball (cd, strp, MS1_OPERAND_BALL2, (unsigned long *) (& fields->f_ball2)); + break; + case MS1_OPERAND_BANKADDR : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_BANKADDR, (unsigned long *) (& fields->f_bankaddr)); + break; + case MS1_OPERAND_BRC : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_BRC, (unsigned long *) (& fields->f_brc)); + break; + case MS1_OPERAND_BRC2 : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_BRC2, (unsigned long *) (& fields->f_brc2)); + break; + case MS1_OPERAND_CBRB : + errmsg = parse_cbrb (cd, strp, MS1_OPERAND_CBRB, (unsigned long *) (& fields->f_cbrb)); + break; + case MS1_OPERAND_CBS : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_CBS, (unsigned long *) (& fields->f_cbs)); + break; + case MS1_OPERAND_CBX : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_CBX, (unsigned long *) (& fields->f_cbx)); + break; + case MS1_OPERAND_CCB : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_CCB, (unsigned long *) (& fields->f_ccb)); + break; + case MS1_OPERAND_CDB : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_CDB, (unsigned long *) (& fields->f_cdb)); + break; + case MS1_OPERAND_CELL : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_CELL, (unsigned long *) (& fields->f_cell)); + break; + case MS1_OPERAND_COLNUM : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_COLNUM, (unsigned long *) (& fields->f_colnum)); + break; + case MS1_OPERAND_CONTNUM : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_CONTNUM, (unsigned long *) (& fields->f_contnum)); + break; + case MS1_OPERAND_CR : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_CR, (unsigned long *) (& fields->f_cr)); + break; + case MS1_OPERAND_CTXDISP : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_CTXDISP, (unsigned long *) (& fields->f_ctxdisp)); + break; + case MS1_OPERAND_DUP : + errmsg = parse_dup (cd, strp, MS1_OPERAND_DUP, (unsigned long *) (& fields->f_dup)); + break; + case MS1_OPERAND_FBDISP : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_FBDISP, (unsigned long *) (& fields->f_fbdisp)); + break; + case MS1_OPERAND_FBINCR : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_FBINCR, (unsigned long *) (& fields->f_fbincr)); + break; + case MS1_OPERAND_FRDR : + errmsg = cgen_parse_keyword (cd, strp, & ms1_cgen_opval_h_spr, & fields->f_dr); + break; + case MS1_OPERAND_FRDRRR : + errmsg = cgen_parse_keyword (cd, strp, & ms1_cgen_opval_h_spr, & fields->f_drrr); + break; + case MS1_OPERAND_FRSR1 : + errmsg = cgen_parse_keyword (cd, strp, & ms1_cgen_opval_h_spr, & fields->f_sr1); + break; + case MS1_OPERAND_FRSR2 : + errmsg = cgen_parse_keyword (cd, strp, & ms1_cgen_opval_h_spr, & fields->f_sr2); + break; + case MS1_OPERAND_ID : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_ID, (unsigned long *) (& fields->f_id)); + break; + case MS1_OPERAND_IMM16 : + errmsg = parse_imm16 (cd, strp, MS1_OPERAND_IMM16, (long *) (& fields->f_imm16s)); + break; + case MS1_OPERAND_IMM16O : + errmsg = parse_imm16 (cd, strp, MS1_OPERAND_IMM16O, (unsigned long *) (& fields->f_imm16s)); + break; + case MS1_OPERAND_IMM16Z : + errmsg = parse_imm16 (cd, strp, MS1_OPERAND_IMM16Z, (unsigned long *) (& fields->f_imm16u)); + break; + case MS1_OPERAND_INCAMT : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_INCAMT, (unsigned long *) (& fields->f_incamt)); + break; + case MS1_OPERAND_INCR : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_INCR, (unsigned long *) (& fields->f_incr)); + break; + case MS1_OPERAND_LENGTH : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_LENGTH, (unsigned long *) (& fields->f_length)); + break; + case MS1_OPERAND_MASK : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_MASK, (unsigned long *) (& fields->f_mask)); + break; + case MS1_OPERAND_MASK1 : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_MASK1, (unsigned long *) (& fields->f_mask1)); + break; + case MS1_OPERAND_MODE : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_MODE, (unsigned long *) (& fields->f_mode)); + break; + case MS1_OPERAND_PERM : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_PERM, (unsigned long *) (& fields->f_perm)); + break; + case MS1_OPERAND_RBBC : + errmsg = parse_rbbc (cd, strp, MS1_OPERAND_RBBC, (unsigned long *) (& fields->f_rbbc)); + break; + case MS1_OPERAND_RC : + errmsg = parse_rc (cd, strp, MS1_OPERAND_RC, (unsigned long *) (& fields->f_rc)); + break; + case MS1_OPERAND_RC1 : + errmsg = parse_rc (cd, strp, MS1_OPERAND_RC1, (unsigned long *) (& fields->f_rc1)); + break; + case MS1_OPERAND_RC2 : + errmsg = parse_rc (cd, strp, MS1_OPERAND_RC2, (unsigned long *) (& fields->f_rc2)); + break; + case MS1_OPERAND_RCNUM : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_RCNUM, (unsigned long *) (& fields->f_rcnum)); + break; + case MS1_OPERAND_RDA : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_RDA, (unsigned long *) (& fields->f_rda)); + break; + case MS1_OPERAND_ROWNUM : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_ROWNUM, (unsigned long *) (& fields->f_rownum)); + break; + case MS1_OPERAND_ROWNUM1 : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_ROWNUM1, (unsigned long *) (& fields->f_rownum1)); + break; + case MS1_OPERAND_ROWNUM2 : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_ROWNUM2, (unsigned long *) (& fields->f_rownum2)); + break; + case MS1_OPERAND_SIZE : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_SIZE, (unsigned long *) (& fields->f_size)); + break; + case MS1_OPERAND_TYPE : + errmsg = parse_type (cd, strp, MS1_OPERAND_TYPE, (unsigned long *) (& fields->f_type)); + break; + case MS1_OPERAND_WR : + errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_WR, (unsigned long *) (& fields->f_wr)); + break; + case MS1_OPERAND_XMODE : + errmsg = parse_xmode (cd, strp, MS1_OPERAND_XMODE, (unsigned long *) (& fields->f_xmode)); + break; + + default : + /* xgettext:c-format */ + fprintf (stderr, _("Unrecognized field %d while parsing.\n"), opindex); + abort (); + } + + return errmsg; +} + +cgen_parse_fn * const ms1_cgen_parse_handlers[] = +{ + parse_insn_normal, +}; + +void +ms1_cgen_init_asm (cd) + CGEN_CPU_DESC cd; +{ + ms1_cgen_init_opcode_table (cd); + ms1_cgen_init_ibld_table (cd); + cd->parse_handlers = & ms1_cgen_parse_handlers[0]; + cd->parse_operand = ms1_cgen_parse_operand; +} + + + +/* Regex construction routine. + + This translates an opcode syntax string into a regex string, + by replacing any non-character syntax element (such as an + opcode) with the pattern '.*' + + It then compiles the regex and stores it in the opcode, for + later use by ms1_cgen_assemble_insn + + Returns NULL for success, an error message for failure. */ + +char * +ms1_cgen_build_insn_regex (CGEN_INSN *insn) +{ + CGEN_OPCODE *opc = (CGEN_OPCODE *) CGEN_INSN_OPCODE (insn); + const char *mnem = CGEN_INSN_MNEMONIC (insn); + char rxbuf[CGEN_MAX_RX_ELEMENTS]; + char *rx = rxbuf; + const CGEN_SYNTAX_CHAR_TYPE *syn; + int reg_err; + + syn = CGEN_SYNTAX_STRING (CGEN_OPCODE_SYNTAX (opc)); + + /* Mnemonics come first in the syntax string. */ + if (! CGEN_SYNTAX_MNEMONIC_P (* syn)) + return _("missing mnemonic in syntax string"); + ++syn; + + /* Generate a case sensitive regular expression that emulates case + insensitive matching in the "C" locale. We cannot generate a case + insensitive regular expression because in Turkish locales, 'i' and 'I' + are not equal modulo case conversion. */ + + /* Copy the literal mnemonic out of the insn. */ + for (; *mnem; mnem++) + { + char c = *mnem; + + if (ISALPHA (c)) + { + *rx++ = '['; + *rx++ = TOLOWER (c); + *rx++ = TOUPPER (c); + *rx++ = ']'; + } + else + *rx++ = c; + } + + /* Copy any remaining literals from the syntax string into the rx. */ + for(; * syn != 0 && rx <= rxbuf + (CGEN_MAX_RX_ELEMENTS - 7 - 4); ++syn) + { + if (CGEN_SYNTAX_CHAR_P (* syn)) + { + char c = CGEN_SYNTAX_CHAR (* syn); + + switch (c) + { + /* Escape any regex metacharacters in the syntax. */ + case '.': case '[': case '\\': + case '*': case '^': case '$': + +#ifdef CGEN_ESCAPE_EXTENDED_REGEX + case '?': case '{': case '}': + case '(': case ')': case '*': + case '|': case '+': case ']': +#endif + *rx++ = '\\'; + *rx++ = c; + break; + + default: + if (ISALPHA (c)) + { + *rx++ = '['; + *rx++ = TOLOWER (c); + *rx++ = TOUPPER (c); + *rx++ = ']'; + } + else + *rx++ = c; + break; + } + } + else + { + /* Replace non-syntax fields with globs. */ + *rx++ = '.'; + *rx++ = '*'; + } + } + + /* Trailing whitespace ok. */ + * rx++ = '['; + * rx++ = ' '; + * rx++ = '\t'; + * rx++ = ']'; + * rx++ = '*'; + + /* But anchor it after that. */ + * rx++ = '$'; + * rx = '\0'; + + CGEN_INSN_RX (insn) = xmalloc (sizeof (regex_t)); + reg_err = regcomp ((regex_t *) CGEN_INSN_RX (insn), rxbuf, REG_NOSUB); + + if (reg_err == 0) + return NULL; + else + { + static char msg[80]; + + regerror (reg_err, (regex_t *) CGEN_INSN_RX (insn), msg, 80); + regfree ((regex_t *) CGEN_INSN_RX (insn)); + free (CGEN_INSN_RX (insn)); + (CGEN_INSN_RX (insn)) = NULL; + return msg; + } +} + + +/* Default insn parser. + + The syntax string is scanned and operands are parsed and stored in FIELDS. + Relocs are queued as we go via other callbacks. + + ??? Note that this is currently an all-or-nothing parser. If we fail to + parse the instruction, we return 0 and the caller will start over from + the beginning. Backtracking will be necessary in parsing subexpressions, + but that can be handled there. Not handling backtracking here may get + expensive in the case of the m68k. Deal with later. + + Returns NULL for success, an error message for failure. */ + +static const char * +parse_insn_normal (CGEN_CPU_DESC cd, + const CGEN_INSN *insn, + const char **strp, + CGEN_FIELDS *fields) +{ + /* ??? Runtime added insns not handled yet. */ + const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn); + const char *str = *strp; + const char *errmsg; + const char *p; + const CGEN_SYNTAX_CHAR_TYPE * syn; +#ifdef CGEN_MNEMONIC_OPERANDS + /* FIXME: wip */ + int past_opcode_p; +#endif + + /* For now we assume the mnemonic is first (there are no leading operands). + We can parse it without needing to set up operand parsing. + GAS's input scrubber will ensure mnemonics are lowercase, but we may + not be called from GAS. */ + p = CGEN_INSN_MNEMONIC (insn); + while (*p && TOLOWER (*p) == TOLOWER (*str)) + ++p, ++str; + + if (* p) + return _("unrecognized instruction"); + +#ifndef CGEN_MNEMONIC_OPERANDS + if (* str && ! ISSPACE (* str)) + return _("unrecognized instruction"); +#endif + + CGEN_INIT_PARSE (cd); + cgen_init_parse_operand (cd); +#ifdef CGEN_MNEMONIC_OPERANDS + past_opcode_p = 0; +#endif + + /* We don't check for (*str != '\0') here because we want to parse + any trailing fake arguments in the syntax string. */ + syn = CGEN_SYNTAX_STRING (syntax); + + /* Mnemonics come first for now, ensure valid string. */ + if (! CGEN_SYNTAX_MNEMONIC_P (* syn)) + abort (); + + ++syn; + + while (* syn != 0) + { + /* Non operand chars must match exactly. */ + if (CGEN_SYNTAX_CHAR_P (* syn)) + { + /* FIXME: While we allow for non-GAS callers above, we assume the + first char after the mnemonic part is a space. */ + /* FIXME: We also take inappropriate advantage of the fact that + GAS's input scrubber will remove extraneous blanks. */ + if (TOLOWER (*str) == TOLOWER (CGEN_SYNTAX_CHAR (* syn))) + { +#ifdef CGEN_MNEMONIC_OPERANDS + if (CGEN_SYNTAX_CHAR(* syn) == ' ') + past_opcode_p = 1; +#endif + ++ syn; + ++ str; + } + else if (*str) + { + /* Syntax char didn't match. Can't be this insn. */ + static char msg [80]; + + /* xgettext:c-format */ + sprintf (msg, _("syntax error (expected char `%c', found `%c')"), + CGEN_SYNTAX_CHAR(*syn), *str); + return msg; + } + else + { + /* Ran out of input. */ + static char msg [80]; + + /* xgettext:c-format */ + sprintf (msg, _("syntax error (expected char `%c', found end of instruction)"), + CGEN_SYNTAX_CHAR(*syn)); + return msg; + } + continue; + } + + /* We have an operand of some sort. */ + errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), + &str, fields); + if (errmsg) + return errmsg; + + /* Done with this operand, continue with next one. */ + ++ syn; + } + + /* If we're at the end of the syntax string, we're done. */ + if (* syn == 0) + { + /* FIXME: For the moment we assume a valid `str' can only contain + blanks now. IE: We needn't try again with a longer version of + the insn and it is assumed that longer versions of insns appear + before shorter ones (eg: lsr r2,r3,1 vs lsr r2,r3). */ + while (ISSPACE (* str)) + ++ str; + + if (* str != '\0') + return _("junk at end of line"); /* FIXME: would like to include `str' */ + + return NULL; + } + + /* We couldn't parse it. */ + return _("unrecognized instruction"); +} + +/* Main entry point. + This routine is called for each instruction to be assembled. + STR points to the insn to be assembled. + We assume all necessary tables have been initialized. + The assembled instruction, less any fixups, is stored in BUF. + Remember that if CGEN_INT_INSN_P then BUF is an int and thus the value + still needs to be converted to target byte order, otherwise BUF is an array + of bytes in target byte order. + The result is a pointer to the insn's entry in the opcode table, + or NULL if an error occured (an error message will have already been + printed). + + Note that when processing (non-alias) macro-insns, + this function recurses. + + ??? It's possible to make this cpu-independent. + One would have to deal with a few minor things. + At this point in time doing so would be more of a curiosity than useful + [for example this file isn't _that_ big], but keeping the possibility in + mind helps keep the design clean. */ + +const CGEN_INSN * +ms1_cgen_assemble_insn (CGEN_CPU_DESC cd, + const char *str, + CGEN_FIELDS *fields, + CGEN_INSN_BYTES_PTR buf, + char **errmsg) +{ + const char *start; + CGEN_INSN_LIST *ilist; + const char *parse_errmsg = NULL; + const char *insert_errmsg = NULL; + int recognized_mnemonic = 0; + + /* Skip leading white space. */ + while (ISSPACE (* str)) + ++ str; + + /* The instructions are stored in hashed lists. + Get the first in the list. */ + ilist = CGEN_ASM_LOOKUP_INSN (cd, str); + + /* Keep looking until we find a match. */ + start = str; + for ( ; ilist != NULL ; ilist = CGEN_ASM_NEXT_INSN (ilist)) + { + const CGEN_INSN *insn = ilist->insn; + recognized_mnemonic = 1; + +#ifdef CGEN_VALIDATE_INSN_SUPPORTED + /* Not usually needed as unsupported opcodes + shouldn't be in the hash lists. */ + /* Is this insn supported by the selected cpu? */ + if (! ms1_cgen_insn_supported (cd, insn)) + continue; +#endif + /* If the RELAXED attribute is set, this is an insn that shouldn't be + chosen immediately. Instead, it is used during assembler/linker + relaxation if possible. */ + if (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_RELAXED) != 0) + continue; + + str = start; + + /* Skip this insn if str doesn't look right lexically. */ + if (CGEN_INSN_RX (insn) != NULL && + regexec ((regex_t *) CGEN_INSN_RX (insn), str, 0, NULL, 0) == REG_NOMATCH) + continue; + + /* Allow parse/insert handlers to obtain length of insn. */ + CGEN_FIELDS_BITSIZE (fields) = CGEN_INSN_BITSIZE (insn); + + parse_errmsg = CGEN_PARSE_FN (cd, insn) (cd, insn, & str, fields); + if (parse_errmsg != NULL) + continue; + + /* ??? 0 is passed for `pc'. */ + insert_errmsg = CGEN_INSERT_FN (cd, insn) (cd, insn, fields, buf, + (bfd_vma) 0); + if (insert_errmsg != NULL) + continue; + + /* It is up to the caller to actually output the insn and any + queued relocs. */ + return insn; + } + + { + static char errbuf[150]; +#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS + const char *tmp_errmsg; + + /* If requesting verbose error messages, use insert_errmsg. + Failing that, use parse_errmsg. */ + tmp_errmsg = (insert_errmsg ? insert_errmsg : + parse_errmsg ? parse_errmsg : + recognized_mnemonic ? + _("unrecognized form of instruction") : + _("unrecognized instruction")); + + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); + else + /* xgettext:c-format */ + sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); +#else + if (strlen (start) > 50) + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s...'"), start); + else + /* xgettext:c-format */ + sprintf (errbuf, _("bad instruction `%.50s'"), start); +#endif + + *errmsg = errbuf; + return NULL; + } +} + +#if 0 /* This calls back to GAS which we can't do without care. */ + +/* Record each member of OPVALS in the assembler's symbol table. + This lets GAS parse registers for us. + ??? Interesting idea but not currently used. */ + +/* Record each member of OPVALS in the assembler's symbol table. + FIXME: Not currently used. */ + +void +ms1_cgen_asm_hash_keywords (CGEN_CPU_DESC cd, CGEN_KEYWORD *opvals) +{ + CGEN_KEYWORD_SEARCH search = cgen_keyword_search_init (opvals, NULL); + const CGEN_KEYWORD_ENTRY * ke; + + while ((ke = cgen_keyword_search_next (& search)) != NULL) + { +#if 0 /* Unnecessary, should be done in the search routine. */ + if (! ms1_cgen_opval_supported (ke)) + continue; +#endif + cgen_asm_record_register (cd, ke->name, ke->value); + } +} + +#endif /* 0 */ diff -uprN binutils-2.16.90.0.3/opcodes/ms1-desc.c binutils-2.16.91.0.1/opcodes/ms1-desc.c --- binutils-2.16.90.0.3/opcodes/ms1-desc.c 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/opcodes/ms1-desc.c 2005-06-22 13:53:36.282089836 -0700 @@ -0,0 +1,1284 @@ +/* CPU data for ms1. + +THIS FILE IS MACHINE GENERATED WITH CGEN. + +Copyright 1996-2005 Free Software Foundation, Inc. + +This file is part of the GNU Binutils and/or GDB, the GNU debugger. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +#include "sysdep.h" +#include +#include +#include "ansidecl.h" +#include "bfd.h" +#include "symcat.h" +#include "ms1-desc.h" +#include "ms1-opc.h" +#include "opintl.h" +#include "libiberty.h" +#include "xregex.h" + +/* Attributes. */ + +static const CGEN_ATTR_ENTRY bool_attr[] = +{ + { "#f", 0 }, + { "#t", 1 }, + { 0, 0 } +}; + +static const CGEN_ATTR_ENTRY MACH_attr[] ATTRIBUTE_UNUSED = +{ + { "base", MACH_BASE }, + { "ms1", MACH_MS1 }, + { "ms1_003", MACH_MS1_003 }, + { "max", MACH_MAX }, + { 0, 0 } +}; + +static const CGEN_ATTR_ENTRY ISA_attr[] ATTRIBUTE_UNUSED = +{ + { "ms1", ISA_MS1 }, + { "max", ISA_MAX }, + { 0, 0 } +}; + +const CGEN_ATTR_TABLE ms1_cgen_ifield_attr_table[] = +{ + { "MACH", & MACH_attr[0], & MACH_attr[0] }, + { "VIRTUAL", &bool_attr[0], &bool_attr[0] }, + { "PCREL-ADDR", &bool_attr[0], &bool_attr[0] }, + { "ABS-ADDR", &bool_attr[0], &bool_attr[0] }, + { "RESERVED", &bool_attr[0], &bool_attr[0] }, + { "SIGN-OPT", &bool_attr[0], &bool_attr[0] }, + { "SIGNED", &bool_attr[0], &bool_attr[0] }, + { 0, 0, 0 } +}; + +const CGEN_ATTR_TABLE ms1_cgen_hardware_attr_table[] = +{ + { "MACH", & MACH_attr[0], & MACH_attr[0] }, + { "VIRTUAL", &bool_attr[0], &bool_attr[0] }, + { "CACHE-ADDR", &bool_attr[0], &bool_attr[0] }, + { "PC", &bool_attr[0], &bool_attr[0] }, + { "PROFILE", &bool_attr[0], &bool_attr[0] }, + { 0, 0, 0 } +}; + +const CGEN_ATTR_TABLE ms1_cgen_operand_attr_table[] = +{ + { "MACH", & MACH_attr[0], & MACH_attr[0] }, + { "VIRTUAL", &bool_attr[0], &bool_attr[0] }, + { "PCREL-ADDR", &bool_attr[0], &bool_attr[0] }, + { "ABS-ADDR", &bool_attr[0], &bool_attr[0] }, + { "SIGN-OPT", &bool_attr[0], &bool_attr[0] }, + { "SIGNED", &bool_attr[0], &bool_attr[0] }, + { "NEGATIVE", &bool_attr[0], &bool_attr[0] }, + { "RELAX", &bool_attr[0], &bool_attr[0] }, + { "SEM-ONLY", &bool_attr[0], &bool_attr[0] }, + { 0, 0, 0 } +}; + +const CGEN_ATTR_TABLE ms1_cgen_insn_attr_table[] = +{ + { "MACH", & MACH_attr[0], & MACH_attr[0] }, + { "ALIAS", &bool_attr[0], &bool_attr[0] }, + { "VIRTUAL", &bool_attr[0], &bool_attr[0] }, + { "UNCOND-CTI", &bool_attr[0], &bool_attr[0] }, + { "COND-CTI", &bool_attr[0], &bool_attr[0] }, + { "SKIP-CTI", &bool_attr[0], &bool_attr[0] }, + { "DELAY-SLOT", &bool_attr[0], &bool_attr[0] }, + { "RELAXABLE", &bool_attr[0], &bool_attr[0] }, + { "RELAXED", &bool_attr[0], &bool_attr[0] }, + { "NO-DIS", &bool_attr[0], &bool_attr[0] }, + { "PBB", &bool_attr[0], &bool_attr[0] }, + { "LOAD-DELAY", &bool_attr[0], &bool_attr[0] }, + { "MEMORY-ACCESS", &bool_attr[0], &bool_attr[0] }, + { "AL-INSN", &bool_attr[0], &bool_attr[0] }, + { "IO-INSN", &bool_attr[0], &bool_attr[0] }, + { "BR-INSN", &bool_attr[0], &bool_attr[0] }, + { "USES-FRDR", &bool_attr[0], &bool_attr[0] }, + { "USES-FRDRRR", &bool_attr[0], &bool_attr[0] }, + { "USES-FRSR1", &bool_attr[0], &bool_attr[0] }, + { "USES-FRSR2", &bool_attr[0], &bool_attr[0] }, + { "SKIPA", &bool_attr[0], &bool_attr[0] }, + { 0, 0, 0 } +}; + +/* Instruction set variants. */ + +static const CGEN_ISA ms1_cgen_isa_table[] = { + { "ms1", 32, 32, 32, 32 }, + { 0, 0, 0, 0, 0 } +}; + +/* Machine variants. */ + +static const CGEN_MACH ms1_cgen_mach_table[] = { + { "ms1", "ms1", MACH_MS1, 0 }, + { "ms1-003", "ms1-003", MACH_MS1_003, 0 }, + { 0, 0, 0, 0 } +}; + +static CGEN_KEYWORD_ENTRY ms1_cgen_opval_msys_syms_entries[] = +{ + { "DUP", 1, {0, {0}}, 0, 0 }, + { "XX", 0, {0, {0}}, 0, 0 } +}; + +CGEN_KEYWORD ms1_cgen_opval_msys_syms = +{ + & ms1_cgen_opval_msys_syms_entries[0], + 2, + 0, 0, 0, 0, "" +}; + +static CGEN_KEYWORD_ENTRY ms1_cgen_opval_h_spr_entries[] = +{ + { "R0", 0, {0, {0}}, 0, 0 }, + { "R1", 1, {0, {0}}, 0, 0 }, + { "R2", 2, {0, {0}}, 0, 0 }, + { "R3", 3, {0, {0}}, 0, 0 }, + { "R4", 4, {0, {0}}, 0, 0 }, + { "R5", 5, {0, {0}}, 0, 0 }, + { "R6", 6, {0, {0}}, 0, 0 }, + { "R7", 7, {0, {0}}, 0, 0 }, + { "R8", 8, {0, {0}}, 0, 0 }, + { "R9", 9, {0, {0}}, 0, 0 }, + { "R10", 10, {0, {0}}, 0, 0 }, + { "R11", 11, {0, {0}}, 0, 0 }, + { "R12", 12, {0, {0}}, 0, 0 }, + { "fp", 12, {0, {0}}, 0, 0 }, + { "R13", 13, {0, {0}}, 0, 0 }, + { "sp", 13, {0, {0}}, 0, 0 }, + { "R14", 14, {0, {0}}, 0, 0 }, + { "ra", 14, {0, {0}}, 0, 0 }, + { "R15", 15, {0, {0}}, 0, 0 }, + { "ira", 15, {0, {0}}, 0, 0 } +}; + +CGEN_KEYWORD ms1_cgen_opval_h_spr = +{ + & ms1_cgen_opval_h_spr_entries[0], + 20, + 0, 0, 0, 0, "" +}; + + +/* The hardware table. */ + +#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) +#define A(a) (1 << CGEN_HW_##a) +#else +#define A(a) (1 << CGEN_HW_/**/a) +#endif + +const CGEN_HW_ENTRY ms1_cgen_hw_table[] = +{ + { "h-memory", HW_H_MEMORY, CGEN_ASM_NONE, 0, { 0, { (1<name) + { + if (strcmp (name, table->bfd_name) == 0) + return table; + ++table; + } + abort (); +} + +/* Subroutine of ms1_cgen_cpu_open to build the hardware table. */ + +static void +build_hw_table (cd) + CGEN_CPU_TABLE *cd; +{ + int i; + int machs = cd->machs; + const CGEN_HW_ENTRY *init = & ms1_cgen_hw_table[0]; + /* MAX_HW is only an upper bound on the number of selected entries. + However each entry is indexed by it's enum so there can be holes in + the table. */ + const CGEN_HW_ENTRY **selected = + (const CGEN_HW_ENTRY **) xmalloc (MAX_HW * sizeof (CGEN_HW_ENTRY *)); + + cd->hw_table.init_entries = init; + cd->hw_table.entry_size = sizeof (CGEN_HW_ENTRY); + memset (selected, 0, MAX_HW * sizeof (CGEN_HW_ENTRY *)); + /* ??? For now we just use machs to determine which ones we want. */ + for (i = 0; init[i].name != NULL; ++i) + if (CGEN_HW_ATTR_VALUE (&init[i], CGEN_HW_MACH) + & machs) + selected[init[i].type] = &init[i]; + cd->hw_table.entries = selected; + cd->hw_table.num_entries = MAX_HW; +} + +/* Subroutine of ms1_cgen_cpu_open to build the hardware table. */ + +static void +build_ifield_table (cd) + CGEN_CPU_TABLE *cd; +{ + cd->ifld_table = & ms1_cgen_ifld_table[0]; +} + +/* Subroutine of ms1_cgen_cpu_open to build the hardware table. */ + +static void +build_operand_table (cd) + CGEN_CPU_TABLE *cd; +{ + int i; + int machs = cd->machs; + const CGEN_OPERAND *init = & ms1_cgen_operand_table[0]; + /* MAX_OPERANDS is only an upper bound on the number of selected entries. + However each entry is indexed by it's enum so there can be holes in + the table. */ + const CGEN_OPERAND **selected = + (const CGEN_OPERAND **) xmalloc (MAX_OPERANDS * sizeof (CGEN_OPERAND *)); + + cd->operand_table.init_entries = init; + cd->operand_table.entry_size = sizeof (CGEN_OPERAND); + memset (selected, 0, MAX_OPERANDS * sizeof (CGEN_OPERAND *)); + /* ??? For now we just use mach to determine which ones we want. */ + for (i = 0; init[i].name != NULL; ++i) + if (CGEN_OPERAND_ATTR_VALUE (&init[i], CGEN_OPERAND_MACH) + & machs) + selected[init[i].type] = &init[i]; + cd->operand_table.entries = selected; + cd->operand_table.num_entries = MAX_OPERANDS; +} + +/* Subroutine of ms1_cgen_cpu_open to build the hardware table. + ??? This could leave out insns not supported by the specified mach/isa, + but that would cause errors like "foo only supported by bar" to become + "unknown insn", so for now we include all insns and require the app to + do the checking later. + ??? On the other hand, parsing of such insns may require their hardware or + operand elements to be in the table [which they mightn't be]. */ + +static void +build_insn_table (cd) + CGEN_CPU_TABLE *cd; +{ + int i; + const CGEN_IBASE *ib = & ms1_cgen_insn_table[0]; + CGEN_INSN *insns = (CGEN_INSN *) xmalloc (MAX_INSNS * sizeof (CGEN_INSN)); + + memset (insns, 0, MAX_INSNS * sizeof (CGEN_INSN)); + for (i = 0; i < MAX_INSNS; ++i) + insns[i].base = &ib[i]; + cd->insn_table.init_entries = insns; + cd->insn_table.entry_size = sizeof (CGEN_IBASE); + cd->insn_table.num_init_entries = MAX_INSNS; +} + +/* Subroutine of ms1_cgen_cpu_open to rebuild the tables. */ + +static void +ms1_cgen_rebuild_tables (cd) + CGEN_CPU_TABLE *cd; +{ + int i; + unsigned int isas = cd->isas; + unsigned int machs = cd->machs; + + cd->int_insn_p = CGEN_INT_INSN_P; + + /* Data derived from the isa spec. */ +#define UNSET (CGEN_SIZE_UNKNOWN + 1) + cd->default_insn_bitsize = UNSET; + cd->base_insn_bitsize = UNSET; + cd->min_insn_bitsize = 65535; /* some ridiculously big number */ + cd->max_insn_bitsize = 0; + for (i = 0; i < MAX_ISAS; ++i) + if (((1 << i) & isas) != 0) + { + const CGEN_ISA *isa = & ms1_cgen_isa_table[i]; + + /* Default insn sizes of all selected isas must be + equal or we set the result to 0, meaning "unknown". */ + if (cd->default_insn_bitsize == UNSET) + cd->default_insn_bitsize = isa->default_insn_bitsize; + else if (isa->default_insn_bitsize == cd->default_insn_bitsize) + ; /* this is ok */ + else + cd->default_insn_bitsize = CGEN_SIZE_UNKNOWN; + + /* Base insn sizes of all selected isas must be equal + or we set the result to 0, meaning "unknown". */ + if (cd->base_insn_bitsize == UNSET) + cd->base_insn_bitsize = isa->base_insn_bitsize; + else if (isa->base_insn_bitsize == cd->base_insn_bitsize) + ; /* this is ok */ + else + cd->base_insn_bitsize = CGEN_SIZE_UNKNOWN; + + /* Set min,max insn sizes. */ + if (isa->min_insn_bitsize < cd->min_insn_bitsize) + cd->min_insn_bitsize = isa->min_insn_bitsize; + if (isa->max_insn_bitsize > cd->max_insn_bitsize) + cd->max_insn_bitsize = isa->max_insn_bitsize; + } + + /* Data derived from the mach spec. */ + for (i = 0; i < MAX_MACHS; ++i) + if (((1 << i) & machs) != 0) + { + const CGEN_MACH *mach = & ms1_cgen_mach_table[i]; + + if (mach->insn_chunk_bitsize != 0) + { + if (cd->insn_chunk_bitsize != 0 && cd->insn_chunk_bitsize != mach->insn_chunk_bitsize) + { + fprintf (stderr, "ms1_cgen_rebuild_tables: conflicting insn-chunk-bitsize values: `%d' vs. `%d'\n", + cd->insn_chunk_bitsize, mach->insn_chunk_bitsize); + abort (); + } + + cd->insn_chunk_bitsize = mach->insn_chunk_bitsize; + } + } + + /* Determine which hw elements are used by MACH. */ + build_hw_table (cd); + + /* Build the ifield table. */ + build_ifield_table (cd); + + /* Determine which operands are used by MACH/ISA. */ + build_operand_table (cd); + + /* Build the instruction table. */ + build_insn_table (cd); +} + +/* Initialize a cpu table and return a descriptor. + It's much like opening a file, and must be the first function called. + The arguments are a set of (type/value) pairs, terminated with + CGEN_CPU_OPEN_END. + + Currently supported values: + CGEN_CPU_OPEN_ISAS: bitmap of values in enum isa_attr + CGEN_CPU_OPEN_MACHS: bitmap of values in enum mach_attr + CGEN_CPU_OPEN_BFDMACH: specify 1 mach using bfd name + CGEN_CPU_OPEN_ENDIAN: specify endian choice + CGEN_CPU_OPEN_END: terminates arguments + + ??? Simultaneous multiple isas might not make sense, but it's not (yet) + precluded. + + ??? We only support ISO C stdargs here, not K&R. + Laziness, plus experiment to see if anything requires K&R - eventually + K&R will no longer be supported - e.g. GDB is currently trying this. */ + +CGEN_CPU_DESC +ms1_cgen_cpu_open (enum cgen_cpu_open_arg arg_type, ...) +{ + CGEN_CPU_TABLE *cd = (CGEN_CPU_TABLE *) xmalloc (sizeof (CGEN_CPU_TABLE)); + static int init_p; + unsigned int isas = 0; /* 0 = "unspecified" */ + unsigned int machs = 0; /* 0 = "unspecified" */ + enum cgen_endian endian = CGEN_ENDIAN_UNKNOWN; + va_list ap; + + if (! init_p) + { + init_tables (); + init_p = 1; + } + + memset (cd, 0, sizeof (*cd)); + + va_start (ap, arg_type); + while (arg_type != CGEN_CPU_OPEN_END) + { + switch (arg_type) + { + case CGEN_CPU_OPEN_ISAS : + isas = va_arg (ap, unsigned int); + break; + case CGEN_CPU_OPEN_MACHS : + machs = va_arg (ap, unsigned int); + break; + case CGEN_CPU_OPEN_BFDMACH : + { + const char *name = va_arg (ap, const char *); + const CGEN_MACH *mach = + lookup_mach_via_bfd_name (ms1_cgen_mach_table, name); + + machs |= 1 << mach->num; + break; + } + case CGEN_CPU_OPEN_ENDIAN : + endian = va_arg (ap, enum cgen_endian); + break; + default : + fprintf (stderr, "ms1_cgen_cpu_open: unsupported argument `%d'\n", + arg_type); + abort (); /* ??? return NULL? */ + } + arg_type = va_arg (ap, enum cgen_cpu_open_arg); + } + va_end (ap); + + /* mach unspecified means "all" */ + if (machs == 0) + machs = (1 << MAX_MACHS) - 1; + /* base mach is always selected */ + machs |= 1; + /* isa unspecified means "all" */ + if (isas == 0) + isas = (1 << MAX_ISAS) - 1; + if (endian == CGEN_ENDIAN_UNKNOWN) + { + /* ??? If target has only one, could have a default. */ + fprintf (stderr, "ms1_cgen_cpu_open: no endianness specified\n"); + abort (); + } + + cd->isas = isas; + cd->machs = machs; + cd->endian = endian; + /* FIXME: for the sparc case we can determine insn-endianness statically. + The worry here is where both data and insn endian can be independently + chosen, in which case this function will need another argument. + Actually, will want to allow for more arguments in the future anyway. */ + cd->insn_endian = endian; + + /* Table (re)builder. */ + cd->rebuild_tables = ms1_cgen_rebuild_tables; + ms1_cgen_rebuild_tables (cd); + + /* Default to not allowing signed overflow. */ + cd->signed_overflow_ok_p = 0; + + return (CGEN_CPU_DESC) cd; +} + +/* Cover fn to ms1_cgen_cpu_open to handle the simple case of 1 isa, 1 mach. + MACH_NAME is the bfd name of the mach. */ + +CGEN_CPU_DESC +ms1_cgen_cpu_open_1 (mach_name, endian) + const char *mach_name; + enum cgen_endian endian; +{ + return ms1_cgen_cpu_open (CGEN_CPU_OPEN_BFDMACH, mach_name, + CGEN_CPU_OPEN_ENDIAN, endian, + CGEN_CPU_OPEN_END); +} + +/* Close a cpu table. + ??? This can live in a machine independent file, but there's currently + no place to put this file (there's no libcgen). libopcodes is the wrong + place as some simulator ports use this but they don't use libopcodes. */ + +void +ms1_cgen_cpu_close (cd) + CGEN_CPU_DESC cd; +{ + unsigned int i; + const CGEN_INSN *insns; + + if (cd->macro_insn_table.init_entries) + { + insns = cd->macro_insn_table.init_entries; + for (i = 0; i < cd->macro_insn_table.num_init_entries; ++i, ++insns) + { + if (CGEN_INSN_RX ((insns))) + regfree (CGEN_INSN_RX (insns)); + } + } + + if (cd->insn_table.init_entries) + { + insns = cd->insn_table.init_entries; + for (i = 0; i < cd->insn_table.num_init_entries; ++i, ++insns) + { + if (CGEN_INSN_RX (insns)) + regfree (CGEN_INSN_RX (insns)); + } + } + + + + if (cd->macro_insn_table.init_entries) + free ((CGEN_INSN *) cd->macro_insn_table.init_entries); + + if (cd->insn_table.init_entries) + free ((CGEN_INSN *) cd->insn_table.init_entries); + + if (cd->hw_table.entries) + free ((CGEN_HW_ENTRY *) cd->hw_table.entries); + + if (cd->operand_table.entries) + free ((CGEN_HW_ENTRY *) cd->operand_table.entries); + + free (cd); +} + diff -uprN binutils-2.16.90.0.3/opcodes/ms1-desc.h binutils-2.16.91.0.1/opcodes/ms1-desc.h --- binutils-2.16.90.0.3/opcodes/ms1-desc.h 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/opcodes/ms1-desc.h 2005-06-22 13:53:36.282089836 -0700 @@ -0,0 +1,246 @@ +/* CPU data header for ms1. + +THIS FILE IS MACHINE GENERATED WITH CGEN. + +Copyright 1996-2005 Free Software Foundation, Inc. + +This file is part of the GNU Binutils and/or GDB, the GNU debugger. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +#ifndef MS1_CPU_H +#define MS1_CPU_H + +#define CGEN_ARCH ms1 + +/* Given symbol S, return ms1_cgen_. */ +#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) +#define CGEN_SYM(s) ms1##_cgen_##s +#else +#define CGEN_SYM(s) ms1/**/_cgen_/**/s +#endif + + +/* Selected cpu families. */ +#define HAVE_CPU_MS1BF +#define HAVE_CPU_MS1_003BF + +#define CGEN_INSN_LSB0_P 1 + +/* Minimum size of any insn (in bytes). */ +#define CGEN_MIN_INSN_SIZE 4 + +/* Maximum size of any insn (in bytes). */ +#define CGEN_MAX_INSN_SIZE 4 + +#define CGEN_INT_INSN_P 1 + +/* Maximum number of syntax elements in an instruction. */ +#define CGEN_ACTUAL_MAX_SYNTAX_ELEMENTS 40 + +/* CGEN_MNEMONIC_OPERANDS is defined if mnemonics have operands. + e.g. In "b,a foo" the ",a" is an operand. If mnemonics have operands + we can't hash on everything up to the space. */ +#define CGEN_MNEMONIC_OPERANDS + +/* Maximum number of fields in an instruction. */ +#define CGEN_ACTUAL_MAX_IFMT_OPERANDS 14 + +/* Enums. */ + +/* Enum declaration for msys enums. */ +typedef enum insn_msys { + MSYS_NO, MSYS_YES +} INSN_MSYS; + +/* Enum declaration for opc enums. */ +typedef enum insn_opc { + OPC_ADD = 0, OPC_ADDU = 1, OPC_SUB = 2, OPC_SUBU = 3 + , OPC_MUL = 4, OPC_AND = 8, OPC_OR = 9, OPC_XOR = 10 + , OPC_NAND = 11, OPC_NOR = 12, OPC_XNOR = 13, OPC_LDUI = 14 + , OPC_LSL = 16, OPC_LSR = 17, OPC_ASR = 18, OPC_BRLT = 24 + , OPC_BRLE = 25, OPC_BREQ = 26, OPC_JMP = 27, OPC_JAL = 28 + , OPC_BRNEQ = 29, OPC_DBNZ = 30, OPC_LDW = 32, OPC_STW = 33 + , OPC_EI = 48, OPC_DI = 49, OPC_SI = 50, OPC_RETI = 51 + , OPC_BREAK = 52, OPC_IFLUSH = 53 +} INSN_OPC; + +/* Enum declaration for msopc enums. */ +typedef enum insn_msopc { + MSOPC_LDCTXT, MSOPC_LDFB, MSOPC_STFB, MSOPC_FBCB + , MSOPC_MFBCB, MSOPC_FBCCI, MSOPC_FBRCI, MSOPC_FBCRI + , MSOPC_FBRRI, MSOPC_MFBCCI, MSOPC_MFBRCI, MSOPC_MFBCRI + , MSOPC_MFBRRI, MSOPC_FBCBDR, MSOPC_RCFBCB, MSOPC_MRCFBCB + , MSOPC_CBCAST, MSOPC_DUPCBCAST, MSOPC_WFBI, MSOPC_WFB + , MSOPC_RCRISC, MSOPC_FBCBINC, MSOPC_RCXMODE, MSOPC_INTLVR + , MSOPC_WFBINC, MSOPC_MWFBINC, MSOPC_WFBINCR, MSOPC_MWFBINCR + , MSOPC_FBCBINCS, MSOPC_MFBCBINCS, MSOPC_FBCBINCRS, MSOPC_MFBCBINCRS +} INSN_MSOPC; + +/* Enum declaration for imm enums. */ +typedef enum insn_imm { + IMM_NO, IMM_YES +} INSN_IMM; + +/* Enum declaration for . */ +typedef enum msys_syms { + H_NIL_DUP = 1, H_NIL_XX = 0 +} MSYS_SYMS; + +/* Attributes. */ + +/* Enum declaration for machine type selection. */ +typedef enum mach_attr { + MACH_BASE, MACH_MS1, MACH_MS1_003, MACH_MAX +} MACH_ATTR; + +/* Enum declaration for instruction set selection. */ +typedef enum isa_attr { + ISA_MS1, ISA_MAX +} ISA_ATTR; + +/* Number of architecture variants. */ +#define MAX_ISAS 1 +#define MAX_MACHS ((int) MACH_MAX) + +/* Ifield support. */ + +/* Ifield attribute indices. */ + +/* Enum declaration for cgen_ifld attrs. */ +typedef enum cgen_ifld_attr { + CGEN_IFLD_VIRTUAL, CGEN_IFLD_PCREL_ADDR, CGEN_IFLD_ABS_ADDR, CGEN_IFLD_RESERVED + , CGEN_IFLD_SIGN_OPT, CGEN_IFLD_SIGNED, CGEN_IFLD_END_BOOLS, CGEN_IFLD_START_NBOOLS = 31 + , CGEN_IFLD_MACH, CGEN_IFLD_END_NBOOLS +} CGEN_IFLD_ATTR; + +/* Number of non-boolean elements in cgen_ifld_attr. */ +#define CGEN_IFLD_NBOOL_ATTRS (CGEN_IFLD_END_NBOOLS - CGEN_IFLD_START_NBOOLS - 1) + +/* Enum declaration for ms1 ifield types. */ +typedef enum ifield_type { + MS1_F_NIL, MS1_F_ANYOF, MS1_F_MSYS, MS1_F_OPC + , MS1_F_IMM, MS1_F_UU24, MS1_F_SR1, MS1_F_SR2 + , MS1_F_DR, MS1_F_DRRR, MS1_F_IMM16U, MS1_F_IMM16S + , MS1_F_IMM16A, MS1_F_UU4A, MS1_F_UU4B, MS1_F_UU12 + , MS1_F_UU16, MS1_F_MSOPC, MS1_F_UU_26_25, MS1_F_MASK + , MS1_F_BANKADDR, MS1_F_RDA, MS1_F_UU_2_25, MS1_F_RBBC + , MS1_F_PERM, MS1_F_MODE, MS1_F_UU_1_24, MS1_F_WR + , MS1_F_FBINCR, MS1_F_UU_2_23, MS1_F_XMODE, MS1_F_A23 + , MS1_F_MASK1, MS1_F_CR, MS1_F_TYPE, MS1_F_INCAMT + , MS1_F_CBS, MS1_F_UU_1_19, MS1_F_BALL, MS1_F_COLNUM + , MS1_F_BRC, MS1_F_INCR, MS1_F_FBDISP, MS1_F_UU_4_15 + , MS1_F_LENGTH, MS1_F_UU_1_15, MS1_F_RC, MS1_F_RCNUM + , MS1_F_ROWNUM, MS1_F_CBX, MS1_F_ID, MS1_F_SIZE + , MS1_F_ROWNUM1, MS1_F_UU_3_11, MS1_F_RC1, MS1_F_CCB + , MS1_F_CBRB, MS1_F_CDB, MS1_F_ROWNUM2, MS1_F_CELL + , MS1_F_UU_3_9, MS1_F_CONTNUM, MS1_F_UU_1_6, MS1_F_DUP + , MS1_F_RC2, MS1_F_CTXDISP, MS1_F_MSYSFRSR2, MS1_F_BRC2 + , MS1_F_BALL2, MS1_F_MAX +} IFIELD_TYPE; + +#define MAX_IFLD ((int) MS1_F_MAX) + +/* Hardware attribute indices. */ + +/* Enum declaration for cgen_hw attrs. */ +typedef enum cgen_hw_attr { + CGEN_HW_VIRTUAL, CGEN_HW_CACHE_ADDR, CGEN_HW_PC, CGEN_HW_PROFILE + , CGEN_HW_END_BOOLS, CGEN_HW_START_NBOOLS = 31, CGEN_HW_MACH, CGEN_HW_END_NBOOLS +} CGEN_HW_ATTR; + +/* Number of non-boolean elements in cgen_hw_attr. */ +#define CGEN_HW_NBOOL_ATTRS (CGEN_HW_END_NBOOLS - CGEN_HW_START_NBOOLS - 1) + +/* Enum declaration for ms1 hardware types. */ +typedef enum cgen_hw_type { + HW_H_MEMORY, HW_H_SINT, HW_H_UINT, HW_H_ADDR + , HW_H_IADDR, HW_H_SPR, HW_H_PC, HW_MAX +} CGEN_HW_TYPE; + +#define MAX_HW ((int) HW_MAX) + +/* Operand attribute indices. */ + +/* Enum declaration for cgen_operand attrs. */ +typedef enum cgen_operand_attr { + CGEN_OPERAND_VIRTUAL, CGEN_OPERAND_PCREL_ADDR, CGEN_OPERAND_ABS_ADDR, CGEN_OPERAND_SIGN_OPT + , CGEN_OPERAND_SIGNED, CGEN_OPERAND_NEGATIVE, CGEN_OPERAND_RELAX, CGEN_OPERAND_SEM_ONLY + , CGEN_OPERAND_END_BOOLS, CGEN_OPERAND_START_NBOOLS = 31, CGEN_OPERAND_MACH, CGEN_OPERAND_END_NBOOLS +} CGEN_OPERAND_ATTR; + +/* Number of non-boolean elements in cgen_operand_attr. */ +#define CGEN_OPERAND_NBOOL_ATTRS (CGEN_OPERAND_END_NBOOLS - CGEN_OPERAND_START_NBOOLS - 1) + +/* Enum declaration for ms1 operand types. */ +typedef enum cgen_operand_type { + MS1_OPERAND_PC, MS1_OPERAND_FRSR1, MS1_OPERAND_FRSR2, MS1_OPERAND_FRDR + , MS1_OPERAND_FRDRRR, MS1_OPERAND_IMM16, MS1_OPERAND_IMM16Z, MS1_OPERAND_IMM16O + , MS1_OPERAND_RC, MS1_OPERAND_RCNUM, MS1_OPERAND_CONTNUM, MS1_OPERAND_RBBC + , MS1_OPERAND_COLNUM, MS1_OPERAND_ROWNUM, MS1_OPERAND_ROWNUM1, MS1_OPERAND_ROWNUM2 + , MS1_OPERAND_RC1, MS1_OPERAND_RC2, MS1_OPERAND_CBRB, MS1_OPERAND_CELL + , MS1_OPERAND_DUP, MS1_OPERAND_CTXDISP, MS1_OPERAND_FBDISP, MS1_OPERAND_TYPE + , MS1_OPERAND_MASK, MS1_OPERAND_BANKADDR, MS1_OPERAND_INCAMT, MS1_OPERAND_XMODE + , MS1_OPERAND_MASK1, MS1_OPERAND_BALL, MS1_OPERAND_BRC, MS1_OPERAND_RDA + , MS1_OPERAND_WR, MS1_OPERAND_BALL2, MS1_OPERAND_BRC2, MS1_OPERAND_PERM + , MS1_OPERAND_A23, MS1_OPERAND_CR, MS1_OPERAND_CBS, MS1_OPERAND_INCR + , MS1_OPERAND_LENGTH, MS1_OPERAND_CBX, MS1_OPERAND_CCB, MS1_OPERAND_CDB + , MS1_OPERAND_MODE, MS1_OPERAND_ID, MS1_OPERAND_SIZE, MS1_OPERAND_FBINCR + , MS1_OPERAND_MAX +} CGEN_OPERAND_TYPE; + +/* Number of operands types. */ +#define MAX_OPERANDS 48 + +/* Maximum number of operands referenced by any insn. */ +#define MAX_OPERAND_INSTANCES 8 + +/* Insn attribute indices. */ + +/* Enum declaration for cgen_insn attrs. */ +typedef enum cgen_insn_attr { + CGEN_INSN_ALIAS, CGEN_INSN_VIRTUAL, CGEN_INSN_UNCOND_CTI, CGEN_INSN_COND_CTI + , CGEN_INSN_SKIP_CTI, CGEN_INSN_DELAY_SLOT, CGEN_INSN_RELAXABLE, CGEN_INSN_RELAXED + , CGEN_INSN_NO_DIS, CGEN_INSN_PBB, CGEN_INSN_LOAD_DELAY, CGEN_INSN_MEMORY_ACCESS + , CGEN_INSN_AL_INSN, CGEN_INSN_IO_INSN, CGEN_INSN_BR_INSN, CGEN_INSN_USES_FRDR + , CGEN_INSN_USES_FRDRRR, CGEN_INSN_USES_FRSR1, CGEN_INSN_USES_FRSR2, CGEN_INSN_SKIPA + , CGEN_INSN_END_BOOLS, CGEN_INSN_START_NBOOLS = 31, CGEN_INSN_MACH, CGEN_INSN_END_NBOOLS +} CGEN_INSN_ATTR; + +/* Number of non-boolean elements in cgen_insn_attr. */ +#define CGEN_INSN_NBOOL_ATTRS (CGEN_INSN_END_NBOOLS - CGEN_INSN_START_NBOOLS - 1) + +/* cgen.h uses things we just defined. */ +#include "opcode/cgen.h" + +extern const struct cgen_ifld ms1_cgen_ifld_table[]; + +/* Attributes. */ +extern const CGEN_ATTR_TABLE ms1_cgen_hardware_attr_table[]; +extern const CGEN_ATTR_TABLE ms1_cgen_ifield_attr_table[]; +extern const CGEN_ATTR_TABLE ms1_cgen_operand_attr_table[]; +extern const CGEN_ATTR_TABLE ms1_cgen_insn_attr_table[]; + +/* Hardware decls. */ + +extern CGEN_KEYWORD ms1_cgen_opval_h_spr; + +extern const CGEN_HW_ENTRY ms1_cgen_hw_table[]; + + + +#endif /* MS1_CPU_H */ diff -uprN binutils-2.16.90.0.3/opcodes/ms1-dis.c binutils-2.16.91.0.1/opcodes/ms1-dis.c --- binutils-2.16.90.0.3/opcodes/ms1-dis.c 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/opcodes/ms1-dis.c 2005-06-22 13:53:36.283089671 -0700 @@ -0,0 +1,678 @@ +/* Disassembler interface for targets using CGEN. -*- C -*- + CGEN: Cpu tools GENerator + +THIS FILE IS MACHINE GENERATED WITH CGEN. +- the resultant file is machine generated, cgen-dis.in isn't + +Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2005 +Free Software Foundation, Inc. + +This file is part of the GNU Binutils and GDB, the GNU debugger. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* ??? Eventually more and more of this stuff can go to cpu-independent files. + Keep that in mind. */ + +#include "sysdep.h" +#include +#include "ansidecl.h" +#include "dis-asm.h" +#include "bfd.h" +#include "symcat.h" +#include "libiberty.h" +#include "ms1-desc.h" +#include "ms1-opc.h" +#include "opintl.h" + +/* Default text to print if an instruction isn't recognized. */ +#define UNKNOWN_INSN_MSG _("*unknown*") + +static void print_normal + (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int); +static void print_address + (CGEN_CPU_DESC, void *, bfd_vma, unsigned int, bfd_vma, int) ATTRIBUTE_UNUSED; +static void print_keyword + (CGEN_CPU_DESC, void *, CGEN_KEYWORD *, long, unsigned int) ATTRIBUTE_UNUSED; +static void print_insn_normal + (CGEN_CPU_DESC, void *, const CGEN_INSN *, CGEN_FIELDS *, bfd_vma, int); +static int print_insn + (CGEN_CPU_DESC, bfd_vma, disassemble_info *, bfd_byte *, unsigned); +static int default_print_insn + (CGEN_CPU_DESC, bfd_vma, disassemble_info *) ATTRIBUTE_UNUSED; +static int read_insn + (CGEN_CPU_DESC, bfd_vma, disassemble_info *, bfd_byte *, int, CGEN_EXTRACT_INFO *, + unsigned long *); + +/* -- disassembler routines inserted here */ + +/* -- dis.c */ +static void print_dollarhex (CGEN_CPU_DESC, PTR, long, unsigned, bfd_vma, int); + +static void +print_dollarhex (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, + void * dis_info, + long value, + unsigned int attrs ATTRIBUTE_UNUSED, + bfd_vma pc ATTRIBUTE_UNUSED, + int length ATTRIBUTE_UNUSED) +{ + disassemble_info *info = (disassemble_info *) dis_info; + + info->fprintf_func (info->stream, "$%x", value); + + if (0) + print_normal (cd, dis_info, value, attrs, pc, length); +} + + +/* -- */ + +void ms1_cgen_print_operand + PARAMS ((CGEN_CPU_DESC, int, PTR, CGEN_FIELDS *, + void const *, bfd_vma, int)); + +/* Main entry point for printing operands. + XINFO is a `void *' and not a `disassemble_info *' to not put a requirement + of dis-asm.h on cgen.h. + + This function is basically just a big switch statement. Earlier versions + used tables to look up the function to use, but + - if the table contains both assembler and disassembler functions then + the disassembler contains much of the assembler and vice-versa, + - there's a lot of inlining possibilities as things grow, + - using a switch statement avoids the function call overhead. + + This function could be moved into `print_insn_normal', but keeping it + separate makes clear the interface between `print_insn_normal' and each of + the handlers. */ + +void +ms1_cgen_print_operand (cd, opindex, xinfo, fields, attrs, pc, length) + CGEN_CPU_DESC cd; + int opindex; + PTR xinfo; + CGEN_FIELDS *fields; + void const *attrs ATTRIBUTE_UNUSED; + bfd_vma pc; + int length; +{ + disassemble_info *info = (disassemble_info *) xinfo; + + switch (opindex) + { + case MS1_OPERAND_A23 : + print_dollarhex (cd, info, fields->f_a23, 0, pc, length); + break; + case MS1_OPERAND_BALL : + print_dollarhex (cd, info, fields->f_ball, 0, pc, length); + break; + case MS1_OPERAND_BALL2 : + print_dollarhex (cd, info, fields->f_ball2, 0, pc, length); + break; + case MS1_OPERAND_BANKADDR : + print_dollarhex (cd, info, fields->f_bankaddr, 0, pc, length); + break; + case MS1_OPERAND_BRC : + print_dollarhex (cd, info, fields->f_brc, 0, pc, length); + break; + case MS1_OPERAND_BRC2 : + print_dollarhex (cd, info, fields->f_brc2, 0, pc, length); + break; + case MS1_OPERAND_CBRB : + print_dollarhex (cd, info, fields->f_cbrb, 0, pc, length); + break; + case MS1_OPERAND_CBS : + print_dollarhex (cd, info, fields->f_cbs, 0, pc, length); + break; + case MS1_OPERAND_CBX : + print_dollarhex (cd, info, fields->f_cbx, 0, pc, length); + break; + case MS1_OPERAND_CCB : + print_dollarhex (cd, info, fields->f_ccb, 0, pc, length); + break; + case MS1_OPERAND_CDB : + print_dollarhex (cd, info, fields->f_cdb, 0, pc, length); + break; + case MS1_OPERAND_CELL : + print_dollarhex (cd, info, fields->f_cell, 0, pc, length); + break; + case MS1_OPERAND_COLNUM : + print_dollarhex (cd, info, fields->f_colnum, 0, pc, length); + break; + case MS1_OPERAND_CONTNUM : + print_dollarhex (cd, info, fields->f_contnum, 0, pc, length); + break; + case MS1_OPERAND_CR : + print_dollarhex (cd, info, fields->f_cr, 0, pc, length); + break; + case MS1_OPERAND_CTXDISP : + print_dollarhex (cd, info, fields->f_ctxdisp, 0, pc, length); + break; + case MS1_OPERAND_DUP : + print_dollarhex (cd, info, fields->f_dup, 0, pc, length); + break; + case MS1_OPERAND_FBDISP : + print_dollarhex (cd, info, fields->f_fbdisp, 0, pc, length); + break; + case MS1_OPERAND_FBINCR : + print_dollarhex (cd, info, fields->f_fbincr, 0, pc, length); + break; + case MS1_OPERAND_FRDR : + print_keyword (cd, info, & ms1_cgen_opval_h_spr, fields->f_dr, 0|(1<f_drrr, 0|(1<f_sr1, 0|(1<f_sr2, 0|(1<f_id, 0, pc, length); + break; + case MS1_OPERAND_IMM16 : + print_dollarhex (cd, info, fields->f_imm16s, 0|(1<f_imm16s, 0, pc, length); + break; + case MS1_OPERAND_IMM16Z : + print_dollarhex (cd, info, fields->f_imm16u, 0, pc, length); + break; + case MS1_OPERAND_INCAMT : + print_dollarhex (cd, info, fields->f_incamt, 0, pc, length); + break; + case MS1_OPERAND_INCR : + print_dollarhex (cd, info, fields->f_incr, 0, pc, length); + break; + case MS1_OPERAND_LENGTH : + print_dollarhex (cd, info, fields->f_length, 0, pc, length); + break; + case MS1_OPERAND_MASK : + print_dollarhex (cd, info, fields->f_mask, 0, pc, length); + break; + case MS1_OPERAND_MASK1 : + print_dollarhex (cd, info, fields->f_mask1, 0, pc, length); + break; + case MS1_OPERAND_MODE : + print_dollarhex (cd, info, fields->f_mode, 0, pc, length); + break; + case MS1_OPERAND_PERM : + print_dollarhex (cd, info, fields->f_perm, 0, pc, length); + break; + case MS1_OPERAND_RBBC : + print_dollarhex (cd, info, fields->f_rbbc, 0, pc, length); + break; + case MS1_OPERAND_RC : + print_dollarhex (cd, info, fields->f_rc, 0, pc, length); + break; + case MS1_OPERAND_RC1 : + print_dollarhex (cd, info, fields->f_rc1, 0, pc, length); + break; + case MS1_OPERAND_RC2 : + print_dollarhex (cd, info, fields->f_rc2, 0, pc, length); + break; + case MS1_OPERAND_RCNUM : + print_dollarhex (cd, info, fields->f_rcnum, 0, pc, length); + break; + case MS1_OPERAND_RDA : + print_dollarhex (cd, info, fields->f_rda, 0, pc, length); + break; + case MS1_OPERAND_ROWNUM : + print_dollarhex (cd, info, fields->f_rownum, 0, pc, length); + break; + case MS1_OPERAND_ROWNUM1 : + print_dollarhex (cd, info, fields->f_rownum1, 0, pc, length); + break; + case MS1_OPERAND_ROWNUM2 : + print_dollarhex (cd, info, fields->f_rownum2, 0, pc, length); + break; + case MS1_OPERAND_SIZE : + print_dollarhex (cd, info, fields->f_size, 0, pc, length); + break; + case MS1_OPERAND_TYPE : + print_dollarhex (cd, info, fields->f_type, 0, pc, length); + break; + case MS1_OPERAND_WR : + print_dollarhex (cd, info, fields->f_wr, 0, pc, length); + break; + case MS1_OPERAND_XMODE : + print_dollarhex (cd, info, fields->f_xmode, 0, pc, length); + break; + + default : + /* xgettext:c-format */ + fprintf (stderr, _("Unrecognized field %d while printing insn.\n"), + opindex); + abort (); + } +} + +cgen_print_fn * const ms1_cgen_print_handlers[] = +{ + print_insn_normal, +}; + + +void +ms1_cgen_init_dis (cd) + CGEN_CPU_DESC cd; +{ + ms1_cgen_init_opcode_table (cd); + ms1_cgen_init_ibld_table (cd); + cd->print_handlers = & ms1_cgen_print_handlers[0]; + cd->print_operand = ms1_cgen_print_operand; +} + + +/* Default print handler. */ + +static void +print_normal (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, + void *dis_info, + long value, + unsigned int attrs, + bfd_vma pc ATTRIBUTE_UNUSED, + int length ATTRIBUTE_UNUSED) +{ + disassemble_info *info = (disassemble_info *) dis_info; + +#ifdef CGEN_PRINT_NORMAL + CGEN_PRINT_NORMAL (cd, info, value, attrs, pc, length); +#endif + + /* Print the operand as directed by the attributes. */ + if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SEM_ONLY)) + ; /* nothing to do */ + else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SIGNED)) + (*info->fprintf_func) (info->stream, "%ld", value); + else + (*info->fprintf_func) (info->stream, "0x%lx", value); +} + +/* Default address handler. */ + +static void +print_address (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, + void *dis_info, + bfd_vma value, + unsigned int attrs, + bfd_vma pc ATTRIBUTE_UNUSED, + int length ATTRIBUTE_UNUSED) +{ + disassemble_info *info = (disassemble_info *) dis_info; + +#ifdef CGEN_PRINT_ADDRESS + CGEN_PRINT_ADDRESS (cd, info, value, attrs, pc, length); +#endif + + /* Print the operand as directed by the attributes. */ + if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SEM_ONLY)) + ; /* nothing to do */ + else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_PCREL_ADDR)) + (*info->print_address_func) (value, info); + else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_ABS_ADDR)) + (*info->print_address_func) (value, info); + else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SIGNED)) + (*info->fprintf_func) (info->stream, "%ld", (long) value); + else + (*info->fprintf_func) (info->stream, "0x%lx", (long) value); +} + +/* Keyword print handler. */ + +static void +print_keyword (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, + void *dis_info, + CGEN_KEYWORD *keyword_table, + long value, + unsigned int attrs ATTRIBUTE_UNUSED) +{ + disassemble_info *info = (disassemble_info *) dis_info; + const CGEN_KEYWORD_ENTRY *ke; + + ke = cgen_keyword_lookup_value (keyword_table, value); + if (ke != NULL) + (*info->fprintf_func) (info->stream, "%s", ke->name); + else + (*info->fprintf_func) (info->stream, "???"); +} + +/* Default insn printer. + + DIS_INFO is defined as `void *' so the disassembler needn't know anything + about disassemble_info. */ + +static void +print_insn_normal (CGEN_CPU_DESC cd, + void *dis_info, + const CGEN_INSN *insn, + CGEN_FIELDS *fields, + bfd_vma pc, + int length) +{ + const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn); + disassemble_info *info = (disassemble_info *) dis_info; + const CGEN_SYNTAX_CHAR_TYPE *syn; + + CGEN_INIT_PRINT (cd); + + for (syn = CGEN_SYNTAX_STRING (syntax); *syn; ++syn) + { + if (CGEN_SYNTAX_MNEMONIC_P (*syn)) + { + (*info->fprintf_func) (info->stream, "%s", CGEN_INSN_MNEMONIC (insn)); + continue; + } + if (CGEN_SYNTAX_CHAR_P (*syn)) + { + (*info->fprintf_func) (info->stream, "%c", CGEN_SYNTAX_CHAR (*syn)); + continue; + } + + /* We have an operand. */ + ms1_cgen_print_operand (cd, CGEN_SYNTAX_FIELD (*syn), info, + fields, CGEN_INSN_ATTRS (insn), pc, length); + } +} + +/* Subroutine of print_insn. Reads an insn into the given buffers and updates + the extract info. + Returns 0 if all is well, non-zero otherwise. */ + +static int +read_insn (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, + bfd_vma pc, + disassemble_info *info, + bfd_byte *buf, + int buflen, + CGEN_EXTRACT_INFO *ex_info, + unsigned long *insn_value) +{ + int status = (*info->read_memory_func) (pc, buf, buflen, info); + if (status != 0) + { + (*info->memory_error_func) (status, pc, info); + return -1; + } + + ex_info->dis_info = info; + ex_info->valid = (1 << buflen) - 1; + ex_info->insn_bytes = buf; + + *insn_value = bfd_get_bits (buf, buflen * 8, info->endian == BFD_ENDIAN_BIG); + return 0; +} + +/* Utility to print an insn. + BUF is the base part of the insn, target byte order, BUFLEN bytes long. + The result is the size of the insn in bytes or zero for an unknown insn + or -1 if an error occurs fetching data (memory_error_func will have + been called). */ + +static int +print_insn (CGEN_CPU_DESC cd, + bfd_vma pc, + disassemble_info *info, + bfd_byte *buf, + unsigned int buflen) +{ + CGEN_INSN_INT insn_value; + const CGEN_INSN_LIST *insn_list; + CGEN_EXTRACT_INFO ex_info; + int basesize; + + /* Extract base part of instruction, just in case CGEN_DIS_* uses it. */ + basesize = cd->base_insn_bitsize < buflen * 8 ? + cd->base_insn_bitsize : buflen * 8; + insn_value = cgen_get_insn_value (cd, buf, basesize); + + + /* Fill in ex_info fields like read_insn would. Don't actually call + read_insn, since the incoming buffer is already read (and possibly + modified a la m32r). */ + ex_info.valid = (1 << buflen) - 1; + ex_info.dis_info = info; + ex_info.insn_bytes = buf; + + /* The instructions are stored in hash lists. + Pick the first one and keep trying until we find the right one. */ + + insn_list = CGEN_DIS_LOOKUP_INSN (cd, (char *) buf, insn_value); + while (insn_list != NULL) + { + const CGEN_INSN *insn = insn_list->insn; + CGEN_FIELDS fields; + int length; + unsigned long insn_value_cropped; + +#ifdef CGEN_VALIDATE_INSN_SUPPORTED + /* Not needed as insn shouldn't be in hash lists if not supported. */ + /* Supported by this cpu? */ + if (! ms1_cgen_insn_supported (cd, insn)) + { + insn_list = CGEN_DIS_NEXT_INSN (insn_list); + continue; + } +#endif + + /* Basic bit mask must be correct. */ + /* ??? May wish to allow target to defer this check until the extract + handler. */ + + /* Base size may exceed this instruction's size. Extract the + relevant part from the buffer. */ + if ((unsigned) (CGEN_INSN_BITSIZE (insn) / 8) < buflen && + (unsigned) (CGEN_INSN_BITSIZE (insn) / 8) <= sizeof (unsigned long)) + insn_value_cropped = bfd_get_bits (buf, CGEN_INSN_BITSIZE (insn), + info->endian == BFD_ENDIAN_BIG); + else + insn_value_cropped = insn_value; + + if ((insn_value_cropped & CGEN_INSN_BASE_MASK (insn)) + == CGEN_INSN_BASE_VALUE (insn)) + { + /* Printing is handled in two passes. The first pass parses the + machine insn and extracts the fields. The second pass prints + them. */ + + /* Make sure the entire insn is loaded into insn_value, if it + can fit. */ + if (((unsigned) CGEN_INSN_BITSIZE (insn) > cd->base_insn_bitsize) && + (unsigned) (CGEN_INSN_BITSIZE (insn) / 8) <= sizeof (unsigned long)) + { + unsigned long full_insn_value; + int rc = read_insn (cd, pc, info, buf, + CGEN_INSN_BITSIZE (insn) / 8, + & ex_info, & full_insn_value); + if (rc != 0) + return rc; + length = CGEN_EXTRACT_FN (cd, insn) + (cd, insn, &ex_info, full_insn_value, &fields, pc); + } + else + length = CGEN_EXTRACT_FN (cd, insn) + (cd, insn, &ex_info, insn_value_cropped, &fields, pc); + + /* length < 0 -> error */ + if (length < 0) + return length; + if (length > 0) + { + CGEN_PRINT_FN (cd, insn) (cd, info, insn, &fields, pc, length); + /* length is in bits, result is in bytes */ + return length / 8; + } + } + + insn_list = CGEN_DIS_NEXT_INSN (insn_list); + } + + return 0; +} + +/* Default value for CGEN_PRINT_INSN. + The result is the size of the insn in bytes or zero for an unknown insn + or -1 if an error occured fetching bytes. */ + +#ifndef CGEN_PRINT_INSN +#define CGEN_PRINT_INSN default_print_insn +#endif + +static int +default_print_insn (CGEN_CPU_DESC cd, bfd_vma pc, disassemble_info *info) +{ + bfd_byte buf[CGEN_MAX_INSN_SIZE]; + int buflen; + int status; + + /* Attempt to read the base part of the insn. */ + buflen = cd->base_insn_bitsize / 8; + status = (*info->read_memory_func) (pc, buf, buflen, info); + + /* Try again with the minimum part, if min < base. */ + if (status != 0 && (cd->min_insn_bitsize < cd->base_insn_bitsize)) + { + buflen = cd->min_insn_bitsize / 8; + status = (*info->read_memory_func) (pc, buf, buflen, info); + } + + if (status != 0) + { + (*info->memory_error_func) (status, pc, info); + return -1; + } + + return print_insn (cd, pc, info, buf, buflen); +} + +/* Main entry point. + Print one instruction from PC on INFO->STREAM. + Return the size of the instruction (in bytes). */ + +typedef struct cpu_desc_list { + struct cpu_desc_list *next; + int isa; + int mach; + int endian; + CGEN_CPU_DESC cd; +} cpu_desc_list; + +int +print_insn_ms1 (bfd_vma pc, disassemble_info *info) +{ + static cpu_desc_list *cd_list = 0; + cpu_desc_list *cl = 0; + static CGEN_CPU_DESC cd = 0; + static int prev_isa; + static int prev_mach; + static int prev_endian; + int length; + int isa,mach; + int endian = (info->endian == BFD_ENDIAN_BIG + ? CGEN_ENDIAN_BIG + : CGEN_ENDIAN_LITTLE); + enum bfd_architecture arch; + + /* ??? gdb will set mach but leave the architecture as "unknown" */ +#ifndef CGEN_BFD_ARCH +#define CGEN_BFD_ARCH bfd_arch_ms1 +#endif + arch = info->arch; + if (arch == bfd_arch_unknown) + arch = CGEN_BFD_ARCH; + + /* There's no standard way to compute the machine or isa number + so we leave it to the target. */ +#ifdef CGEN_COMPUTE_MACH + mach = CGEN_COMPUTE_MACH (info); +#else + mach = info->mach; +#endif + +#ifdef CGEN_COMPUTE_ISA + isa = CGEN_COMPUTE_ISA (info); +#else + isa = info->insn_sets; +#endif + + /* If we've switched cpu's, try to find a handle we've used before */ + if (cd + && (isa != prev_isa + || mach != prev_mach + || endian != prev_endian)) + { + cd = 0; + for (cl = cd_list; cl; cl = cl->next) + { + if (cl->isa == isa && + cl->mach == mach && + cl->endian == endian) + { + cd = cl->cd; + break; + } + } + } + + /* If we haven't initialized yet, initialize the opcode table. */ + if (! cd) + { + const bfd_arch_info_type *arch_type = bfd_lookup_arch (arch, mach); + const char *mach_name; + + if (!arch_type) + abort (); + mach_name = arch_type->printable_name; + + prev_isa = isa; + prev_mach = mach; + prev_endian = endian; + cd = ms1_cgen_cpu_open (CGEN_CPU_OPEN_ISAS, prev_isa, + CGEN_CPU_OPEN_BFDMACH, mach_name, + CGEN_CPU_OPEN_ENDIAN, prev_endian, + CGEN_CPU_OPEN_END); + if (!cd) + abort (); + + /* save this away for future reference */ + cl = xmalloc (sizeof (struct cpu_desc_list)); + cl->cd = cd; + cl->isa = isa; + cl->mach = mach; + cl->endian = endian; + cl->next = cd_list; + cd_list = cl; + + ms1_cgen_init_dis (cd); + } + + /* We try to have as much common code as possible. + But at this point some targets need to take over. */ + /* ??? Some targets may need a hook elsewhere. Try to avoid this, + but if not possible try to move this hook elsewhere rather than + have two hooks. */ + length = CGEN_PRINT_INSN (cd, pc, info); + if (length > 0) + return length; + if (length < 0) + return -1; + + (*info->fprintf_func) (info->stream, UNKNOWN_INSN_MSG); + return cd->default_insn_bitsize / 8; +} diff -uprN binutils-2.16.90.0.3/opcodes/ms1-ibld.c binutils-2.16.91.0.1/opcodes/ms1-ibld.c --- binutils-2.16.90.0.3/opcodes/ms1-ibld.c 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/opcodes/ms1-ibld.c 2005-06-22 13:53:36.285089341 -0700 @@ -0,0 +1,1618 @@ +/* Instruction building/extraction support for ms1. -*- C -*- + +THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator. +- the resultant file is machine generated, cgen-ibld.in isn't + +Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + +This file is part of the GNU Binutils and GDB, the GNU debugger. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* ??? Eventually more and more of this stuff can go to cpu-independent files. + Keep that in mind. */ + +#include "sysdep.h" +#include +#include "ansidecl.h" +#include "dis-asm.h" +#include "bfd.h" +#include "symcat.h" +#include "ms1-desc.h" +#include "ms1-opc.h" +#include "opintl.h" +#include "safe-ctype.h" + +#undef min +#define min(a,b) ((a) < (b) ? (a) : (b)) +#undef max +#define max(a,b) ((a) > (b) ? (a) : (b)) + +/* Used by the ifield rtx function. */ +#define FLD(f) (fields->f) + +static const char * insert_normal + (CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int, + unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR); +static const char * insert_insn_normal + (CGEN_CPU_DESC, const CGEN_INSN *, + CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma); +static int extract_normal + (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT, + unsigned int, unsigned int, unsigned int, unsigned int, + unsigned int, unsigned int, bfd_vma, long *); +static int extract_insn_normal + (CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *, + CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma); +#if CGEN_INT_INSN_P +static void put_insn_int_value + (CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT); +#endif +#if ! CGEN_INT_INSN_P +static CGEN_INLINE void insert_1 + (CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *); +static CGEN_INLINE int fill_cache + (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma); +static CGEN_INLINE long extract_1 + (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int, unsigned char *, bfd_vma); +#endif + +/* Operand insertion. */ + +#if ! CGEN_INT_INSN_P + +/* Subroutine of insert_normal. */ + +static CGEN_INLINE void +insert_1 (CGEN_CPU_DESC cd, + unsigned long value, + int start, + int length, + int word_length, + unsigned char *bufp) +{ + unsigned long x,mask; + int shift; + + x = cgen_get_insn_value (cd, bufp, word_length); + + /* Written this way to avoid undefined behaviour. */ + mask = (((1L << (length - 1)) - 1) << 1) | 1; + if (CGEN_INSN_LSB0_P) + shift = (start + 1) - length; + else + shift = (word_length - (start + length)); + x = (x & ~(mask << shift)) | ((value & mask) << shift); + + cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x); +} + +#endif /* ! CGEN_INT_INSN_P */ + +/* Default insertion routine. + + ATTRS is a mask of the boolean attributes. + WORD_OFFSET is the offset in bits from the start of the insn of the value. + WORD_LENGTH is the length of the word in bits in which the value resides. + START is the starting bit number in the word, architecture origin. + LENGTH is the length of VALUE in bits. + TOTAL_LENGTH is the total length of the insn in bits. + + The result is an error message or NULL if success. */ + +/* ??? This duplicates functionality with bfd's howto table and + bfd_install_relocation. */ +/* ??? This doesn't handle bfd_vma's. Create another function when + necessary. */ + +static const char * +insert_normal (CGEN_CPU_DESC cd, + long value, + unsigned int attrs, + unsigned int word_offset, + unsigned int start, + unsigned int length, + unsigned int word_length, + unsigned int total_length, + CGEN_INSN_BYTES_PTR buffer) +{ + static char errbuf[100]; + /* Written this way to avoid undefined behaviour. */ + unsigned long mask = (((1L << (length - 1)) - 1) << 1) | 1; + + /* If LENGTH is zero, this operand doesn't contribute to the value. */ + if (length == 0) + return NULL; + +#if 0 + if (CGEN_INT_INSN_P + && word_offset != 0) + abort (); +#endif + + if (word_length > 32) + abort (); + + /* For architectures with insns smaller than the base-insn-bitsize, + word_length may be too big. */ + if (cd->min_insn_bitsize < cd->base_insn_bitsize) + { + if (word_offset == 0 + && word_length > total_length) + word_length = total_length; + } + + /* Ensure VALUE will fit. */ + if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGN_OPT)) + { + long minval = - (1L << (length - 1)); + unsigned long maxval = mask; + + if ((value > 0 && (unsigned long) value > maxval) + || value < minval) + { + /* xgettext:c-format */ + sprintf (errbuf, + _("operand out of range (%ld not between %ld and %lu)"), + value, minval, maxval); + return errbuf; + } + } + else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED)) + { + unsigned long maxval = mask; + + if ((unsigned long) value > maxval) + { + /* xgettext:c-format */ + sprintf (errbuf, + _("operand out of range (%lu not between 0 and %lu)"), + value, maxval); + return errbuf; + } + } + else + { + if (! cgen_signed_overflow_ok_p (cd)) + { + long minval = - (1L << (length - 1)); + long maxval = (1L << (length - 1)) - 1; + + if (value < minval || value > maxval) + { + sprintf + /* xgettext:c-format */ + (errbuf, _("operand out of range (%ld not between %ld and %ld)"), + value, minval, maxval); + return errbuf; + } + } + } + +#if CGEN_INT_INSN_P + + { + int shift; + + if (CGEN_INSN_LSB0_P) + shift = (word_offset + start + 1) - length; + else + shift = total_length - (word_offset + start + length); + *buffer = (*buffer & ~(mask << shift)) | ((value & mask) << shift); + } + +#else /* ! CGEN_INT_INSN_P */ + + { + unsigned char *bufp = (unsigned char *) buffer + word_offset / 8; + + insert_1 (cd, value, start, length, word_length, bufp); + } + +#endif /* ! CGEN_INT_INSN_P */ + + return NULL; +} + +/* Default insn builder (insert handler). + The instruction is recorded in CGEN_INT_INSN_P byte order (meaning + that if CGEN_INSN_BYTES_PTR is an int * and thus, the value is + recorded in host byte order, otherwise BUFFER is an array of bytes + and the value is recorded in target byte order). + The result is an error message or NULL if success. */ + +static const char * +insert_insn_normal (CGEN_CPU_DESC cd, + const CGEN_INSN * insn, + CGEN_FIELDS * fields, + CGEN_INSN_BYTES_PTR buffer, + bfd_vma pc) +{ + const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn); + unsigned long value; + const CGEN_SYNTAX_CHAR_TYPE * syn; + + CGEN_INIT_INSERT (cd); + value = CGEN_INSN_BASE_VALUE (insn); + + /* If we're recording insns as numbers (rather than a string of bytes), + target byte order handling is deferred until later. */ + +#if CGEN_INT_INSN_P + + put_insn_int_value (cd, buffer, cd->base_insn_bitsize, + CGEN_FIELDS_BITSIZE (fields), value); + +#else + + cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize, + (unsigned) CGEN_FIELDS_BITSIZE (fields)), + value); + +#endif /* ! CGEN_INT_INSN_P */ + + /* ??? It would be better to scan the format's fields. + Still need to be able to insert a value based on the operand though; + e.g. storing a branch displacement that got resolved later. + Needs more thought first. */ + + for (syn = CGEN_SYNTAX_STRING (syntax); * syn; ++ syn) + { + const char *errmsg; + + if (CGEN_SYNTAX_CHAR_P (* syn)) + continue; + + errmsg = (* cd->insert_operand) (cd, CGEN_SYNTAX_FIELD (*syn), + fields, buffer, pc); + if (errmsg) + return errmsg; + } + + return NULL; +} + +#if CGEN_INT_INSN_P +/* Cover function to store an insn value into an integral insn. Must go here + because it needs -desc.h for CGEN_INT_INSN_P. */ + +static void +put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, + CGEN_INSN_BYTES_PTR buf, + int length, + int insn_length, + CGEN_INSN_INT value) +{ + /* For architectures with insns smaller than the base-insn-bitsize, + length may be too big. */ + if (length > insn_length) + *buf = value; + else + { + int shift = insn_length - length; + /* Written this way to avoid undefined behaviour. */ + CGEN_INSN_INT mask = (((1L << (length - 1)) - 1) << 1) | 1; + *buf = (*buf & ~(mask << shift)) | ((value & mask) << shift); + } +} +#endif + +/* Operand extraction. */ + +#if ! CGEN_INT_INSN_P + +/* Subroutine of extract_normal. + Ensure sufficient bytes are cached in EX_INFO. + OFFSET is the offset in bytes from the start of the insn of the value. + BYTES is the length of the needed value. + Returns 1 for success, 0 for failure. */ + +static CGEN_INLINE int +fill_cache (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, + CGEN_EXTRACT_INFO *ex_info, + int offset, + int bytes, + bfd_vma pc) +{ + /* It's doubtful that the middle part has already been fetched so + we don't optimize that case. kiss. */ + unsigned int mask; + disassemble_info *info = (disassemble_info *) ex_info->dis_info; + + /* First do a quick check. */ + mask = (1 << bytes) - 1; + if (((ex_info->valid >> offset) & mask) == mask) + return 1; + + /* Search for the first byte we need to read. */ + for (mask = 1 << offset; bytes > 0; --bytes, ++offset, mask <<= 1) + if (! (mask & ex_info->valid)) + break; + + if (bytes) + { + int status; + + pc += offset; + status = (*info->read_memory_func) + (pc, ex_info->insn_bytes + offset, bytes, info); + + if (status != 0) + { + (*info->memory_error_func) (status, pc, info); + return 0; + } + + ex_info->valid |= ((1 << bytes) - 1) << offset; + } + + return 1; +} + +/* Subroutine of extract_normal. */ + +static CGEN_INLINE long +extract_1 (CGEN_CPU_DESC cd, + CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED, + int start, + int length, + int word_length, + unsigned char *bufp, + bfd_vma pc ATTRIBUTE_UNUSED) +{ + unsigned long x; + int shift; +#if 0 + int big_p = CGEN_CPU_INSN_ENDIAN (cd) == CGEN_ENDIAN_BIG; +#endif + x = cgen_get_insn_value (cd, bufp, word_length); + + if (CGEN_INSN_LSB0_P) + shift = (start + 1) - length; + else + shift = (word_length - (start + length)); + return x >> shift; +} + +#endif /* ! CGEN_INT_INSN_P */ + +/* Default extraction routine. + + INSN_VALUE is the first base_insn_bitsize bits of the insn in host order, + or sometimes less for cases like the m32r where the base insn size is 32 + but some insns are 16 bits. + ATTRS is a mask of the boolean attributes. We only need `SIGNED', + but for generality we take a bitmask of all of them. + WORD_OFFSET is the offset in bits from the start of the insn of the value. + WORD_LENGTH is the length of the word in bits in which the value resides. + START is the starting bit number in the word, architecture origin. + LENGTH is the length of VALUE in bits. + TOTAL_LENGTH is the total length of the insn in bits. + + Returns 1 for success, 0 for failure. */ + +/* ??? The return code isn't properly used. wip. */ + +/* ??? This doesn't handle bfd_vma's. Create another function when + necessary. */ + +static int +extract_normal (CGEN_CPU_DESC cd, +#if ! CGEN_INT_INSN_P + CGEN_EXTRACT_INFO *ex_info, +#else + CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED, +#endif + CGEN_INSN_INT insn_value, + unsigned int attrs, + unsigned int word_offset, + unsigned int start, + unsigned int length, + unsigned int word_length, + unsigned int total_length, +#if ! CGEN_INT_INSN_P + bfd_vma pc, +#else + bfd_vma pc ATTRIBUTE_UNUSED, +#endif + long *valuep) +{ + long value, mask; + + /* If LENGTH is zero, this operand doesn't contribute to the value + so give it a standard value of zero. */ + if (length == 0) + { + *valuep = 0; + return 1; + } + +#if 0 + if (CGEN_INT_INSN_P + && word_offset != 0) + abort (); +#endif + + if (word_length > 32) + abort (); + + /* For architectures with insns smaller than the insn-base-bitsize, + word_length may be too big. */ + if (cd->min_insn_bitsize < cd->base_insn_bitsize) + { + if (word_offset == 0 + && word_length > total_length) + word_length = total_length; + } + + /* Does the value reside in INSN_VALUE, and at the right alignment? */ + + if (CGEN_INT_INSN_P || (word_offset == 0 && word_length == total_length)) + { + if (CGEN_INSN_LSB0_P) + value = insn_value >> ((word_offset + start + 1) - length); + else + value = insn_value >> (total_length - ( word_offset + start + length)); + } + +#if ! CGEN_INT_INSN_P + + else + { + unsigned char *bufp = ex_info->insn_bytes + word_offset / 8; + + if (word_length > 32) + abort (); + + if (fill_cache (cd, ex_info, word_offset / 8, word_length / 8, pc) == 0) + return 0; + + value = extract_1 (cd, ex_info, start, length, word_length, bufp, pc); + } + +#endif /* ! CGEN_INT_INSN_P */ + + /* Written this way to avoid undefined behaviour. */ + mask = (((1L << (length - 1)) - 1) << 1) | 1; + + value &= mask; + /* sign extend? */ + if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED) + && (value & (1L << (length - 1)))) + value |= ~mask; + + *valuep = value; + + return 1; +} + +/* Default insn extractor. + + INSN_VALUE is the first base_insn_bitsize bits, translated to host order. + The extracted fields are stored in FIELDS. + EX_INFO is used to handle reading variable length insns. + Return the length of the insn in bits, or 0 if no match, + or -1 if an error occurs fetching data (memory_error_func will have + been called). */ + +static int +extract_insn_normal (CGEN_CPU_DESC cd, + const CGEN_INSN *insn, + CGEN_EXTRACT_INFO *ex_info, + CGEN_INSN_INT insn_value, + CGEN_FIELDS *fields, + bfd_vma pc) +{ + const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn); + const CGEN_SYNTAX_CHAR_TYPE *syn; + + CGEN_FIELDS_BITSIZE (fields) = CGEN_INSN_BITSIZE (insn); + + CGEN_INIT_EXTRACT (cd); + + for (syn = CGEN_SYNTAX_STRING (syntax); *syn; ++syn) + { + int length; + + if (CGEN_SYNTAX_CHAR_P (*syn)) + continue; + + length = (* cd->extract_operand) (cd, CGEN_SYNTAX_FIELD (*syn), + ex_info, insn_value, fields, pc); + if (length <= 0) + return length; + } + + /* We recognized and successfully extracted this insn. */ + return CGEN_INSN_BITSIZE (insn); +} + +/* machine generated code added here */ + +const char * ms1_cgen_insert_operand + PARAMS ((CGEN_CPU_DESC, int, CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma)); + +/* Main entry point for operand insertion. + + This function is basically just a big switch statement. Earlier versions + used tables to look up the function to use, but + - if the table contains both assembler and disassembler functions then + the disassembler contains much of the assembler and vice-versa, + - there's a lot of inlining possibilities as things grow, + - using a switch statement avoids the function call overhead. + + This function could be moved into `parse_insn_normal', but keeping it + separate makes clear the interface between `parse_insn_normal' and each of + the handlers. It's also needed by GAS to insert operands that couldn't be + resolved during parsing. */ + +const char * +ms1_cgen_insert_operand (cd, opindex, fields, buffer, pc) + CGEN_CPU_DESC cd; + int opindex; + CGEN_FIELDS * fields; + CGEN_INSN_BYTES_PTR buffer; + bfd_vma pc ATTRIBUTE_UNUSED; +{ + const char * errmsg = NULL; + unsigned int total_length = CGEN_FIELDS_BITSIZE (fields); + + switch (opindex) + { + case MS1_OPERAND_A23 : + errmsg = insert_normal (cd, fields->f_a23, 0, 0, 23, 1, 32, total_length, buffer); + break; + case MS1_OPERAND_BALL : + errmsg = insert_normal (cd, fields->f_ball, 0, 0, 19, 1, 32, total_length, buffer); + break; + case MS1_OPERAND_BALL2 : + errmsg = insert_normal (cd, fields->f_ball2, 0, 0, 15, 1, 32, total_length, buffer); + break; + case MS1_OPERAND_BANKADDR : + errmsg = insert_normal (cd, fields->f_bankaddr, 0, 0, 25, 13, 32, total_length, buffer); + break; + case MS1_OPERAND_BRC : + errmsg = insert_normal (cd, fields->f_brc, 0, 0, 18, 3, 32, total_length, buffer); + break; + case MS1_OPERAND_BRC2 : + errmsg = insert_normal (cd, fields->f_brc2, 0, 0, 14, 3, 32, total_length, buffer); + break; + case MS1_OPERAND_CBRB : + errmsg = insert_normal (cd, fields->f_cbrb, 0, 0, 10, 1, 32, total_length, buffer); + break; + case MS1_OPERAND_CBS : + errmsg = insert_normal (cd, fields->f_cbs, 0, 0, 19, 2, 32, total_length, buffer); + break; + case MS1_OPERAND_CBX : + errmsg = insert_normal (cd, fields->f_cbx, 0, 0, 14, 3, 32, total_length, buffer); + break; + case MS1_OPERAND_CCB : + errmsg = insert_normal (cd, fields->f_ccb, 0, 0, 11, 1, 32, total_length, buffer); + break; + case MS1_OPERAND_CDB : + errmsg = insert_normal (cd, fields->f_cdb, 0, 0, 10, 1, 32, total_length, buffer); + break; + case MS1_OPERAND_CELL : + errmsg = insert_normal (cd, fields->f_cell, 0, 0, 9, 3, 32, total_length, buffer); + break; + case MS1_OPERAND_COLNUM : + errmsg = insert_normal (cd, fields->f_colnum, 0, 0, 18, 3, 32, total_length, buffer); + break; + case MS1_OPERAND_CONTNUM : + errmsg = insert_normal (cd, fields->f_contnum, 0, 0, 8, 9, 32, total_length, buffer); + break; + case MS1_OPERAND_CR : + errmsg = insert_normal (cd, fields->f_cr, 0, 0, 22, 3, 32, total_length, buffer); + break; + case MS1_OPERAND_CTXDISP : + errmsg = insert_normal (cd, fields->f_ctxdisp, 0, 0, 5, 6, 32, total_length, buffer); + break; + case MS1_OPERAND_DUP : + errmsg = insert_normal (cd, fields->f_dup, 0, 0, 6, 1, 32, total_length, buffer); + break; + case MS1_OPERAND_FBDISP : + errmsg = insert_normal (cd, fields->f_fbdisp, 0, 0, 15, 6, 32, total_length, buffer); + break; + case MS1_OPERAND_FBINCR : + errmsg = insert_normal (cd, fields->f_fbincr, 0, 0, 23, 4, 32, total_length, buffer); + break; + case MS1_OPERAND_FRDR : + errmsg = insert_normal (cd, fields->f_dr, 0|(1<f_drrr, 0|(1<f_sr1, 0|(1<f_sr2, 0|(1<f_id, 0, 0, 14, 1, 32, total_length, buffer); + break; + case MS1_OPERAND_IMM16 : + { + long value = fields->f_imm16s; + value = ((value) + (0)); + errmsg = insert_normal (cd, value, 0|(1<f_imm16s; + value = ((value) + (0)); + errmsg = insert_normal (cd, value, 0|(1<f_imm16u, 0, 0, 15, 16, 32, total_length, buffer); + break; + case MS1_OPERAND_INCAMT : + errmsg = insert_normal (cd, fields->f_incamt, 0, 0, 19, 8, 32, total_length, buffer); + break; + case MS1_OPERAND_INCR : + errmsg = insert_normal (cd, fields->f_incr, 0, 0, 17, 6, 32, total_length, buffer); + break; + case MS1_OPERAND_LENGTH : + errmsg = insert_normal (cd, fields->f_length, 0, 0, 15, 3, 32, total_length, buffer); + break; + case MS1_OPERAND_MASK : + errmsg = insert_normal (cd, fields->f_mask, 0, 0, 25, 16, 32, total_length, buffer); + break; + case MS1_OPERAND_MASK1 : + errmsg = insert_normal (cd, fields->f_mask1, 0, 0, 22, 3, 32, total_length, buffer); + break; + case MS1_OPERAND_MODE : + errmsg = insert_normal (cd, fields->f_mode, 0, 0, 25, 2, 32, total_length, buffer); + break; + case MS1_OPERAND_PERM : + errmsg = insert_normal (cd, fields->f_perm, 0, 0, 25, 2, 32, total_length, buffer); + break; + case MS1_OPERAND_RBBC : + errmsg = insert_normal (cd, fields->f_rbbc, 0, 0, 25, 2, 32, total_length, buffer); + break; + case MS1_OPERAND_RC : + errmsg = insert_normal (cd, fields->f_rc, 0, 0, 15, 1, 32, total_length, buffer); + break; + case MS1_OPERAND_RC1 : + errmsg = insert_normal (cd, fields->f_rc1, 0, 0, 11, 1, 32, total_length, buffer); + break; + case MS1_OPERAND_RC2 : + errmsg = insert_normal (cd, fields->f_rc2, 0, 0, 6, 1, 32, total_length, buffer); + break; + case MS1_OPERAND_RCNUM : + errmsg = insert_normal (cd, fields->f_rcnum, 0, 0, 14, 3, 32, total_length, buffer); + break; + case MS1_OPERAND_RDA : + errmsg = insert_normal (cd, fields->f_rda, 0, 0, 25, 1, 32, total_length, buffer); + break; + case MS1_OPERAND_ROWNUM : + errmsg = insert_normal (cd, fields->f_rownum, 0, 0, 14, 3, 32, total_length, buffer); + break; + case MS1_OPERAND_ROWNUM1 : + errmsg = insert_normal (cd, fields->f_rownum1, 0, 0, 12, 3, 32, total_length, buffer); + break; + case MS1_OPERAND_ROWNUM2 : + errmsg = insert_normal (cd, fields->f_rownum2, 0, 0, 9, 3, 32, total_length, buffer); + break; + case MS1_OPERAND_SIZE : + errmsg = insert_normal (cd, fields->f_size, 0, 0, 13, 14, 32, total_length, buffer); + break; + case MS1_OPERAND_TYPE : + errmsg = insert_normal (cd, fields->f_type, 0, 0, 21, 2, 32, total_length, buffer); + break; + case MS1_OPERAND_WR : + errmsg = insert_normal (cd, fields->f_wr, 0, 0, 24, 1, 32, total_length, buffer); + break; + case MS1_OPERAND_XMODE : + errmsg = insert_normal (cd, fields->f_xmode, 0, 0, 23, 1, 32, total_length, buffer); + break; + + default : + /* xgettext:c-format */ + fprintf (stderr, _("Unrecognized field %d while building insn.\n"), + opindex); + abort (); + } + + return errmsg; +} + +int ms1_cgen_extract_operand + PARAMS ((CGEN_CPU_DESC, int, CGEN_EXTRACT_INFO *, CGEN_INSN_INT, + CGEN_FIELDS *, bfd_vma)); + +/* Main entry point for operand extraction. + The result is <= 0 for error, >0 for success. + ??? Actual values aren't well defined right now. + + This function is basically just a big switch statement. Earlier versions + used tables to look up the function to use, but + - if the table contains both assembler and disassembler functions then + the disassembler contains much of the assembler and vice-versa, + - there's a lot of inlining possibilities as things grow, + - using a switch statement avoids the function call overhead. + + This function could be moved into `print_insn_normal', but keeping it + separate makes clear the interface between `print_insn_normal' and each of + the handlers. */ + +int +ms1_cgen_extract_operand (cd, opindex, ex_info, insn_value, fields, pc) + CGEN_CPU_DESC cd; + int opindex; + CGEN_EXTRACT_INFO *ex_info; + CGEN_INSN_INT insn_value; + CGEN_FIELDS * fields; + bfd_vma pc; +{ + /* Assume success (for those operands that are nops). */ + int length = 1; + unsigned int total_length = CGEN_FIELDS_BITSIZE (fields); + + switch (opindex) + { + case MS1_OPERAND_A23 : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 23, 1, 32, total_length, pc, & fields->f_a23); + break; + case MS1_OPERAND_BALL : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 19, 1, 32, total_length, pc, & fields->f_ball); + break; + case MS1_OPERAND_BALL2 : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 1, 32, total_length, pc, & fields->f_ball2); + break; + case MS1_OPERAND_BANKADDR : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 13, 32, total_length, pc, & fields->f_bankaddr); + break; + case MS1_OPERAND_BRC : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 18, 3, 32, total_length, pc, & fields->f_brc); + break; + case MS1_OPERAND_BRC2 : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 14, 3, 32, total_length, pc, & fields->f_brc2); + break; + case MS1_OPERAND_CBRB : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 1, 32, total_length, pc, & fields->f_cbrb); + break; + case MS1_OPERAND_CBS : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 19, 2, 32, total_length, pc, & fields->f_cbs); + break; + case MS1_OPERAND_CBX : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 14, 3, 32, total_length, pc, & fields->f_cbx); + break; + case MS1_OPERAND_CCB : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 11, 1, 32, total_length, pc, & fields->f_ccb); + break; + case MS1_OPERAND_CDB : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 1, 32, total_length, pc, & fields->f_cdb); + break; + case MS1_OPERAND_CELL : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 3, 32, total_length, pc, & fields->f_cell); + break; + case MS1_OPERAND_COLNUM : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 18, 3, 32, total_length, pc, & fields->f_colnum); + break; + case MS1_OPERAND_CONTNUM : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 9, 32, total_length, pc, & fields->f_contnum); + break; + case MS1_OPERAND_CR : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 22, 3, 32, total_length, pc, & fields->f_cr); + break; + case MS1_OPERAND_CTXDISP : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 6, 32, total_length, pc, & fields->f_ctxdisp); + break; + case MS1_OPERAND_DUP : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 1, 32, total_length, pc, & fields->f_dup); + break; + case MS1_OPERAND_FBDISP : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 6, 32, total_length, pc, & fields->f_fbdisp); + break; + case MS1_OPERAND_FBINCR : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 23, 4, 32, total_length, pc, & fields->f_fbincr); + break; + case MS1_OPERAND_FRDR : + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_dr); + break; + case MS1_OPERAND_FRDRRR : + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_drrr); + break; + case MS1_OPERAND_FRSR1 : + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_sr1); + break; + case MS1_OPERAND_FRSR2 : + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_sr2); + break; + case MS1_OPERAND_ID : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 14, 1, 32, total_length, pc, & fields->f_id); + break; + case MS1_OPERAND_IMM16 : + { + long value; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_imm16s = value; + } + break; + case MS1_OPERAND_IMM16O : + { + long value; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_imm16s = value; + } + break; + case MS1_OPERAND_IMM16Z : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 16, 32, total_length, pc, & fields->f_imm16u); + break; + case MS1_OPERAND_INCAMT : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 19, 8, 32, total_length, pc, & fields->f_incamt); + break; + case MS1_OPERAND_INCR : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_incr); + break; + case MS1_OPERAND_LENGTH : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 3, 32, total_length, pc, & fields->f_length); + break; + case MS1_OPERAND_MASK : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 16, 32, total_length, pc, & fields->f_mask); + break; + case MS1_OPERAND_MASK1 : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 22, 3, 32, total_length, pc, & fields->f_mask1); + break; + case MS1_OPERAND_MODE : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 2, 32, total_length, pc, & fields->f_mode); + break; + case MS1_OPERAND_PERM : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 2, 32, total_length, pc, & fields->f_perm); + break; + case MS1_OPERAND_RBBC : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 2, 32, total_length, pc, & fields->f_rbbc); + break; + case MS1_OPERAND_RC : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 1, 32, total_length, pc, & fields->f_rc); + break; + case MS1_OPERAND_RC1 : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 11, 1, 32, total_length, pc, & fields->f_rc1); + break; + case MS1_OPERAND_RC2 : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 1, 32, total_length, pc, & fields->f_rc2); + break; + case MS1_OPERAND_RCNUM : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 14, 3, 32, total_length, pc, & fields->f_rcnum); + break; + case MS1_OPERAND_RDA : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 1, 32, total_length, pc, & fields->f_rda); + break; + case MS1_OPERAND_ROWNUM : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 14, 3, 32, total_length, pc, & fields->f_rownum); + break; + case MS1_OPERAND_ROWNUM1 : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 12, 3, 32, total_length, pc, & fields->f_rownum1); + break; + case MS1_OPERAND_ROWNUM2 : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 3, 32, total_length, pc, & fields->f_rownum2); + break; + case MS1_OPERAND_SIZE : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 14, 32, total_length, pc, & fields->f_size); + break; + case MS1_OPERAND_TYPE : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 21, 2, 32, total_length, pc, & fields->f_type); + break; + case MS1_OPERAND_WR : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 1, 32, total_length, pc, & fields->f_wr); + break; + case MS1_OPERAND_XMODE : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 23, 1, 32, total_length, pc, & fields->f_xmode); + break; + + default : + /* xgettext:c-format */ + fprintf (stderr, _("Unrecognized field %d while decoding insn.\n"), + opindex); + abort (); + } + + return length; +} + +cgen_insert_fn * const ms1_cgen_insert_handlers[] = +{ + insert_insn_normal, +}; + +cgen_extract_fn * const ms1_cgen_extract_handlers[] = +{ + extract_insn_normal, +}; + +int ms1_cgen_get_int_operand + PARAMS ((CGEN_CPU_DESC, int, const CGEN_FIELDS *)); +bfd_vma ms1_cgen_get_vma_operand + PARAMS ((CGEN_CPU_DESC, int, const CGEN_FIELDS *)); + +/* Getting values from cgen_fields is handled by a collection of functions. + They are distinguished by the type of the VALUE argument they return. + TODO: floating point, inlining support, remove cases where result type + not appropriate. */ + +int +ms1_cgen_get_int_operand (cd, opindex, fields) + CGEN_CPU_DESC cd ATTRIBUTE_UNUSED; + int opindex; + const CGEN_FIELDS * fields; +{ + int value; + + switch (opindex) + { + case MS1_OPERAND_A23 : + value = fields->f_a23; + break; + case MS1_OPERAND_BALL : + value = fields->f_ball; + break; + case MS1_OPERAND_BALL2 : + value = fields->f_ball2; + break; + case MS1_OPERAND_BANKADDR : + value = fields->f_bankaddr; + break; + case MS1_OPERAND_BRC : + value = fields->f_brc; + break; + case MS1_OPERAND_BRC2 : + value = fields->f_brc2; + break; + case MS1_OPERAND_CBRB : + value = fields->f_cbrb; + break; + case MS1_OPERAND_CBS : + value = fields->f_cbs; + break; + case MS1_OPERAND_CBX : + value = fields->f_cbx; + break; + case MS1_OPERAND_CCB : + value = fields->f_ccb; + break; + case MS1_OPERAND_CDB : + value = fields->f_cdb; + break; + case MS1_OPERAND_CELL : + value = fields->f_cell; + break; + case MS1_OPERAND_COLNUM : + value = fields->f_colnum; + break; + case MS1_OPERAND_CONTNUM : + value = fields->f_contnum; + break; + case MS1_OPERAND_CR : + value = fields->f_cr; + break; + case MS1_OPERAND_CTXDISP : + value = fields->f_ctxdisp; + break; + case MS1_OPERAND_DUP : + value = fields->f_dup; + break; + case MS1_OPERAND_FBDISP : + value = fields->f_fbdisp; + break; + case MS1_OPERAND_FBINCR : + value = fields->f_fbincr; + break; + case MS1_OPERAND_FRDR : + value = fields->f_dr; + break; + case MS1_OPERAND_FRDRRR : + value = fields->f_drrr; + break; + case MS1_OPERAND_FRSR1 : + value = fields->f_sr1; + break; + case MS1_OPERAND_FRSR2 : + value = fields->f_sr2; + break; + case MS1_OPERAND_ID : + value = fields->f_id; + break; + case MS1_OPERAND_IMM16 : + value = fields->f_imm16s; + break; + case MS1_OPERAND_IMM16O : + value = fields->f_imm16s; + break; + case MS1_OPERAND_IMM16Z : + value = fields->f_imm16u; + break; + case MS1_OPERAND_INCAMT : + value = fields->f_incamt; + break; + case MS1_OPERAND_INCR : + value = fields->f_incr; + break; + case MS1_OPERAND_LENGTH : + value = fields->f_length; + break; + case MS1_OPERAND_MASK : + value = fields->f_mask; + break; + case MS1_OPERAND_MASK1 : + value = fields->f_mask1; + break; + case MS1_OPERAND_MODE : + value = fields->f_mode; + break; + case MS1_OPERAND_PERM : + value = fields->f_perm; + break; + case MS1_OPERAND_RBBC : + value = fields->f_rbbc; + break; + case MS1_OPERAND_RC : + value = fields->f_rc; + break; + case MS1_OPERAND_RC1 : + value = fields->f_rc1; + break; + case MS1_OPERAND_RC2 : + value = fields->f_rc2; + break; + case MS1_OPERAND_RCNUM : + value = fields->f_rcnum; + break; + case MS1_OPERAND_RDA : + value = fields->f_rda; + break; + case MS1_OPERAND_ROWNUM : + value = fields->f_rownum; + break; + case MS1_OPERAND_ROWNUM1 : + value = fields->f_rownum1; + break; + case MS1_OPERAND_ROWNUM2 : + value = fields->f_rownum2; + break; + case MS1_OPERAND_SIZE : + value = fields->f_size; + break; + case MS1_OPERAND_TYPE : + value = fields->f_type; + break; + case MS1_OPERAND_WR : + value = fields->f_wr; + break; + case MS1_OPERAND_XMODE : + value = fields->f_xmode; + break; + + default : + /* xgettext:c-format */ + fprintf (stderr, _("Unrecognized field %d while getting int operand.\n"), + opindex); + abort (); + } + + return value; +} + +bfd_vma +ms1_cgen_get_vma_operand (cd, opindex, fields) + CGEN_CPU_DESC cd ATTRIBUTE_UNUSED; + int opindex; + const CGEN_FIELDS * fields; +{ + bfd_vma value; + + switch (opindex) + { + case MS1_OPERAND_A23 : + value = fields->f_a23; + break; + case MS1_OPERAND_BALL : + value = fields->f_ball; + break; + case MS1_OPERAND_BALL2 : + value = fields->f_ball2; + break; + case MS1_OPERAND_BANKADDR : + value = fields->f_bankaddr; + break; + case MS1_OPERAND_BRC : + value = fields->f_brc; + break; + case MS1_OPERAND_BRC2 : + value = fields->f_brc2; + break; + case MS1_OPERAND_CBRB : + value = fields->f_cbrb; + break; + case MS1_OPERAND_CBS : + value = fields->f_cbs; + break; + case MS1_OPERAND_CBX : + value = fields->f_cbx; + break; + case MS1_OPERAND_CCB : + value = fields->f_ccb; + break; + case MS1_OPERAND_CDB : + value = fields->f_cdb; + break; + case MS1_OPERAND_CELL : + value = fields->f_cell; + break; + case MS1_OPERAND_COLNUM : + value = fields->f_colnum; + break; + case MS1_OPERAND_CONTNUM : + value = fields->f_contnum; + break; + case MS1_OPERAND_CR : + value = fields->f_cr; + break; + case MS1_OPERAND_CTXDISP : + value = fields->f_ctxdisp; + break; + case MS1_OPERAND_DUP : + value = fields->f_dup; + break; + case MS1_OPERAND_FBDISP : + value = fields->f_fbdisp; + break; + case MS1_OPERAND_FBINCR : + value = fields->f_fbincr; + break; + case MS1_OPERAND_FRDR : + value = fields->f_dr; + break; + case MS1_OPERAND_FRDRRR : + value = fields->f_drrr; + break; + case MS1_OPERAND_FRSR1 : + value = fields->f_sr1; + break; + case MS1_OPERAND_FRSR2 : + value = fields->f_sr2; + break; + case MS1_OPERAND_ID : + value = fields->f_id; + break; + case MS1_OPERAND_IMM16 : + value = fields->f_imm16s; + break; + case MS1_OPERAND_IMM16O : + value = fields->f_imm16s; + break; + case MS1_OPERAND_IMM16Z : + value = fields->f_imm16u; + break; + case MS1_OPERAND_INCAMT : + value = fields->f_incamt; + break; + case MS1_OPERAND_INCR : + value = fields->f_incr; + break; + case MS1_OPERAND_LENGTH : + value = fields->f_length; + break; + case MS1_OPERAND_MASK : + value = fields->f_mask; + break; + case MS1_OPERAND_MASK1 : + value = fields->f_mask1; + break; + case MS1_OPERAND_MODE : + value = fields->f_mode; + break; + case MS1_OPERAND_PERM : + value = fields->f_perm; + break; + case MS1_OPERAND_RBBC : + value = fields->f_rbbc; + break; + case MS1_OPERAND_RC : + value = fields->f_rc; + break; + case MS1_OPERAND_RC1 : + value = fields->f_rc1; + break; + case MS1_OPERAND_RC2 : + value = fields->f_rc2; + break; + case MS1_OPERAND_RCNUM : + value = fields->f_rcnum; + break; + case MS1_OPERAND_RDA : + value = fields->f_rda; + break; + case MS1_OPERAND_ROWNUM : + value = fields->f_rownum; + break; + case MS1_OPERAND_ROWNUM1 : + value = fields->f_rownum1; + break; + case MS1_OPERAND_ROWNUM2 : + value = fields->f_rownum2; + break; + case MS1_OPERAND_SIZE : + value = fields->f_size; + break; + case MS1_OPERAND_TYPE : + value = fields->f_type; + break; + case MS1_OPERAND_WR : + value = fields->f_wr; + break; + case MS1_OPERAND_XMODE : + value = fields->f_xmode; + break; + + default : + /* xgettext:c-format */ + fprintf (stderr, _("Unrecognized field %d while getting vma operand.\n"), + opindex); + abort (); + } + + return value; +} + +void ms1_cgen_set_int_operand + PARAMS ((CGEN_CPU_DESC, int, CGEN_FIELDS *, int)); +void ms1_cgen_set_vma_operand + PARAMS ((CGEN_CPU_DESC, int, CGEN_FIELDS *, bfd_vma)); + +/* Stuffing values in cgen_fields is handled by a collection of functions. + They are distinguished by the type of the VALUE argument they accept. + TODO: floating point, inlining support, remove cases where argument type + not appropriate. */ + +void +ms1_cgen_set_int_operand (cd, opindex, fields, value) + CGEN_CPU_DESC cd ATTRIBUTE_UNUSED; + int opindex; + CGEN_FIELDS * fields; + int value; +{ + switch (opindex) + { + case MS1_OPERAND_A23 : + fields->f_a23 = value; + break; + case MS1_OPERAND_BALL : + fields->f_ball = value; + break; + case MS1_OPERAND_BALL2 : + fields->f_ball2 = value; + break; + case MS1_OPERAND_BANKADDR : + fields->f_bankaddr = value; + break; + case MS1_OPERAND_BRC : + fields->f_brc = value; + break; + case MS1_OPERAND_BRC2 : + fields->f_brc2 = value; + break; + case MS1_OPERAND_CBRB : + fields->f_cbrb = value; + break; + case MS1_OPERAND_CBS : + fields->f_cbs = value; + break; + case MS1_OPERAND_CBX : + fields->f_cbx = value; + break; + case MS1_OPERAND_CCB : + fields->f_ccb = value; + break; + case MS1_OPERAND_CDB : + fields->f_cdb = value; + break; + case MS1_OPERAND_CELL : + fields->f_cell = value; + break; + case MS1_OPERAND_COLNUM : + fields->f_colnum = value; + break; + case MS1_OPERAND_CONTNUM : + fields->f_contnum = value; + break; + case MS1_OPERAND_CR : + fields->f_cr = value; + break; + case MS1_OPERAND_CTXDISP : + fields->f_ctxdisp = value; + break; + case MS1_OPERAND_DUP : + fields->f_dup = value; + break; + case MS1_OPERAND_FBDISP : + fields->f_fbdisp = value; + break; + case MS1_OPERAND_FBINCR : + fields->f_fbincr = value; + break; + case MS1_OPERAND_FRDR : + fields->f_dr = value; + break; + case MS1_OPERAND_FRDRRR : + fields->f_drrr = value; + break; + case MS1_OPERAND_FRSR1 : + fields->f_sr1 = value; + break; + case MS1_OPERAND_FRSR2 : + fields->f_sr2 = value; + break; + case MS1_OPERAND_ID : + fields->f_id = value; + break; + case MS1_OPERAND_IMM16 : + fields->f_imm16s = value; + break; + case MS1_OPERAND_IMM16O : + fields->f_imm16s = value; + break; + case MS1_OPERAND_IMM16Z : + fields->f_imm16u = value; + break; + case MS1_OPERAND_INCAMT : + fields->f_incamt = value; + break; + case MS1_OPERAND_INCR : + fields->f_incr = value; + break; + case MS1_OPERAND_LENGTH : + fields->f_length = value; + break; + case MS1_OPERAND_MASK : + fields->f_mask = value; + break; + case MS1_OPERAND_MASK1 : + fields->f_mask1 = value; + break; + case MS1_OPERAND_MODE : + fields->f_mode = value; + break; + case MS1_OPERAND_PERM : + fields->f_perm = value; + break; + case MS1_OPERAND_RBBC : + fields->f_rbbc = value; + break; + case MS1_OPERAND_RC : + fields->f_rc = value; + break; + case MS1_OPERAND_RC1 : + fields->f_rc1 = value; + break; + case MS1_OPERAND_RC2 : + fields->f_rc2 = value; + break; + case MS1_OPERAND_RCNUM : + fields->f_rcnum = value; + break; + case MS1_OPERAND_RDA : + fields->f_rda = value; + break; + case MS1_OPERAND_ROWNUM : + fields->f_rownum = value; + break; + case MS1_OPERAND_ROWNUM1 : + fields->f_rownum1 = value; + break; + case MS1_OPERAND_ROWNUM2 : + fields->f_rownum2 = value; + break; + case MS1_OPERAND_SIZE : + fields->f_size = value; + break; + case MS1_OPERAND_TYPE : + fields->f_type = value; + break; + case MS1_OPERAND_WR : + fields->f_wr = value; + break; + case MS1_OPERAND_XMODE : + fields->f_xmode = value; + break; + + default : + /* xgettext:c-format */ + fprintf (stderr, _("Unrecognized field %d while setting int operand.\n"), + opindex); + abort (); + } +} + +void +ms1_cgen_set_vma_operand (cd, opindex, fields, value) + CGEN_CPU_DESC cd ATTRIBUTE_UNUSED; + int opindex; + CGEN_FIELDS * fields; + bfd_vma value; +{ + switch (opindex) + { + case MS1_OPERAND_A23 : + fields->f_a23 = value; + break; + case MS1_OPERAND_BALL : + fields->f_ball = value; + break; + case MS1_OPERAND_BALL2 : + fields->f_ball2 = value; + break; + case MS1_OPERAND_BANKADDR : + fields->f_bankaddr = value; + break; + case MS1_OPERAND_BRC : + fields->f_brc = value; + break; + case MS1_OPERAND_BRC2 : + fields->f_brc2 = value; + break; + case MS1_OPERAND_CBRB : + fields->f_cbrb = value; + break; + case MS1_OPERAND_CBS : + fields->f_cbs = value; + break; + case MS1_OPERAND_CBX : + fields->f_cbx = value; + break; + case MS1_OPERAND_CCB : + fields->f_ccb = value; + break; + case MS1_OPERAND_CDB : + fields->f_cdb = value; + break; + case MS1_OPERAND_CELL : + fields->f_cell = value; + break; + case MS1_OPERAND_COLNUM : + fields->f_colnum = value; + break; + case MS1_OPERAND_CONTNUM : + fields->f_contnum = value; + break; + case MS1_OPERAND_CR : + fields->f_cr = value; + break; + case MS1_OPERAND_CTXDISP : + fields->f_ctxdisp = value; + break; + case MS1_OPERAND_DUP : + fields->f_dup = value; + break; + case MS1_OPERAND_FBDISP : + fields->f_fbdisp = value; + break; + case MS1_OPERAND_FBINCR : + fields->f_fbincr = value; + break; + case MS1_OPERAND_FRDR : + fields->f_dr = value; + break; + case MS1_OPERAND_FRDRRR : + fields->f_drrr = value; + break; + case MS1_OPERAND_FRSR1 : + fields->f_sr1 = value; + break; + case MS1_OPERAND_FRSR2 : + fields->f_sr2 = value; + break; + case MS1_OPERAND_ID : + fields->f_id = value; + break; + case MS1_OPERAND_IMM16 : + fields->f_imm16s = value; + break; + case MS1_OPERAND_IMM16O : + fields->f_imm16s = value; + break; + case MS1_OPERAND_IMM16Z : + fields->f_imm16u = value; + break; + case MS1_OPERAND_INCAMT : + fields->f_incamt = value; + break; + case MS1_OPERAND_INCR : + fields->f_incr = value; + break; + case MS1_OPERAND_LENGTH : + fields->f_length = value; + break; + case MS1_OPERAND_MASK : + fields->f_mask = value; + break; + case MS1_OPERAND_MASK1 : + fields->f_mask1 = value; + break; + case MS1_OPERAND_MODE : + fields->f_mode = value; + break; + case MS1_OPERAND_PERM : + fields->f_perm = value; + break; + case MS1_OPERAND_RBBC : + fields->f_rbbc = value; + break; + case MS1_OPERAND_RC : + fields->f_rc = value; + break; + case MS1_OPERAND_RC1 : + fields->f_rc1 = value; + break; + case MS1_OPERAND_RC2 : + fields->f_rc2 = value; + break; + case MS1_OPERAND_RCNUM : + fields->f_rcnum = value; + break; + case MS1_OPERAND_RDA : + fields->f_rda = value; + break; + case MS1_OPERAND_ROWNUM : + fields->f_rownum = value; + break; + case MS1_OPERAND_ROWNUM1 : + fields->f_rownum1 = value; + break; + case MS1_OPERAND_ROWNUM2 : + fields->f_rownum2 = value; + break; + case MS1_OPERAND_SIZE : + fields->f_size = value; + break; + case MS1_OPERAND_TYPE : + fields->f_type = value; + break; + case MS1_OPERAND_WR : + fields->f_wr = value; + break; + case MS1_OPERAND_XMODE : + fields->f_xmode = value; + break; + + default : + /* xgettext:c-format */ + fprintf (stderr, _("Unrecognized field %d while setting vma operand.\n"), + opindex); + abort (); + } +} + +/* Function to call before using the instruction builder tables. */ + +void +ms1_cgen_init_ibld_table (cd) + CGEN_CPU_DESC cd; +{ + cd->insert_handlers = & ms1_cgen_insert_handlers[0]; + cd->extract_handlers = & ms1_cgen_extract_handlers[0]; + + cd->insert_operand = ms1_cgen_insert_operand; + cd->extract_operand = ms1_cgen_extract_operand; + + cd->get_int_operand = ms1_cgen_get_int_operand; + cd->set_int_operand = ms1_cgen_set_int_operand; + cd->get_vma_operand = ms1_cgen_get_vma_operand; + cd->set_vma_operand = ms1_cgen_set_vma_operand; +} diff -uprN binutils-2.16.90.0.3/opcodes/ms1-opc.c binutils-2.16.91.0.1/opcodes/ms1-opc.c --- binutils-2.16.90.0.3/opcodes/ms1-opc.c 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/opcodes/ms1-opc.c 2005-06-22 13:53:36.286089175 -0700 @@ -0,0 +1,896 @@ +/* Instruction opcode table for ms1. + +THIS FILE IS MACHINE GENERATED WITH CGEN. + +Copyright 1996-2005 Free Software Foundation, Inc. + +This file is part of the GNU Binutils and/or GDB, the GNU debugger. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +#include "sysdep.h" +#include "ansidecl.h" +#include "bfd.h" +#include "symcat.h" +#include "ms1-desc.h" +#include "ms1-opc.h" +#include "libiberty.h" + +/* -- opc.c */ +#include "safe-ctype.h" + +/* Special check to ensure that instruction exists for given machine. */ + +int +ms1_cgen_insn_supported (CGEN_CPU_DESC cd, + const CGEN_INSN *insn) +{ + int machs = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_MACH); + + /* No mach attribute? Assume it's supported for all machs. */ + if (machs == 0) + return 1; + + return ((machs & cd->machs) != 0); +} + +/* A better hash function for instruction mnemonics. */ + +unsigned int +ms1_asm_hash (const char* insn) +{ + unsigned int hash; + const char* m = insn; + + for (hash = 0; *m && ! ISSPACE (*m); m++) + hash = (hash * 23) ^ (0x1F & TOLOWER (*m)); + + /* printf ("%s %d\n", insn, (hash % CGEN_ASM_HASH_SIZE)); */ + + return hash % CGEN_ASM_HASH_SIZE; +} + + +/* -- asm.c */ +/* The hash functions are recorded here to help keep assembler code out of + the disassembler and vice versa. */ + +static int asm_hash_insn_p PARAMS ((const CGEN_INSN *)); +static unsigned int asm_hash_insn PARAMS ((const char *)); +static int dis_hash_insn_p PARAMS ((const CGEN_INSN *)); +static unsigned int dis_hash_insn PARAMS ((const char *, CGEN_INSN_INT)); + +/* Instruction formats. */ + +#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) +#define F(f) & ms1_cgen_ifld_table[MS1_##f] +#else +#define F(f) & ms1_cgen_ifld_table[MS1_/**/f] +#endif +static const CGEN_IFMT ifmt_empty ATTRIBUTE_UNUSED = { + 0, 0, 0x0, { { 0 } } +}; + +static const CGEN_IFMT ifmt_add ATTRIBUTE_UNUSED = { + 32, 32, 0xff000fff, { { F (F_MSYS) }, { F (F_OPC) }, { F (F_IMM) }, { F (F_SR1) }, { F (F_SR2) }, { F (F_DRRR) }, { F (F_UU12) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_addi ATTRIBUTE_UNUSED = { + 32, 32, 0xff000000, { { F (F_MSYS) }, { F (F_OPC) }, { F (F_IMM) }, { F (F_SR1) }, { F (F_DR) }, { F (F_IMM16S) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_addui ATTRIBUTE_UNUSED = { + 32, 32, 0xff000000, { { F (F_MSYS) }, { F (F_OPC) }, { F (F_IMM) }, { F (F_SR1) }, { F (F_DR) }, { F (F_IMM16U) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_nop ATTRIBUTE_UNUSED = { + 32, 32, 0xffffffff, { { F (F_MSYS) }, { F (F_OPC) }, { F (F_IMM) }, { F (F_UU24) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_ldui ATTRIBUTE_UNUSED = { + 32, 32, 0xfff00000, { { F (F_MSYS) }, { F (F_OPC) }, { F (F_IMM) }, { F (F_UU4B) }, { F (F_DR) }, { F (F_IMM16U) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_brlt ATTRIBUTE_UNUSED = { + 32, 32, 0xff000000, { { F (F_MSYS) }, { F (F_OPC) }, { F (F_IMM) }, { F (F_SR1) }, { F (F_SR2) }, { F (F_IMM16S) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_jmp ATTRIBUTE_UNUSED = { + 32, 32, 0xffff0000, { { F (F_MSYS) }, { F (F_OPC) }, { F (F_IMM) }, { F (F_UU4B) }, { F (F_UU4A) }, { F (F_IMM16S) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_jal ATTRIBUTE_UNUSED = { + 32, 32, 0xff0f0fff, { { F (F_MSYS) }, { F (F_OPC) }, { F (F_IMM) }, { F (F_SR1) }, { F (F_UU4A) }, { F (F_DRRR) }, { F (F_UU12) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_dbnz ATTRIBUTE_UNUSED = { + 32, 32, 0xff0f0000, { { F (F_MSYS) }, { F (F_OPC) }, { F (F_IMM) }, { F (F_SR1) }, { F (F_UU4A) }, { F (F_IMM16S) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_ei ATTRIBUTE_UNUSED = { + 32, 32, 0xffffffff, { { F (F_MSYS) }, { F (F_OPC) }, { F (F_IMM) }, { F (F_UU4B) }, { F (F_UU4A) }, { F (F_UU16) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_si ATTRIBUTE_UNUSED = { + 32, 32, 0xffff0fff, { { F (F_MSYS) }, { F (F_OPC) }, { F (F_IMM) }, { F (F_UU4B) }, { F (F_UU4A) }, { F (F_DRRR) }, { F (F_UU12) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_reti ATTRIBUTE_UNUSED = { + 32, 32, 0xff0fffff, { { F (F_MSYS) }, { F (F_OPC) }, { F (F_IMM) }, { F (F_SR1) }, { F (F_UU4A) }, { F (F_UU16) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_stw ATTRIBUTE_UNUSED = { + 32, 32, 0xff000000, { { F (F_MSYS) }, { F (F_OPC) }, { F (F_IMM) }, { F (F_SR1) }, { F (F_SR2) }, { F (F_IMM16S) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_ldctxt ATTRIBUTE_UNUSED = { + 32, 32, 0xff000e00, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_UU_2_25) }, { F (F_SR1) }, { F (F_SR2) }, { F (F_RC) }, { F (F_RCNUM) }, { F (F_UU_3_11) }, { F (F_CONTNUM) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_ldfb ATTRIBUTE_UNUSED = { + 32, 32, 0xff000000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_UU_2_25) }, { F (F_SR1) }, { F (F_SR2) }, { F (F_IMM16U) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_fbcb ATTRIBUTE_UNUSED = { + 32, 32, 0xfc00f000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_RBBC) }, { F (F_SR1) }, { F (F_BALL) }, { F (F_BRC) }, { F (F_UU_4_15) }, { F (F_RC) }, { F (F_CBRB) }, { F (F_CELL) }, { F (F_DUP) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_mfbcb ATTRIBUTE_UNUSED = { + 32, 32, 0xfc00f000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_RBBC) }, { F (F_SR1) }, { F (F_SR2) }, { F (F_UU_4_15) }, { F (F_RC1) }, { F (F_CBRB) }, { F (F_CELL) }, { F (F_DUP) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_fbcci ATTRIBUTE_UNUSED = { + 32, 32, 0xfc000000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_RBBC) }, { F (F_SR1) }, { F (F_BALL) }, { F (F_BRC) }, { F (F_FBDISP) }, { F (F_CELL) }, { F (F_DUP) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_mfbcci ATTRIBUTE_UNUSED = { + 32, 32, 0xfc000000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_RBBC) }, { F (F_SR1) }, { F (F_SR2) }, { F (F_FBDISP) }, { F (F_CELL) }, { F (F_DUP) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_fbcbdr ATTRIBUTE_UNUSED = { + 32, 32, 0xfc000000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_RBBC) }, { F (F_SR1) }, { F (F_SR2) }, { F (F_BALL2) }, { F (F_BRC2) }, { F (F_RC1) }, { F (F_CBRB) }, { F (F_CELL) }, { F (F_DUP) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_rcfbcb ATTRIBUTE_UNUSED = { + 32, 32, 0xfcc08000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_RBBC) }, { F (F_UU_2_23) }, { F (F_TYPE) }, { F (F_BALL) }, { F (F_BRC) }, { F (F_UU_1_15) }, { F (F_ROWNUM) }, { F (F_RC1) }, { F (F_CBRB) }, { F (F_CELL) }, { F (F_DUP) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_mrcfbcb ATTRIBUTE_UNUSED = { + 32, 32, 0xfcc08000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_RBBC) }, { F (F_UU_2_23) }, { F (F_TYPE) }, { F (F_SR2) }, { F (F_UU_1_15) }, { F (F_ROWNUM) }, { F (F_RC1) }, { F (F_CBRB) }, { F (F_CELL) }, { F (F_DUP) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_cbcast ATTRIBUTE_UNUSED = { + 32, 32, 0xfc000380, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_MASK) }, { F (F_UU_3_9) }, { F (F_RC2) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_dupcbcast ATTRIBUTE_UNUSED = { + 32, 32, 0xfc000000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_MASK) }, { F (F_CELL) }, { F (F_RC2) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_wfbi ATTRIBUTE_UNUSED = { + 32, 32, 0xfc000000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_BANKADDR) }, { F (F_ROWNUM1) }, { F (F_CELL) }, { F (F_DUP) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_wfb ATTRIBUTE_UNUSED = { + 32, 32, 0xff000040, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_UU_2_25) }, { F (F_SR1) }, { F (F_SR2) }, { F (F_FBDISP) }, { F (F_ROWNUM2) }, { F (F_UU_1_6) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_rcrisc ATTRIBUTE_UNUSED = { + 32, 32, 0xfc080000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_RBBC) }, { F (F_SR1) }, { F (F_UU_1_19) }, { F (F_COLNUM) }, { F (F_DRRR) }, { F (F_RC1) }, { F (F_CBRB) }, { F (F_CELL) }, { F (F_DUP) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_fbcbinc ATTRIBUTE_UNUSED = { + 32, 32, 0xfc000000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_RBBC) }, { F (F_SR1) }, { F (F_INCAMT) }, { F (F_RC1) }, { F (F_CBRB) }, { F (F_CELL) }, { F (F_DUP) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_rcxmode ATTRIBUTE_UNUSED = { + 32, 32, 0xfc000000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_RDA) }, { F (F_WR) }, { F (F_XMODE) }, { F (F_MASK1) }, { F (F_SR2) }, { F (F_FBDISP) }, { F (F_ROWNUM2) }, { F (F_RC2) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_interleaver ATTRIBUTE_UNUSED = { + 32, 32, 0xfc008000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_MODE) }, { F (F_SR1) }, { F (F_SR2) }, { F (F_UU_1_15) }, { F (F_ID) }, { F (F_SIZE) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_wfbinc ATTRIBUTE_UNUSED = { + 32, 32, 0xfc000000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_RDA) }, { F (F_WR) }, { F (F_FBINCR) }, { F (F_BALL) }, { F (F_COLNUM) }, { F (F_LENGTH) }, { F (F_ROWNUM1) }, { F (F_ROWNUM2) }, { F (F_DUP) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_mwfbinc ATTRIBUTE_UNUSED = { + 32, 32, 0xfc000000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_RDA) }, { F (F_WR) }, { F (F_FBINCR) }, { F (F_SR2) }, { F (F_LENGTH) }, { F (F_ROWNUM1) }, { F (F_ROWNUM2) }, { F (F_DUP) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_wfbincr ATTRIBUTE_UNUSED = { + 32, 32, 0xfc000000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_RDA) }, { F (F_WR) }, { F (F_SR1) }, { F (F_BALL) }, { F (F_COLNUM) }, { F (F_LENGTH) }, { F (F_ROWNUM1) }, { F (F_ROWNUM2) }, { F (F_DUP) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_mwfbincr ATTRIBUTE_UNUSED = { + 32, 32, 0xfc000000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_RDA) }, { F (F_WR) }, { F (F_SR1) }, { F (F_SR2) }, { F (F_LENGTH) }, { F (F_ROWNUM1) }, { F (F_ROWNUM2) }, { F (F_DUP) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_fbcbincs ATTRIBUTE_UNUSED = { + 32, 32, 0xfc000000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_PERM) }, { F (F_A23) }, { F (F_CR) }, { F (F_CBS) }, { F (F_INCR) }, { F (F_CCB) }, { F (F_CDB) }, { F (F_ROWNUM2) }, { F (F_DUP) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_mfbcbincs ATTRIBUTE_UNUSED = { + 32, 32, 0xfc000000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_PERM) }, { F (F_SR1) }, { F (F_CBS) }, { F (F_INCR) }, { F (F_CCB) }, { F (F_CDB) }, { F (F_ROWNUM2) }, { F (F_DUP) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_fbcbincrs ATTRIBUTE_UNUSED = { + 32, 32, 0xfc008000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_PERM) }, { F (F_SR1) }, { F (F_BALL) }, { F (F_COLNUM) }, { F (F_UU_1_15) }, { F (F_CBX) }, { F (F_CCB) }, { F (F_CDB) }, { F (F_ROWNUM2) }, { F (F_DUP) }, { F (F_CTXDISP) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_mfbcbincrs ATTRIBUTE_UNUSED = { + 32, 32, 0xfc008000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_PERM) }, { F (F_SR1) }, { F (F_SR2) }, { F (F_UU_1_15) }, { F (F_CBX) }, { F (F_CCB) }, { F (F_CDB) }, { F (F_ROWNUM2) }, { F (F_DUP) }, { F (F_CTXDISP) }, { 0 } } +}; + +#undef F + +#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) +#define A(a) (1 << CGEN_INSN_##a) +#else +#define A(a) (1 << CGEN_INSN_/**/a) +#endif +#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) +#define OPERAND(op) MS1_OPERAND_##op +#else +#define OPERAND(op) MS1_OPERAND_/**/op +#endif +#define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */ +#define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field)) + +/* The instruction table. */ + +static const CGEN_OPCODE ms1_cgen_insn_opcode_table[MAX_INSNS] = +{ + /* Special null first entry. + A `num' value of zero is thus invalid. + Also, the special `invalid' insn resides here. */ + { { 0, 0, 0, 0 }, {{0}}, 0, {0}}, +/* add $frdrrr,$frsr1,$frsr2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDRRR), ',', OP (FRSR1), ',', OP (FRSR2), 0 } }, + & ifmt_add, { 0x0 } + }, +/* addu $frdrrr,$frsr1,$frsr2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDRRR), ',', OP (FRSR1), ',', OP (FRSR2), 0 } }, + & ifmt_add, { 0x2000000 } + }, +/* addi $frdr,$frsr1,#$imm16 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDR), ',', OP (FRSR1), ',', '#', OP (IMM16), 0 } }, + & ifmt_addi, { 0x1000000 } + }, +/* addui $frdr,$frsr1,#$imm16z */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDR), ',', OP (FRSR1), ',', '#', OP (IMM16Z), 0 } }, + & ifmt_addui, { 0x3000000 } + }, +/* sub $frdrrr,$frsr1,$frsr2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDRRR), ',', OP (FRSR1), ',', OP (FRSR2), 0 } }, + & ifmt_add, { 0x4000000 } + }, +/* subu $frdrrr,$frsr1,$frsr2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDRRR), ',', OP (FRSR1), ',', OP (FRSR2), 0 } }, + & ifmt_add, { 0x6000000 } + }, +/* subi $frdr,$frsr1,#$imm16 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDR), ',', OP (FRSR1), ',', '#', OP (IMM16), 0 } }, + & ifmt_addi, { 0x5000000 } + }, +/* subui $frdr,$frsr1,#$imm16z */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDR), ',', OP (FRSR1), ',', '#', OP (IMM16Z), 0 } }, + & ifmt_addui, { 0x7000000 } + }, +/* mul $frdrrr,$frsr1,$frsr2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDRRR), ',', OP (FRSR1), ',', OP (FRSR2), 0 } }, + & ifmt_add, { 0x8000000 } + }, +/* muli $frdr,$frsr1,#$imm16 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDR), ',', OP (FRSR1), ',', '#', OP (IMM16), 0 } }, + & ifmt_addi, { 0x9000000 } + }, +/* and $frdrrr,$frsr1,$frsr2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDRRR), ',', OP (FRSR1), ',', OP (FRSR2), 0 } }, + & ifmt_add, { 0x10000000 } + }, +/* andi $frdr,$frsr1,#$imm16z */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDR), ',', OP (FRSR1), ',', '#', OP (IMM16Z), 0 } }, + & ifmt_addui, { 0x11000000 } + }, +/* or $frdrrr,$frsr1,$frsr2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDRRR), ',', OP (FRSR1), ',', OP (FRSR2), 0 } }, + & ifmt_add, { 0x12000000 } + }, +/* nop */ + { + { 0, 0, 0, 0 }, + { { MNEM, 0 } }, + & ifmt_nop, { 0x12000000 } + }, +/* ori $frdr,$frsr1,#$imm16z */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDR), ',', OP (FRSR1), ',', '#', OP (IMM16Z), 0 } }, + & ifmt_addui, { 0x13000000 } + }, +/* xor $frdrrr,$frsr1,$frsr2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDRRR), ',', OP (FRSR1), ',', OP (FRSR2), 0 } }, + & ifmt_add, { 0x14000000 } + }, +/* xori $frdr,$frsr1,#$imm16z */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDR), ',', OP (FRSR1), ',', '#', OP (IMM16Z), 0 } }, + & ifmt_addui, { 0x15000000 } + }, +/* nand $frdrrr,$frsr1,$frsr2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDRRR), ',', OP (FRSR1), ',', OP (FRSR2), 0 } }, + & ifmt_add, { 0x16000000 } + }, +/* nandi $frdr,$frsr1,#$imm16z */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDR), ',', OP (FRSR1), ',', '#', OP (IMM16Z), 0 } }, + & ifmt_addui, { 0x17000000 } + }, +/* nor $frdrrr,$frsr1,$frsr2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDRRR), ',', OP (FRSR1), ',', OP (FRSR2), 0 } }, + & ifmt_add, { 0x18000000 } + }, +/* nori $frdr,$frsr1,#$imm16z */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDR), ',', OP (FRSR1), ',', '#', OP (IMM16Z), 0 } }, + & ifmt_addui, { 0x19000000 } + }, +/* xnor $frdrrr,$frsr1,$frsr2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDRRR), ',', OP (FRSR1), ',', OP (FRSR2), 0 } }, + & ifmt_add, { 0x1a000000 } + }, +/* xnori $frdr,$frsr1,#$imm16z */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDR), ',', OP (FRSR1), ',', '#', OP (IMM16Z), 0 } }, + & ifmt_addui, { 0x1b000000 } + }, +/* ldui $frdr,#$imm16z */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDR), ',', '#', OP (IMM16Z), 0 } }, + & ifmt_ldui, { 0x1d000000 } + }, +/* lsl $frdrrr,$frsr1,$frsr2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDRRR), ',', OP (FRSR1), ',', OP (FRSR2), 0 } }, + & ifmt_add, { 0x20000000 } + }, +/* lsli $frdr,$frsr1,#$imm16 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDR), ',', OP (FRSR1), ',', '#', OP (IMM16), 0 } }, + & ifmt_addi, { 0x21000000 } + }, +/* lsr $frdrrr,$frsr1,$frsr2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDRRR), ',', OP (FRSR1), ',', OP (FRSR2), 0 } }, + & ifmt_add, { 0x22000000 } + }, +/* lsri $frdr,$frsr1,#$imm16 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDR), ',', OP (FRSR1), ',', '#', OP (IMM16), 0 } }, + & ifmt_addi, { 0x23000000 } + }, +/* asr $frdrrr,$frsr1,$frsr2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDRRR), ',', OP (FRSR1), ',', OP (FRSR2), 0 } }, + & ifmt_add, { 0x24000000 } + }, +/* asri $frdr,$frsr1,#$imm16 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDR), ',', OP (FRSR1), ',', '#', OP (IMM16), 0 } }, + & ifmt_addi, { 0x25000000 } + }, +/* brlt $frsr1,$frsr2,$imm16o */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', OP (FRSR2), ',', OP (IMM16O), 0 } }, + & ifmt_brlt, { 0x31000000 } + }, +/* brle $frsr1,$frsr2,$imm16o */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', OP (FRSR2), ',', OP (IMM16O), 0 } }, + & ifmt_brlt, { 0x33000000 } + }, +/* breq $frsr1,$frsr2,$imm16o */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', OP (FRSR2), ',', OP (IMM16O), 0 } }, + & ifmt_brlt, { 0x35000000 } + }, +/* brne $frsr1,$frsr2,$imm16o */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', OP (FRSR2), ',', OP (IMM16O), 0 } }, + & ifmt_brlt, { 0x3b000000 } + }, +/* jmp $imm16o */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (IMM16O), 0 } }, + & ifmt_jmp, { 0x37000000 } + }, +/* jal $frdrrr,$frsr1 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDRRR), ',', OP (FRSR1), 0 } }, + & ifmt_jal, { 0x38000000 } + }, +/* dbnz $frsr1,$imm16o */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', OP (IMM16O), 0 } }, + & ifmt_dbnz, { 0x3d000000 } + }, +/* ei */ + { + { 0, 0, 0, 0 }, + { { MNEM, 0 } }, + & ifmt_ei, { 0x60000000 } + }, +/* di */ + { + { 0, 0, 0, 0 }, + { { MNEM, 0 } }, + & ifmt_ei, { 0x62000000 } + }, +/* si $frdrrr */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDRRR), 0 } }, + & ifmt_si, { 0x64000000 } + }, +/* reti $frsr1 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), 0 } }, + & ifmt_reti, { 0x66000000 } + }, +/* ldw $frdr,$frsr1,#$imm16 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDR), ',', OP (FRSR1), ',', '#', OP (IMM16), 0 } }, + & ifmt_addi, { 0x41000000 } + }, +/* stw $frsr2,$frsr1,#$imm16 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR2), ',', OP (FRSR1), ',', '#', OP (IMM16), 0 } }, + & ifmt_stw, { 0x43000000 } + }, +/* break */ + { + { 0, 0, 0, 0 }, + { { MNEM, 0 } }, + & ifmt_nop, { 0x68000000 } + }, +/* iflush */ + { + { 0, 0, 0, 0 }, + { { MNEM, 0 } }, + & ifmt_nop, { 0x6a000000 } + }, +/* ldctxt $frsr1,$frsr2,#$rc,#$rcnum,#$contnum */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', OP (FRSR2), ',', '#', OP (RC), ',', '#', OP (RCNUM), ',', '#', OP (CONTNUM), 0 } }, + & ifmt_ldctxt, { 0x80000000 } + }, +/* ldfb $frsr1,$frsr2,#$imm16z */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', OP (FRSR2), ',', '#', OP (IMM16Z), 0 } }, + & ifmt_ldfb, { 0x84000000 } + }, +/* stfb $frsr1,$frsr2,#$imm16z */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', OP (FRSR2), ',', '#', OP (IMM16Z), 0 } }, + & ifmt_ldfb, { 0x88000000 } + }, +/* fbcb $frsr1,#$rbbc,#$ball,#$brc,#$rc1,#$cbrb,#$cell,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', '#', OP (RBBC), ',', '#', OP (BALL), ',', '#', OP (BRC), ',', '#', OP (RC1), ',', '#', OP (CBRB), ',', '#', OP (CELL), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_fbcb, { 0x8c000000 } + }, +/* mfbcb $frsr1,#$rbbc,$frsr2,#$rc1,#$cbrb,#$cell,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', '#', OP (RBBC), ',', OP (FRSR2), ',', '#', OP (RC1), ',', '#', OP (CBRB), ',', '#', OP (CELL), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_mfbcb, { 0x90000000 } + }, +/* fbcci $frsr1,#$rbbc,#$ball,#$brc,#$fbdisp,#$cell,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', '#', OP (RBBC), ',', '#', OP (BALL), ',', '#', OP (BRC), ',', '#', OP (FBDISP), ',', '#', OP (CELL), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_fbcci, { 0x94000000 } + }, +/* fbrci $frsr1,#$rbbc,#$ball,#$brc,#$fbdisp,#$cell,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', '#', OP (RBBC), ',', '#', OP (BALL), ',', '#', OP (BRC), ',', '#', OP (FBDISP), ',', '#', OP (CELL), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_fbcci, { 0x98000000 } + }, +/* fbcri $frsr1,#$rbbc,#$ball,#$brc,#$fbdisp,#$cell,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', '#', OP (RBBC), ',', '#', OP (BALL), ',', '#', OP (BRC), ',', '#', OP (FBDISP), ',', '#', OP (CELL), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_fbcci, { 0x9c000000 } + }, +/* fbrri $frsr1,#$rbbc,#$ball,#$brc,#$fbdisp,#$cell,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', '#', OP (RBBC), ',', '#', OP (BALL), ',', '#', OP (BRC), ',', '#', OP (FBDISP), ',', '#', OP (CELL), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_fbcci, { 0xa0000000 } + }, +/* mfbcci $frsr1,#$rbbc,$frsr2,#$fbdisp,#$cell,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', '#', OP (RBBC), ',', OP (FRSR2), ',', '#', OP (FBDISP), ',', '#', OP (CELL), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_mfbcci, { 0xa4000000 } + }, +/* mfbrci $frsr1,#$rbbc,$frsr2,#$fbdisp,#$cell,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', '#', OP (RBBC), ',', OP (FRSR2), ',', '#', OP (FBDISP), ',', '#', OP (CELL), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_mfbcci, { 0xa8000000 } + }, +/* mfbcri $frsr1,#$rbbc,$frsr2,#$fbdisp,#$cell,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', '#', OP (RBBC), ',', OP (FRSR2), ',', '#', OP (FBDISP), ',', '#', OP (CELL), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_mfbcci, { 0xac000000 } + }, +/* mfbrri $frsr1,#$rbbc,$frsr2,#$fbdisp,#$cell,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', '#', OP (RBBC), ',', OP (FRSR2), ',', '#', OP (FBDISP), ',', '#', OP (CELL), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_mfbcci, { 0xb0000000 } + }, +/* fbcbdr $frsr1,#$rbbc,$frsr2,#$ball2,#$brc2,#$rc1,#$cbrb,#$cell,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', '#', OP (RBBC), ',', OP (FRSR2), ',', '#', OP (BALL2), ',', '#', OP (BRC2), ',', '#', OP (RC1), ',', '#', OP (CBRB), ',', '#', OP (CELL), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_fbcbdr, { 0xb4000000 } + }, +/* rcfbcb #$rbbc,#$type,#$ball,#$brc,#$rownum,#$rc1,#$cbrb,#$cell,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', '#', OP (RBBC), ',', '#', OP (TYPE), ',', '#', OP (BALL), ',', '#', OP (BRC), ',', '#', OP (ROWNUM), ',', '#', OP (RC1), ',', '#', OP (CBRB), ',', '#', OP (CELL), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_rcfbcb, { 0xb8000000 } + }, +/* mrcfbcb $frsr2,#$rbbc,#$type,#$rownum,#$rc1,#$cbrb,#$cell,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR2), ',', '#', OP (RBBC), ',', '#', OP (TYPE), ',', '#', OP (ROWNUM), ',', '#', OP (RC1), ',', '#', OP (CBRB), ',', '#', OP (CELL), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_mrcfbcb, { 0xbc000000 } + }, +/* cbcast #$mask,#$rc2,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', '#', OP (MASK), ',', '#', OP (RC2), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_cbcast, { 0xc0000000 } + }, +/* dupcbcast #$mask,#$cell,#$rc2,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', '#', OP (MASK), ',', '#', OP (CELL), ',', '#', OP (RC2), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_dupcbcast, { 0xc4000000 } + }, +/* wfbi #$bankaddr,#$rownum1,#$cell,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', '#', OP (BANKADDR), ',', '#', OP (ROWNUM1), ',', '#', OP (CELL), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_wfbi, { 0xc8000000 } + }, +/* wfb $frsr1,$frsr2,#$fbdisp,#$rownum2,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', OP (FRSR2), ',', '#', OP (FBDISP), ',', '#', OP (ROWNUM2), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_wfb, { 0xcc000000 } + }, +/* rcrisc $frdrrr,#$rbbc,$frsr1,#$colnum,#$rc1,#$cbrb,#$cell,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRDRRR), ',', '#', OP (RBBC), ',', OP (FRSR1), ',', '#', OP (COLNUM), ',', '#', OP (RC1), ',', '#', OP (CBRB), ',', '#', OP (CELL), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_rcrisc, { 0xd0000000 } + }, +/* fbcbinc $frsr1,#$rbbc,#$incamt,#$rc1,#$cbrb,#$cell,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', '#', OP (RBBC), ',', '#', OP (INCAMT), ',', '#', OP (RC1), ',', '#', OP (CBRB), ',', '#', OP (CELL), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_fbcbinc, { 0xd4000000 } + }, +/* rcxmode $frsr2,#$rda,#$wr,#$xmode,#$mask1,#$fbdisp,#$rownum2,#$rc2,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR2), ',', '#', OP (RDA), ',', '#', OP (WR), ',', '#', OP (XMODE), ',', '#', OP (MASK1), ',', '#', OP (FBDISP), ',', '#', OP (ROWNUM2), ',', '#', OP (RC2), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_rcxmode, { 0xd8000000 } + }, +/* intlvr $frsr1,#$mode,$frsr2,#$id,#$size */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', '#', OP (MODE), ',', OP (FRSR2), ',', '#', OP (ID), ',', '#', OP (SIZE), 0 } }, + & ifmt_interleaver, { 0xdc000000 } + }, +/* wfbinc #$rda,#$wr,#$fbincr,#$ball,#$colnum,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', '#', OP (RDA), ',', '#', OP (WR), ',', '#', OP (FBINCR), ',', '#', OP (BALL), ',', '#', OP (COLNUM), ',', '#', OP (LENGTH), ',', '#', OP (ROWNUM1), ',', '#', OP (ROWNUM2), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_wfbinc, { 0xe0000000 } + }, +/* mwfbinc $frsr2,#$rda,#$wr,#$fbincr,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR2), ',', '#', OP (RDA), ',', '#', OP (WR), ',', '#', OP (FBINCR), ',', '#', OP (LENGTH), ',', '#', OP (ROWNUM1), ',', '#', OP (ROWNUM2), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_mwfbinc, { 0xe4000000 } + }, +/* wfbincr $frsr1,#$rda,#$wr,#$ball,#$colnum,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', '#', OP (RDA), ',', '#', OP (WR), ',', '#', OP (BALL), ',', '#', OP (COLNUM), ',', '#', OP (LENGTH), ',', '#', OP (ROWNUM1), ',', '#', OP (ROWNUM2), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_wfbincr, { 0xe8000000 } + }, +/* mwfbincr $frsr1,$frsr2,#$rda,#$wr,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', OP (FRSR2), ',', '#', OP (RDA), ',', '#', OP (WR), ',', '#', OP (LENGTH), ',', '#', OP (ROWNUM1), ',', '#', OP (ROWNUM2), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_mwfbincr, { 0xec000000 } + }, +/* fbcbincs #$perm,#$a23,#$cr,#$cbs,#$incr,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', '#', OP (PERM), ',', '#', OP (A23), ',', '#', OP (CR), ',', '#', OP (CBS), ',', '#', OP (INCR), ',', '#', OP (CCB), ',', '#', OP (CDB), ',', '#', OP (ROWNUM2), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_fbcbincs, { 0xf0000000 } + }, +/* mfbcbincs $frsr1,#$perm,#$cbs,#$incr,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', '#', OP (PERM), ',', '#', OP (CBS), ',', '#', OP (INCR), ',', '#', OP (CCB), ',', '#', OP (CDB), ',', '#', OP (ROWNUM2), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_mfbcbincs, { 0xf4000000 } + }, +/* fbcbincrs $frsr1,#$perm,#$ball,#$colnum,#$cbx,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', '#', OP (PERM), ',', '#', OP (BALL), ',', '#', OP (COLNUM), ',', '#', OP (CBX), ',', '#', OP (CCB), ',', '#', OP (CDB), ',', '#', OP (ROWNUM2), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_fbcbincrs, { 0xf8000000 } + }, +/* mfbcbincrs $frsr1,$frsr2,#$perm,#$cbx,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (FRSR1), ',', OP (FRSR2), ',', '#', OP (PERM), ',', '#', OP (CBX), ',', '#', OP (CCB), ',', '#', OP (CDB), ',', '#', OP (ROWNUM2), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } }, + & ifmt_mfbcbincrs, { 0xfc000000 } + }, +}; + +#undef A +#undef OPERAND +#undef MNEM +#undef OP + +/* Formats for ALIAS macro-insns. */ + +#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) +#define F(f) & ms1_cgen_ifld_table[MS1_##f] +#else +#define F(f) & ms1_cgen_ifld_table[MS1_/**/f] +#endif +#undef F + +/* Each non-simple macro entry points to an array of expansion possibilities. */ + +#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) +#define A(a) (1 << CGEN_INSN_##a) +#else +#define A(a) (1 << CGEN_INSN_/**/a) +#endif +#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) +#define OPERAND(op) MS1_OPERAND_##op +#else +#define OPERAND(op) MS1_OPERAND_/**/op +#endif +#define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */ +#define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field)) + +/* The macro instruction table. */ + +static const CGEN_IBASE ms1_cgen_macro_insn_table[] = +{ +}; + +/* The macro instruction opcode table. */ + +static const CGEN_OPCODE ms1_cgen_macro_insn_opcode_table[] = +{ +}; + +#undef A +#undef OPERAND +#undef MNEM +#undef OP + +#ifndef CGEN_ASM_HASH_P +#define CGEN_ASM_HASH_P(insn) 1 +#endif + +#ifndef CGEN_DIS_HASH_P +#define CGEN_DIS_HASH_P(insn) 1 +#endif + +/* Return non-zero if INSN is to be added to the hash table. + Targets are free to override CGEN_{ASM,DIS}_HASH_P in the .opc file. */ + +static int +asm_hash_insn_p (insn) + const CGEN_INSN *insn ATTRIBUTE_UNUSED; +{ + return CGEN_ASM_HASH_P (insn); +} + +static int +dis_hash_insn_p (insn) + const CGEN_INSN *insn; +{ + /* If building the hash table and the NO-DIS attribute is present, + ignore. */ + if (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_NO_DIS)) + return 0; + return CGEN_DIS_HASH_P (insn); +} + +#ifndef CGEN_ASM_HASH +#define CGEN_ASM_HASH_SIZE 127 +#ifdef CGEN_MNEMONIC_OPERANDS +#define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE) +#else +#define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE) /*FIXME*/ +#endif +#endif + +/* It doesn't make much sense to provide a default here, + but while this is under development we do. + BUFFER is a pointer to the bytes of the insn, target order. + VALUE is the first base_insn_bitsize bits as an int in host order. */ + +#ifndef CGEN_DIS_HASH +#define CGEN_DIS_HASH_SIZE 256 +#define CGEN_DIS_HASH(buf, value) (*(unsigned char *) (buf)) +#endif + +/* The result is the hash value of the insn. + Targets are free to override CGEN_{ASM,DIS}_HASH in the .opc file. */ + +static unsigned int +asm_hash_insn (mnem) + const char * mnem; +{ + return CGEN_ASM_HASH (mnem); +} + +/* BUF is a pointer to the bytes of the insn, target order. + VALUE is the first base_insn_bitsize bits as an int in host order. */ + +static unsigned int +dis_hash_insn (buf, value) + const char * buf ATTRIBUTE_UNUSED; + CGEN_INSN_INT value ATTRIBUTE_UNUSED; +{ + return CGEN_DIS_HASH (buf, value); +} + +static void set_fields_bitsize PARAMS ((CGEN_FIELDS *, int)); + +/* Set the recorded length of the insn in the CGEN_FIELDS struct. */ + +static void +set_fields_bitsize (fields, size) + CGEN_FIELDS *fields; + int size; +{ + CGEN_FIELDS_BITSIZE (fields) = size; +} + +/* Function to call before using the operand instance table. + This plugs the opcode entries and macro instructions into the cpu table. */ + +void +ms1_cgen_init_opcode_table (cd) + CGEN_CPU_DESC cd; +{ + int i; + int num_macros = (sizeof (ms1_cgen_macro_insn_table) / + sizeof (ms1_cgen_macro_insn_table[0])); + const CGEN_IBASE *ib = & ms1_cgen_macro_insn_table[0]; + const CGEN_OPCODE *oc = & ms1_cgen_macro_insn_opcode_table[0]; + CGEN_INSN *insns = (CGEN_INSN *) xmalloc (num_macros * sizeof (CGEN_INSN)); + memset (insns, 0, num_macros * sizeof (CGEN_INSN)); + for (i = 0; i < num_macros; ++i) + { + insns[i].base = &ib[i]; + insns[i].opcode = &oc[i]; + ms1_cgen_build_insn_regex (& insns[i]); + } + cd->macro_insn_table.init_entries = insns; + cd->macro_insn_table.entry_size = sizeof (CGEN_IBASE); + cd->macro_insn_table.num_init_entries = num_macros; + + oc = & ms1_cgen_insn_opcode_table[0]; + insns = (CGEN_INSN *) cd->insn_table.init_entries; + for (i = 0; i < MAX_INSNS; ++i) + { + insns[i].opcode = &oc[i]; + ms1_cgen_build_insn_regex (& insns[i]); + } + + cd->sizeof_fields = sizeof (CGEN_FIELDS); + cd->set_fields_bitsize = set_fields_bitsize; + + cd->asm_hash_p = asm_hash_insn_p; + cd->asm_hash = asm_hash_insn; + cd->asm_hash_size = CGEN_ASM_HASH_SIZE; + + cd->dis_hash_p = dis_hash_insn_p; + cd->dis_hash = dis_hash_insn; + cd->dis_hash_size = CGEN_DIS_HASH_SIZE; +} diff -uprN binutils-2.16.90.0.3/opcodes/ms1-opc.h binutils-2.16.91.0.1/opcodes/ms1-opc.h --- binutils-2.16.90.0.3/opcodes/ms1-opc.h 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/opcodes/ms1-opc.h 2005-06-22 13:53:36.286089175 -0700 @@ -0,0 +1,169 @@ +/* Instruction opcode header for ms1. + +THIS FILE IS MACHINE GENERATED WITH CGEN. + +Copyright 1996-2005 Free Software Foundation, Inc. + +This file is part of the GNU Binutils and/or GDB, the GNU debugger. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +#ifndef MS1_OPC_H +#define MS1_OPC_H + +/* -- opc.h */ + +/* Check applicability of instructions against machines. */ +#define CGEN_VALIDATE_INSN_SUPPORTED + +/* Allows reason codes to be output when assembler errors occur. */ +#define CGEN_VERBOSE_ASSEMBLER_ERRORS + +/* Override disassembly hashing - there are variable bits in the top + byte of these instructions. */ +#define CGEN_DIS_HASH_SIZE 8 +#define CGEN_DIS_HASH(buf, value) (((* (unsigned char *) (buf)) >> 5) % CGEN_DIS_HASH_SIZE) + +#define CGEN_ASM_HASH_SIZE 127 +#define CGEN_ASM_HASH(insn) ms1_asm_hash (insn) + +extern unsigned int ms1_asm_hash (const char *); + +extern int ms1_cgen_insn_supported (CGEN_CPU_DESC, const CGEN_INSN *); + + +/* -- opc.c */ +/* Enum declaration for ms1 instruction types. */ +typedef enum cgen_insn_type { + MS1_INSN_INVALID, MS1_INSN_ADD, MS1_INSN_ADDU, MS1_INSN_ADDI + , MS1_INSN_ADDUI, MS1_INSN_SUB, MS1_INSN_SUBU, MS1_INSN_SUBI + , MS1_INSN_SUBUI, MS1_INSN_MUL, MS1_INSN_MULI, MS1_INSN_AND + , MS1_INSN_ANDI, MS1_INSN_OR, MS1_INSN_NOP, MS1_INSN_ORI + , MS1_INSN_XOR, MS1_INSN_XORI, MS1_INSN_NAND, MS1_INSN_NANDI + , MS1_INSN_NOR, MS1_INSN_NORI, MS1_INSN_XNOR, MS1_INSN_XNORI + , MS1_INSN_LDUI, MS1_INSN_LSL, MS1_INSN_LSLI, MS1_INSN_LSR + , MS1_INSN_LSRI, MS1_INSN_ASR, MS1_INSN_ASRI, MS1_INSN_BRLT + , MS1_INSN_BRLE, MS1_INSN_BREQ, MS1_INSN_BRNE, MS1_INSN_JMP + , MS1_INSN_JAL, MS1_INSN_DBNZ, MS1_INSN_EI, MS1_INSN_DI + , MS1_INSN_SI, MS1_INSN_RETI, MS1_INSN_LDW, MS1_INSN_STW + , MS1_INSN_BREAK, MS1_INSN_IFLUSH, MS1_INSN_LDCTXT, MS1_INSN_LDFB + , MS1_INSN_STFB, MS1_INSN_FBCB, MS1_INSN_MFBCB, MS1_INSN_FBCCI + , MS1_INSN_FBRCI, MS1_INSN_FBCRI, MS1_INSN_FBRRI, MS1_INSN_MFBCCI + , MS1_INSN_MFBRCI, MS1_INSN_MFBCRI, MS1_INSN_MFBRRI, MS1_INSN_FBCBDR + , MS1_INSN_RCFBCB, MS1_INSN_MRCFBCB, MS1_INSN_CBCAST, MS1_INSN_DUPCBCAST + , MS1_INSN_WFBI, MS1_INSN_WFB, MS1_INSN_RCRISC, MS1_INSN_FBCBINC + , MS1_INSN_RCXMODE, MS1_INSN_INTERLEAVER, MS1_INSN_WFBINC, MS1_INSN_MWFBINC + , MS1_INSN_WFBINCR, MS1_INSN_MWFBINCR, MS1_INSN_FBCBINCS, MS1_INSN_MFBCBINCS + , MS1_INSN_FBCBINCRS, MS1_INSN_MFBCBINCRS +} CGEN_INSN_TYPE; + +/* Index of `invalid' insn place holder. */ +#define CGEN_INSN_INVALID MS1_INSN_INVALID + +/* Total number of insns in table. */ +#define MAX_INSNS ((int) MS1_INSN_MFBCBINCRS + 1) + +/* This struct records data prior to insertion or after extraction. */ +struct cgen_fields +{ + int length; + long f_nil; + long f_anyof; + long f_msys; + long f_opc; + long f_imm; + long f_uu24; + long f_sr1; + long f_sr2; + long f_dr; + long f_drrr; + long f_imm16u; + long f_imm16s; + long f_imm16a; + long f_uu4a; + long f_uu4b; + long f_uu12; + long f_uu16; + long f_msopc; + long f_uu_26_25; + long f_mask; + long f_bankaddr; + long f_rda; + long f_uu_2_25; + long f_rbbc; + long f_perm; + long f_mode; + long f_uu_1_24; + long f_wr; + long f_fbincr; + long f_uu_2_23; + long f_xmode; + long f_a23; + long f_mask1; + long f_cr; + long f_type; + long f_incamt; + long f_cbs; + long f_uu_1_19; + long f_ball; + long f_colnum; + long f_brc; + long f_incr; + long f_fbdisp; + long f_uu_4_15; + long f_length; + long f_uu_1_15; + long f_rc; + long f_rcnum; + long f_rownum; + long f_cbx; + long f_id; + long f_size; + long f_rownum1; + long f_uu_3_11; + long f_rc1; + long f_ccb; + long f_cbrb; + long f_cdb; + long f_rownum2; + long f_cell; + long f_uu_3_9; + long f_contnum; + long f_uu_1_6; + long f_dup; + long f_rc2; + long f_ctxdisp; + long f_msysfrsr2; + long f_brc2; + long f_ball2; +}; + +#define CGEN_INIT_PARSE(od) \ +{\ +} +#define CGEN_INIT_INSERT(od) \ +{\ +} +#define CGEN_INIT_EXTRACT(od) \ +{\ +} +#define CGEN_INIT_PRINT(od) \ +{\ +} + + +#endif /* MS1_OPC_H */ diff -uprN binutils-2.16.90.0.3/opcodes/ppc-dis.c binutils-2.16.91.0.1/opcodes/ppc-dis.c --- binutils-2.16.90.0.3/opcodes/ppc-dis.c 2005-05-10 15:46:54.000000000 -0700 +++ binutils-2.16.91.0.1/opcodes/ppc-dis.c 2005-06-22 13:53:36.287089010 -0700 @@ -72,6 +72,10 @@ powerpc_dialect (struct disassemble_info dialect |= PPC_OPCODE_POWER4; if (info->disassembler_options + && strstr (info->disassembler_options, "power5") != NULL) + dialect |= PPC_OPCODE_POWER4 | PPC_OPCODE_POWER5; + + if (info->disassembler_options && strstr (info->disassembler_options, "any") != NULL) dialect |= PPC_OPCODE_ANY; @@ -302,6 +306,7 @@ the -M switch:\n"); fprintf (stream, " e500|e500x2 Disassemble the e500 instructions\n"); fprintf (stream, " efs Disassemble the EFS instructions\n"); fprintf (stream, " power4 Disassemble the Power4 instructions\n"); + fprintf (stream, " power5 Disassemble the Power5 instructions\n"); fprintf (stream, " 32 Do not disassemble 64-bit instructions\n"); fprintf (stream, " 64 Allow disassembly of 64-bit instructions\n"); } diff -uprN binutils-2.16.90.0.3/opcodes/ppc-opc.c binutils-2.16.91.0.1/opcodes/ppc-opc.c --- binutils-2.16.90.0.3/opcodes/ppc-opc.c 2005-05-10 15:46:54.000000000 -0700 +++ binutils-2.16.91.0.1/opcodes/ppc-opc.c 2005-06-22 13:53:36.292088184 -0700 @@ -304,10 +304,14 @@ const struct powerpc_operand powerpc_ope #define L FXM4 + 1 { 1, 21, NULL, NULL, PPC_OPERAND_OPTIONAL }, - /* The LEV field in a POWER SC form instruction. */ -#define LEV L + 1 + /* The LEV field in a POWER SVC form instruction. */ +#define SVC_LEV L + 1 { 7, 5, NULL, NULL, 0 }, + /* The LEV field in an SC form instruction. */ +#define LEV SVC_LEV + 1 + { 7, 5, NULL, NULL, PPC_OPERAND_OPTIONAL }, + /* The LI field in an I form instruction. The lower two bits are forced to zero. */ #define LI LEV + 1 @@ -1818,6 +1822,7 @@ extract_tbr (unsigned long insn, #define PPCCOM PPC_OPCODE_PPC | PPC_OPCODE_COMMON #define NOPOWER4 PPC_OPCODE_NOPOWER4 | PPCCOM #define POWER4 PPC_OPCODE_POWER4 +#define POWER5 PPC_OPCODE_POWER5 #define PPC32 PPC_OPCODE_32 | PPC_OPCODE_PPC #define PPC64 PPC_OPCODE_64 | PPC_OPCODE_PPC #define PPC403 PPC_OPCODE_403 @@ -2749,9 +2754,9 @@ const struct powerpc_opcode powerpc_opco { "bcla+", B(16,1,1), B_MASK, PPCCOM, { BOE, BI, BDPA } }, { "bcla", B(16,1,1), B_MASK, COM, { BO, BI, BDA } }, -{ "sc", SC(17,1,0), 0xffffffff, PPC, { 0 } }, -{ "svc", SC(17,0,0), SC_MASK, POWER, { LEV, FL1, FL2 } }, -{ "svcl", SC(17,0,1), SC_MASK, POWER, { LEV, FL1, FL2 } }, +{ "sc", SC(17,1,0), SC_MASK, PPC, { LEV } }, +{ "svc", SC(17,0,0), SC_MASK, POWER, { SVC_LEV, FL1, FL2 } }, +{ "svcl", SC(17,0,1), SC_MASK, POWER, { SVC_LEV, FL1, FL2 } }, { "svca", SC(17,1,0), SC_MASK, PWRCOM, { SV } }, { "svcla", SC(17,1,1), SC_MASK, POWER, { SV } }, @@ -3008,6 +3013,8 @@ const struct powerpc_opcode powerpc_opco { "crand", XL(19,257), XL_MASK, COM, { BT, BA, BB } }, +{ "hrfid", XL(19,274), 0xffffffff, POWER5, { 0 } }, + { "crset", XL(19,289), XL_MASK, PPCCOM, { BT, BAT, BBA } }, { "creqv", XL(19,289), XL_MASK, COM, { BT, BA, BB } }, @@ -3435,6 +3442,8 @@ const struct powerpc_opcode powerpc_opco { "lbzux", X(31,119), X_MASK, COM, { RT, RAL, RB } }, +{ "popcntb", X(31,122), XRB_MASK, POWER5, { RA, RS } }, + { "not", XRC(31,124,0), X_MASK, COM, { RA, RS, RBS } }, { "nor", XRC(31,124,0), X_MASK, COM, { RA, RS, RB } }, { "not.", XRC(31,124,1), X_MASK, COM, { RA, RS, RBS } }, @@ -4512,6 +4521,9 @@ const struct powerpc_opcode powerpc_opco { "fmuls", A(59,25,0), AFRB_MASK, PPC, { FRT, FRA, FRC } }, { "fmuls.", A(59,25,1), AFRB_MASK, PPC, { FRT, FRA, FRC } }, +{ "fsqrtes", A(59,26,0), AFRAFRC_MASK, POWER5, { FRT, FRB } }, +{ "fsqrtes.", A(59,26,1), AFRAFRC_MASK, POWER5, { FRT, FRB } }, + { "fmsubs", A(59,28,0), A_MASK, PPC, { FRT,FRA,FRC,FRB } }, { "fmsubs.", A(59,28,1), A_MASK, PPC, { FRT,FRA,FRC,FRB } }, @@ -4583,6 +4595,9 @@ const struct powerpc_opcode powerpc_opco { "fsel", A(63,23,0), A_MASK, PPC, { FRT,FRA,FRC,FRB } }, { "fsel.", A(63,23,1), A_MASK, PPC, { FRT,FRA,FRC,FRB } }, +{ "fre", A(63,24,0), AFRAFRC_MASK, POWER5, { FRT, FRB } }, +{ "fre.", A(63,24,1), AFRAFRC_MASK, POWER5, { FRT, FRB } }, + { "fmul", A(63,25,0), AFRB_MASK, PPCCOM, { FRT, FRA, FRC } }, { "fm", A(63,25,0), AFRB_MASK, PWRCOM, { FRT, FRA, FRC } }, { "fmul.", A(63,25,1), AFRB_MASK, PPCCOM, { FRT, FRA, FRC } }, diff -uprN binutils-2.16.90.0.3/patches/bfd-dwarf-addr-3.patch binutils-2.16.91.0.1/patches/bfd-dwarf-addr-3.patch --- binutils-2.16.90.0.3/patches/bfd-dwarf-addr-3.patch 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/patches/bfd-dwarf-addr-3.patch 2005-06-22 13:53:36.298087193 -0700 @@ -0,0 +1,81 @@ +2005-06-06 H.J. Lu + + * dwarf2.c (varinfo): Add addr. + (lookup_symbol_in_variable_table): Also check addr. + (scan_unit_for_symbols): Set addr for variable. + (comp_unit_find_line): Updated. + +--- bfd/dwarf2.c.addr 2005-06-06 08:45:04.000000000 -0700 ++++ bfd/dwarf2.c 2005-06-06 18:13:02.000000000 -0700 +@@ -719,6 +719,7 @@ struct varinfo + int line; + int tag; + char *name; ++ bfd_vma addr; + /* Where the symbol is defined */ + asection *sec; + /* Is this a stack variable? */ +@@ -1500,6 +1501,7 @@ lookup_symbol_in_function_table (struct + static bfd_boolean + lookup_symbol_in_variable_table (struct comp_unit *unit, + asymbol *sym, ++ bfd_vma addr, + const char **filename_ptr, + unsigned int *linenumber_ptr) + { +@@ -1509,6 +1511,9 @@ lookup_symbol_in_variable_table (struct + + for (each = unit->variable_table; each; each = each->prev_var) + if (each->stack == 0 ++ && each->file != NULL ++ && each->name != NULL ++ && each->addr == addr + && (!each->sec || each->sec == sec) + && strcmp (name, each->name) == 0) + break; +@@ -1754,21 +1759,23 @@ scan_unit_for_symbols (struct comp_unit + break; + + case DW_AT_location: +- if (var->stack) ++ switch (attr.form) + { +- switch (attr.form) ++ case DW_FORM_block: ++ case DW_FORM_block1: ++ case DW_FORM_block2: ++ case DW_FORM_block4: ++ if (*attr.u.blk->data == DW_OP_addr) + { +- case DW_FORM_block: +- case DW_FORM_block1: +- case DW_FORM_block2: +- case DW_FORM_block4: +- if (*attr.u.blk->data == DW_OP_addr) +- var->stack = 0; +- break; +- +- default: +- break; ++ var->stack = 0; ++ var->addr = bfd_get ((attr.u.blk->size - 1) * 8, ++ unit->abfd, ++ attr.u.blk->data + 1); + } ++ break; ++ ++ default: ++ break; + } + break; + +@@ -2078,7 +2085,8 @@ comp_unit_find_line (struct comp_unit *u + filename_ptr, + linenumber_ptr); + else +- return lookup_symbol_in_variable_table (unit, sym, filename_ptr, ++ return lookup_symbol_in_variable_table (unit, sym, addr, ++ filename_ptr, + linenumber_ptr); + } + diff -uprN binutils-2.16.90.0.3/patches/bfd-elf-vsb-1.patch binutils-2.16.91.0.1/patches/bfd-elf-vsb-1.patch --- binutils-2.16.90.0.3/patches/bfd-elf-vsb-1.patch 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/patches/bfd-elf-vsb-1.patch 2005-06-22 13:53:36.298087193 -0700 @@ -0,0 +1,21 @@ +2005-05-27 H.J. Lu + + PR 975 + * elflink.c (_bfd_elf_symbol_refs_local_p): Only undefined + symbol with default visibility is local. + +--- bfd/elflink.c.vsb 2005-05-19 10:38:30.000000000 -0700 ++++ bfd/elflink.c 2005-05-27 17:03:01.000000000 -0700 +@@ -2572,8 +2572,10 @@ _bfd_elf_symbol_refs_local_p (struct elf + if (ELF_COMMON_DEF_P (h)) + /* Do nothing. */; + /* If we don't have a definition in a regular file, then we can't +- resolve locally. The sym is either undefined or dynamic. */ +- else if (!h->def_regular) ++ resolve locally unless it has non-default visibility . The sym ++ is either undefined or dynamic. */ ++ else if (!h->def_regular ++ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) + return FALSE; + + /* Forced local symbols resolve locally. */ diff -uprN binutils-2.16.90.0.3/patches/binutils-provide-3.patch binutils-2.16.91.0.1/patches/binutils-provide-3.patch --- binutils-2.16.90.0.3/patches/binutils-provide-3.patch 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/patches/binutils-provide-3.patch 2005-06-22 13:53:36.299087028 -0700 @@ -0,0 +1,322 @@ +bfd/ + +2005-05-31 H.J. Lu + + * elf-bfd.h (elf_link_hash_entry): Add the provide field. + + * elflink.c (bfd_elf_set_symbol): Set the provide field to 1. + (_bfd_elf_provide_section_bound_symbols): Also provide the + symbol if the provide field is non-zero. + +ld/ + +2005-05-31 H.J. Lu + + * emultempl/aix.em (ld_${EMULATION_NAME}_emulation): Set to the + provide_symbols field to NULL. + * emultempl/armcoff.em: Likewise. + * emultempl/beos.em: Likewise. + * emultempl/generic.em: Likewise. + * emultempl/gld960.em: Likewise. + * emultempl/gld960c.em: Likewise. + * emultempl/linux.em: Likewise. + * emultempl/lnk960.em: Likewise. + * emultempl/m68kcoff.em: Likewise. + * emultempl/pe.em: Likewise. + * emultempl/sunos.em: Likewise. + * emultempl/ticoff.em: Likewise. + * emultempl/vanilla.em: Likewise. + + * emultempl/elf32.em (gld${EMULATION_NAME}_provide_init_fini_syms): + Renamd to ... + (gld${EMULATION_NAME}_provide_symbols): This. + + * emultempl/elf32.em (gld${EMULATION_NAME}_finish): Remove call + to gld${EMULATION_NAME}_provide_init_fini_syms. + * emultempl/hppaelf.em: Likewise. + * emultempl/ppc64elf.em: Likewise. + + * ldemul.c (ldemul_provide_symbols): New. + + * ldemul.h (ldemul_provide_symbols): New. + (ld_emulation_xfer_struct): Add the provide_symbols field. + + * ldlang.c (lang_do_assignments): Call ldemul_provide_symbols. + +--- binutils/bfd/elf-bfd.h.provide 2005-06-09 09:06:41.000000000 -0700 ++++ binutils/bfd/elf-bfd.h 2005-06-09 09:06:41.000000000 -0700 +@@ -172,6 +172,10 @@ struct elf_link_hash_entry + matters. */ + unsigned int pointer_equality_needed : 1; + ++ /* Symbol is provided by linker emulation. */ ++ unsigned int provide: 1; ++ ++ /* Symbol is referenced by a shared object. */ + /* String table index in .dynstr if this is a dynamic symbol. */ + unsigned long dynstr_index; + +--- binutils/bfd/elflink.c.provide 2005-06-09 09:06:41.000000000 -0700 ++++ binutils/bfd/elflink.c 2005-06-09 09:06:41.000000000 -0700 +@@ -9828,6 +9828,7 @@ bfd_elf_set_symbol (struct elf_link_hash + h->root.u.def.section = bfd_abs_section_ptr; + h->root.u.def.value = val; + h->def_regular = 1; ++ h->provide = 1; + h->type = STT_OBJECT; + h->other = STV_HIDDEN | (h->other & ~ ELF_ST_VISIBILITY (-1)); + h->forced_local = 1; +@@ -9865,13 +9866,15 @@ _bfd_elf_provide_section_bound_symbols ( + hs = elf_link_hash_lookup (elf_hash_table (info), start, FALSE, + FALSE, FALSE); + do_start = (hs != NULL +- && (hs->root.type == bfd_link_hash_undefined ++ && (hs->provide ++ || hs->root.type == bfd_link_hash_undefined + || hs->root.type == bfd_link_hash_undefweak)); + + he = elf_link_hash_lookup (elf_hash_table (info), end, FALSE, + FALSE, FALSE); + do_end = (he != NULL +- && (he->root.type == bfd_link_hash_undefined ++ && (he->provide ++ || he->root.type == bfd_link_hash_undefined + || he->root.type == bfd_link_hash_undefweak)); + + if (!do_start && !do_end) +--- binutils/ld/emultempl/aix.em.provide 2005-05-12 09:59:24.000000000 -0700 ++++ binutils/ld/emultempl/aix.em 2005-06-09 09:06:41.000000000 -0700 +@@ -1348,6 +1348,7 @@ struct ld_emulation_xfer_struct ld_${EMU + 0, /* open_dynamic_archive */ + 0, /* place_orphan */ + 0, /* set_symbols */ ++ 0, /* provide_symbols */ + gld${EMULATION_NAME}_parse_args, + gld${EMULATION_NAME}_add_options, + gld${EMULATION_NAME}_handle_option, +--- binutils/ld/emultempl/armcoff.em.provide 2005-05-12 09:59:24.000000000 -0700 ++++ binutils/ld/emultempl/armcoff.em 2005-06-09 09:06:41.000000000 -0700 +@@ -268,6 +268,7 @@ struct ld_emulation_xfer_struct ld_${EMU + NULL, /* open dynamic archive */ + NULL, /* place orphan */ + NULL, /* set symbols */ ++ NULL, /* provide symbols */ + NULL, /* parse_args */ + gld${EMULATION_NAME}_add_options, + gld${EMULATION_NAME}_handle_option, +--- binutils/ld/emultempl/beos.em.provide 2005-06-01 08:51:13.000000000 -0700 ++++ binutils/ld/emultempl/beos.em 2005-06-09 09:06:41.000000000 -0700 +@@ -775,6 +775,7 @@ struct ld_emulation_xfer_struct ld_${EMU + NULL, /* open dynamic archive */ + gld${EMULATION_NAME}_place_orphan, + gld_${EMULATION_NAME}_set_symbols, ++ NULL, /* provide_symbols */ + NULL, /* parse_args */ + gld${EMULATION_NAME}_add_options, + gld${EMULATION_NAME}_handle_option, +--- binutils/ld/emultempl/elf32.em.provide 2005-06-09 09:00:48.000000000 -0700 ++++ binutils/ld/emultempl/elf32.em 2005-06-09 09:06:41.000000000 -0700 +@@ -62,7 +62,7 @@ static bfd_boolean gld${EMULATION_NAME}_ + (lang_input_statement_type *file, asection *s); + static void gld${EMULATION_NAME}_layout_sections_again (void); + static void gld${EMULATION_NAME}_strip_empty_sections (void); +-static void gld${EMULATION_NAME}_provide_init_fini_syms (void); ++static void gld${EMULATION_NAME}_provide_symbols (void); + static void gld${EMULATION_NAME}_finish (void) ATTRIBUTE_UNUSED; + + EOF +@@ -1475,7 +1475,7 @@ gld${EMULATION_NAME}_provide_bound_symbo + section alignment affecting where the section starts. */ + + static void +-gld${EMULATION_NAME}_provide_init_fini_syms (void) ++gld${EMULATION_NAME}_provide_symbols (void) + { + if (!link_info.relocatable && link_info.executable) + { +@@ -1541,7 +1541,6 @@ gld${EMULATION_NAME}_finish (void) + gld${EMULATION_NAME}_layout_sections_again (); + + gld${EMULATION_NAME}_strip_empty_sections (); +- gld${EMULATION_NAME}_provide_init_fini_syms (); + } + EOF + fi +@@ -1920,6 +1919,7 @@ struct ld_emulation_xfer_struct ld_${EMU + ${LDEMUL_OPEN_DYNAMIC_ARCHIVE-gld${EMULATION_NAME}_open_dynamic_archive}, + ${LDEMUL_PLACE_ORPHAN-gld${EMULATION_NAME}_place_orphan}, + ${LDEMUL_SET_SYMBOLS-NULL}, ++ ${LDEMUL_PROVIDE_SYMBOLS-gld${EMULATION_NAME}_provide_symbols}, + ${LDEMUL_PARSE_ARGS-NULL}, + gld${EMULATION_NAME}_add_options, + gld${EMULATION_NAME}_handle_option, +--- binutils/ld/emultempl/generic.em.provide 2005-05-12 09:59:24.000000000 -0700 ++++ binutils/ld/emultempl/generic.em 2005-06-09 09:06:41.000000000 -0700 +@@ -136,6 +136,7 @@ struct ld_emulation_xfer_struct ld_${EMU + ${LDEMUL_OPEN_DYNAMIC_ARCHIVE-NULL}, + ${LDEMUL_PLACE_ORPHAN-NULL}, + ${LDEMUL_SET_SYMBOLS-NULL}, ++ ${LDEMUL_PROVIDE_SYMBOLS-NULL}, + ${LDEMUL_PARSE_ARGS-NULL}, + NULL, /* add_options */ + NULL, /* handle_option */ +--- binutils/ld/emultempl/gld960.em.provide 2005-05-12 09:59:24.000000000 -0700 ++++ binutils/ld/emultempl/gld960.em 2005-06-09 09:06:41.000000000 -0700 +@@ -142,6 +142,7 @@ struct ld_emulation_xfer_struct ld_gld96 + NULL, /* open dynamic archive */ + NULL, /* place orphan */ + NULL, /* set symbols */ ++ NULL, /* provide symbols */ + NULL, /* parse args */ + NULL, /* add_options */ + NULL, /* handle_option */ +--- binutils/ld/emultempl/gld960c.em.provide 2005-05-12 09:59:24.000000000 -0700 ++++ binutils/ld/emultempl/gld960c.em 2005-06-09 09:06:41.000000000 -0700 +@@ -157,6 +157,7 @@ struct ld_emulation_xfer_struct ld_gld96 + NULL, /* open dynamic archive */ + NULL, /* place orphan */ + NULL, /* set symbols */ ++ NULL, /* provide symbols */ + NULL, /* parse args */ + NULL, /* add_options */ + NULL, /* handle_option */ +--- binutils/ld/emultempl/hppaelf.em.provide 2005-05-12 09:59:24.000000000 -0700 ++++ binutils/ld/emultempl/hppaelf.em 2005-06-09 09:06:41.000000000 -0700 +@@ -306,7 +306,6 @@ hppaelf_finish (void) + } + + gld${EMULATION_NAME}_strip_empty_sections (); +- gld${EMULATION_NAME}_provide_init_fini_syms (); + } + + +--- binutils/ld/emultempl/linux.em.provide 2005-05-12 09:59:24.000000000 -0700 ++++ binutils/ld/emultempl/linux.em 2005-06-09 09:06:41.000000000 -0700 +@@ -197,6 +197,7 @@ struct ld_emulation_xfer_struct ld_${EMU + gld${EMULATION_NAME}_open_dynamic_archive, + NULL, /* place orphan */ + NULL, /* set symbols */ ++ NULL, /* provide symbols */ + NULL, /* parse args */ + NULL, /* add_options */ + NULL, /* handle_option */ +--- binutils/ld/emultempl/lnk960.em.provide 2005-05-12 09:59:24.000000000 -0700 ++++ binutils/ld/emultempl/lnk960.em 2005-06-09 09:06:41.000000000 -0700 +@@ -277,6 +277,7 @@ struct ld_emulation_xfer_struct ld_lnk96 + NULL, /* open dynamic archive */ + NULL, /* place orphan */ + NULL, /* set symbols */ ++ NULL, /* provide symbols */ + NULL, /* parse args */ + NULL, /* add_options */ + NULL, /* handle_option */ +--- binutils/ld/emultempl/m68kcoff.em.provide 2005-05-12 09:59:24.000000000 -0700 ++++ binutils/ld/emultempl/m68kcoff.em 2005-06-09 09:06:41.000000000 -0700 +@@ -230,6 +230,7 @@ struct ld_emulation_xfer_struct ld_${EMU + NULL, /* open dynamic archive */ + NULL, /* place orphan */ + NULL, /* set symbols */ ++ NULL, /* provide symbols */ + NULL, /* parse args */ + NULL, /* add_options */ + NULL, /* handle_option */ +--- binutils/ld/emultempl/pe.em.provide 2005-06-01 08:51:13.000000000 -0700 ++++ binutils/ld/emultempl/pe.em 2005-06-09 09:06:41.000000000 -0700 +@@ -1830,6 +1830,7 @@ struct ld_emulation_xfer_struct ld_${EMU + gld_${EMULATION_NAME}_open_dynamic_archive, + gld_${EMULATION_NAME}_place_orphan, + gld_${EMULATION_NAME}_set_symbols, ++ NULL, /* provide_symbols */ + NULL, /* parse_args */ + gld${EMULATION_NAME}_add_options, + gld${EMULATION_NAME}_handle_option, +--- binutils/ld/emultempl/ppc64elf.em.provide 2005-06-09 09:00:48.000000000 -0700 ++++ binutils/ld/emultempl/ppc64elf.em 2005-06-09 09:06:41.000000000 -0700 +@@ -380,7 +380,6 @@ ppc_finish (void) + + ppc64_elf_restore_symbols (&link_info); + gld${EMULATION_NAME}_strip_empty_sections (); +- gld${EMULATION_NAME}_provide_init_fini_syms (); + } + + +--- binutils/ld/emultempl/sunos.em.provide 2005-05-12 09:59:24.000000000 -0700 ++++ binutils/ld/emultempl/sunos.em 2005-06-09 09:06:41.000000000 -0700 +@@ -1021,6 +1021,7 @@ struct ld_emulation_xfer_struct ld_${EMU + NULL, /* open dynamic archive */ + NULL, /* place orphan */ + gld${EMULATION_NAME}_set_symbols, ++ NULL, /* provide_symbols */ + NULL, /* parse args */ + NULL, /* add_options */ + NULL, /* handle_option */ +--- binutils/ld/emultempl/ticoff.em.provide 2005-05-12 09:59:24.000000000 -0700 ++++ binutils/ld/emultempl/ticoff.em 2005-06-09 09:06:41.000000000 -0700 +@@ -170,6 +170,7 @@ struct ld_emulation_xfer_struct ld_${EMU + NULL, /* open dynamic archive */ + NULL, /* place orphan */ + NULL, /* set_symbols */ ++ NULL, /* provide_symbols */ + NULL, /* parse_args */ + gld${EMULATION_NAME}_add_options, + gld${EMULATION_NAME}_handle_option, +--- binutils/ld/emultempl/vanilla.em.provide 2005-05-12 09:59:24.000000000 -0700 ++++ binutils/ld/emultempl/vanilla.em 2005-06-09 09:06:41.000000000 -0700 +@@ -73,6 +73,7 @@ struct ld_emulation_xfer_struct ld_vanil + NULL, /* open dynamic archive */ + NULL, /* place orphan */ + NULL, /* set symbols */ ++ NULL, /* provide symbols */ + NULL, /* parse args */ + NULL, /* add_options */ + NULL, /* handle_option */ +--- binutils/ld/ldemul.c.provide 2005-05-12 09:59:24.000000000 -0700 ++++ binutils/ld/ldemul.c 2005-06-09 09:06:41.000000000 -0700 +@@ -100,6 +100,13 @@ ldemul_set_symbols (void) + } + + void ++ldemul_provide_symbols (void) ++{ ++ if (ld_emulation->provide_symbols) ++ ld_emulation->provide_symbols (); ++} ++ ++void + ldemul_create_output_section_statements (void) + { + if (ld_emulation->create_output_section_statements) +--- binutils/ld/ldemul.h.provide 2005-03-03 09:24:14.000000000 -0800 ++++ binutils/ld/ldemul.h 2005-06-09 09:06:41.000000000 -0700 +@@ -51,6 +51,8 @@ extern void ldemul_finish + (void); + extern void ldemul_set_symbols + (void); ++extern void ldemul_provide_symbols ++ (void); + extern void ldemul_create_output_section_statements + (void); + extern bfd_boolean ldemul_place_orphan +@@ -149,6 +151,10 @@ typedef struct ld_emulation_xfer_struct + reading the script. Used to initialize symbols used in the script. */ + void (*set_symbols) (void); + ++ /* Called in lang_do_assignments. Used to provide symbols by linker ++ emulation. */ ++ void (*provide_symbols) (void); ++ + /* Parse args which the base linker doesn't understand. + Return TRUE if the arg needs no further processing. */ + bfd_boolean (*parse_args) (int, char **); +--- binutils/ld/ldlang.c.provide 2005-06-09 09:06:41.000000000 -0700 ++++ binutils/ld/ldlang.c 2005-06-09 09:07:53.000000000 -0700 +@@ -4665,6 +4665,9 @@ lang_do_assignments (void) + { + lang_statement_iteration++; + lang_do_assignments_1 (statement_list.head, abs_output_section, NULL, 0); ++ ++ /* Assign values for symbols provided by emulation. */ ++ ldemul_provide_symbols (); + } + + /* Fix any .startof. or .sizeof. symbols. When the assemblers see the diff -uprN binutils-2.16.90.0.3/patches/binutils-version-exec-2.patch binutils-2.16.91.0.1/patches/binutils-version-exec-2.patch --- binutils-2.16.90.0.3/patches/binutils-version-exec-2.patch 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.16.91.0.1/patches/binutils-version-exec-2.patch 2005-06-22 13:53:36.299087028 -0700 @@ -0,0 +1,290 @@ +bfd/ + +2005-05-05 H.J. Lu + + * elf-bfd.h (elf_link_hash_entry): Add forced_global. + + * elflink.c (bfd_elf_link_record_dynamic_symbol): Don't check + symbol visibilty when we force a forced local symbol to global. + (_bfd_elf_link_renumber_dynsyms): Move forced local symbols + just before global ones. + (_bfd_elf_link_assign_sym_version): When building shared + library, set the forced_global field and make it global dynamic + if a forced local symbol is marked as global. When building + executable, make a symbol dynamic if it is marked global. + (elf_link_output_extsym): Handle forced_global. + +ld/ + +2005-05-05 H.J. Lu + + * ld.texinfo: Document similarity between version script and + --export-dynamicr/-Bsymbolic. + + * ldlang.c (lang_final): Don't allow named version tag on + executables. + +--- binutils/bfd/elf-bfd.h.exec 2005-05-05 07:44:33.000000000 -0700 ++++ binutils/bfd/elf-bfd.h 2005-05-05 10:53:45.000000000 -0700 +@@ -155,6 +155,8 @@ struct elf_link_hash_entry + unsigned int hidden : 1; + /* Symbol was forced to local scope due to a version script file. */ + unsigned int forced_local : 1; ++ /* Symbol was forced to global scope due to a version script file. */ ++ unsigned int forced_global : 1; + /* Symbol was marked during garbage collection. */ + unsigned int mark : 1; + /* Symbol is referenced by a non-GOT/non-PLT relocation. This is +--- binutils/bfd/elflink.c.exec 2005-05-05 10:52:50.000000000 -0700 ++++ binutils/bfd/elflink.c 2005-05-05 10:53:45.000000000 -0700 +@@ -375,22 +375,24 @@ bfd_elf_link_record_dynamic_symbol (stru + /* XXX: The ABI draft says the linker must turn hidden and + internal symbols into STB_LOCAL symbols when producing the + DSO. However, if ld.so honors st_other in the dynamic table, +- this would not be necessary. */ +- switch (ELF_ST_VISIBILITY (h->other)) +- { +- case STV_INTERNAL: +- case STV_HIDDEN: +- if (h->root.type != bfd_link_hash_undefined +- && h->root.type != bfd_link_hash_undefweak) +- { +- h->forced_local = 1; +- if (!elf_hash_table (info)->is_relocatable_executable) +- return TRUE; +- } ++ this would not be necessary. Don't check symbol visibilty ++ when we force a forced local symbol to global. */ ++ if (!h->forced_global) ++ switch (ELF_ST_VISIBILITY (h->other)) ++ { ++ case STV_INTERNAL: ++ case STV_HIDDEN: ++ if (h->root.type != bfd_link_hash_undefined ++ && h->root.type != bfd_link_hash_undefweak) ++ { ++ h->forced_local = 1; ++ if (!elf_hash_table (info)->is_relocatable_executable) ++ return TRUE; ++ } + +- default: +- break; +- } ++ default: ++ break; ++ } + + h->dynindx = elf_hash_table (info)->dynsymcount; + ++elf_hash_table (info)->dynsymcount; +@@ -700,9 +702,9 @@ _bfd_elf_link_omit_section_dynsym (bfd * + } + + /* Assign dynsym indices. In a shared library we generate a section +- symbol for each output section, which come first. Next come symbols +- which have been forced to local binding. Then all of the back-end +- allocated local dynamic syms, followed by the rest of the global ++ symbol for each output section, which come first. Next come all of ++ the back-end allocated local dynamic syms. Then symbols which have ++ been forced to local binding, followed by the rest of the global + symbols. */ + + static unsigned long +@@ -724,10 +726,6 @@ _bfd_elf_link_renumber_dynsyms (bfd *out + } + *section_sym_count = dynsymcount; + +- elf_link_hash_traverse (elf_hash_table (info), +- elf_link_renumber_local_hash_table_dynsyms, +- &dynsymcount); +- + if (elf_hash_table (info)->dynlocal) + { + struct elf_link_local_dynamic_entry *p; +@@ -736,6 +734,10 @@ _bfd_elf_link_renumber_dynsyms (bfd *out + } + + elf_link_hash_traverse (elf_hash_table (info), ++ elf_link_renumber_local_hash_table_dynsyms, ++ &dynsymcount); ++ ++ elf_link_hash_traverse (elf_hash_table (info), + elf_link_renumber_hash_table_dynsyms, + &dynsymcount); + +@@ -1696,6 +1698,7 @@ _bfd_elf_link_assign_sym_version (struct + struct elf_info_failed eif; + char *p; + bfd_size_type amt; ++ bfd_boolean global; + + sinfo = data; + info = sinfo->info; +@@ -1718,6 +1721,9 @@ _bfd_elf_link_assign_sym_version (struct + if (!h->def_regular) + return TRUE; + ++ /* Check if a symbol is marked as global in version script. */ ++ global = FALSE; ++ + bed = get_elf_backend_data (sinfo->output_bfd); + p = strchr (h->root.root.string, ELF_VER_CHR); + if (p != NULL && h->verinfo.vertree == NULL) +@@ -1779,6 +1785,8 @@ _bfd_elf_link_assign_sym_version (struct + && ! info->export_dynamic) + (*bed->elf_backend_hide_symbol) (info, h, TRUE); + } ++ else if (d) ++ global = TRUE; + + free (alc); + break; +@@ -1869,6 +1877,7 @@ _bfd_elf_link_assign_sym_version (struct + h->verinfo.vertree = t; + local_ver = NULL; + d->script = 1; ++ global = TRUE; + break; + } + if (d != NULL) +@@ -1904,11 +1913,22 @@ _bfd_elf_link_assign_sym_version (struct + if (h->dynindx != -1 + && ! info->export_dynamic) + { ++ global = FALSE; + (*bed->elf_backend_hide_symbol) (info, h, TRUE); + } + } + } + ++ if (global && (info->executable || h->forced_local)) ++ { ++ if (h->forced_local) ++ h->forced_global = 1; ++ ++ if (h->dynindx == -1 ++ && ! bfd_elf_link_record_dynamic_symbol (info, h)) ++ return FALSE; ++ } ++ + return TRUE; + } + +@@ -6337,12 +6357,12 @@ elf_link_output_extsym (struct elf_link_ + /* Decide whether to output this symbol in this pass. */ + if (eoinfo->localsyms) + { +- if (!h->forced_local) ++ if (!h->forced_local || h->forced_global) + return TRUE; + } + else + { +- if (h->forced_local) ++ if (h->forced_local && !h->forced_global) + return TRUE; + } + +@@ -6372,6 +6392,7 @@ elf_link_output_extsym (struct elf_link_ + if (! finfo->info->relocatable + && (! finfo->info->shared) + && h->forced_local ++ && !h->forced_global + && h->ref_dynamic + && !h->dynamic_def + && !h->dynamic_weak +@@ -6425,7 +6446,14 @@ elf_link_output_extsym (struct elf_link_ + sym.st_value = 0; + sym.st_size = h->size; + sym.st_other = h->other; +- if (h->forced_local) ++ if (h->forced_global) ++ { ++ /* A forced global symbol has the default visibility. */ ++ sym.st_other ++ = STV_DEFAULT | (h->other & ~ ELF_ST_VISIBILITY (-1)); ++ sym.st_info = ELF_ST_INFO (STB_GLOBAL, h->type); ++ } ++ else if (h->forced_local) + sym.st_info = ELF_ST_INFO (STB_LOCAL, h->type); + else if (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_defweak) +--- binutils/ld/ld.texinfo.exec 2005-04-19 10:43:06.000000000 -0700 ++++ binutils/ld/ld.texinfo 2005-05-05 12:18:44.000000000 -0700 +@@ -476,11 +476,10 @@ mentioned in the link. + If you use @code{dlopen} to load a dynamic object which needs to refer + back to the symbols defined by the program, rather than some other + dynamic object, then you will probably need to use this option when +-linking the program itself. +- +-You can also use the version script to control what symbols should +-be added to the dynamic symbol table if the output format supports it. +-See the description of @samp{--version-script} in @ref{VERSION}. ++linking the program itself. If the output format supports the version ++script, you can also use it to add the symbols needed by the dynamic ++object to the dynamic symbol table. See the description of ++@samp{--version-script} in @ref{VERSION}. + + @ifclear SingleFormat + @cindex big-endian objects +@@ -1057,7 +1056,10 @@ When creating a shared library, bind ref + definition within the shared library, if any. Normally, it is possible + for a program linked against a shared library to override the definition + within the shared library. This option is only meaningful on ELF +-platforms which support shared libraries. ++platforms which support shared libraries. You can also use the version ++script to control which symbols should be bound to the definitions ++within the shared library. See the description of ++@samp{--version-script} in @ref{VERSION}. + + @kindex --check-sections + @kindex --no-check-sections +@@ -4257,12 +4259,22 @@ However, this would be a confusing way t + Node name can be omited, provided it is the only version node + in the version script. Such version script doesn't assign any versions to + symbols, only selects which symbols will be globally visible out and which +-won't. ++won't. It can be used on executables to control which symbols will be ++exported and which won't. When it is used to export symbols in ++executables, it is similar to @samp{--export-dynamic}, except for that ++symbols can be exported selectively with a version script. + + @smallexample + @{ global: foo; bar; local: *; @}; + @end smallexample + ++When a hidden symbol in a shared library is listed as global in a ++version script, its reference will be bound to the definition within ++the shared library and it will be exported. It is similar to ++@samp{-Bsymbolic}, except for that symbols can be selectively bound ++their definitions. If compiler is aware of symbol visibility, it can ++perform optimization which can't be done with @samp{-Bsymbolic} alone. ++ + When you link an application against a shared library that has versioned + symbols, the application itself knows which version of each symbol it + requires, and it also knows which version nodes it needs from each +--- binutils/ld/ldlang.c.exec 2005-05-05 10:53:45.000000000 -0700 ++++ binutils/ld/ldlang.c 2005-05-05 11:20:33.000000000 -0700 +@@ -5150,9 +5150,20 @@ lang_enter_output_section_statement (con + void + lang_final (void) + { +- lang_output_statement_type *new = +- new_stat (lang_output_statement, stat_ptr); ++ lang_output_statement_type *new; + ++ /* Check if version tag is valid for executable. */ ++ if (!link_info.relocatable && link_info.executable) ++ { ++ struct bfd_elf_version_tree *t; ++ ++ for (t = lang_elf_version_info; t; t = t->next) ++ if (t->name [0] != '\0') ++ einfo (_("%F%P: Invalid version tag `%s'. Only anonymous " ++ "version tag is allowed in executable.\n"), t->name); ++ } ++ ++ new = new_stat (lang_output_statement, stat_ptr); + new->name = output_filename; + } + diff -uprN binutils-2.16.90.0.3/patches/ChangeLog binutils-2.16.91.0.1/patches/ChangeLog --- binutils-2.16.90.0.3/patches/ChangeLog 2004-09-15 12:05:05.000000000 -0700 +++ binutils-2.16.91.0.1/patches/ChangeLog 2005-06-22 13:53:36.297087358 -0700 @@ -1,3 +1,19 @@ +2004-06-22 H.J. Lu + + * bfd-dwarf-addr-3.patch: New file. Fix DWARF 2 address. + + * bfd-elf-vsb-1.patch: New file. Fix undefined symbol with + non-default visibility. + + * binutils-provide-3.patch: New file. Fix provided symbols with + relaxation. + + * binutils-version-exec-2.patch: New file. Support selectly + --export-dynamic and -Bsymbolic. + + * README: Apply bfd-dwarf-addr-3.patch, bfd-elf-vsb-1.patch, + binutils-provide-3.patch and binutils-version-exec-2.patch. + 2004-08-13 H.J. Lu * bfd-abort.patch: Removed. diff -uprN binutils-2.16.90.0.3/patches/README binutils-2.16.91.0.1/patches/README --- binutils-2.16.90.0.3/patches/README 2004-09-15 12:05:05.000000000 -0700 +++ binutils-2.16.91.0.1/patches/README 2005-06-22 13:53:36.298087193 -0700 @@ -14,6 +14,10 @@ dir=`dirname $0` +patch -p0 -b --suffix .addr < $dir/bfd-dwarf-addr-3.patch && +patch -p1 -b --suffix .exec < $dir/binutils-version-exec-2.patch && +patch -p0 -b --suffix .vsb < $dir/bfd-elf-vsb-1.patch && +patch -p1 -b --suffix .provide < $dir/binutils-provide-3.patch && true [ $? = 0 ] || exit 1 find -name "*.rej" | grep rej && exit 1 diff -uprN binutils-2.16.90.0.3/ylwrap binutils-2.16.91.0.1/ylwrap --- binutils-2.16.90.0.3/ylwrap 1999-06-03 11:01:52.000000000 -0700 +++ binutils-2.16.91.0.1/ylwrap 2005-06-22 13:53:34.097450795 -0700 @@ -1,6 +1,11 @@ #! /bin/sh # ylwrap - wrapper for lex/yacc invocations. -# Copyright (C) 1996, 1997 Free Software Foundation, Inc. + +scriptversion=2005-02-02.22 + +# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -17,56 +22,81 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# Usage: -# ylwrap PROGRAM INPUT [OUTPUT DESIRED]... -- [ARGS]... -# * PROGRAM is program to run. -# * INPUT is the input file -# * OUTPUT is file PROG generates -# * DESIRED is file we actually want -# * ARGS are passed to PROG -# Any number of OUTPUT,DESIRED pairs may be used. - -# The program to run. -prog="$1" -shift -# Make any relative path in $prog absolute. -case "$prog" in - /* | [A-Za-z]:\\*) ;; - */*) prog="`pwd`/$prog" ;; +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case "$1" in + '') + echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 + exit 1 + ;; + --basedir) + basedir=$2 + shift 2 + ;; + -h|--h*) + cat <<\EOF +Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... + +Wrapper for lex/yacc invocations, renaming files as desired. + + INPUT is the input file + OUTPUT is one file PROG generates + DESIRED is the file we actually want instead of OUTPUT + PROGRAM is program to run + ARGS are passed to PROG + +Any number of OUTPUT,DESIRED pairs may be used. + +Report bugs to . +EOF + exit $? + ;; + -v|--v*) + echo "ylwrap $scriptversion" + exit $? + ;; esac + # The input. input="$1" shift case "$input" in - /* | [A-Za-z]:\\*) + [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; - *) - # Relative path. Make it absolute. Why? Because otherwise any - # debugging info in the generated file will point to the wrong - # place. This is really gross. + *) + # Relative path. Make it absolute. input="`pwd`/$input" ;; esac -# We don't want to use the absolute path if the input in the current -# directory like when making a tar ball. -input_base=`echo $input | sed -e 's|.*/||'` -if test -f $input_base && cmp $input_base $input >/dev/null 2>&1; then - input=$input_base -fi - pairlist= while test "$#" -ne 0; do - if test "$1" = "--"; then - shift - break - fi - pairlist="$pairlist $1" - shift + if test "$1" = "--"; then + shift + break + fi + pairlist="$pairlist $1" + shift done +# The program to run. +prog="$1" +shift +# Make any relative path in $prog absolute. +case "$prog" in + [\\/]* | ?:[\\/]*) ;; + *[\\/]*) prog="`pwd`/$prog" ;; +esac + # FIXME: add hostname here for parallel makes that run commands on # other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ @@ -74,50 +104,119 @@ trap "cd `pwd`; rm -rf $dirname > /dev/n mkdir $dirname || exit 1 cd $dirname -case "$input" in - /* | [A-Za-z]:\\*) - # Absolute path; do nothing. - ;; - *) - # Make a symbolic link, hard link or hardcopy. - ln -s ../"$input" . > /dev/null 2>&1 || ln ../"$input" . > /dev/null 2>&1 || cp ../"$input" . - ;; + +case $# in + 0) $prog "$input" ;; + *) $prog "$@" "$input" ;; esac -$prog ${1+"$@"} "$input" -status=$? +ret=$? -if test $status -eq 0; then - set X $pairlist - shift - first=yes - while test "$#" -ne 0; do - if test -f "$1"; then - # If $2 is an absolute path name, then just use that, - # otherwise prepend `../'. - case "$2" in - /* | [A-Za-z]:\\*) target="$2";; - *) target="../$2";; - esac - mv "$1" "$target" || status=$? +if test $ret -eq 0; then + set X $pairlist + shift + first=yes + # Since DOS filename conventions don't allow two dots, + # the DOS version of Bison writes out y_tab.c instead of y.tab.c + # and y_tab.h instead of y.tab.h. Test to see if this is the case. + y_tab_nodot="no" + if test -f y_tab.c || test -f y_tab.h; then + y_tab_nodot="yes" + fi + + # The directory holding the input. + input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` + # Quote $INPUT_DIR so we can use it in a regexp. + # FIXME: really we should care about more than `.' and `\'. + input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'` + + while test "$#" -ne 0; do + from="$1" + # Handle y_tab.c and y_tab.h output by DOS + if test $y_tab_nodot = "yes"; then + if test $from = "y.tab.c"; then + from="y_tab.c" else - # A missing file is only an error for the first file. This - # is a blatant hack to let us support using "yacc -d". If -d - # is not specified, we don't want an error when the header - # file is "missing". - if test $first = yes; then - status=1 - fi + if test $from = "y.tab.h"; then + from="y_tab.h" + fi fi - shift - shift - first=no - done + fi + if test -f "$from"; then + # If $2 is an absolute path name, then just use that, + # otherwise prepend `../'. + case "$2" in + [\\/]* | ?:[\\/]*) target="$2";; + *) target="../$2";; + esac + + # We do not want to overwrite a header file if it hasn't + # changed. This avoid useless recompilations. However the + # parser itself (the first file) should always be updated, + # because it is the destination of the .y.c rule in the + # Makefile. Divert the output of all other files to a temporary + # file so we can compare them to existing versions. + if test $first = no; then + realtarget="$target" + target="tmp-`echo $target | sed s/.*[\\/]//g`" + fi + # Edit out `#line' or `#' directives. + # + # We don't want the resulting debug information to point at + # an absolute srcdir; it is better for it to just mention the + # .y file with no path. + # + # We want to use the real output file name, not yy.lex.c for + # instance. + # + # We want the include guards to be adjusted too. + FROM=`echo "$from" | sed \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ + -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` + TARGET=`echo "$2" | sed \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ + -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` + + sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ + -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$? + + # Check whether header files must be updated. + if test $first = no; then + if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then + echo "$2" is unchanged + rm -f "$target" + else + echo updating "$2" + mv -f "$target" "$realtarget" + fi + fi + else + # A missing file is only an error for the first file. This + # is a blatant hack to let us support using "yacc -d". If -d + # is not specified, we don't want an error when the header + # file is "missing". + if test $first = yes; then + ret=1 + fi + fi + shift + shift + first=no + done else - status=$? + ret=$? fi # Remove the directory. cd .. rm -rf $dirname -exit $status +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: