aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobody <>1999-06-02 12:39:45 +0000
committernobody <>1999-06-02 12:39:45 +0000
commit94a3815c4d8518a470dd038d15d33e699ad30e2f (patch)
tree0d6858f8514ff609603051f8fc682ef5b153e207
parent19990502 sourceware import (diff)
downloadbinutils-gdb-94a3815c4d8518a470dd038d15d33e699ad30e2f.tar.gz
binutils-gdb-94a3815c4d8518a470dd038d15d33e699ad30e2f.tar.bz2
binutils-gdb-94a3815c4d8518a470dd038d15d33e699ad30e2f.zip
This commit was manufactured by cvs2svn to create tag 'binu_ss_19990602'.binu_ss_19990602
Sprout from cygnus 1999-05-03 07:29:11 UTC Richard Henderson <rth@redhat.com> '19990502 sourceware import' Cherrypick from master 1999-06-02 12:39:44 UTC Richard Henderson <rth@redhat.com> '* hosts/alphalinux.h (TRAD_CORE_EXTRA_SIZE_ALLOWED): Expand to 4096.': ChangeLog bfd/ChangeLog bfd/Makefile.am bfd/Makefile.in bfd/aclocal.m4 bfd/archive.c bfd/bfd-in.h bfd/bfd-in2.h bfd/coff-arm.c bfd/coff-mcore.c bfd/coffcode.h bfd/coffgen.c bfd/coffswap.h bfd/config.bfd bfd/config.in bfd/configure bfd/configure.host bfd/configure.in bfd/dwarf2.c bfd/ecoff.c bfd/elf-bfd.h bfd/elf.c bfd/elf32-arm.h bfd/elf32-i960.c bfd/elf32-m68k.c bfd/elf32-mcore.c bfd/elf32-mips.c bfd/elf32-v850.c bfd/elf64-mips.c bfd/elfarm-nabi.c bfd/elfarm-oabi.c bfd/elfxx-target.h bfd/hosts/alphalinux.h bfd/libbfd-in.h bfd/libbfd.h bfd/peicode.h bfd/reloc.c bfd/som.c bfd/targets.c bfd/vms-misc.c binutils/ChangeLog binutils/Makefile.am binutils/Makefile.in binutils/NEWS binutils/binutils.texi binutils/configure binutils/configure.in binutils/dlltool.c binutils/objcopy.c binutils/objdump.c binutils/rclex.l binutils/rcparse.y binutils/readelf.c binutils/rename.c binutils/rescoff.c binutils/resrc.c binutils/testsuite/ChangeLog binutils/testsuite/binutils-all/readelf.h binutils/windres.c binutils/windres.h config.guess config.sub gas/ChangeLog gas/Makefile.am gas/Makefile.in gas/NEWS gas/aclocal.m4 gas/atof-generic.c gas/config/atof-ieee.c gas/config/m68k-parse.h gas/config/obj-coff.c gas/config/obj-elf.c gas/config/tc-arm.c gas/config/tc-hppa.c gas/config/tc-i386.c gas/config/tc-i386.h gas/config/tc-i960.c gas/config/tc-i960.h gas/config/tc-m68k.c gas/config/tc-m68k.h gas/config/tc-mcore.c gas/config/tc-mips.c gas/config/tc-ppc.c gas/configure gas/configure.in gas/doc/internals.texi gas/ecoff.c gas/expr.c gas/hash.h gas/listing.c gas/read.c gas/symbols.c gas/testsuite/ChangeLog gas/testsuite/gas/i386/amd.d gas/testsuite/gas/i386/amd.s gas/testsuite/gas/i386/i386.exp gas/testsuite/gas/i386/katmai.d gas/testsuite/gas/i386/katmai.s gas/testsuite/gas/i386/opcode.d gas/testsuite/gas/i386/prefix.d gas/testsuite/gas/i386/prefix.s gas/testsuite/gas/i386/reloc.d gas/testsuite/gas/i386/reloc.s gas/testsuite/gas/mcore/allinsn.d gas/testsuite/gas/vtable/vtable.exp gas/write.c include/coff/ChangeLog include/coff/arm.h include/coff/mcore.h include/elf/ChangeLog include/elf/common.h include/elf/i960.h include/elf/m68k.h include/elf/mcore.h include/elf/reloc-macros.h include/opcode/ChangeLog include/opcode/hppa.h include/opcode/i386.h include/opcode/m68k.h include/opcode/ppc.h ld/ChangeLog ld/Makefile.am ld/Makefile.in ld/configure.tgt ld/emulparams/armelf.sh ld/emulparams/armelf_linux.sh ld/emulparams/armelf_oabi.sh ld/emulparams/elf32_i960.sh ld/emulparams/elf32mcore.sh ld/emulparams/elf32ppclinux.sh ld/emulparams/mcorepe.sh ld/emultempl/armcoff.em ld/emultempl/armelf.em ld/emultempl/armelf_oabi.em ld/emultempl/pe.em ld/ld.texinfo ld/ldlang.c ld/lexsup.c ld/pe-dll.c ld/scripttempl/mcorepe.sc ld/scripttempl/pe.sc ld/testsuite/ChangeLog ld/testsuite/ld-srec/srec.exp ld/testsuite/ld-undefined/undefined.exp libiberty/ChangeLog libiberty/configure libiberty/configure.in libiberty/cplus-dem.c libiberty/getruntime.c opcodes/ChangeLog opcodes/i386-dis.c opcodes/m68k-dis.c opcodes/m68k-opc.c opcodes/mcore-dis.c opcodes/mcore-opc.h
-rw-r--r--ChangeLog8
-rw-r--r--bfd/ChangeLog283
-rw-r--r--bfd/Makefile.am5
-rw-r--r--bfd/Makefile.in9
-rw-r--r--bfd/aclocal.m4471
-rw-r--r--bfd/archive.c15
-rw-r--r--bfd/bfd-in.h11
-rw-r--r--bfd/bfd-in2.h16
-rw-r--r--bfd/coff-arm.c34
-rw-r--r--bfd/coff-mcore.c56
-rw-r--r--bfd/coffcode.h42
-rw-r--r--bfd/coffgen.c16
-rw-r--r--bfd/coffswap.h11
-rw-r--r--bfd/config.bfd29
-rw-r--r--bfd/config.in6
-rwxr-xr-xbfd/configure832
-rw-r--r--bfd/configure.host2
-rw-r--r--bfd/configure.in7
-rw-r--r--bfd/dwarf2.c4
-rw-r--r--bfd/ecoff.c7
-rw-r--r--bfd/elf-bfd.h6
-rw-r--r--bfd/elf.c14
-rw-r--r--bfd/elf32-arm.h291
-rw-r--r--bfd/elf32-i960.c167
-rw-r--r--bfd/elf32-m68k.c223
-rw-r--r--bfd/elf32-mcore.c18
-rw-r--r--bfd/elf32-mips.c55
-rw-r--r--bfd/elf32-v850.c12
-rw-r--r--bfd/elf64-mips.c6
-rw-r--r--bfd/elfarm-nabi.c6
-rw-r--r--bfd/elfarm-oabi.c97
-rw-r--r--bfd/elfxx-target.h4
-rw-r--r--bfd/hosts/alphalinux.h4
-rw-r--r--bfd/libbfd-in.h3
-rw-r--r--bfd/libbfd.h8
-rw-r--r--bfd/peicode.h51
-rw-r--r--bfd/reloc.c10
-rw-r--r--bfd/som.c5
-rw-r--r--bfd/targets.c4
-rw-r--r--bfd/vms-misc.c3
-rw-r--r--binutils/ChangeLog145
-rw-r--r--binutils/Makefile.am3
-rw-r--r--binutils/Makefile.in3
-rw-r--r--binutils/NEWS4
-rw-r--r--binutils/binutils.texi5
-rwxr-xr-xbinutils/configure9
-rw-r--r--binutils/configure.in9
-rw-r--r--binutils/dlltool.c441
-rw-r--r--binutils/objcopy.c13
-rw-r--r--binutils/objdump.c9
-rw-r--r--binutils/rclex.l201
-rw-r--r--binutils/rcparse.y2
-rw-r--r--binutils/readelf.c245
-rw-r--r--binutils/rename.c8
-rw-r--r--binutils/rescoff.c7
-rw-r--r--binutils/resrc.c121
-rw-r--r--binutils/testsuite/ChangeLog4
-rw-r--r--binutils/testsuite/binutils-all/readelf.h5
-rw-r--r--binutils/windres.c65
-rw-r--r--binutils/windres.h2
-rwxr-xr-xconfig.guess2
-rwxr-xr-xconfig.sub313
-rw-r--r--gas/ChangeLog137
-rw-r--r--gas/Makefile.am3
-rw-r--r--gas/Makefile.in6
-rw-r--r--gas/NEWS2
-rw-r--r--gas/aclocal.m4471
-rw-r--r--gas/atof-generic.c2
-rw-r--r--gas/config/atof-ieee.c27
-rw-r--r--gas/config/m68k-parse.h44
-rw-r--r--gas/config/obj-coff.c13
-rw-r--r--gas/config/obj-elf.c2
-rw-r--r--gas/config/tc-arm.c16
-rw-r--r--gas/config/tc-hppa.c8
-rw-r--r--gas/config/tc-i386.c146
-rw-r--r--gas/config/tc-i386.h25
-rw-r--r--gas/config/tc-i960.c154
-rw-r--r--gas/config/tc-i960.h23
-rw-r--r--gas/config/tc-m68k.c150
-rw-r--r--gas/config/tc-m68k.h2
-rw-r--r--gas/config/tc-mcore.c146
-rw-r--r--gas/config/tc-mips.c43
-rw-r--r--gas/config/tc-ppc.c12
-rwxr-xr-xgas/configure784
-rw-r--r--gas/configure.in3
-rw-r--r--gas/doc/internals.texi5
-rw-r--r--gas/ecoff.c5
-rw-r--r--gas/expr.c4
-rw-r--r--gas/hash.h2
-rw-r--r--gas/listing.c2
-rw-r--r--gas/read.c14
-rw-r--r--gas/symbols.c27
-rw-r--r--gas/testsuite/ChangeLog23
-rw-r--r--gas/testsuite/gas/i386/amd.d7
-rw-r--r--gas/testsuite/gas/i386/amd.s5
-rw-r--r--gas/testsuite/gas/i386/i386.exp1
-rw-r--r--gas/testsuite/gas/i386/katmai.d176
-rw-r--r--gas/testsuite/gas/i386/katmai.s166
-rw-r--r--gas/testsuite/gas/i386/opcode.d2
-rw-r--r--gas/testsuite/gas/i386/prefix.d2
-rw-r--r--gas/testsuite/gas/i386/prefix.s4
-rw-r--r--gas/testsuite/gas/i386/reloc.d5
-rw-r--r--gas/testsuite/gas/i386/reloc.s3
-rw-r--r--gas/testsuite/gas/mcore/allinsn.d263
-rw-r--r--gas/testsuite/gas/vtable/vtable.exp5
-rw-r--r--gas/write.c43
-rw-r--r--include/coff/ChangeLog10
-rw-r--r--include/coff/arm.h19
-rw-r--r--include/coff/mcore.h1
-rw-r--r--include/elf/ChangeLog26
-rw-r--r--include/elf/common.h1
-rw-r--r--include/elf/i960.h37
-rw-r--r--include/elf/m68k.h2
-rw-r--r--include/elf/mcore.h4
-rw-r--r--include/elf/reloc-macros.h4
-rw-r--r--include/opcode/ChangeLog38
-rw-r--r--include/opcode/hppa.h64
-rw-r--r--include/opcode/i386.h360
-rw-r--r--include/opcode/m68k.h33
-rw-r--r--include/opcode/ppc.h3
-rw-r--r--ld/ChangeLog121
-rw-r--r--ld/Makefile.am12
-rw-r--r--ld/Makefile.in205
-rw-r--r--ld/configure.tgt10
-rw-r--r--ld/emulparams/armelf.sh1
-rw-r--r--ld/emulparams/armelf_linux.sh2
-rw-r--r--ld/emulparams/armelf_oabi.sh2
-rw-r--r--ld/emulparams/elf32_i960.sh8
-rw-r--r--ld/emulparams/elf32mcore.sh16
-rw-r--r--ld/emulparams/elf32ppclinux.sh8
-rw-r--r--ld/emultempl/armcoff.em2
-rw-r--r--ld/emultempl/armelf.em1079
-rw-r--r--ld/emultempl/armelf_oabi.em2
-rw-r--r--ld/emultempl/pe.em99
-rw-r--r--ld/ld.texinfo17
-rw-r--r--ld/ldlang.c475
-rw-r--r--ld/lexsup.c8
-rw-r--r--ld/pe-dll.c239
-rw-r--r--ld/scripttempl/mcorepe.sc7
-rw-r--r--ld/scripttempl/pe.sc1
-rw-r--r--ld/testsuite/ChangeLog8
-rw-r--r--ld/testsuite/ld-srec/srec.exp6
-rw-r--r--ld/testsuite/ld-undefined/undefined.exp1
-rw-r--r--libiberty/ChangeLog13
-rwxr-xr-xlibiberty/configure2
-rw-r--r--libiberty/configure.in2
-rw-r--r--libiberty/cplus-dem.c85
-rw-r--r--libiberty/getruntime.c4
-rw-r--r--opcodes/ChangeLog126
-rw-r--r--opcodes/i386-dis.c1246
-rw-r--r--opcodes/m68k-dis.c75
-rw-r--r--opcodes/m68k-opc.c493
-rw-r--r--opcodes/mcore-dis.c53
-rw-r--r--opcodes/mcore-opc.h10
154 files changed, 9316 insertions, 3174 deletions
diff --git a/ChangeLog b/ChangeLog
index 2604b21d5c6..d0a5953e8be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sun May 30 16:03:16 1999 Cort Dougan <cort@cs.nmt.edu>
+
+ * config.guess (ppc-*-linux-gnu): Also use ld emul elf32ppclinux.
+
+1999-05-24 Nick Clifton <nickc@cygnus.com>
+
+ * config.sub: Updated to match latest EGCS version.
+
1999-04-30 Tom Tromey <tromey@cygnus.com>
* ltmain.sh: [mode link] Always use CC given by ltconfig.
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 66a5b243f36..258a11803de 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,286 @@
+Wed Jun 2 12:38:49 1999 Miodrag Vallat <miodrag@multimania.com>
+
+ * hosts/alphalinux.h (TRAD_CORE_EXTRA_SIZE_ALLOWED): Expand to 4096.
+
+Tue Jun 1 17:57:58 1999 Mark P. Mitchell <mitchell@n02.acl.lanl.gov>
+
+ * reloc.c (BFD_RELOC_MIPS_SUB): New relocation.
+ (BFD_RELOC_MIPS_GOT_PAGE): Likewise.
+ (BFD_RELOC_MIPS_GOT_OFST): Likewise.
+ (BFD_RELOC_MIPS_GOT_DISP): Likewise.
+ * bfd-in2.h: Regenerated.
+ * libbfd.h: Likewise.
+ * elf32-mips.c (mips_info_to_howto_rela): New function.
+ (USE_REL): Adjust for new conventions.
+ (MINUS_ONE): New macro.
+ (elf_mips_howto_table): Add R_MIPS_SUB.
+ (mips_r): Add entries for MIPS_SUB, MIPS_GOT_PAGE, MIPS_GOT_OFST,
+ and MIPS_GOT_DISP.
+ (mips_elf_final_write_processing): Set sh_link, not sh_info, for a
+ .MIPS.content section.
+ (_bfd_mips_elf_fake_sections): Treat all sections that begin
+ with .MIPS.content as .MIPS.content sections. Set
+ SHF_MNIPS_NOSTRIP for such section.
+ (elf_info_to_howto): Define to mips_info_to_howto_rela.
+ * elf64-mips.c (mips_r): Add entries for MIPS_SUB, MIPS_GOT_PAGE,
+ MIPS_GOT_OFST, and MIPS_GOT_DISP.
+
+Wed Jun 2 11:51:12 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
+
+ * vms-misc.c (_bfd_vms_hash_newfunc): Fix use of uninitialized
+ variable.
+
+ * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Avoid ambigous
+ `else'.
+
+1999-05-30 Philip Blundell <philb@gnu.org>
+
+ * elf32-arm.h (elf32_arm_relocate_section): Reinstate change of
+ 1993-03-25 (!!). Take into account the bitmasks for the reloc so
+ the addend does not overflow into the rest of the word.
+
+1999-05-29 Nick Clifton <nickc@cygnus.com>
+
+ * bfd-in.h: Amend prototype for
+ bfd_elf32_arm_process_before_allocation .
+ * bfd-in.h: Regenerate.
+
+ * elfarm-oabi.c (NUM_ELEM): New macro: Compute the number of
+ elements in a fixed sized array.
+ (ARM_ELF_ABI_VERSION): Define.
+ (ARM_ELF_OS_ABI_VERSION): Define.
+ (R_ARM_THM_ABS5): Fix rightshift and size.
+ (R_ARM_THM_PC22): Fix size.
+ (R_ARM_PLT32): Define Howto.
+ (find_howto): New function: Locate a howto based on a reloc
+ number.
+ (elf32_arm_info_to_howto): Use find_howto if necessary.
+ (elf32_arm_reloc_map): Change type of field bfd_reloc_val to
+ bfd_reloc_code_real_type.
+ (elf32_arm_reloc_map[]): Add entries for BFD_RELOC_VTABLE_INHERIT
+ and BFD_RELOC_VTABLE_ENTRY.
+ (elf32_arm_reloc_type_lookup): Use find_howto if necessary.
+
+ * elfarm-nabi.c (NUM_ELEM): New macro: Compute the number of
+ elements in a fixed sized array.
+ (ARM_ELF_ABI_VERSION): Define.
+ (ARM_ELF_OS_ABI_VERSION): Define.
+ (R_ARM_THM_ABS5): Fix rightshift and size.
+ (R_ARM_THM_PC22): Fix size.
+ (elf32_arm_info_to_howto_rel): Rename to elf32_arm_info_to_howto.
+ (elf32_arm_reloc_map): Change type of field bfd_reloc_val to
+ bfd_reloc_code_real_type.
+
+ * elf32-arm.h (struct elf32_arm_link_hash_table): Add new field:
+ no_pipeline_knowledge.
+ (elf32_arm_link_hash_create): Initialise new field to zero.
+ (bfd_elf32_arm_process_before_allocation): Add new paraemter:
+ no_pipeline_knowledge. Use this parameter to initialise the field
+ in the globals data structure.
+ (elf32_arm_final_link_relocate): Only add in pipeline offset if
+ no_pipeline_knowledge is false and the binary is from an old
+ toolchain.
+ (elf32_arm_merge_private_data): Generate an error if an attempt is
+ made to linl together big endian and little endian code.
+ (elf32_arm_post_process_headers): New function: Initialise the
+ EI_OSABI and EI_ABIVERSION fields of the newly created ELF program
+ header.
+ (elf_backend_post_process_headers): Define.
+
+1999-05-28 Nick Clifton <nickc@cygnus.com>
+
+ * elf-bfd.h (struct elf_backend_data): Add new field:
+ elf_backend_post_process_headers.
+
+ * elfxx-target.h (elf_backend_post_process_headers): Define to
+ NULL if not already defined.
+ (elfNN_bed): Initialise elf_backend_post_process_headers field.
+
+ * elf.c (prep_headers): Set the EI_OSABI and EI_ABIVERSION fields
+ to zero.
+ (_bfd_elf_compute_section_file_positions): Call
+ elf_backend_post_process_headers if defined.
+
+1999-05-28 Ian Lance Taylor <ian@zembu.com>
+
+ * configure.in: Check whether getuid and getgid exist.
+ * archive.c: Define getuid and getgid as macros if HAVE_GETUID or
+ HAVE_GETGID are not defined, respectively.
+ (bfd_write_armap): Don't special case on _WIN32 for getuid and
+ getgid.
+ * configure.host: Set ac_cv_func_get{ug}id for *-*-windows*.
+ * configure, config.in: Rebuild.
+
+1999-05-28 Martin Dorey <mdorey@madge.com>
+
+ * elf32-i960.c: New file.
+ * elf.c (prep_headers): Handle bfd_arch_i960.
+ * targets.c (bfd_target_vector): Add &bfd_elf32_i960_vec.
+ * config.bfd (i960-*-elf*): New target.
+ * configure.in (bfd_elf32_i960_vec): New target vector.
+ * Makefile.am (BFD32_BACKENDS): Add elf32-i960.lo.
+ (BFD32_BACKENDS_CFILES): Add elf32-i960.c.
+ * Makefile.in, aclocal.m4, configure: Rebuild.
+
+1999-05-27 Nick Clifton <nickc@cygnus.com>
+
+ * elfarm-oabi.c (elf32_arm_howto_table): Add entry for
+ R_ARM_PLT32.
+ (find_howto): New function: Find entries in the
+ elf32_arm_howto_table.
+ (elf32_arm_info_to_howto): Use find_howto if the entry cannot be
+ computed simply.
+ (elf32_arm_reloc_type_lookup): Add lookup for
+ BFD_RELOC_ARM_PLT32.
+
+1999-05-25 Philip Blundell <pb@nexus.co.uk>
+
+ * bfd/elf32-arm.h (elf32_arm_link_hash_newfunc): New function.
+ (elf32_arm_link_hash_table_create): Use above function as the
+ constructor for hash table entries.
+ (elf32_arm_relocate_section): Avoid crash when there is no output
+ section.
+ (elf32_arm_final_link_relocate): New parameter h.
+ (elf32_arm_relocate_section): Pass symbol hash entry to above
+ routine.
+ (elf32_arm_gc_sweep_hook, elf32_arm_check relocs): Correct
+ comments.
+
+1999-05-25 Catherine Moore <clm@cygnus.com>
+
+ * coff-arm.c (coff_arm_relocate_section): Don't emit
+ base file entries for pc-relative values.
+
+1999-05-25 DJ Delorie <dj@cygnus.com>
+
+ * peicode.h (coff_swap_sym_in): When we create the actual section
+ to reflect the not-there section C_SECTION symbols refer to,
+ change the symbol class to C_STAT as the section is now really
+ there.
+
+1999-05-24 Philip Blundell <pb@nexus.co.uk>
+
+ * elf32-arm.h (elf32_arm_relocate_section): Undo change of
+ 1999-03-25.
+
+Mon May 17 13:35:35 1999 Stan Cox <scox@cygnus.com>
+ * coff-arm.c (_bfd_coff_arm_set_private_flags): Changed
+ F_PIC_INT to F_PIC.
+ * coffcode.h (coff_set_arch_mach_hook): Added F_ARM_2a, and
+ F_ARM_3M labels. Changed F_PIC_INT to F_PIC.
+
+1999-05-16 Nick Clifton <nickc@cygnus.com>
+
+ * coff-mcore.c (in_reloc_p): Reinstate.
+
+1999-05-15 Nick Clifton <nickc@cygnus.com>
+
+ * reloc.c (BFD_RELOC_MCORE_RVA): Define.
+ * bfd-in2.h: Regenerate.
+ * coff-mcore.c (in_reloc_p): Remove defintion.
+ (mcore_coff_howto): Add IMAGE_REL_MCORE_RVA.
+ (mcore_coff_reloc_type_lookup): Map BFD_RELOC_RVA to
+ IMAGE_REL_MCORE_RVA.
+ (coff_mcore_rtype_to_howto): Add special processing for
+ IMAGE_REL_MCORE_RVA.
+ (coff_mcore_relocate_section): Add support for
+ IMAGE_REL_MCORE_RVA.
+ * elf32-mcore (mcore_elf_howto_): Add R_MCORE_RELATIVE.
+ (mcore_elf_reloc_type_lookup): Map BFD_RELOC_RVA to
+ R_MCORE_RELATIVE.
+ (mcore_elf_relocate_section): Delete redundant case labels.
+
+Fri May 14 10:59:55 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
+
+ * elf32-arm.h (elf32_arm_relocate_section): Fix operator
+ precedence between bit-and and comparison.
+
+Thu May 13 09:45:23 1999 Joel Sherrill (joel@OARcorp.com)
+
+ * config.bfd (i[3456]86*-*-rtems*, m68k*-*-rtems*): Added to
+ list of target formats (targ_selvecs).
+ (i[3456]86*-*-rtemself*, mips*el-*-rtems*): New targets.
+ (powerpcle*-*rtems*, sh-*-rtemself*): New targets.
+
+1999-05-10 DJ Delorie <dj@cygnus.com>
+
+ * ecoff.c (_bfd_ecoff_write_armap): give the symtab element a
+ reasonable mode until "ar x" is smart enough to skip it (fixes
+ gcc/libgcc.a builds on mips-ecoff targets
+
+ * coffcode.h (styp_to_sec_flags): Explain how COMDATs are supposed
+ to work. Hack to support MS import libraries, which use different
+ COMDAT types than GNU.
+ (coff_slurp_symbol_table): C_SECTION symbols are local; they refer
+ to implied zero-length sections (see peicode below)
+ * coffgen.c (coff_get_normalized_symtab): Properly read long MS
+ filename symbols, which use one *or more* auxents.
+ * coffswap.h (coff_swap_aux_in): ditto
+ * peicode.h (coff_swap_sym_in): Build the implied zero-length
+ sections
+
+Tue May 11 15:51:58 1999 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c (v850_elf_howto_table): Make partial_inplace false
+ for all relocations.
+
+1999-05-10 Catherine Moore <clm@cygnus.com>
+
+ * bfd-in.h (bfd_arm_allocate_interworking_sections): Static
+ if COFF_IMAGE_WITH_PE.
+ (bfd_arm_process_before_allocation): Likewise.
+ (bfd_arm_get_bfd_for_interworking): Likewise.
+ * coff-arm.c: Likewise.
+ * bfd-in2.h: Regenerate.
+ * configure.in (armpe_little_vec): Remove coff-arm.lo.
+ (armpe_big_vec): Likewise.
+ * configure: Rebuild.
+
+1999-05-10 Nick Clifton <nickc@cygnus.com>
+
+ * elf.c (elf_fake_sections): Check for .rel. as start of rel
+ section, not just .rel. Same for .rela.
+
+1999-05-07 Nick Clifton <nickc@cygnus.com>
+
+ * coff-mcore.c (coff_mcore_relocate_section): Replace assert about
+ endianism with an error message.
+
+Thu May 6 17:09:09 1999 Fred Fish <fnf@be.com>
+
+ * dwarf2.c (read_abbrevs): Change cast of dwarf_abbrev_buffer
+ assignment from "unsigned char *" to "char *".
+ (decode_line_info): Likewise for dwarf_line_buffer assignment.
+
+1999-05-05 Catherine Moore <clm@cygnus.com>
+
+ * coff-arm.c (coff_arm_relocate_section): Add one to
+ address of ARM_RVA32 thumb functions.
+
+1999-05-05 Catherine Moore <clm@cygnus.com>
+
+ * elf32-m68k.c (elf32_m68k_set_private_flags): New.
+ (elf32_m68k_copy_private_bfd_data): New.
+ (elf32_m68k_merge_private_bfd_data): New.
+ (elf32_m68k_print_private_bfd_data): New.
+ (CPU32_FLAG): Define.
+ (PLT_CPU32_ENTRY_SIZE): Define.
+ (elf_cpu32_plt0_entry): Declare.
+ (elf_cpu32_plt_entry): Declare.
+ (elf_m68k_adjust_dynamic_symbol): Generate cpu32 plt entries.
+ (elf_m68k_finish_dynamic_symbol): Likewise.
+ (elf_m68k_finish_dynamic_sections): Likewise.
+ (elf_backend_plt_header_size): Remove definition.
+ (bfd_elf32_bfd_copy_private_bfd_data): Define.
+ (bfd_elf32_bfd_merge_private_bfd_data): Define.
+ (bfd_elf32_bfd_set_private_flags): Define.
+ (bfd_elf32_bfd_print_private_bfd_data): Define.
+
+Mon May 3 09:24:49 1999 Jeffrey A Law (law@cygnus.com)
+
+ * som.c (som_fixup_formats): Fix comments for R_SHORT_PCREL_MODE
+ and R_LONG_PCREL_MODE.
+
1999-04-29 Nick Clifton <nickc@cygnus.com>
* coff-mcore.c (coff_mcore_relocate_section): Fix typos.
diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index a15531171d8..99ad5083c71 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -158,6 +158,7 @@ BFD32_BACKENDS = \
elf32-hppa.lo \
elf32-i386.lo \
elf32-i860.lo \
+ elf32-i960.lo \
elf32-m32r.lo \
elf32-m68k.lo \
elf32-m88k.lo \
@@ -276,6 +277,7 @@ BFD32_BACKENDS_CFILES = \
elf32-hppa.c \
elf32-i386.c \
elf32-i860.c \
+ elf32-i960.c \
elf32-m32r.c \
elf32-m68k.c \
elf32-m88k.c \
@@ -839,6 +841,9 @@ elf32-i386.lo: elf32-i386.c $(INCDIR)/bfdlink.h elf-bfd.h \
elf32-i860.lo: elf32-i860.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-target.h
+elf32-i960.lo: elf32-i960.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/i960.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-m32r.lo: elf32-m32r.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
$(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index 9258df13b2f..24b3dfea5a1 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -104,6 +104,7 @@ RANLIB = @RANLIB@
TDEFINES = @TDEFINES@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
+USE_SYMBOL_UNDERSCORE = @USE_SYMBOL_UNDERSCORE@
VERSION = @VERSION@
WIN32LDFLAGS = @WIN32LDFLAGS@
WIN32LIBADD = @WIN32LIBADD@
@@ -276,6 +277,7 @@ BFD32_BACKENDS = \
elf32-hppa.lo \
elf32-i386.lo \
elf32-i860.lo \
+ elf32-i960.lo \
elf32-m32r.lo \
elf32-m68k.lo \
elf32-m88k.lo \
@@ -395,6 +397,7 @@ BFD32_BACKENDS_CFILES = \
elf32-hppa.c \
elf32-i386.c \
elf32-i860.c \
+ elf32-i960.c \
elf32-m32r.c \
elf32-m68k.c \
elf32-m88k.c \
@@ -613,7 +616,7 @@ configure.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
+TAR = gtar
GZIP_ENV = --best
SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES)
OBJECTS = $(libbfd_a_OBJECTS) $(libbfd_la_OBJECTS)
@@ -1150,7 +1153,6 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES)
config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host
$(SHELL) ./config.status --recheck
-
elfarm-oabi.lo: elfarm-oabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
$(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
@@ -1369,6 +1371,9 @@ elf32-i386.lo: elf32-i386.c $(INCDIR)/bfdlink.h elf-bfd.h \
elf32-i860.lo: elf32-i860.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-target.h
+elf32-i960.lo: elf32-i960.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/i960.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-m32r.lo: elf32-m32r.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
$(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
diff --git a/bfd/aclocal.m4 b/bfd/aclocal.m4
index 43580002449..39df10e5092 100644
--- a/bfd/aclocal.m4
+++ b/bfd/aclocal.m4
@@ -208,26 +208,58 @@ fi
AC_SUBST($1)])
-# serial 25 AM_PROG_LIBTOOL
-AC_DEFUN(AM_PROG_LIBTOOL,
-[AC_REQUIRE([AM_ENABLE_SHARED])dnl
-AC_REQUIRE([AM_ENABLE_STATIC])dnl
+# serial 35 AC_PROG_LIBTOOL
+AC_DEFUN(AC_PROG_LIBTOOL,
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+
+# Save cache, so that ltconfig can load it
+AC_CACHE_SAVE
+
+# Actually configure libtool. ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
+DLLTOOL="$DLLTOOL" AS="$AS" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
+|| AC_MSG_ERROR([libtool configure failed])
+
+# Reload cache, that may have been modified by ltconfig
+AC_CACHE_LOAD
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+])
+
+AC_DEFUN(AC_LIBTOOL_SETUP,
+[AC_PREREQ(2.13)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AM_PROG_LD])dnl
-AC_REQUIRE([AM_PROG_NM])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+AC_REQUIRE([AC_SYS_NM_PARSE])dnl
+AC_REQUIRE([AC_SYS_SYMBOL_UNDERSCORE])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
dnl
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
# Check for any special flags to pass to ltconfig.
-libtool_flags=
+libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen"
test "$silent" = yes && libtool_flags="$libtool_flags --silent"
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
@@ -256,37 +288,46 @@ case "$host" in
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
;;
*-*-cygwin*)
- AM_SYS_LIBTOOL_CYGWIN
+ AC_SYS_LIBTOOL_CYGWIN
;;
esac
-# Actually configure libtool. ac_aux_dir is where install-sh is found.
-CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
-LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
-DLLTOOL="$DLLTOOL" AS="$AS" \
-${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
-|| AC_MSG_ERROR([libtool configure failed])
+# enable the --disable-libtool-lock switch
-# Redirect the config.log output again, so that the ltconfig log is not
-# clobbered by the next message.
-exec 5>>./config.log
+AC_ARG_ENABLE(libtool-lock,
+[ --disable-libtool-lock force libtool not to do file locking],
+need_locks=$enableval,
+need_locks=yes)
+
+if test x"$need_locks" = xno; then
+ libtool_flags="$libtool_flags --disable-lock"
+fi
])
-# AM_ENABLE_SHARED - implement the --enable-shared flag
-# Usage: AM_ENABLE_SHARED[(DEFAULT)]
+# AC_LIBTOOL_DLOPEN - check for dlopen support
+AC_DEFUN(AC_LIBTOOL_DLOPEN, [lt_dlopen=yes])
+
+# AC_ENABLE_SHARED - implement the --enable-shared flag
+# Usage: AC_ENABLE_SHARED[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
-AC_DEFUN(AM_ENABLE_SHARED,
-[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_DEFUN(AC_ENABLE_SHARED,
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(shared,
changequote(<<, >>)dnl
-<< --enable-shared[=PKGS] build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT],
+<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
@@ -304,26 +345,22 @@ no) enable_shared=no ;;
IFS="$ac_save_ifs"
;;
esac],
-enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
+enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
])
-# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
-AC_DEFUN(AM_DISABLE_SHARED,
-[AM_ENABLE_SHARED(no)])
+# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
+AC_DEFUN(AC_DISABLE_SHARED,
+[AC_ENABLE_SHARED(no)])
-# AM_DISABLE_STATIC - set the default static flag to --disable-static
-AC_DEFUN(AM_DISABLE_STATIC,
-[AM_ENABLE_STATIC(no)])
-
-# AM_ENABLE_STATIC - implement the --enable-static flag
-# Usage: AM_ENABLE_STATIC[(DEFAULT)]
+# AC_ENABLE_STATIC - implement the --enable-static flag
+# Usage: AC_ENABLE_STATIC[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
-AC_DEFUN(AM_ENABLE_STATIC,
-[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_DEFUN(AC_ENABLE_STATIC,
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(static,
changequote(<<, >>)dnl
-<< --enable-static[=PKGS] build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT],
+<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
@@ -341,28 +378,74 @@ no) enable_static=no ;;
IFS="$ac_save_ifs"
;;
esac],
-enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
+enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
+])
+
+# AC_DISABLE_STATIC - set the default static flag to --disable-static
+AC_DEFUN(AC_DISABLE_STATIC,
+[AC_ENABLE_STATIC(no)])
+
+
+# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
+# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN(AC_ENABLE_FAST_INSTALL,
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(fast-install,
+changequote(<<, >>)dnl
+<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
+changequote([, ])dnl
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
])
+# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
+AC_DEFUN(AC_DISABLE_FAST_INSTALL,
+[AC_ENABLE_FAST_INSTALL(no)])
+
-# AM_PROG_LD - find the path to the GNU or non-GNU linker
-AC_DEFUN(AM_PROG_LD,
+# AC_PROG_LD - find the path to the GNU or non-GNU linker
+AC_DEFUN(AC_PROG_LD,
[AC_ARG_WITH(gnu-ld,
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
ac_prog=ld
if test "$ac_cv_prog_gcc" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by GCC])
ac_prog=`($CC -print-prog-name=ld) 2>&5`
case "$ac_prog" in
- # Accept absolute paths.
+ # Accept absolute paths.
changequote(,)dnl
- /* | [A-Za-z]:\\*)
+ /* | [A-Za-z]:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
changequote([,])dnl
- test -z "$LD" && LD="$ac_prog"
- ;;
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
@@ -390,7 +473,7 @@ AC_CACHE_VAL(ac_cv_path_LD,
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
- test "$with_gnu_ld" != yes && break
+ test "$with_gnu_ld" != yes && break
fi
fi
done
@@ -406,10 +489,10 @@ else
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_SUBST(LD)
-AM_PROG_LD_GNU
+AC_PROG_LD_GNU
])
-AC_DEFUN(AM_PROG_LD_GNU,
+AC_DEFUN(AC_PROG_LD_GNU,
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
@@ -419,8 +502,8 @@ else
fi])
])
-# AM_PROG_NM - find the path to a BSD-compatible name lister
-AC_DEFUN(AM_PROG_NM,
+# AC_PROG_NM - find the path to a BSD-compatible name lister
+AC_DEFUN(AC_PROG_NM,
[AC_MSG_CHECKING([for BSD-compatible nm])
AC_CACHE_VAL(ac_cv_path_NM,
[if test -n "$NM"; then
@@ -428,20 +511,22 @@ AC_CACHE_VAL(ac_cv_path_NM,
ac_cv_path_NM="$NM"
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/nm; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -B"
+ ac_cv_path_NM="$ac_dir/nm -B"
+ break
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -p"
+ ac_cv_path_NM="$ac_dir/nm -p"
+ break
else
- ac_cv_path_NM="$ac_dir/nm"
+ ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
fi
- break
fi
done
IFS="$ac_save_ifs"
@@ -452,12 +537,280 @@ AC_MSG_RESULT([$NM])
AC_SUBST(NM)
])
-# AM_SYS_LIBTOOL_CYGWIN - find tools needed on cygwin
-AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN,
+# AC_SYS_NM_PARSE - Check for command to grab the raw symbol name followed
+# by C symbol name from nm.
+AC_DEFUN(AC_SYS_NM_PARSE,
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output])
+AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
+[# These are sane defaults that work on at least a few old systems.
+# {They come from Ultrix. What could be older than Ultrix?!! ;)}
+
+changequote(,)dnl
+# Character class describing NM global symbol codes.
+ac_symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+ac_symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+
+# Define system-specific variables.
+case "$host_os" in
+aix*)
+ ac_symcode='[BCDT]'
+ ;;
+cygwin* | mingw*)
+ ac_symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
+ ;;
+irix*)
+ ac_symcode='[BCDEGRST]'
+ ;;
+solaris*)
+ ac_symcode='[BDT]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
+ ac_symcode='[ABCDGISTW]'
+fi
+changequote([,])dnl
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+ ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
+
+ # Check to see that the pipe works correctly.
+ ac_pipe_works=no
+ rm -f conftest.$ac_ext
+ cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func;return 0;}
+EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ ac_nlist=conftest.nm
+
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
+
+ # Try sorting and uniquifying the output.
+ if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
+ mv -f "$ac_nlist"T "$ac_nlist"
+ else
+ rm -f "$ac_nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
+ if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
+ cat <<EOF > conftest.c
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
+
+ cat <<EOF >> conftest.c
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr_t address;
+}
+changequote(,)dnl
+lt_preloaded_symbols[] =
+changequote([,])dnl
+{
+EOF
+ sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
+ cat <<\EOF >> conftest.c
+ {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftestm.$ac_objext
+ ac_save_LIBS="$LIBS"
+ ac_save_CFLAGS="$CFLAGS"
+ LIBS="conftestm.$ac_objext"
+ CFLAGS="$CFLAGS$no_builtin_flag"
+ if AC_TRY_EVAL(ac_link) && test -s conftest; then
+ ac_pipe_works=yes
+ else
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat conftest.c >&AC_FD_CC
+ fi
+ LIBS="$ac_save_LIBS"
+ CFLAGS="$ac_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
+ fi
+ else
+ echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
+ fi
+ else
+ echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
+ fi
+ else
+ echo "$progname: failed program was:" >&AC_FD_CC
+ cat conftest.c >&AC_FD_CC
+ fi
+ rm -rf conftest*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$ac_pipe_works" = yes; then
+ if test x"$ac_symprfx" = x"_"; then
+ ac_cv_sys_symbol_underscore=yes
+ else
+ ac_cv_sys_symbol_underscore=no
+ fi
+ break
+ else
+ ac_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+
+ac_result=yes
+if test -z "$ac_cv_sys_global_symbol_pipe"; then
+ ac_result=no
+fi
+AC_MSG_RESULT($ac_result)
+])
+
+# AC_SYS_LIBTOOL_CYGWIN - find tools needed on cygwin
+AC_DEFUN(AC_SYS_LIBTOOL_CYGWIN,
[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(AS, as, false)
])
+# AC_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
+# with an underscore?
+AC_DEFUN(AC_SYS_SYMBOL_UNDERSCORE,
+[AC_REQUIRE([AC_PROG_NM])dnl
+AC_REQUIRE([AC_SYS_NM_PARSE])dnl
+AC_MSG_CHECKING([for _ prefix in compiled symbols])
+AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
+[ac_cv_sys_symbol_underscore=no
+cat > conftest.$ac_ext <<EOF
+void nm_test_func(){}
+int main(){nm_test_func;return 0;}
+EOF
+if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ ac_nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
+ # See whether the symbols have a leading underscore.
+ if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
+ ac_cv_sys_symbol_underscore=yes
+ else
+ if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
+ :
+ else
+ echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
+ fi
+ fi
+ else
+ echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
+ fi
+else
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat conftest.c >&AC_FD_CC
+fi
+rm -rf conftest*
+])
+AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
+USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
+AC_SUBST(USE_SYMBOL_UNDERSCORE)dnl
+])
+
+# AC_CHECK_LIBM - check for math library
+AC_DEFUN(AC_CHECK_LIBM, [
+AC_CHECK_LIB(mw, _mwvalidcheckl)
+AC_CHECK_LIB(m, cos)
+])
+
+# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl convenience library, adds --enable-ltdl-convenience to
+# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
+# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
+# to be `${top_builddir}/libltdl'. Make sure you start DIR with
+# '${top_builddir}/' (note the single quotes!) if your package is not
+# flat, and, if you're not using automake, define top_builddir as
+# appropriate in the Makefiles.
+AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [
+ case "$enable_ltdl_convenience" in
+ no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+ "") enable_ltdl_convenience=yes
+ ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+ esac
+ LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
+])
+
+# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl installable library, and adds --enable-ltdl-install to
+# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
+# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
+# to be `${top_builddir}/libltdl'. Make sure you start DIR with
+# '${top_builddir}/' (note the single quotes!) if your package is not
+# flat, and, if you're not using automake, define top_builddir as
+# appropriate in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [
+ AC_CHECK_LIB(ltdl, main, LIBLTDL="-lltdl", [
+ case "$enable_ltdl_install" in
+ no) AC_MSG_WARN([libltdl not installed, but installation disabled]) ;;
+ "") enable_ltdl_install=yes
+ ac_configure_args="$ac_configure_args --enable-ltdl-install" ;;
+ esac
+ ])
+ if test x"$enable_ltdl_install" != x"no"; then
+ LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
+ fi
+])
+
+dnl old names
+AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
+AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
+AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
+AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
+AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
+AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
+AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
+AC_DEFUN(AM_SYS_NM_PARSE, [indir([AC_SYS_NM_PARSE])])dnl
+AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE, [indir([AC_SYS_SYMBOL_UNDERSCORE])])dnl
+AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN, [indir([AC_SYS_LIBTOOL_CYGWIN])])dnl
+
# Like AC_CONFIG_HEADER, but automatically create stamp file.
AC_DEFUN(AM_CONFIG_HEADER,
diff --git a/bfd/archive.c b/bfd/archive.c
index 8ac5aa4e95d..ac5aeaf6220 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -1,5 +1,5 @@
/* BFD back-end for archive files (libraries).
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault.
@@ -1340,6 +1340,14 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen)
/** A couple of functions for creating ar_hdrs */
+#ifndef HAVE_GETUID
+#define getuid() 0
+#endif
+
+#ifndef HAVE_GETGID
+#define getgid() 0
+#endif
+
/* Takes a filename, returns an arelt_data for it, or NULL if it can't
make one. The filename must refer to a filename in the filesystem.
The filename field of the ar_hdr will NOT be initialized. If member
@@ -1901,13 +1909,8 @@ bsd_write_armap (arch, elength, map, orl_count, stridx)
bfd_ardata (arch)->armap_datepos = (SARMAG
+ offsetof (struct ar_hdr, ar_date[0]));
sprintf (hdr.ar_date, "%ld", bfd_ardata (arch)->armap_timestamp);
-#ifndef _WIN32
sprintf (hdr.ar_uid, "%ld", (long) getuid ());
sprintf (hdr.ar_gid, "%ld", (long) getgid ());
-#else
- sprintf (hdr.ar_uid, "%ld", (long) 666);
- sprintf (hdr.ar_gid, "%ld", (long) 42);
-#endif
sprintf (hdr.ar_size, "%-10d", (int) mapsize);
strncpy (hdr.ar_fmag, ARFMAG, 2);
for (i = 0; i < sizeof (struct ar_hdr); i++)
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 8bdbf80f1b1..7c18ce79da3 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -705,18 +705,27 @@ extern boolean bfd_coff_set_symbol_class
PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int));
/* ARM Interworking support. Called from linker. */
+#ifdef COFF_IMAGE_WITH_PE
+static
+#endif
extern boolean bfd_arm_allocate_interworking_sections
PARAMS ((struct bfd_link_info *));
+#ifdef COFF_IMAGE_WITH_PE
+static
+#endif
extern boolean bfd_arm_process_before_allocation
PARAMS ((bfd *, struct bfd_link_info *, int));
+#ifdef COFF_IMAGE_WITH_PE
+static
+#endif
extern boolean bfd_arm_get_bfd_for_interworking
PARAMS ((bfd *, struct bfd_link_info *));
/* ELF ARM Interworking support. Called from linker. */
extern boolean bfd_elf32_arm_allocate_interworking_sections
- PARAMS ((struct bfd_link_info *));
+ PARAMS ((struct bfd_link_info *, int));
extern boolean bfd_elf32_arm_process_before_allocation
PARAMS ((bfd *, struct bfd_link_info *));
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 8e86304d953..248ab9dbbd7 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -705,18 +705,27 @@ extern boolean bfd_coff_set_symbol_class
PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int));
/* ARM Interworking support. Called from linker. */
+#ifdef COFF_IMAGE_WITH_PE
+static
+#endif
extern boolean bfd_arm_allocate_interworking_sections
PARAMS ((struct bfd_link_info *));
+#ifdef COFF_IMAGE_WITH_PE
+static
+#endif
extern boolean bfd_arm_process_before_allocation
PARAMS ((bfd *, struct bfd_link_info *, int));
+#ifdef COFF_IMAGE_WITH_PE
+static
+#endif
extern boolean bfd_arm_get_bfd_for_interworking
PARAMS ((bfd *, struct bfd_link_info *));
/* ELF ARM Interworking support. Called from linker. */
extern boolean bfd_elf32_arm_allocate_interworking_sections
- PARAMS ((struct bfd_link_info *));
+ PARAMS ((struct bfd_link_info *, int));
extern boolean bfd_elf32_arm_process_before_allocation
PARAMS ((bfd *, struct bfd_link_info *));
@@ -1828,6 +1837,10 @@ to compensate for the borrow when the low bits are added. */
BFD_RELOC_MIPS_GOT_LO16,
BFD_RELOC_MIPS_CALL_HI16,
BFD_RELOC_MIPS_CALL_LO16,
+ BFD_RELOC_MIPS_SUB,
+ BFD_RELOC_MIPS_GOT_PAGE,
+ BFD_RELOC_MIPS_GOT_OFST,
+ BFD_RELOC_MIPS_GOT_DISP,
/* i386/elf relocations */
@@ -2162,6 +2175,7 @@ short offset into 11 bits. */
BFD_RELOC_MCORE_PCREL_IMM4BY2,
BFD_RELOC_MCORE_PCREL_32,
BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
+ BFD_RELOC_MCORE_RVA,
/* These two relocations are used by the linker to determine which of
the entries in a C++ virtual function table are actually used. When
diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c
index d478ce5f98c..52baa856713 100644
--- a/bfd/coff-arm.c
+++ b/bfd/coff-arm.c
@@ -1,5 +1,5 @@
/* BFD back-end for ARM COFF files.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -934,8 +934,6 @@ static const insn32 a2t1_ldr_insn = 0xe59fc000;
static const insn32 a2t2_bx_r12_insn = 0xe12fff1c;
static const insn32 a2t3_func_addr_insn = 0x00000001;
-#define A2T3_OFFSET 8
-
/*
Thumb->ARM: Thumb->(non-interworking aware) ARM
@@ -959,8 +957,6 @@ static const insn16 t2a1_bx_pc_insn = 0x4778;
static const insn16 t2a2_noop_insn = 0x46c0;
static const insn32 t2a3_b_insn = 0xea000000;
-#define T2A3_OFFSET 8
-
static const insn16 t2a1_push_insn = 0xb540;
static const insn16 t2a2_ldr_insn = 0x4e03;
static const insn16 t2a3_mov_insn = 0x46fe;
@@ -1211,7 +1207,8 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
s->contents + my_offset + 8);
if (info->base_file)
- arm_emit_base_file_entry (info, output_bfd, s, A2T3_OFFSET);
+ arm_emit_base_file_entry (info, output_bfd, s,
+ my_offset + 8);
}
@@ -1236,7 +1233,6 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_put_32 (output_bfd, tmp, contents + rel->r_vaddr
- input_section->vma);
-
done = 1;
}
}
@@ -1319,6 +1315,9 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
/* Store the address of the function in the last word of the stub. */
bfd_put_32 (output_bfd, h_val,
s->contents + my_offset + 16);
+
+ if (info->base_file)
+ arm_emit_base_file_entry (info, output_bfd, s, my_offset + 16);
}
else
{
@@ -1341,8 +1340,6 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
t2a3_b_insn | ((ret_offset >> 2) & 0x00FFFFFF),
s->contents + my_offset + 4);
- if (info->base_file)
- arm_emit_base_file_entry (info, output_bfd, s, T2A3_OFFSET);
}
}
@@ -1365,9 +1362,6 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
contents + rel->r_vaddr
- input_section->vma);
- if (info->base_file)
- arm_emit_base_file_entry (info, output_bfd, input_section, rel->r_vaddr);
-
done = 1;
}
}
@@ -1537,7 +1531,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
Probably not, but it works, and if it works it don't need fixing! nickc@cygnus.com */
/* Only perform this fix during the final link, not a relocatable link. nickc@cygnus.com */
if (! info->relocateable
- && rel->r_type == ARM_32)
+ && (rel->r_type == ARM_32 || rel->r_type == ARM_RVA32))
{
/* Determine if we need to set the bottom bit of a relocated address
because the address is the address of a Thumb code symbol. */
@@ -1610,7 +1604,9 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
return true;
}
-#ifndef COFF_WITH_PE
+#ifdef COFF_IMAGE_WITH_PE
+static
+#endif
boolean
bfd_arm_allocate_interworking_sections (info)
struct bfd_link_info * info;
@@ -1797,6 +1793,9 @@ record_thumb_to_arm_glue (info, h)
/* Select a BFD to be used to hold the sections used by the glue code.
This function is called from the linker scripts in ld/emultempl/
{armcoff/pe}.em */
+#ifdef COFF_IMAGE_WITH_PE
+static
+#endif
boolean
bfd_arm_get_bfd_for_interworking (abfd, info)
bfd * abfd;
@@ -1852,6 +1851,9 @@ bfd_arm_get_bfd_for_interworking (abfd, info)
return true;
}
+#ifdef COFF_IMAGE_WITH_PE
+static
+#endif
boolean
bfd_arm_process_before_allocation (abfd, info, support_old_code)
bfd * abfd;
@@ -1959,8 +1961,6 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code)
return true;
}
-#endif /* ! COFF_WITH_PE */
-
#define coff_bfd_reloc_type_lookup coff_arm_reloc_type_lookup
#define coff_relocate_section coff_arm_relocate_section
#define coff_bfd_is_local_label_name coff_arm_is_local_label_name
@@ -2183,7 +2183,7 @@ _bfd_coff_arm_set_private_flags (abfd, flags)
if (APCS_SET (abfd)
&& ( (APCS_26_FLAG (abfd) != flag)
|| (APCS_FLOAT_FLAG (abfd) != (flags & F_APCS_FLOAT))
- || (PIC_FLAG (abfd) != (flags & F_PIC_INT ? F_PIC : 0))
+ || (PIC_FLAG (abfd) != (flags & F_PIC))
))
return false;
diff --git a/bfd/coff-mcore.c b/bfd/coff-mcore.c
index d787096e379..c0efebfa1e0 100644
--- a/bfd/coff-mcore.c
+++ b/bfd/coff-mcore.c
@@ -45,8 +45,6 @@ static struct bfd_link_hash_table * coff_mcore_link_hash_table_create
PARAMS ((bfd *));
static bfd_reloc_status_type mcore_coff_unsupported_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static boolean in_reloc_p
- PARAMS ((bfd *, reloc_howto_type *));
static boolean coff_mcore_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
struct internal_reloc *, struct internal_syment *, asection **));
@@ -84,7 +82,7 @@ static reloc_howto_type mcore_coff_howto_table[] =
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* dont complain_on_overflow */
- 0, /* special_function */
+ NULL, /* special_function */
"ABSOLUTE", /* name */
false, /* partial_inplace */
0x00, /* src_mask */
@@ -98,7 +96,7 @@ static reloc_howto_type mcore_coff_howto_table[] =
false, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- 0, /* special_function */
+ NULL, /* special_function */
"ADDR32", /* name */
true, /* partial_inplace */
0xffffffff, /* src_mask */
@@ -114,7 +112,7 @@ static reloc_howto_type mcore_coff_howto_table[] =
true, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- mcore_coff_unsupported_reloc, /* special_function */
+ mcore_coff_unsupported_reloc, /* special_function */
"IMM8BY4", /* name */
false, /* partial_inplace */
0, /* src_mask */
@@ -146,7 +144,7 @@ static reloc_howto_type mcore_coff_howto_table[] =
true, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- mcore_coff_unsupported_reloc,/* special_function */
+ mcore_coff_unsupported_reloc, /* special_function */
"IMM4BY2", /* name */
false, /* partial_inplace */
0, /* src_mask */
@@ -187,6 +185,20 @@ static reloc_howto_type mcore_coff_howto_table[] =
false, /* partial_inplace */
0x0, /* src_mask */
0x7ff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ HOWTO (IMAGE_REL_MCORE_RVA, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ NULL, /* special_function */
+ "MCORE_RVA", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
true) /* pcrel_offset */
};
@@ -277,6 +289,7 @@ mcore_coff_reloc_type_lookup (abfd, code)
HOW2MAP (BFD_RELOC_MCORE_PCREL_IMM4BY2, IMAGE_REL_MCORE_PCREL_IMM4BY2);
HOW2MAP (BFD_RELOC_32_PCREL, IMAGE_REL_MCORE_PCREL_32);
HOW2MAP (BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2, IMAGE_REL_MCORE_PCREL_JSR_IMM11BY2);
+ HOW2MAP (BFD_RELOC_RVA, IMAGE_REL_MCORE_RVA);
default:
return NULL;
}
@@ -304,6 +317,9 @@ coff_mcore_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
return NULL;
howto = mcore_coff_howto_table + rel->r_type;
+
+ if (rel->r_type == IMAGE_REL_MCORE_RVA)
+ * addendp -= pe_data (sec->output_section->owner)->pe_opthdr.ImageBase;
if (howto->pc_relative)
{
@@ -323,16 +339,18 @@ coff_mcore_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
return howto;
}
-
-/* Return true if this relocation should
- appear in the output .reloc section. */
-static boolean in_reloc_p (abfd, howto)
+
+/* Return true if this relocation should appear in the output .reloc section.
+ This function is referenced in pe_mkobject in peicode.h. */
+static boolean
+in_reloc_p (abfd, howto)
bfd * abfd;
reloc_howto_type * howto;
{
- return ! howto->pc_relative;
+ return ! howto->pc_relative && howto->type != IMAGE_REL_MCORE_RVA;
}
+
/* The reloc processing routine for the optimized COFF linker. */
static boolean
coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
@@ -357,8 +375,19 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
if (info->relocateable)
return true;
- BFD_ASSERT (input_bfd->xvec->byteorder
- == output_bfd->xvec->byteorder);
+ /* Check if we have the same endianess */
+ if ( input_bfd->xvec->byteorder != output_bfd->xvec->byteorder
+ && output_bfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
+ {
+ (*_bfd_error_handler)
+ (_("%s: compiled for a %s endian system and target is %s endian.\n"),
+ bfd_get_filename (input_bfd),
+ bfd_big_endian (input_bfd) ? "big" : "little",
+ bfd_big_endian (output_bfd) ? "big" : "little");
+
+ bfd_set_error (bfd_error_wrong_format);
+ return false;
+ }
hihalf = false;
hihalf_val = 0;
@@ -481,6 +510,7 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
case IMAGE_REL_MCORE_PCREL_32:
case IMAGE_REL_MCORE_PCREL_JSR_IMM11BY2:
case IMAGE_REL_MCORE_ADDR32:
+ case IMAGE_REL_MCORE_RVA:
rstat = _bfd_relocate_contents (howto, input_bfd, val, loc);
break;
}
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 383719c00c9..bdd9769d5bb 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -588,6 +588,12 @@ styp_to_sec_flags (abfd, hdr, name)
can't call slurp_symtab, because the linker doesn't want the
swapped symbols. */
+ /* COMDAT sections are special. The first symbol is the section
+ symbol, which tells what kind of COMDAT section it is. The
+ *second* symbol is the "comdat symbol" - the one with the
+ unique name. GNU uses the section symbol for the unique
+ name; MS uses ".text" for every comdat section. Sigh. - DJ */
+
if (_bfd_coff_get_external_symbols (abfd))
{
bfd_byte *esym, *esymend;
@@ -629,10 +635,23 @@ styp_to_sec_flags (abfd, hdr, name)
isym.n_type, isym.n_sclass,
0, isym.n_numaux, (PTR) &aux);
+ /* FIXME: Microsoft uses NODUPLICATES and
+ ASSOCIATIVE, but gnu uses ANY and SAME_SIZE.
+ Unfortunately, gnu doesn't do the comdat
+ symbols right. So, until we can fix it to do
+ the right thing, we are temporarily disabling
+ comdats for the MS types (they're used in
+ DLLs and C++, but we don't support *their*
+ C++ libraries anyway - DJ */
+
switch (aux.x_scn.x_comdat)
{
case IMAGE_COMDAT_SELECT_NODUPLICATES:
+#if 0
sec_flags |= SEC_LINK_DUPLICATES_ONE_ONLY;
+#else
+ sec_flags &= ~SEC_LINK_ONCE;
+#endif
break;
default:
@@ -649,8 +668,12 @@ styp_to_sec_flags (abfd, hdr, name)
break;
case IMAGE_COMDAT_SELECT_ASSOCIATIVE:
+#if 0
/* FIXME: This is not currently implemented. */
sec_flags |= SEC_LINK_DUPLICATES_DISCARD;
+#else
+ sec_flags &= ~SEC_LINK_ONCE;
+#endif
break;
}
@@ -1396,11 +1419,13 @@ coff_set_arch_mach_hook (abfd, filehdr)
arch = bfd_arch_arm;
switch (internal_f->f_flags & F_ARM_ARCHITECTURE_MASK)
{
- case F_ARM_2: machine = bfd_mach_arm_2; break;
- case F_ARM_3: machine = bfd_mach_arm_3; break;
- default:
- case F_ARM_4: machine = bfd_mach_arm_4; break;
- case F_ARM_4T: machine = bfd_mach_arm_4T; break;
+ case F_ARM_2: machine = bfd_mach_arm_2; break;
+ case F_ARM_2a: machine = bfd_mach_arm_2a; break;
+ case F_ARM_3: machine = bfd_mach_arm_3; break;
+ default:
+ case F_ARM_3M: machine = bfd_mach_arm_3M; break;
+ case F_ARM_4: machine = bfd_mach_arm_4; break;
+ case F_ARM_4T: machine = bfd_mach_arm_4T; break;
}
break;
#endif
@@ -2027,7 +2052,7 @@ coff_set_flags (abfd, magicp, flagsp)
* flagsp |= F_APCS_FLOAT;
if (PIC_FLAG (abfd))
- * flagsp |= F_PIC_INT;
+ * flagsp |= F_PIC;
}
if (INTERWORK_SET (abfd) && INTERWORK_FLAG (abfd))
* flagsp |= F_INTERWORK;
@@ -3581,6 +3606,11 @@ coff_slurp_symbol_table (abfd)
#ifdef COFF_WITH_PE
if (src->u.syment.n_sclass == C_NT_WEAK)
dst->symbol.flags = BSF_WEAK;
+ if (src->u.syment.n_sclass == C_SECTION
+ && src->u.syment.n_scnum > 0)
+ {
+ dst->symbol.flags = BSF_LOCAL;
+ }
#endif
if (src->u.syment.n_sclass == C_WEAKEXT)
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index df413833bd3..a06ed663b3d 100644
--- a/bfd/coffgen.c
+++ b/bfd/coffgen.c
@@ -1747,9 +1747,19 @@ coff_get_normalized_symtab (abfd)
else
{
/* ordinary short filename, put into memory anyway */
- internal_ptr->u.syment._n._n_n._n_offset = (long)
- copy_name (abfd, (internal_ptr + 1)->u.auxent.x_file.x_fname,
- FILNMLEN);
+ if (internal_ptr->u.syment.n_numaux > 1
+ && coff_data (abfd)->pe)
+ {
+ internal_ptr->u.syment._n._n_n._n_offset = (long)
+ copy_name (abfd, (internal_ptr + 1)->u.auxent.x_file.x_fname,
+ internal_ptr->u.syment.n_numaux * symesz);
+ }
+ else
+ {
+ internal_ptr->u.syment._n._n_n._n_offset = (long)
+ copy_name (abfd, (internal_ptr + 1)->u.auxent.x_file.x_fname,
+ FILNMLEN);
+ }
}
}
else
diff --git a/bfd/coffswap.h b/bfd/coffswap.h
index ae30a5d966f..9bc180f4de8 100644
--- a/bfd/coffswap.h
+++ b/bfd/coffswap.h
@@ -422,7 +422,16 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
#if FILNMLEN != E_FILNMLEN
-> Error, we need to cope with truncating or extending FILNMLEN!;
#else
- memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN);
+ if (numaux > 1)
+ {
+ if (indx == 0)
+ memcpy (in->x_file.x_fname, ext->x_file.x_fname,
+ numaux * sizeof (AUXENT));
+ }
+ else
+ {
+ memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN);
+ }
#endif
}
goto end;
diff --git a/bfd/config.bfd b/bfd/config.bfd
index 449ae915b1d..e677d5de617 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -220,15 +220,23 @@ case "${targ}" in
targ_defvec=bfd_elf32_i386_vec
targ_selvecs=i386coff_vec
;;
+ i[3456]86-*-rtemself*)
+ targ_defvec=bfd_elf32_i386_vec
+ targ_selvecs="i386coff_vec i386aout_vec"
+ ;;
i[3456]86-*-msdosdjgpp* | i[3456]*-*-go32* | i[3456]86-go32-rtems* )
targ_defvec=go32coff_vec
targ_selvecs="go32stubbedcoff_vec i386aout_vec"
;;
i[3456]86-*-sysv* | i[3456]86-*-isc* | i[3456]86-*-sco* | i[3456]86-*-coff | \
- i[3456]86-*-aix* | i[3456]86*-*-rtems*)
+ i[3456]86-*-aix*)
+ targ_defvec=i386coff_vec
+ ;;
+ i[3456]86*-*-rtems*)
targ_defvec=i386coff_vec
+ targ_selvecs="bfd_elf32_i386_vec i386aout_vec"
;;
- i[3456]86-sequent-bsd*)
+ i[3456]86-sequent-bsd*)
targ_defvec=i386dynix_vec
targ_underscore=yes
;;
@@ -323,6 +331,10 @@ case "${targ}" in
targ_selvecs="b_out_vec_big_host icoff_little_vec icoff_big_vec ieee_vec"
targ_underscore=yes
;;
+ i960-*-elf*)
+ targ_defvec=bfd_elf32_i960_vec
+ targ_selvecs="icoff_little_vec icoff_big_vec"
+ ;;
m32r-*-*)
targ_defvec=bfd_elf32_m32r_vec
@@ -354,7 +366,11 @@ case "${targ}" in
targ_defvec=bfd_elf32_m68k_vec
targ_selvecs="m68kcoff_vec ieee_vec"
;;
- m68*-*-coff* | m68*-*-sysv* | m68*-*-rtems*)
+ m68*-*-rtems*)
+ targ_defvec=m68kcoff_vec
+ targ_selvecs="m68kcoff_vec versados_vec ieee_vec aout0_big_vec"
+ ;;
+ m68*-*-coff* | m68*-*-sysv*)
targ_defvec=m68kcoff_vec
targ_selvecs="m68kcoff_vec versados_vec ieee_vec"
;;
@@ -491,7 +507,7 @@ case "${targ}" in
targ_defvec=ecoff_big_vec
targ_selvecs=ecoff_little_vec
;;
- mips*el-*-elf* | mips*el-*-vxworks*)
+ mips*el-*-elf* | mips*el-*-rtems* | mips*el-*-vxworks*)
targ_defvec=bfd_elf32_littlemips_vec
targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
;;
@@ -546,7 +562,8 @@ case "${targ}" in
targ_selvecs="nlm32_powerpc_vec rs6000coff_vec"
;;
powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks*)
+ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
+ powerpcle-*-rtems*)
targ_defvec=bfd_elf32_powerpcle_vec
targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
;;
@@ -560,7 +577,7 @@ case "${targ}" in
targ_defvec=rs6000coff_vec
;;
- sh-*-elf*)
+ sh-*-elf* | sh-*-rtemself*)
targ_defvec=bfd_elf32_sh_vec
targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
targ_underscore=yes
diff --git a/bfd/config.in b/bfd/config.in
index 51fa45b6928..abb2c7872cc 100644
--- a/bfd/config.in
+++ b/bfd/config.in
@@ -67,9 +67,15 @@
/* Define if you have the getcwd function. */
#undef HAVE_GETCWD
+/* Define if you have the getgid function. */
+#undef HAVE_GETGID
+
/* Define if you have the getpagesize function. */
#undef HAVE_GETPAGESIZE
+/* Define if you have the getuid function. */
+#undef HAVE_GETUID
+
/* Define if you have the madvise function. */
#undef HAVE_MADVISE
diff --git a/bfd/configure b/bfd/configure
index f6ca66fae69..83e93e6bdbf 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -16,8 +16,12 @@ ac_help="$ac_help
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 force libtool not to do file locking"
+ac_help="$ac_help
--enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)"
ac_help="$ac_help
--enable-targets alternative target configurations"
@@ -590,7 +594,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:594: checking host system type" >&5
+echo "configure:598: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -611,7 +615,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:615: checking target system type" >&5
+echo "configure:619: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -629,7 +633,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:633: checking build system type" >&5
+echo "configure:637: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -654,7 +658,7 @@ test "$host_alias" != "$target_alias" &&
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:658: checking for $ac_word" >&5
+echo "configure:662: 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
@@ -684,7 +688,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:688: checking for $ac_word" >&5
+echo "configure:692: 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
@@ -735,7 +739,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:739: checking for $ac_word" >&5
+echo "configure:743: 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
@@ -767,7 +771,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:771: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:775: 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.
@@ -778,12 +782,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 782 "configure"
+#line 786 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:791: \"$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
@@ -809,12 +813,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:813: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:817: 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:818: checking whether we are using GNU C" >&5
+echo "configure:822: 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
@@ -823,7 +827,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:827: \"$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:831: \"$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
@@ -842,7 +846,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:846: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:850: 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
@@ -874,7 +878,7 @@ else
fi
echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:878: checking for POSIXized ISC" >&5
+echo "configure:882: checking for POSIXized ISC" >&5
if test -d /etc/conf/kconfig.d &&
grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
@@ -907,7 +911,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:911: checking for a BSD compatible install" >&5
+echo "configure:915: 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
@@ -960,7 +964,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:964: checking whether build environment is sane" >&5
+echo "configure:968: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@@ -1017,7 +1021,7 @@ test "$program_suffix" != NONE &&
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1021: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1025: 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
@@ -1063,7 +1067,7 @@ EOF
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:1067: checking for working aclocal" >&5
+echo "configure:1071: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1076,7 +1080,7 @@ else
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1080: checking for working autoconf" >&5
+echo "configure:1084: 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.
@@ -1089,7 +1093,7 @@ else
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1093: checking for working automake" >&5
+echo "configure:1097: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1102,7 +1106,7 @@ else
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1106: checking for working autoheader" >&5
+echo "configure:1110: 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.
@@ -1115,7 +1119,7 @@ else
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1119: checking for working makeinfo" >&5
+echo "configure:1123: 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.
@@ -1138,7 +1142,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1142: checking for $ac_word" >&5
+echo "configure:1146: 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
@@ -1170,7 +1174,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1174: checking for $ac_word" >&5
+echo "configure:1178: 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
@@ -1202,7 +1206,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1206: checking for $ac_word" >&5
+echo "configure:1210: 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
@@ -1282,10 +1286,33 @@ else
enable_static=yes
fi
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+ enableval="$enable_fast_install"
+ p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_fast_install=yes
+fi
+
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1289: checking for $ac_word" >&5
+echo "configure:1316: 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
@@ -1320,18 +1347,23 @@ else
with_gnu_ld=no
fi
-
ac_prog=ld
if test "$ac_cv_prog_gcc" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1329: checking for ld used by GCC" >&5
+echo "configure:1355: checking for ld used by GCC" >&5
ac_prog=`($CC -print-prog-name=ld) 2>&5`
case "$ac_prog" in
- # Accept absolute paths.
- /* | [A-Za-z]:\\*)
- test -z "$LD" && LD="$ac_prog"
- ;;
+ # Accept absolute paths.
+ /* | [A-Za-z]:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
@@ -1343,10 +1375,10 @@ echo "configure:1329: checking for ld used by GCC" >&5
esac
elif test "$with_gnu_ld" = yes; then
echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1347: checking for GNU ld" >&5
+echo "configure:1379: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1350: checking for non-GNU ld" >&5
+echo "configure:1382: checking for non-GNU ld" >&5
fi
if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1363,7 +1395,7 @@ else
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
- test "$with_gnu_ld" != yes && break
+ test "$with_gnu_ld" != yes && break
fi
fi
done
@@ -1382,7 +1414,7 @@ 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:1386: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1418: checking if the linker ($LD) is GNU ld" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1398,7 +1430,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1402: checking for BSD-compatible nm" >&5
+echo "configure:1434: checking for BSD-compatible nm" >&5
if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1407,20 +1439,22 @@ else
ac_cv_path_NM="$NM"
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/nm; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -B"
+ ac_cv_path_NM="$ac_dir/nm -B"
+ break
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -p"
+ ac_cv_path_NM="$ac_dir/nm -p"
+ break
else
- ac_cv_path_NM="$ac_dir/nm"
+ ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
fi
- break
fi
done
IFS="$ac_save_ifs"
@@ -1432,8 +1466,212 @@ NM="$ac_cv_path_NM"
echo "$ac_t""$NM" 1>&6
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
+echo "configure:1472: checking command to parse $NM output" >&5
+if eval "test \"`echo '$''{'ac_cv_sys_global_symbol_pipe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # These are sane defaults that work on at least a few old systems.
+# {They come from Ultrix. What could be older than Ultrix?!! ;)}
+
+# Character class describing NM global symbol codes.
+ac_symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+ac_symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+
+# Define system-specific variables.
+case "$host_os" in
+aix*)
+ ac_symcode='[BCDT]'
+ ;;
+cygwin* | mingw*)
+ ac_symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
+ ;;
+irix*)
+ ac_symcode='[BCDEGRST]'
+ ;;
+solaris*)
+ ac_symcode='[BDT]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
+ ac_symcode='[ABCDGISTW]'
+fi
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+ ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.* \($ac_symcode\) *\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
+
+ # Check to see that the pipe works correctly.
+ ac_pipe_works=no
+ rm -f conftest.$ac_ext
+ cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func;return 0;}
+EOF
+
+ if { (eval echo configure:1535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ # Now try to grab the symbols.
+ ac_nlist=conftest.nm
+
+ if { (eval echo configure:1539: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+
+ # Try sorting and uniquifying the output.
+ if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
+ mv -f "$ac_nlist"T "$ac_nlist"
+ else
+ rm -f "$ac_nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
+ if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
+ cat <<EOF > conftest.c
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
+
+ cat <<EOF >> conftest.c
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+ sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
+ cat <<\EOF >> conftest.c
+ {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftestm.$ac_objext
+ ac_save_LIBS="$LIBS"
+ ac_save_CFLAGS="$CFLAGS"
+ LIBS="conftestm.$ac_objext"
+ CFLAGS="$CFLAGS$no_builtin_flag"
+ if { (eval echo configure:1591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ ac_pipe_works=yes
+ else
+ echo "configure: failed program was:" >&5
+ cat conftest.c >&5
+ fi
+ LIBS="$ac_save_LIBS"
+ CFLAGS="$ac_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $ac_nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $ac_nlist" >&5
+ fi
+ else
+ echo "cannot run $ac_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.c >&5
+ fi
+ rm -rf conftest*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$ac_pipe_works" = yes; then
+ if test x"$ac_symprfx" = x"_"; then
+ ac_cv_sys_symbol_underscore=yes
+ else
+ ac_cv_sys_symbol_underscore=no
+ fi
+ break
+ else
+ ac_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+
+ac_result=yes
+if test -z "$ac_cv_sys_global_symbol_pipe"; then
+ ac_result=no
+fi
+echo "$ac_t""$ac_result" 1>&6
+
+echo $ac_n "checking for _ prefix in compiled symbols""... $ac_c" 1>&6
+echo "configure:1637: checking for _ prefix in compiled symbols" >&5
+if eval "test \"`echo '$''{'ac_cv_sys_symbol_underscore'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_cv_sys_symbol_underscore=no
+cat > conftest.$ac_ext <<EOF
+void nm_test_func(){}
+int main(){nm_test_func;return 0;}
+EOF
+if { (eval echo configure:1646: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ # Now try to grab the symbols.
+ ac_nlist=conftest.nm
+ if { (eval echo configure:1649: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+ # See whether the symbols have a leading underscore.
+ if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
+ ac_cv_sys_symbol_underscore=yes
+ else
+ if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
+ :
+ else
+ echo "configure: cannot find nm_test_func in $ac_nlist" >&5
+ fi
+ fi
+ else
+ echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&5
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.c >&5
+fi
+rm -rf conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_sys_symbol_underscore" 1>&6
+USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
+
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1437: checking whether ln -s works" >&5
+echo "configure:1675: 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
@@ -1453,13 +1691,13 @@ else
echo "$ac_t""no" 1>&6
fi
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
# Check for any special flags to pass to ltconfig.
-libtool_flags=
+libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen"
test "$silent" = yes && libtool_flags="$libtool_flags --silent"
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
@@ -1469,8 +1707,8 @@ test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
case "$host" in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 1473 "configure"' > conftest.$ac_ext
- if { (eval echo configure:1474: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ echo '#line 1711 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:1712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*32-bit*)
LD="${LD-ld} -32"
@@ -1488,14 +1726,45 @@ case "$host" in
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
+ echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
+echo "configure:1733: checking whether the C compiler needs -belf" >&5
+if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1738 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:1745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ lt_cv_cc_needs_belf=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ lt_cv_cc_needs_belf=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
;;
*-*-cygwin*)
# Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ac_tool_prefix}dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1499: checking for $ac_word" >&5
+echo "configure:1768: 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
@@ -1527,7 +1796,7 @@ if test -n "$ac_tool_prefix"; 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:1531: checking for $ac_word" >&5
+echo "configure:1800: 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
@@ -1562,7 +1831,7 @@ fi
# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
set dummy ${ac_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1566: checking for $ac_word" >&5
+echo "configure:1835: 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
@@ -1594,7 +1863,7 @@ if test -n "$ac_tool_prefix"; 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:1598: checking for $ac_word" >&5
+echo "configure:1867: 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
@@ -1631,6 +1900,71 @@ fi
esac
+# enable the --disable-libtool-lock switch
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval="$enable_libtool_lock"
+ need_locks=$enableval
+else
+ need_locks=yes
+fi
+
+
+if test x"$need_locks" = xno; then
+ libtool_flags="$libtool_flags --disable-lock"
+fi
+
+
+# Save cache, so that ltconfig can load it
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+
# Actually configure libtool. ac_aux_dir is where install-sh is found.
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
@@ -1639,6 +1973,22 @@ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
+# Reload cache, that may have been modified by ltconfig
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
# Redirect the config.log output again, so that the ltconfig log is not
# clobbered by the next message.
exec 5>>./config.log
@@ -1714,7 +2064,7 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1718: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:2068: 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"
@@ -1737,12 +2087,12 @@ fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:1741: checking for Cygwin environment" >&5
+echo "configure:2091: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1746 "configure"
+#line 2096 "configure"
#include "confdefs.h"
int main() {
@@ -1753,7 +2103,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:1757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -1770,19 +2120,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:1774: checking for mingw32 environment" >&5
+echo "configure:2124: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1779 "configure"
+#line 2129 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:1786: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2136: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -1801,7 +2151,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1805: checking for executable suffix" >&5
+echo "configure:2155: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1811,7 +2161,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:1815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:2165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj | *.ilk | *.pdb) ;;
@@ -1840,7 +2190,7 @@ target64=false
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1844: checking for $ac_word" >&5
+echo "configure:2194: 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
@@ -1870,7 +2220,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:1874: checking for $ac_word" >&5
+echo "configure:2224: 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
@@ -1921,7 +2271,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:1925: checking for $ac_word" >&5
+echo "configure:2275: 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
@@ -1953,7 +2303,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1957: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2307: 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.
@@ -1964,12 +2314,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 1968 "configure"
+#line 2318 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2323: \"$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
@@ -1995,12 +2345,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:1999: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2349: 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:2004: checking whether we are using GNU C" >&5
+echo "configure:2354: 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
@@ -2009,7 +2359,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2013: \"$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:2363: \"$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
@@ -2028,7 +2378,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:2032: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2382: 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
@@ -2062,7 +2412,7 @@ fi
ALL_LINGUAS=
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2066: checking how to run the C preprocessor" >&5
+echo "configure:2416: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -2077,13 +2427,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 2081 "configure"
+#line 2431 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2087: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2437: \"$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
:
@@ -2094,13 +2444,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 2098 "configure"
+#line 2448 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2104: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2454: \"$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
:
@@ -2111,13 +2461,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 2115 "configure"
+#line 2465 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2121: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2471: \"$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
:
@@ -2142,12 +2492,12 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2146: checking for ANSI C header files" >&5
+echo "configure:2496: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2151 "configure"
+#line 2501 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2155,7 +2505,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2509: \"$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*
@@ -2172,7 +2522,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 2176 "configure"
+#line 2526 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2190,7 +2540,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 2194 "configure"
+#line 2544 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2211,7 +2561,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2215 "configure"
+#line 2565 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2222,7 +2572,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2246,12 +2596,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2250: checking for working const" >&5
+echo "configure:2600: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2255 "configure"
+#line 2605 "configure"
#include "confdefs.h"
int main() {
@@ -2300,7 +2650,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:2304: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -2321,21 +2671,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2325: checking for inline" >&5
+echo "configure:2675: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 2332 "configure"
+#line 2682 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:2339: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -2361,12 +2711,12 @@ EOF
esac
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:2365: checking for off_t" >&5
+echo "configure:2715: 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 <<EOF
-#line 2370 "configure"
+#line 2720 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2394,12 +2744,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2398: checking for size_t" >&5
+echo "configure:2748: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2403 "configure"
+#line 2753 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2429,19 +2779,19 @@ fi
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:2433: checking for working alloca.h" >&5
+echo "configure:2783: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2438 "configure"
+#line 2788 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:2445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2795: \"$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
@@ -2462,12 +2812,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2466: checking for alloca" >&5
+echo "configure:2816: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2471 "configure"
+#line 2821 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -2495,7 +2845,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:2499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -2527,12 +2877,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2531: checking whether alloca needs Cray hooks" >&5
+echo "configure:2881: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2536 "configure"
+#line 2886 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -2557,12 +2907,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2561: checking for $ac_func" >&5
+echo "configure:2911: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2566 "configure"
+#line 2916 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2585,7 +2935,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2939: \"$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
@@ -2612,7 +2962,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2616: checking stack direction for C alloca" >&5
+echo "configure:2966: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2620,7 +2970,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 2624 "configure"
+#line 2974 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -2639,7 +2989,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:2643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -2664,17 +3014,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2668: checking for $ac_hdr" >&5
+echo "configure:3018: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2673 "configure"
+#line 3023 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2678: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3028: \"$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*
@@ -2703,12 +3053,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2707: checking for $ac_func" >&5
+echo "configure:3057: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2712 "configure"
+#line 3062 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2731,7 +3081,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3085: \"$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
@@ -2756,7 +3106,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2760: checking for working mmap" >&5
+echo "configure:3110: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2764,7 +3114,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 2768 "configure"
+#line 3118 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -2904,7 +3254,7 @@ main()
}
EOF
-if { (eval echo configure:2908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -2932,17 +3282,17 @@ unistd.h values.h sys/param.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2936: checking for $ac_hdr" >&5
+echo "configure:3286: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2941 "configure"
+#line 3291 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3296: \"$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*
@@ -2972,12 +3322,12 @@ done
__argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2976: checking for $ac_func" >&5
+echo "configure:3326: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2981 "configure"
+#line 3331 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3000,7 +3350,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3354: \"$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
@@ -3029,12 +3379,12 @@ done
for ac_func in stpcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3033: checking for $ac_func" >&5
+echo "configure:3383: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3038 "configure"
+#line 3388 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3057,7 +3407,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3411: \"$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
@@ -3091,19 +3441,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:3095: checking for LC_MESSAGES" >&5
+echo "configure:3445: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3100 "configure"
+#line 3450 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:3107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_val_LC_MESSAGES=yes
else
@@ -3124,7 +3474,7 @@ EOF
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:3128: checking whether NLS is requested" >&5
+echo "configure:3478: checking whether NLS is requested" >&5
# Check whether --enable-nls or --disable-nls was given.
if test "${enable_nls+set}" = set; then
enableval="$enable_nls"
@@ -3144,7 +3494,7 @@ fi
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:3148: checking whether included gettext is requested" >&5
+echo "configure:3498: checking whether included gettext is requested" >&5
# Check whether --with-included-gettext or --without-included-gettext was given.
if test "${with_included_gettext+set}" = set; then
withval="$with_included_gettext"
@@ -3163,17 +3513,17 @@ fi
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:3167: checking for libintl.h" >&5
+echo "configure:3517: checking for libintl.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3172 "configure"
+#line 3522 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3177: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3527: \"$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*
@@ -3190,19 +3540,19 @@ fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:3194: checking for gettext in libc" >&5
+echo "configure:3544: checking for gettext in libc" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3199 "configure"
+#line 3549 "configure"
#include "confdefs.h"
#include <libintl.h>
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:3206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gettext_libc=yes
else
@@ -3218,7 +3568,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
if test "$gt_cv_func_gettext_libc" != "yes"; then
echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:3222: checking for bindtextdomain in -lintl" >&5
+echo "configure:3572: 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
@@ -3226,7 +3576,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3230 "configure"
+#line 3580 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3237,7 +3587,7 @@ int main() {
bindtextdomain()
; return 0; }
EOF
-if { (eval echo configure:3241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3591: \"$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
@@ -3253,19 +3603,19 @@ fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:3257: checking for gettext in libintl" >&5
+echo "configure:3607: checking for gettext in libintl" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3262 "configure"
+#line 3612 "configure"
#include "confdefs.h"
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:3269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gettext_libintl=yes
else
@@ -3293,7 +3643,7 @@ EOF
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3297: checking for $ac_word" >&5
+echo "configure:3647: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3327,12 +3677,12 @@ fi
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3331: checking for $ac_func" >&5
+echo "configure:3681: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3336 "configure"
+#line 3686 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3355,7 +3705,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3709: \"$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
@@ -3382,7 +3732,7 @@ done
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3386: checking for $ac_word" >&5
+echo "configure:3736: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3418,7 +3768,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3422: checking for $ac_word" >&5
+echo "configure:3772: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3450,7 +3800,7 @@ else
fi
cat > conftest.$ac_ext <<EOF
-#line 3454 "configure"
+#line 3804 "configure"
#include "confdefs.h"
int main() {
@@ -3458,7 +3808,7 @@ extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:3462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
CATOBJEXT=.gmo
DATADIRNAME=share
@@ -3490,7 +3840,7 @@ fi
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3494: checking for $ac_word" >&5
+echo "configure:3844: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3524,7 +3874,7 @@ fi
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3528: checking for $ac_word" >&5
+echo "configure:3878: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3560,7 +3910,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3564: checking for $ac_word" >&5
+echo "configure:3914: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3650,7 +4000,7 @@ fi
LINGUAS=
else
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:3654: checking for catalogs to be installed" >&5
+echo "configure:4004: checking for catalogs to be installed" >&5
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
@@ -3678,17 +4028,17 @@ echo "configure:3654: checking for catalogs to be installed" >&5
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:3682: checking for linux/version.h" >&5
+echo "configure:4032: checking for linux/version.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3687 "configure"
+#line 4037 "configure"
#include "confdefs.h"
#include <linux/version.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4042: \"$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*
@@ -3766,7 +4116,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:3770: checking for a BSD compatible install" >&5
+echo "configure:4120: 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
@@ -3849,7 +4199,7 @@ 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:3853: checking for build system executable suffix" >&5
+echo "configure:4203: checking for build system executable suffix" >&5
if eval "test \"`echo '$''{'bfd_cv_build_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3874,17 +4224,17 @@ for ac_hdr in stddef.h string.h strings.h stdlib.h time.h unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3878: checking for $ac_hdr" >&5
+echo "configure:4228: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3883 "configure"
+#line 4233 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4238: \"$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*
@@ -3914,17 +4264,17 @@ for ac_hdr in fcntl.h sys/file.h sys/time.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3918: checking for $ac_hdr" >&5
+echo "configure:4268: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3923 "configure"
+#line 4273 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4278: \"$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*
@@ -3951,12 +4301,12 @@ fi
done
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:3955: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:4305: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3960 "configure"
+#line 4310 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -3965,7 +4315,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:3969: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4319: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -3990,12 +4340,12 @@ 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:3994: checking for $ac_hdr that defines DIR" >&5
+echo "configure:4344: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3999 "configure"
+#line 4349 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
@@ -4003,7 +4353,7 @@ int main() {
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:4007: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -4028,7 +4378,7 @@ 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:4032: checking for opendir in -ldir" >&5
+echo "configure:4382: 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
@@ -4036,7 +4386,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4040 "configure"
+#line 4390 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4047,7 +4397,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:4051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4401: \"$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
@@ -4069,7 +4419,7 @@ fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4073: checking for opendir in -lx" >&5
+echo "configure:4423: 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
@@ -4077,7 +4427,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4081 "configure"
+#line 4431 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4088,7 +4438,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:4092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4442: \"$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
@@ -4110,15 +4460,15 @@ fi
fi
-for ac_func in fcntl getpagesize setitimer sysconf fdopen
+for ac_func in fcntl getpagesize setitimer sysconf fdopen getuid getgid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4117: checking for $ac_func" >&5
+echo "configure:4467: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4122 "configure"
+#line 4472 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4141,7 +4491,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4495: \"$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
@@ -4176,12 +4526,12 @@ EOF
esac
echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:4180: checking whether strstr must be declared" >&5
+echo "configure:4530: checking whether strstr must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4185 "configure"
+#line 4535 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4202,7 +4552,7 @@ int main() {
char *(*pfn) = (char *(*)) strstr
; return 0; }
EOF
-if { (eval echo configure:4206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strstr=no
else
@@ -4223,12 +4573,12 @@ EOF
fi
echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:4227: checking whether malloc must be declared" >&5
+echo "configure:4577: checking whether malloc must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4232 "configure"
+#line 4582 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4249,7 +4599,7 @@ int main() {
char *(*pfn) = (char *(*)) malloc
; return 0; }
EOF
-if { (eval echo configure:4253: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_malloc=no
else
@@ -4270,12 +4620,12 @@ EOF
fi
echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:4274: checking whether realloc must be declared" >&5
+echo "configure:4624: checking whether realloc must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4279 "configure"
+#line 4629 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4296,7 +4646,7 @@ int main() {
char *(*pfn) = (char *(*)) realloc
; return 0; }
EOF
-if { (eval echo configure:4300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4650: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_realloc=no
else
@@ -4317,12 +4667,12 @@ EOF
fi
echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:4321: checking whether free must be declared" >&5
+echo "configure:4671: checking whether free must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4326 "configure"
+#line 4676 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4343,7 +4693,7 @@ int main() {
char *(*pfn) = (char *(*)) free
; return 0; }
EOF
-if { (eval echo configure:4347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_free=no
else
@@ -4364,12 +4714,12 @@ EOF
fi
echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:4368: checking whether getenv must be declared" >&5
+echo "configure:4718: checking whether getenv must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4373 "configure"
+#line 4723 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4390,7 +4740,7 @@ int main() {
char *(*pfn) = (char *(*)) getenv
; return 0; }
EOF
-if { (eval echo configure:4394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_getenv=no
else
@@ -4591,17 +4941,17 @@ if test "${target}" = "${host}"; then
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4595: checking for $ac_hdr" >&5
+echo "configure:4945: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4600 "configure"
+#line 4950 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4955: \"$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*
@@ -4629,19 +4979,19 @@ done
if test "$ac_cv_header_sys_procfs_h" = yes; then
echo $ac_n "checking for prstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4633: checking for prstatus_t in sys/procfs.h" >&5
+echo "configure:4983: checking for prstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4638 "configure"
+#line 4988 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main() {
prstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:4645: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prstatus_t=yes
else
@@ -4663,19 +5013,19 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus_t" 1>&6
echo $ac_n "checking for prstatus_t.pr_who in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4667: checking for prstatus_t.pr_who in sys/procfs.h" >&5
+echo "configure:5017: checking for prstatus_t.pr_who in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4672 "configure"
+#line 5022 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main() {
prstatus_t avar; void* aref = (void*) &avar.pr_who
; return 0; }
EOF
-if { (eval echo configure:4679: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5029: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who=yes
else
@@ -4697,19 +5047,19 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" 1>&6
echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4701: checking for pstatus_t in sys/procfs.h" >&5
+echo "configure:5051: checking for pstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4706 "configure"
+#line 5056 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main() {
pstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:4713: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5063: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pstatus_t=yes
else
@@ -4731,19 +5081,19 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6
echo $ac_n "checking for prpsinfo_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4735: checking for prpsinfo_t in sys/procfs.h" >&5
+echo "configure:5085: checking for prpsinfo_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4740 "configure"
+#line 5090 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main() {
prpsinfo_t avar
; return 0; }
EOF
-if { (eval echo configure:4747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prpsinfo_t=yes
else
@@ -4765,19 +5115,19 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo_t" 1>&6
echo $ac_n "checking for psinfo_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4769: checking for psinfo_t in sys/procfs.h" >&5
+echo "configure:5119: checking for psinfo_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4774 "configure"
+#line 5124 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main() {
psinfo_t avar
; return 0; }
EOF
-if { (eval echo configure:4781: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_psinfo_t=yes
else
@@ -4799,19 +5149,19 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo_t" 1>&6
echo $ac_n "checking for lwpstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4803: checking for lwpstatus_t in sys/procfs.h" >&5
+echo "configure:5153: checking for lwpstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4808 "configure"
+#line 5158 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main() {
lwpstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:4815: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5165: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_lwpstatus_t=yes
else
@@ -4833,19 +5183,19 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpstatus_t" 1>&6
echo $ac_n "checking for lwpstatus_t.pr_context in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4837: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5
+echo "configure:5187: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4842 "configure"
+#line 5192 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main() {
lwpstatus_t avar; void* aref = (void*) &avar.pr_context
; return 0; }
EOF
-if { (eval echo configure:4849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5199: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context=yes
else
@@ -4867,19 +5217,19 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context" 1>&6
echo $ac_n "checking for lwpstatus_t.pr_reg in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4871: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5
+echo "configure:5221: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4876 "configure"
+#line 5226 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main() {
lwpstatus_t avar; void* aref = (void*) &avar.pr_reg
; return 0; }
EOF
-if { (eval echo configure:4883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg=yes
else
@@ -5002,8 +5352,8 @@ do
a_out_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;;
armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
- armpe_little_vec) tb="$tb pe-arm.lo coff-arm.lo cofflink.lo " ;;
- armpe_big_vec) tb="$tb pe-arm.lo coff-arm.lo cofflink.lo " ;;
+ armpe_little_vec) tb="$tb pe-arm.lo cofflink.lo " ;;
+ armpe_big_vec) tb="$tb pe-arm.lo cofflink.lo " ;;
armpei_little_vec) tb="$tb pei-arm.lo cofflink.lo " ;;
armpei_big_vec) tb="$tb pei-arm.lo cofflink.lo " ;;
arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo cofflink.lo " ;;
@@ -5036,6 +5386,7 @@ do
bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;;
bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
+ bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;;
bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
@@ -5228,17 +5579,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5239: checking for $ac_hdr" >&5
+echo "configure:5583: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5244 "configure"
+#line 5588 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5249: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5593: \"$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*
@@ -5267,12 +5618,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5278: checking for $ac_func" >&5
+echo "configure:5622: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5283 "configure"
+#line 5627 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5295,7 +5646,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5650: \"$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
@@ -5320,7 +5671,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:5331: checking for working mmap" >&5
+echo "configure:5675: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5328,7 +5679,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 5339 "configure"
+#line 5683 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -5468,7 +5819,7 @@ main()
}
EOF
-if { (eval echo configure:5479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -5493,12 +5844,12 @@ fi
for ac_func in madvise mprotect
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5504: checking for $ac_func" >&5
+echo "configure:5848: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5509 "configure"
+#line 5853 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5521,7 +5872,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5876: \"$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
@@ -5717,10 +6068,11 @@ s%@AR@%$AR%g
s%@RANLIB@%$RANLIB%g
s%@LD@%$LD%g
s%@NM@%$NM%g
+s%@USE_SYMBOL_UNDERSCORE@%$USE_SYMBOL_UNDERSCORE%g
s%@LN_S@%$LN_S%g
-s%@LIBTOOL@%$LIBTOOL%g
s%@DLLTOOL@%$DLLTOOL%g
s%@AS@%$AS%g
+s%@LIBTOOL@%$LIBTOOL%g
s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
s%@MAINT@%$MAINT%g
diff --git a/bfd/configure.host b/bfd/configure.host
index ef7048be13c..e24cd600228 100644
--- a/bfd/configure.host
+++ b/bfd/configure.host
@@ -63,6 +63,8 @@ m68*-hp-hpux*) HDEFINES=-DHOST_HP300HPUX ;;
ac_cv_func_getpagesize=no
ac_cv_func_madvise=no
ac_cv_func_mprotect=no
+ ac_cv_func_getuid=no
+ ac_cv_func_getgid=no
ac_cv_header_sys_file_h=no
ac_cv_header_sys_time_h=no
ac_cv_header_unistd_h=no
diff --git a/bfd/configure.in b/bfd/configure.in
index 3a3e36f1b66..94f3ef60feb 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -98,7 +98,7 @@ AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h)
AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h)
AC_HEADER_TIME
AC_HEADER_DIRENT
-AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen)
+AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid)
BFD_BINARY_FOPEN
@@ -414,8 +414,8 @@ do
a_out_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;;
armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
- armpe_little_vec) tb="$tb pe-arm.lo coff-arm.lo cofflink.lo " ;;
- armpe_big_vec) tb="$tb pe-arm.lo coff-arm.lo cofflink.lo " ;;
+ armpe_little_vec) tb="$tb pe-arm.lo cofflink.lo " ;;
+ armpe_big_vec) tb="$tb pe-arm.lo cofflink.lo " ;;
armpei_little_vec) tb="$tb pei-arm.lo cofflink.lo " ;;
armpei_big_vec) tb="$tb pei-arm.lo cofflink.lo " ;;
arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo cofflink.lo " ;;
@@ -448,6 +448,7 @@ do
bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;;
bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
+ bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;;
bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 385bf821b6e..1ea7cffb3d9 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -423,7 +423,7 @@ read_abbrevs (abfd, offset)
}
stash->dwarf_abbrev_size = bfd_get_section_size_before_reloc (msec);
- stash->dwarf_abbrev_buffer = (unsigned char*) bfd_alloc (abfd, stash->dwarf_abbrev_size);
+ stash->dwarf_abbrev_buffer = (char*) bfd_alloc (abfd, stash->dwarf_abbrev_size);
if (! stash->dwarf_abbrev_buffer)
return 0;
@@ -723,7 +723,7 @@ decode_line_info (unit)
}
size = bfd_get_section_size_before_reloc (msec);
- dwarf_line_buffer = (unsigned char*) bfd_alloc (abfd, size);
+ dwarf_line_buffer = (char*) bfd_alloc (abfd, size);
if (! dwarf_line_buffer)
return 0;
diff --git a/bfd/ecoff.c b/bfd/ecoff.c
index d5c6f85a717..32a2309e941 100644
--- a/bfd/ecoff.c
+++ b/bfd/ecoff.c
@@ -3181,7 +3181,14 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx)
armap. */
hdr.ar_uid[0] = '0';
hdr.ar_gid[0] = '0';
+#if 0
hdr.ar_mode[0] = '0';
+#else
+ /* Building gcc ends up extracting the armap as a file - twice. */
+ hdr.ar_mode[0] = '6';
+ hdr.ar_mode[1] = '4';
+ hdr.ar_mode[2] = '4';
+#endif
sprintf (hdr.ar_size, "%-10d", (int) mapsize);
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 82ffe2add97..218780dae28 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -515,6 +515,12 @@ struct elf_backend_data
PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *o,
const Elf_Internal_Rela *relocs));
+ /* This function, if defined, is called after the ELF headers have
+ been created. This allows for things like the OS and ABI versions
+ to be changed. */
+ void (*elf_backend_post_process_headers)
+ PARAMS ((bfd *, struct bfd_link_info *));
+
/* The swapping table to use when dealing with ECOFF information.
Used for the MIPS ELF .mdebug section. */
const struct ecoff_debug_swap *elf_backend_ecoff_debug_swap;
diff --git a/bfd/elf.c b/bfd/elf.c
index ab010d46f4b..135e55392ac 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1490,13 +1490,13 @@ elf_fake_sections (abfd, asect, failedptrarg)
this_hdr->sh_type = SHT_DYNAMIC;
this_hdr->sh_entsize = bed->s->sizeof_dyn;
}
- else if (strncmp (asect->name, ".rela", 5) == 0
+ else if (strncmp (asect->name, ".rela.", 6) == 0
&& get_elf_backend_data (abfd)->use_rela_p)
{
this_hdr->sh_type = SHT_RELA;
this_hdr->sh_entsize = bed->s->sizeof_rela;
}
- else if (strncmp (asect->name, ".rel", 4) == 0
+ else if (strncmp (asect->name, ".rel.", 5) == 0
&& ! get_elf_backend_data (abfd)->use_rela_p)
{
this_hdr->sh_type = SHT_REL;
@@ -2011,6 +2011,10 @@ _bfd_elf_compute_section_file_positions (abfd, link_info)
if (! prep_headers (abfd))
return false;
+ /* Post process the headers if necessary. */
+ if (bed->elf_backend_post_process_headers)
+ (*bed->elf_backend_post_process_headers) (abfd, link_info);
+
failed = false;
bfd_map_over_sections (abfd, elf_fake_sections, &failed);
if (failed)
@@ -3042,6 +3046,9 @@ prep_headers (abfd)
bfd_big_endian (abfd) ? ELFDATA2MSB : ELFDATA2LSB;
i_ehdrp->e_ident[EI_VERSION] = bed->s->ev_current;
+ i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_SYSV;
+ i_ehdrp->e_ident[EI_ABIVERSION] = 0;
+
for (count = EI_PAD; count < EI_NIDENT; count++)
i_ehdrp->e_ident[count] = 0;
@@ -3077,6 +3084,9 @@ prep_headers (abfd)
case bfd_arch_i860:
i_ehdrp->e_machine = EM_860;
break;
+ case bfd_arch_i960:
+ i_ehdrp->e_machine = EM_960;
+ break;
case bfd_arch_mips: /* MIPS Rxxxx */
i_ehdrp->e_machine = EM_MIPS; /* only MIPS R3000 */
break;
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h
index d4e97d6b9bf..f7ef578a164 100644
--- a/bfd/elf32-arm.h
+++ b/bfd/elf32-arm.h
@@ -34,7 +34,9 @@ static int elf32_arm_get_symbol_type
static struct bfd_link_hash_table *elf32_arm_link_hash_table_create
PARAMS ((bfd *));
static bfd_reloc_status_type elf32_arm_final_link_relocate
- PARAMS ((reloc_howto_type *, bfd *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, bfd_vma, struct bfd_link_info *, asection *, const char *, unsigned char));
+ PARAMS ((reloc_howto_type *, bfd *, bfd *, asection *, bfd_byte *,
+ Elf_Internal_Rela *, bfd_vma, struct bfd_link_info *, asection *,
+ const char *, unsigned char, struct elf_link_hash_entry *));
static insn32 insert_thumb_branch
PARAMS ((insn32, int));
@@ -46,6 +48,8 @@ static void record_arm_to_thumb_glue
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
static void record_thumb_to_arm_glue
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
+static void elf32_arm_post_process_headers
+ PARAMS ((bfd *, struct bfd_link_info *));
/* The linker script knows the section names for placement.
The entry_names are used to do simple name mangling on the stubs.
@@ -113,7 +117,7 @@ struct elf32_arm_pcrel_relocs_copied
bfd_size_type count;
};
-/* arm ELF linker hash entry. */
+/* Arm ELF linker hash entry. */
struct elf32_arm_link_hash_entry
{
@@ -154,9 +158,43 @@ struct elf32_arm_link_hash_table
/* An arbitary input BFD chosen to hold the glue sections. */
bfd * bfd_of_glue_owner;
+
+ /* A boolean indicating whether knowledge of the ARM's pipeline
+ length should be applied by the linker. */
+ int no_pipeline_knowledge;
};
+/* Create an entry in an ARM ELF linker hash table. */
+
+static struct bfd_hash_entry *
+elf32_arm_link_hash_newfunc (entry, table, string)
+ struct bfd_hash_entry * entry;
+ struct bfd_hash_table * table;
+ const char * string;
+{
+ struct elf32_arm_link_hash_entry * ret =
+ (struct elf32_arm_link_hash_entry *) entry;
+
+ /* Allocate the structure if it has not already been allocated by a
+ subclass. */
+ if (ret == (struct elf32_arm_link_hash_entry *) NULL)
+ ret = ((struct elf32_arm_link_hash_entry *)
+ bfd_hash_allocate (table,
+ sizeof (struct elf32_arm_link_hash_entry)));
+ if (ret == (struct elf32_arm_link_hash_entry *) NULL)
+ return (struct bfd_hash_entry *) ret;
+
+ /* Call the allocation method of the superclass. */
+ ret = ((struct elf32_arm_link_hash_entry *)
+ _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
+ table, string));
+ if (ret != (struct elf32_arm_link_hash_entry *) NULL)
+ ret->pcrel_relocs_copied = NULL;
+
+ return (struct bfd_hash_entry *) ret;
+}
+
/* Create an ARM elf linker hash table */
static struct bfd_link_hash_table *
@@ -171,7 +209,7 @@ elf32_arm_link_hash_table_create (abfd)
return NULL;
if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
- _bfd_elf_link_hash_newfunc))
+ elf32_arm_link_hash_newfunc))
{
bfd_release (abfd, ret);
return NULL;
@@ -180,6 +218,7 @@ elf32_arm_link_hash_table_create (abfd)
ret->thumb_glue_size = 0;
ret->arm_glue_size = 0;
ret->bfd_of_glue_owner = NULL;
+ ret->no_pipeline_knowledge = 0;
return &ret->root.root;
}
@@ -531,9 +570,10 @@ bfd_elf32_arm_get_bfd_for_interworking (abfd, info)
}
boolean
-bfd_elf32_arm_process_before_allocation (abfd, link_info)
+bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge)
bfd *abfd;
struct bfd_link_info *link_info;
+ int no_pipeline_knowledge;
{
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Rela *free_relocs = NULL;
@@ -559,6 +599,8 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info)
BFD_ASSERT (globals != NULL);
BFD_ASSERT (globals->bfd_of_glue_owner != NULL);
+ globals->no_pipeline_knowledge = no_pipeline_knowledge;
+
/* Rummage around all the relocs and map the glue vectors. */
sec = abfd->sections;
@@ -591,7 +633,7 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info)
r_index = ELF32_R_SYM (irel->r_info);
/* These are the only relocation types we care about */
- if (r_type != R_ARM_PC24
+ if ( r_type != R_ARM_PC24
&& r_type != R_ARM_THM_PC22)
continue;
@@ -943,7 +985,7 @@ elf32_arm_to_thumb_stub (info, name, input_bfd, output_bfd, input_section,
static bfd_reloc_status_type
elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
input_section, contents, rel, value,
- info, sym_sec, sym_name, sym_flags)
+ info, sym_sec, sym_name, sym_flags, h)
reloc_howto_type * howto;
bfd * input_bfd;
bfd * output_bfd;
@@ -955,6 +997,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
asection * sym_sec;
const char * sym_name;
unsigned char sym_flags;
+ struct elf_link_hash_entry * h;
{
unsigned long r_type = howto->type;
unsigned long r_symndx;
@@ -966,8 +1009,11 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
asection * sgot = NULL;
asection * splt = NULL;
asection * sreloc = NULL;
- struct elf_link_hash_entry * h = NULL;
bfd_vma addend;
+ bfd_signed_vma signed_addend;
+ struct elf32_arm_link_hash_table * globals;
+
+ globals = elf32_arm_hash_table (info);
dynobj = elf_hash_table (info)->dynobj;
if (dynobj)
@@ -981,9 +1027,18 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
r_symndx = ELF32_R_SYM (rel->r_info);
#ifdef USE_REL
- addend = (bfd_get_32 (input_bfd, hit_data) & howto->src_mask);
+ addend = bfd_get_32 (input_bfd, hit_data) & howto->src_mask;
+
+ if (addend & ((howto->src_mask + 1) >> 1))
+ {
+ signed_addend = -1;
+ signed_addend &= ~ howto->src_mask;
+ signed_addend |= addend;
+ }
+ else
+ signed_addend = addend;
#else
- addend = rel->r_addend;
+ addend = signed_addend = rel->r_addend;
#endif
switch (r_type)
@@ -1112,15 +1167,66 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
input_section, hit_data, sym_sec, rel->r_offset, addend, value);
return bfd_reloc_ok;
}
+
+ if ( strcmp (bfd_get_target (input_bfd), "elf32-littlearm-oabi") == 0
+ || strcmp (bfd_get_target (input_bfd), "elf32-bigarm-oabi") == 0)
+ {
+ /* The old way of doing things. Trearing the addend as a
+ byte sized field and adding in the pipeline offset. */
+
+ value -= (input_section->output_section->vma
+ + input_section->output_offset);
+ value -= rel->r_offset;
+ value += addend;
+
+ if (! globals->no_pipeline_knowledge)
+ value -= 8;
+ }
+ else
+ {
+ /* The ARM ELF ABI says that this reloc is computed as: S - P + A
+ where:
+ S is the address of the symbol in the relocation.
+ P is address of the instruction being relocated.
+ A is the addend (extracted from the instruction) in bytes.
+
+ S is held in 'value'.
+ P is the base address of the section containing the instruction
+ plus the offset of the reloc into that section, ie:
+ (input_section->output_section->vma +
+ input_section->output_offset +
+ rel->r_offset).
+ A is the addend, converted into bytes, ie:
+ (signed_addend * 4)
+
+ Note: None of these operations have knowledge of the pipeline
+ size of the processor, thus it is up to the assembler to encode
+ this information into the addend. */
+
+ value -= (input_section->output_section->vma
+ + input_section->output_offset);
+ value -= rel->r_offset;
+ value += (signed_addend << howto->size);
+
+ /* Previous versions of this code also used to add in the pipeline
+ offset here. This is wrong because the linker is not supposed
+ to know about such things, and one day it might change. In order
+ to support old binaries that need the old behaviour however, so
+ we attempt to detect which ABI was used to create the reloc. */
+ if (! globals->no_pipeline_knowledge)
+ {
+ Elf_Internal_Ehdr * i_ehdrp; /* Elf file header, internal form */
+
+ i_ehdrp = elf_elfheader (input_bfd);
+
+ if (i_ehdrp->e_ident[EI_OSABI] == 0)
+ value -= 8;
+ }
+ }
- value = value + addend;
- value -= (input_section->output_section->vma
- + input_section->output_offset + 8);
- value -= rel->r_offset;
- value = value >> howto->rightshift;
-
- value &= 0xffffff;
- value |= (bfd_get_32 (input_bfd, hit_data) & 0xff000000);
+ value >>= howto->rightshift;
+ value &= howto->dst_mask;
+ value |= (bfd_get_32 (input_bfd, hit_data) & (~ howto->dst_mask));
break;
case R_ARM_ABS32:
@@ -1190,26 +1296,25 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
case R_ARM_THM_PC22:
/* Thumb BL (branch long instruction). */
{
- bfd_vma relocation;
- boolean overflow = false;
- bfd_vma upper_insn = bfd_get_16 (input_bfd, hit_data);
- bfd_vma lower_insn = bfd_get_16 (input_bfd, hit_data + 2);
- bfd_vma src_mask = 0x007FFFFE;
+ bfd_vma relocation;
+ boolean overflow = false;
+ bfd_vma upper_insn = bfd_get_16 (input_bfd, hit_data);
+ bfd_vma lower_insn = bfd_get_16 (input_bfd, hit_data + 2);
+ bfd_vma src_mask = 0x007FFFFE;
bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1;
- bfd_signed_vma reloc_signed_min = ~reloc_signed_max;
- bfd_vma check;
+ bfd_signed_vma reloc_signed_min = ~ reloc_signed_max;
+ bfd_vma check;
bfd_signed_vma signed_check;
- bfd_vma add;
- bfd_signed_vma signed_add;
#ifdef USE_REL
/* Need to refetch the addend and squish the two 11 bit pieces
together. */
{
- bfd_vma upper = bfd_get_16 (input_bfd, hit_data) & 0x7ff;
- bfd_vma lower = bfd_get_16 (input_bfd, hit_data + 2) & 0x7ff;
+ bfd_vma upper = upper_insn & 0x7ff;
+ bfd_vma lower = lower_insn & 0x7ff;
upper = (upper ^ 0x400) - 0x400; /* sign extend */
addend = (upper << 12) | (lower << 1);
+ signed_addend = addend;
}
#endif
@@ -1223,13 +1328,30 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
else
return bfd_reloc_dangerous;
}
-
- /* +4: pc is offset by 4 */
- relocation = value + addend + 4;
+
+ relocation = value + signed_addend;
+
relocation -= (input_section->output_section->vma
- + input_section->output_offset);
- relocation -= rel->r_offset;
-
+ + input_section->output_offset
+ + rel->r_offset);
+
+ if (! globals->no_pipeline_knowledge)
+ {
+ Elf_Internal_Ehdr * i_ehdrp; /* Elf file header, internal form */
+
+ i_ehdrp = elf_elfheader (input_bfd);
+
+ /* Previous versions of this code also used to add in the pipline
+ offset here. This is wrong because the linker is not supposed
+ to know about such things, and one day it might change. In order
+ to support old binaries that need the old behaviour however, so
+ we attempt to detect which ABI was used to create the reloc. */
+ if ( strcmp (bfd_get_target (input_bfd), "elf32-littlearm-oabi") == 0
+ || strcmp (bfd_get_target (input_bfd), "elf32-bigarm-oabi") == 0
+ || i_ehdrp->e_ident[EI_OSABI] == 0)
+ relocation += 4;
+ }
+
check = relocation >> howto->rightshift;
/* If this is a signed value, the rightshift just dropped
@@ -1239,17 +1361,8 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
else
signed_check = check | ~((bfd_vma) -1 >> howto->rightshift);
- add = ((upper_insn & 0x7ff) << 12) | ((lower_insn & 0x7ff) << 1);
- /* sign extend */
- signed_add = (add ^ 0x400000) - 0x400000;
-
- /* Add the value from the object file. */
- signed_check += signed_add;
- relocation += signed_add;
-
/* Assumes two's complement. */
- if (signed_check > reloc_signed_max
- || signed_check < reloc_signed_min)
+ if (signed_check > reloc_signed_max || signed_check < reloc_signed_min)
overflow = true;
/* Put RELOCATION back into the insn. */
@@ -1483,25 +1596,25 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
relend = relocs + input_section->reloc_count;
for (; rel < relend; rel++)
{
- int r_type;
- reloc_howto_type * howto;
- unsigned long r_symndx;
- Elf_Internal_Sym * sym;
- asection * sec;
+ int r_type;
+ reloc_howto_type * howto;
+ unsigned long r_symndx;
+ Elf_Internal_Sym * sym;
+ asection * sec;
struct elf_link_hash_entry * h;
- bfd_vma relocation;
- bfd_reloc_status_type r;
-
+ bfd_vma relocation;
+ bfd_reloc_status_type r;
+ arelent bfd_reloc;
+
r_symndx = ELF32_R_SYM (rel->r_info);
- r_type = ELF32_R_TYPE (rel->r_info);
+ r_type = ELF32_R_TYPE (rel->r_info);
- if (r_type == R_ARM_GNU_VTENTRY
- || r_type == R_ARM_GNU_VTINHERIT )
+ if ( r_type == R_ARM_GNU_VTENTRY
+ || r_type == R_ARM_GNU_VTINHERIT)
continue;
- /* ScottB: range check r_type here. */
-
- howto = elf32_arm_howto_table + r_type;
+ elf32_arm_info_to_howto (input_bfd, & bfd_reloc, rel);
+ howto = bfd_reloc.howto;
if (info->relocateable)
{
@@ -1518,8 +1631,14 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
#ifdef USE_REL
{
bfd_vma val;
- val = bfd_get_32 (input_bfd, contents + rel->r_offset);
- val += (sec->output_offset + sym->st_value) >> howto->rightshift;
+ bfd_vma insn;
+
+ insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
+ val = insn + ((sec->output_offset + sym->st_value)
+ >> howto->rightshift);
+ val &= howto->dst_mask;
+ val |= insn & ~(howto->dst_mask);
+
bfd_put_32 (input_bfd, val, contents + rel->r_offset);
}
#else
@@ -1553,11 +1672,9 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
if (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
{
- sec = h->root.u.def.section;
+ int relocation_needed = 1;
- relocation = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
+ sec = h->root.u.def.section;
/* In these cases, we don't need the relocation value.
We check specially because in some obscure cases
@@ -1569,15 +1686,15 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
if (info->shared
&& (
(!info->symbolic && h->dynindx != -1)
- || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR == 0)
+ || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
)
&& ((input_section->flags & SEC_ALLOC) != 0)
)
- relocation = 0;
+ relocation_needed = 0;
break;
case R_ARM_GOTPC:
- relocation = 0;
+ relocation_needed = 0;
break;
case R_ARM_GOT32:
@@ -1587,12 +1704,12 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
|| (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
)
)
- relocation = 0;
+ relocation_needed = 0;
break;
case R_ARM_PLT32:
if (h->plt.offset != (bfd_vma)-1)
- relocation = 0;
+ relocation_needed = 0;
break;
default:
@@ -1602,9 +1719,16 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
(_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
bfd_get_filename (input_bfd), h->root.root.string,
bfd_get_section_name (input_bfd, input_section));
- relocation = 0;
+ relocation_needed = 0;
}
}
+
+ if (relocation_needed)
+ relocation = h->root.u.def.value
+ + sec->output_section->vma
+ + sec->output_offset;
+ else
+ relocation = 0;
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
@@ -1632,7 +1756,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
input_section, contents, rel,
relocation, info, sec, name,
(h ? ELF_ST_TYPE (h->type) :
- ELF_ST_TYPE (sym->st_info)));
+ ELF_ST_TYPE (sym->st_info)), h);
if (r != bfd_reloc_ok)
{
@@ -1957,6 +2081,8 @@ elf32_arm_gc_mark_hook (abfd, info, rel, h, sym)
return NULL;
}
+/* Update the got entry reference counts for the section being removed. */
+
static boolean
elf32_arm_gc_sweep_hook (abfd, info, sec, relocs)
bfd *abfd;
@@ -1964,14 +2090,12 @@ elf32_arm_gc_sweep_hook (abfd, info, sec, relocs)
asection *sec;
const Elf_Internal_Rela *relocs;
{
- /* we don't use got and plt entries for armelf */
+ /* We don't support garbage collection of GOT and PLT relocs yet. */
return true;
}
-/* Look through the relocs for a section during the first phase.
- Since we don't do .gots or .plts, we just need to consider the
- virtual table relocs for gc. */
-
+/* Look through the relocs for a section during the first phase. */
+
static boolean
elf32_arm_check_relocs (abfd, info, sec, relocs)
bfd * abfd;
@@ -2978,6 +3102,20 @@ elf32_arm_finish_dynamic_sections (output_bfd, info)
return true;
}
+static void
+elf32_arm_post_process_headers (abfd, link_info)
+ bfd * abfd;
+ struct bfd_link_info * link_info;
+{
+ Elf_Internal_Ehdr * i_ehdrp; /* Elf file header, internal form */
+
+ i_ehdrp = elf_elfheader (abfd);
+
+ i_ehdrp->e_ident[EI_OSABI] = ARM_ELF_OS_ABI_VERSION;
+ i_ehdrp->e_ident[EI_ABIVERSION] = ARM_ELF_ABI_VERSION;
+}
+
+
#define ELF_ARCH bfd_arch_arm
#define ELF_MACHINE_CODE EM_ARM
#define ELF_MAXPAGE_SIZE 0x8000
@@ -3001,6 +3139,7 @@ elf32_arm_finish_dynamic_sections (output_bfd, info)
#define elf_backend_finish_dynamic_symbol elf32_arm_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections elf32_arm_finish_dynamic_sections
#define elf_backend_size_dynamic_sections elf32_arm_size_dynamic_sections
+#define elf_backend_post_process_headers elf32_arm_post_process_headers
#define elf_backend_can_gc_sections 1
#define elf_backend_plt_readonly 1
diff --git a/bfd/elf32-i960.c b/bfd/elf32-i960.c
new file mode 100644
index 00000000000..7a3fd56d996
--- /dev/null
+++ b/bfd/elf32-i960.c
@@ -0,0 +1,167 @@
+/* Intel 860 specific support for 32-bit ELF
+ Copyright 1999 Free Software Foundation, Inc.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+#include "elf/i960.h"
+
+static bfd_reloc_status_type elf32_i960_relocate
+ PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+static reloc_howto_type *elf32_i960_reloc_type_lookup
+ PARAMS ((bfd *, bfd_reloc_code_real_type));
+
+#define USE_REL 1
+
+#define bfd_elf32_bfd_reloc_type_lookup elf32_i960_reloc_type_lookup
+#define elf_info_to_howto elf32_i960_info_to_howto
+#define elf_info_to_howto_rel elf32_i960_info_to_howto_rel
+
+static reloc_howto_type elf_howto_table[]=
+{
+ HOWTO(R_960_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ elf32_i960_relocate, "R_960_NONE", true,
+ 0x00000000, 0x00000000, false),
+ { 1 },
+ HOWTO (R_960_32, 0, 2, 32, false, 0, complain_overflow_bitfield,
+ elf32_i960_relocate, "R_960_32", true,
+ 0xffffffff, 0xffffffff, false),
+ HOWTO (R_960_IP24, 0, 2, 24, true, 0, complain_overflow_signed,
+ elf32_i960_relocate, "R_960_IP24 ", true,
+ 0x00ffffff, 0x00ffffff, false),
+ { 4 },
+ { 5 },
+ { 6 },
+ { 7 }
+};
+
+static enum elf_i960_reloc_type
+elf32_i960_bfd_to_reloc_type (bfd_reloc_code_real_type code)
+{
+ switch (code)
+ {
+ default:
+ return R_960_NONE;
+ case BFD_RELOC_I960_CALLJ:
+ return R_960_OPTCALL;
+ case BFD_RELOC_32:
+ case BFD_RELOC_CTOR:
+ return R_960_32;
+ case BFD_RELOC_24_PCREL:
+ return R_960_IP24;
+ }
+}
+
+static void
+elf32_i960_info_to_howto (abfd, cache_ptr, dst)
+ bfd *abfd;
+ arelent *cache_ptr;
+ Elf32_Internal_Rela *dst;
+{
+ abort ();
+}
+
+static void
+elf32_i960_info_to_howto_rel (abfd, cache_ptr, dst)
+ bfd *abfd;
+ arelent *cache_ptr;
+ Elf32_Internal_Rel *dst;
+{
+ enum elf_i960_reloc_type type;
+
+ type = (enum elf_i960_reloc_type) ELF32_R_TYPE (dst->r_info);
+ BFD_ASSERT (type < R_960_max);
+
+ cache_ptr->howto = &elf_howto_table[(int) type];
+}
+
+/* ELF relocs are against symbols. If we are producing relocateable
+ output, and the reloc is against an external symbol, and nothing
+ has given us any additional addend, the resulting reloc will also
+ be against the same symbol. In such a case, we don't want to
+ change anything about the way the reloc is handled, since it will
+ all be done at final link time. Rather than put special case code
+ into bfd_perform_relocation, all the reloc types use this howto
+ function. It just short circuits the reloc if producing
+ relocateable output against an external symbol. */
+
+/*ARGSUSED*/
+bfd_reloc_status_type
+elf32_i960_relocate (abfd,
+ reloc_entry,
+ symbol,
+ data,
+ input_section,
+ output_bfd,
+ error_message)
+ bfd *abfd;
+ arelent *reloc_entry;
+ asymbol *symbol;
+ PTR data;
+ asection *input_section;
+ bfd *output_bfd;
+ char **error_message;
+{
+ /* HACK: I think this first condition is necessary when producing
+ relocatable output. After the end of HACK, the code is identical
+ to bfd_elf_generic_reloc(). I would _guess_ the first change
+ belongs there rather than here. martindo 1998-10-23. */
+ if (output_bfd != (bfd *) NULL
+ && reloc_entry->howto->pc_relative
+ && !reloc_entry->howto->pcrel_offset)
+ {
+ reloc_entry->addend -= symbol->value;
+ }
+ /* This is more dubious. */
+ else if (output_bfd != (bfd *) NULL
+ && (symbol->flags & BSF_SECTION_SYM) != 0)
+ {
+ reloc_entry->addend -= symbol->section->output_section->vma;
+ }
+ else
+ {
+ /* end of HACK */
+ if (output_bfd != (bfd *) NULL
+ && (symbol->flags & BSF_SECTION_SYM) == 0
+ && (! reloc_entry->howto->partial_inplace
+ || reloc_entry->addend == 0))
+ {
+ reloc_entry->address += input_section->output_offset;
+ return bfd_reloc_ok;
+ }
+ }
+
+ return bfd_reloc_continue;
+}
+
+static reloc_howto_type *
+elf32_i960_reloc_type_lookup (abfd, code)
+ bfd *abfd;
+ bfd_reloc_code_real_type code;
+{
+ return elf_howto_table + elf32_i960_bfd_to_reloc_type (code);
+}
+
+#define TARGET_LITTLE_SYM bfd_elf32_i960_vec
+#define TARGET_LITTLE_NAME "elf32-i960"
+#define ELF_ARCH bfd_arch_i960
+#define ELF_MACHINE_CODE EM_960
+
+#include "elf32-target.h"
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index 2d0aba210fb..23ecf36a142 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -56,6 +56,15 @@ static boolean elf_m68k_finish_dynamic_symbol
static boolean elf_m68k_finish_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
+static boolean elf32_m68k_set_private_flags
+ PARAMS ((bfd *, flagword));
+static boolean elf32_m68k_copy_private_bfd_data
+ PARAMS ((bfd *, bfd *));
+static boolean elf32_m68k_merge_private_bfd_data
+ PARAMS ((bfd *, bfd *));
+static boolean elf32_m68k_print_private_bfd_data
+ PARAMS ((bfd *, PTR));
+
static reloc_howto_type howto_table[] = {
HOWTO(R_68K_NONE, 0, 0, 0, false,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_NONE", false, 0, 0x00000000,false),
HOWTO(R_68K_32, 0, 2,32, false,0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_32", false, 0, 0xffffffff,false),
@@ -211,6 +220,33 @@ static const bfd_byte elf_m68k_plt_entry[PLT_ENTRY_SIZE] =
0, 0, 0, 0 /* replaced with offset to start of .plt. */
};
+#define CPU32_FLAG(abfd) (elf_elfheader (abfd)->e_flags & EF_CPU32)
+
+#define PLT_CPU32_ENTRY_SIZE 24
+/* Procedure linkage table entries for the cpu32 */
+static const bfd_byte elf_cpu32_plt0_entry[PLT_CPU32_ENTRY_SIZE] =
+{
+ 0x20, 0x7b, 0x01, 0x70, /* moveal %pc@(0xc), %a0 */
+ 0, 0, 0, 0, /* replaced with offset to .got + 4. */
+ 0x4e, 0xd0, /* jmp %a0@ */
+ 0, 0, 0, 0, /* replace with offset to .got +8. */
+ 0, 0, 0, 0, /* pad out to 24 bytes. */
+ 0, 0, 0, 0, /* pad out to 24 bytes. */
+ 0, 0
+};
+
+static const bfd_byte elf_cpu32_plt_entry[PLT_CPU32_ENTRY_SIZE] =
+{
+ 0x20, 0x7b, 0x01, 0x70, /* moveal %pc@(0xc), %a0 */
+ 0, 0, 0, 0, /* replaced with offset to symbol's .got entry. */
+ 0x4e, 0xd0, /* jmp %a0@ */
+ 0x2f, 0x3c, /* move.l #offset,-(%sp) */
+ 0, 0, 0, 0, /* replaced with offset into relocation table. */
+ 0x60, 0xff, /* bra.l .plt */
+ 0, 0, 0, 0, /* replaced with offset to start of .plt. */
+ 0, 0
+};
+
/* The m68k linker needs to keep track of the number of relocs that it
decides to copy in check_relocs for each symbol. This is so that it
can discard PC relative relocs if it doesn't need them when linking
@@ -320,6 +356,88 @@ elf_m68k_link_hash_table_create (abfd)
return &ret->root.root;
}
+/* Keep m68k-specific flags in the ELF header */
+static boolean
+elf32_m68k_set_private_flags (abfd, flags)
+ bfd *abfd;
+ flagword flags;
+{
+ elf_elfheader (abfd)->e_flags = flags;
+ elf_flags_init (abfd) = true;
+ return true;
+}
+
+/* Copy m68k-specific data from one module to another */
+static boolean
+elf32_m68k_copy_private_bfd_data (ibfd, obfd)
+ bfd *ibfd;
+ bfd *obfd;
+{
+ flagword in_flags;
+
+ if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+ || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+ return true;
+
+ in_flags = elf_elfheader (ibfd)->e_flags;
+
+ elf_elfheader (obfd)->e_flags = in_flags;
+ elf_flags_init (obfd) = true;
+
+ return true;
+}
+
+/* Merge backend specific data from an object file to the output
+ object file when linking. */
+static boolean
+elf32_m68k_merge_private_bfd_data (ibfd, obfd)
+ bfd *ibfd;
+ bfd *obfd;
+{
+ flagword out_flags;
+ flagword in_flags;
+
+ if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+ || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+ return true;
+
+ in_flags = elf_elfheader (ibfd)->e_flags;
+ out_flags = elf_elfheader (obfd)->e_flags;
+
+ if (!elf_flags_init (obfd))
+ {
+ elf_flags_init (obfd) = true;
+ elf_elfheader (obfd)->e_flags = in_flags;
+ }
+
+ return true;
+}
+
+/* Display the flags field */
+static boolean
+elf32_m68k_print_private_bfd_data (abfd, ptr)
+ bfd *abfd;
+ PTR ptr;
+{
+ FILE *file = (FILE *) ptr;
+
+ BFD_ASSERT (abfd != NULL && ptr != NULL);
+
+ /* Print normal ELF private data. */
+ _bfd_elf_print_private_bfd_data (abfd, ptr);
+
+ /* Ignore init flag - it may not be set, despite the flags field containing valid data. */
+
+ /* xgettext:c-format */
+ fprintf (file, _ ("private flags = %lx:"), elf_elfheader (abfd)->e_flags);
+
+ if (elf_elfheader (abfd)->e_flags & EF_CPU32)
+ fprintf (file, _ (" [cpu32]"));
+
+ fputc ('\n', file);
+
+ return true;
+}
/* Look through the relocs for a section during the first phase, and
allocate space in the global offset table or procedure linkage
table. */
@@ -890,7 +1008,12 @@ elf_m68k_adjust_dynamic_symbol (info, h)
/* If this is the first .plt entry, make room for the special
first entry. */
if (s->_raw_size == 0)
- s->_raw_size += PLT_ENTRY_SIZE;
+ {
+ if (CPU32_FLAG (dynobj))
+ s->_raw_size += PLT_CPU32_ENTRY_SIZE;
+ else
+ s->_raw_size += PLT_ENTRY_SIZE;
+ }
/* If this symbol is not defined in a regular file, and we are
not generating a shared library, then set the symbol to this
@@ -907,7 +1030,10 @@ elf_m68k_adjust_dynamic_symbol (info, h)
h->plt.offset = s->_raw_size;
/* Make room for this entry. */
- s->_raw_size += PLT_ENTRY_SIZE;
+ if (CPU32_FLAG (dynobj))
+ s->_raw_size += PLT_CPU32_ENTRY_SIZE;
+ else
+ s->_raw_size += PLT_ENTRY_SIZE;
/* We also need to make an entry in the .got.plt section, which
will be placed in the .got section by the linker script. */
@@ -1776,6 +1902,7 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
Elf_Internal_Sym *sym;
{
bfd *dynobj;
+ int plt_off1, plt_off2, plt_off3;
dynobj = elf_hash_table (info)->dynobj;
@@ -1802,16 +1929,35 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
corresponds to this symbol. This is the index of this symbol
in all the symbols for which we are making plt entries. The
first entry in the procedure linkage table is reserved. */
- plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
+ if ( CPU32_FLAG (output_bfd))
+ plt_index = h->plt.offset / PLT_CPU32_ENTRY_SIZE - 1;
+ else
+ plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
/* Get the offset into the .got table of the entry that
corresponds to this function. Each .got entry is 4 bytes.
The first three are reserved. */
got_offset = (plt_index + 3) * 4;
- /* Fill in the entry in the procedure linkage table. */
- memcpy (splt->contents + h->plt.offset, elf_m68k_plt_entry,
- PLT_ENTRY_SIZE);
+ if ( CPU32_FLAG (output_bfd))
+ {
+ /* Fill in the entry in the procedure linkage table. */
+ memcpy (splt->contents + h->plt.offset, elf_cpu32_plt_entry,
+ PLT_CPU32_ENTRY_SIZE);
+ plt_off1 = 4;
+ plt_off2 = 12;
+ plt_off3 = 18;
+ }
+ else
+ {
+ /* Fill in the entry in the procedure linkage table. */
+ memcpy (splt->contents + h->plt.offset, elf_m68k_plt_entry,
+ PLT_ENTRY_SIZE);
+ plt_off1 = 4;
+ plt_off2 = 10;
+ plt_off3 = 16;
+ }
+
/* The offset is relative to the first extension word. */
bfd_put_32 (output_bfd,
(sgot->output_section->vma
@@ -1819,12 +1965,12 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
+ got_offset
- (splt->output_section->vma
+ h->plt.offset + 2)),
- splt->contents + h->plt.offset + 4);
+ splt->contents + h->plt.offset + plt_off1);
bfd_put_32 (output_bfd, plt_index * sizeof (Elf32_External_Rela),
- splt->contents + h->plt.offset + 10);
- bfd_put_32 (output_bfd, - (h->plt.offset + 16),
- splt->contents + h->plt.offset + 16);
+ splt->contents + h->plt.offset + plt_off2);
+ bfd_put_32 (output_bfd, - (h->plt.offset + plt_off3),
+ splt->contents + h->plt.offset + plt_off3);
/* Fill in the entry in the global offset table. */
bfd_put_32 (output_bfd,
@@ -1941,6 +2087,7 @@ elf_m68k_finish_dynamic_sections (output_bfd, info)
bfd *dynobj;
asection *sgot;
asection *sdyn;
+ int plt_entry0_size, plt_off1, plt_off2;
dynobj = elf_hash_table (info)->dynobj;
@@ -2017,21 +2164,39 @@ elf_m68k_finish_dynamic_sections (output_bfd, info)
/* Fill in the first entry in the procedure linkage table. */
if (splt->_raw_size > 0)
{
- memcpy (splt->contents, elf_m68k_plt0_entry, PLT_ENTRY_SIZE);
- bfd_put_32 (output_bfd,
- (sgot->output_section->vma
- + sgot->output_offset + 4
- - (splt->output_section->vma + 2)),
- splt->contents + 4);
- bfd_put_32 (output_bfd,
- (sgot->output_section->vma
- + sgot->output_offset + 8
- - (splt->output_section->vma + 10)),
- splt->contents + 12);
+ if (!CPU32_FLAG (output_bfd))
+ {
+ memcpy (splt->contents, elf_m68k_plt0_entry, PLT_ENTRY_SIZE);
+ bfd_put_32 (output_bfd,
+ (sgot->output_section->vma
+ + sgot->output_offset + 4
+ - (splt->output_section->vma + 2)),
+ splt->contents + 4);
+ bfd_put_32 (output_bfd,
+ (sgot->output_section->vma
+ + sgot->output_offset + 8
+ - (splt->output_section->vma + 10)),
+ splt->contents + 12);
+ elf_section_data (splt->output_section)->this_hdr.sh_entsize
+ = PLT_ENTRY_SIZE;
+ }
+ else /* cpu32 */
+ {
+ memcpy (splt->contents, elf_cpu32_plt0_entry, PLT_CPU32_ENTRY_SIZE);
+ bfd_put_32 (output_bfd,
+ (sgot->output_section->vma
+ + sgot->output_offset + 4
+ - (splt->output_section->vma + 2)),
+ splt->contents + 4);
+ bfd_put_32 (output_bfd,
+ (sgot->output_section->vma
+ + sgot->output_offset + 8
+ - (splt->output_section->vma + 10)),
+ splt->contents + 10);
+ elf_section_data (splt->output_section)->this_hdr.sh_entsize
+ = PLT_CPU32_ENTRY_SIZE;
+ }
}
-
- elf_section_data (splt->output_section)->this_hdr.sh_entsize
- = PLT_ENTRY_SIZE;
}
/* Fill in the first three entries in the global offset table. */
@@ -2118,11 +2283,19 @@ elf_m68k_finish_dynamic_sections (output_bfd, info)
elf_m68k_finish_dynamic_sections
#define elf_backend_gc_mark_hook elf_m68k_gc_mark_hook
#define elf_backend_gc_sweep_hook elf_m68k_gc_sweep_hook
+#define bfd_elf32_bfd_copy_private_bfd_data \
+ elf32_m68k_copy_private_bfd_data
+#define bfd_elf32_bfd_merge_private_bfd_data \
+ elf32_m68k_merge_private_bfd_data
+#define bfd_elf32_bfd_set_private_flags \
+ elf32_m68k_set_private_flags
+#define bfd_elf32_bfd_print_private_bfd_data \
+ elf32_m68k_print_private_bfd_data
+
#define elf_backend_can_gc_sections 1
#define elf_backend_want_got_plt 1
#define elf_backend_plt_readonly 1
#define elf_backend_want_plt_sym 0
#define elf_backend_got_header_size 12
-#define elf_backend_plt_header_size PLT_ENTRY_SIZE
#include "elf32-target.h"
diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c
index ef3a39f1957..0f78002dcfe 100644
--- a/bfd/elf32-mcore.c
+++ b/bfd/elf32-mcore.c
@@ -196,6 +196,20 @@ static reloc_howto_type mcore_elf_howto_raw[] =
0, /* src_mask */
0, /* dst_mask */
false), /* pcrel_offset */
+
+ HOWTO (R_MCORE_RELATIVE, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_MCORE_RELATIVE", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ true) /* pcrel_offset */
};
#ifndef NUM_ELEM
@@ -239,6 +253,7 @@ mcore_elf_reloc_type_lookup (abfd, code)
case BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2: mcore_reloc = R_MCORE_PCRELJSR_IMM11BY2; break;
case BFD_RELOC_VTABLE_INHERIT: mcore_reloc = R_MCORE_GNU_VTINHERIT; break;
case BFD_RELOC_VTABLE_ENTRY: mcore_reloc = R_MCORE_GNU_VTENTRY; break;
+ case BFD_RELOC_RVA: mcore_reloc = R_MCORE_RELATIVE; break;
default:
return (reloc_howto_type *)NULL;
}
@@ -532,9 +547,6 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section,
switch (r_type)
{
default:
- case R_MCORE_PCRELIMM8BY4:
- case R_MCORE_PCRELIMM11BY2:
- case R_MCORE_PCRELIMM4BY2:
break;
case R_MCORE_PCRELJSR_IMM11BY2:
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index 9f03262eb38..6828ba00041 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -47,6 +47,8 @@ static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type));
static void mips_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *));
+static void mips_info_to_howto_rela
+ PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *));
static void bfd_mips_elf32_swap_gptab_in
PARAMS ((bfd *, const Elf32_External_gptab *, Elf32_gptab *));
static void bfd_mips_elf32_swap_gptab_out
@@ -297,6 +299,10 @@ static void bfd_elf32_swap_crinfo_out
#define USE_REL 1 /* MIPS uses REL relocations instead of RELA */
+/* In case we're on a 32-bit machine, construct a 64-bit "-1" value
+ from smaller values. Start with zero, widen, *then* decrement. */
+#define MINUS_ONE (((bfd_vma)0) - 1)
+
static reloc_howto_type elf_mips_howto_table[] =
{
/* No relocation. */
@@ -634,8 +640,21 @@ static reloc_howto_type elf_mips_howto_table[] =
0x0000ffff, /* dst_mask */
false), /* pcrel_offset */
- /* 64 bit subtraction. Presumably not used in 32 bit ELF. */
- { R_MIPS_SUB },
+ /* 64 bit subtraction. Used in the N32 ABI. */
+ /* FIXME: Not handled correctly. */
+ HOWTO (R_MIPS_SUB, /* type */
+ 0, /* rightshift */
+ 4, /* size (0 = byte, 1 = short, 2 = long) */
+ 64, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MIPS_SUB", /* name */
+ true, /* partial_inplace */
+ MINUS_ONE, /* src_mask */
+ MINUS_ONE, /* dst_mask */
+ false), /* pcrel_offset */
/* Used to cause the linker to insert and delete instructions? */
{ R_MIPS_INSERT_A },
@@ -1607,7 +1626,11 @@ static CONST struct elf_reloc_map mips_reloc_map[] =
{ BFD_RELOC_MIPS_GOT_HI16, R_MIPS_GOT_HI16 },
{ BFD_RELOC_MIPS_GOT_LO16, R_MIPS_GOT_LO16 },
{ BFD_RELOC_MIPS_CALL_HI16, R_MIPS_CALL_HI16 },
- { BFD_RELOC_MIPS_CALL_LO16, R_MIPS_CALL_LO16 }
+ { BFD_RELOC_MIPS_CALL_LO16, R_MIPS_CALL_LO16 },
+ { BFD_RELOC_MIPS_SUB, R_MIPS_SUB },
+ { BFD_RELOC_MIPS_GOT_PAGE, R_MIPS_GOT_PAGE },
+ { BFD_RELOC_MIPS_GOT_OFST, R_MIPS_GOT_OFST },
+ { BFD_RELOC_MIPS_GOT_DISP, R_MIPS_GOT_DISP }
};
/* Given a BFD reloc type, return a howto structure. */
@@ -1651,7 +1674,7 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code)
}
}
-/* Given a MIPS reloc type, fill in an arelent structure. */
+/* Given a MIPS Elf32_Internal_Rel, fill in an arelent structure. */
static void
mips_info_to_howto_rel (abfd, cache_ptr, dst)
@@ -1692,6 +1715,23 @@ mips_info_to_howto_rel (abfd, cache_ptr, dst)
|| r_type == (unsigned int) R_MIPS_LITERAL))
cache_ptr->addend = elf_gp (abfd);
}
+
+/* Given a MIPS Elf32_Internal_Rela, fill in an arelent structure. */
+
+static void
+mips_info_to_howto_rela (abfd, cache_ptr, dst)
+ bfd *abfd;
+ arelent *cache_ptr;
+ Elf32_Internal_Rela *dst;
+{
+ /* Since an Elf32_Internal_Rel is an initial prefix of an
+ Elf32_Internal_Rela, we can just use mips_info_to_howto_rel
+ above. */
+ mips_info_to_howto_rel (abfd, cache_ptr, (Elf32_Internal_Rel *) dst);
+
+ /* If we ever need to do any extra processing with dst->r_addend
+ (the field omitted in an Elf32_Internal_Rel) we can do it here. */
+}
/* A .reginfo section holds a single Elf32_RegInfo structure. These
routines swap this structure in and out. They are used outside of
@@ -1992,7 +2032,7 @@ _bfd_mips_elf_final_write_processing (abfd, linker)
sec = bfd_get_section_by_name (abfd,
name + sizeof ".MIPS.content" - 1);
BFD_ASSERT (sec != NULL);
- (*hdrpp)->sh_info = elf_section_data (sec)->this_idx;
+ (*hdrpp)->sh_link = elf_section_data (sec)->this_idx;
break;
case SHT_MIPS_SYMBOL_LIB:
@@ -2527,9 +2567,10 @@ _bfd_mips_elf_fake_sections (abfd, hdr, sec)
hdr->sh_type = SHT_MIPS_IFACE;
hdr->sh_flags |= SHF_MIPS_NOSTRIP;
}
- else if (strcmp (name, ".MIPS.content") == 0)
+ else if (strncmp (name, ".MIPS.content", strlen (".MIPS.content")) == 0)
{
hdr->sh_type = SHT_MIPS_CONTENT;
+ hdr->sh_flags |= SHF_MIPS_NOSTRIP;
/* The sh_info field is set in final_write_processing. */
}
else if (strcmp (name, ".options") == 0
@@ -7743,7 +7784,7 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap =
#define elf_backend_collect true
#define elf_backend_type_change_ok true
#define elf_backend_can_gc_sections true
-#define elf_info_to_howto 0
+#define elf_info_to_howto mips_info_to_howto_rela
#define elf_info_to_howto_rel mips_info_to_howto_rel
#define elf_backend_sym_is_global mips_elf_sym_is_global
#define elf_backend_object_p mips_elf32_object_p
diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c
index e71353df55f..08d4b75c234 100644
--- a/bfd/elf32-v850.c
+++ b/bfd/elf32-v850.c
@@ -143,7 +143,7 @@ static reloc_howto_type v850_elf_howto_table[] =
complain_overflow_dont, /* complain_on_overflow */
v850_elf_reloc, /* special_function */
"R_V850_HI16_S", /* name */
- true, /* partial_inplace */
+ false, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
false), /* pcrel_offset */
@@ -158,7 +158,7 @@ static reloc_howto_type v850_elf_howto_table[] =
complain_overflow_dont, /* complain_on_overflow */
v850_elf_reloc, /* special_function */
"R_V850_HI16", /* name */
- true, /* partial_inplace */
+ false, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
false), /* pcrel_offset */
@@ -173,7 +173,7 @@ static reloc_howto_type v850_elf_howto_table[] =
complain_overflow_dont, /* complain_on_overflow */
v850_elf_reloc, /* special_function */
"R_V850_LO16", /* name */
- true, /* partial_inplace */
+ false, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
false), /* pcrel_offset */
@@ -188,7 +188,7 @@ static reloc_howto_type v850_elf_howto_table[] =
complain_overflow_dont, /* complain_on_overflow */
v850_elf_reloc, /* special_function */
"R_V850_32", /* name */
- true, /* partial_inplace */
+ false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
@@ -203,7 +203,7 @@ static reloc_howto_type v850_elf_howto_table[] =
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_V850_16", /* name */
- true, /* partial_inplace */
+ false, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
false), /* pcrel_offset */
@@ -218,7 +218,7 @@ static reloc_howto_type v850_elf_howto_table[] =
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_V850_8", /* name */
- true, /* partial_inplace */
+ false, /* partial_inplace */
0xff, /* src_mask */
0xff, /* dst_mask */
false), /* pcrel_offset */
diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c
index 9fb8bb9c85e..05001a61620 100644
--- a/bfd/elf64-mips.c
+++ b/bfd/elf64-mips.c
@@ -1255,7 +1255,11 @@ static CONST struct elf_reloc_map mips_reloc_map[] =
{ BFD_RELOC_MIPS_GOT_HI16, R_MIPS_GOT_HI16 },
{ BFD_RELOC_MIPS_GOT_LO16, R_MIPS_GOT_LO16 },
{ BFD_RELOC_MIPS_CALL_HI16, R_MIPS_CALL_HI16 },
- { BFD_RELOC_MIPS_CALL_LO16, R_MIPS_CALL_LO16 }
+ { BFD_RELOC_MIPS_CALL_LO16, R_MIPS_CALL_LO16 },
+ { BFD_RELOC_MIPS_SUB, R_MIPS_SUB },
+ { BFD_RELOC_MIPS_GOT_PAGE, R_MIPS_GOT_PAGE },
+ { BFD_RELOC_MIPS_GOT_OFST, R_MIPS_GOT_OFST },
+ { BFD_RELOC_MIPS_GOT_DISP, R_MIPS_GOT_DISP }
};
/* Given a BFD reloc type, return a howto structure. */
diff --git a/bfd/elfarm-nabi.c b/bfd/elfarm-nabi.c
index 5952e74e5ef..87cfada1138 100644
--- a/bfd/elfarm-nabi.c
+++ b/bfd/elfarm-nabi.c
@@ -35,8 +35,10 @@
#define TARGET_BIG_NAME "elf32-bigarm"
#define elf_info_to_howto 0
-#define elf_info_to_howto_rel elf32_arm_info_to_howto_rel
+#define elf_info_to_howto_rel elf32_arm_info_to_howto
+#define ARM_ELF_ABI_VERSION 0
+#define ARM_ELF_OS_ABI_VERSION ELFOSABI_ARM
static reloc_howto_type * elf32_arm_reloc_type_lookup
PARAMS ((bfd * abfd, bfd_reloc_code_real_type code));
@@ -574,7 +576,7 @@ static reloc_howto_type elf32_arm_thm_pc9_howto =
static void
-elf32_arm_info_to_howto_rel (abfd, bfd_reloc, elf_reloc)
+elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc)
bfd * abfd;
arelent * bfd_reloc;
Elf32_Internal_Rel * elf_reloc;
diff --git a/bfd/elfarm-oabi.c b/bfd/elfarm-oabi.c
index f219b92ea7b..911d83e7277 100644
--- a/bfd/elfarm-oabi.c
+++ b/bfd/elfarm-oabi.c
@@ -23,6 +23,10 @@
#include "libbfd.h"
#include "elf-bfd.h"
+#ifndef NUM_ELEM
+#define NUM_ELEM(a) (sizeof (a) / sizeof (a)[0])
+#endif
+
#define USE_RELA
#define TARGET_LITTLE_SYM bfd_elf32_littlearm_oabi_vec
@@ -33,6 +37,9 @@
#define elf_info_to_howto elf32_arm_info_to_howto
#define elf_info_to_howto_rel 0
+#define ARM_ELF_ABI_VERSION 0
+#define ARM_ELF_OS_ABI_VERSION 0
+
static reloc_howto_type elf32_arm_howto_table[] =
{
/* No relocation */
@@ -173,7 +180,7 @@ static reloc_howto_type elf32_arm_howto_table[] =
0, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_ARM_SBREL32", /* name */
false, /* partial_inplace */
@@ -254,7 +261,24 @@ static reloc_howto_type elf32_arm_howto_table[] =
0, /* src_mask */
0, /* dst_mask */
false), /* pcrel_offset */
-
+
+ /* XXX - gap in index numbering here. */
+
+ HOWTO (R_ARM_PLT32, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_PLT32", /* name */
+ true, /* partial_inplace */
+ 0x00ffffff, /* src_mask */
+ 0x00ffffff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* XXX - gap in index numbering here. */
HOWTO (R_ARM_RREL32, /* type */
0, /* rightshift */
@@ -310,10 +334,24 @@ static reloc_howto_type elf32_arm_howto_table[] =
false, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
- false), /* pcrel_offset */
-
+ false) /* pcrel_offset */
};
+/* Locate a reloc in the howto table. This function must be used
+ when the entry number is is > R_ARM_GNU_VTINHERIT. */
+static reloc_howto_type *
+find_howto (r_type)
+ unsigned int r_type;
+{
+ int i;
+
+ for (i = NUM_ELEM (elf32_arm_howto_table); i--;)
+ if (elf32_arm_howto_table [i].type == r_type)
+ return elf32_arm_howto_table + i;
+
+ return NULL;
+}
+
static void
elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc)
bfd *abfd;
@@ -323,9 +361,11 @@ elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc)
unsigned int r_type;
r_type = ELF32_R_TYPE (elf_reloc->r_info);
- /* fixme: need range test */
- /* BFD_ASSERT (r_type < (unsigned int) R_ELF32_ARM_MAX); */
- bfd_reloc->howto = &elf32_arm_howto_table[r_type];
+
+ if (r_type <= R_ARM_GNU_VTINHERIT)
+ bfd_reloc->howto = & elf32_arm_howto_table[r_type];
+ else
+ bfd_reloc->howto = find_howto (r_type);
}
struct elf32_arm_reloc_map
@@ -336,21 +376,21 @@ struct elf32_arm_reloc_map
static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] =
{
- {BFD_RELOC_NONE, R_ARM_NONE,},
- {BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24,},
- {BFD_RELOC_32, R_ARM_ABS32,},
- {BFD_RELOC_32_PCREL, R_ARM_REL32,},
- {BFD_RELOC_8, R_ARM_ABS8,},
- {BFD_RELOC_16, R_ARM_ABS16,},
- {BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12,},
- {BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5,},
- {BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22,},
- {BFD_RELOC_VTABLE_INHERIT, R_ARM_GNU_VTINHERIT },
- {BFD_RELOC_VTABLE_ENTRY, R_ARM_GNU_VTENTRY },
- {BFD_RELOC_NONE, R_ARM_SBREL32,},
- {BFD_RELOC_NONE, R_ARM_AMP_VCALL9,},
- {BFD_RELOC_THUMB_PCREL_BRANCH12, R_ARM_THM_PC11,},
- {BFD_RELOC_THUMB_PCREL_BRANCH9, R_ARM_THM_PC9,}
+ {BFD_RELOC_NONE, R_ARM_NONE },
+ {BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24 },
+ {BFD_RELOC_32, R_ARM_ABS32 },
+ {BFD_RELOC_32_PCREL, R_ARM_REL32 },
+ {BFD_RELOC_8, R_ARM_ABS8 },
+ {BFD_RELOC_16, R_ARM_ABS16 },
+ {BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12 },
+ {BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5 },
+ {BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22 },
+ {BFD_RELOC_NONE, R_ARM_SBREL32 },
+ {BFD_RELOC_NONE, R_ARM_AMP_VCALL9 },
+ {BFD_RELOC_THUMB_PCREL_BRANCH12, R_ARM_THM_PC11 },
+ {BFD_RELOC_THUMB_PCREL_BRANCH9, R_ARM_THM_PC9 },
+ {BFD_RELOC_VTABLE_INHERIT, R_ARM_GNU_VTINHERIT },
+ {BFD_RELOC_VTABLE_ENTRY, R_ARM_GNU_VTENTRY }
};
static reloc_howto_type *
@@ -360,14 +400,13 @@ elf32_arm_reloc_type_lookup (abfd, code)
{
unsigned int i;
- for (i = 0;
- i < sizeof (elf32_arm_reloc_map) / sizeof (struct 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];
- }
+ for (i = NUM_ELEM (elf32_arm_reloc_map); i--;)
+ if (elf32_arm_reloc_map[i].bfd_reloc_val == code)
+ return & elf32_arm_howto_table [elf32_arm_reloc_map[i].elf_reloc_val];
+ if (code == BFD_RELOC_ARM_PLT32)
+ return find_howto (R_ARM_PLT32);
+
return NULL;
}
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h
index 9acabd1e607..dc116ef3a9a 100644
--- a/bfd/elfxx-target.h
+++ b/bfd/elfxx-target.h
@@ -290,6 +290,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef elf_backend_plt_header_size
#define elf_backend_plt_header_size 0
#endif
+#ifndef elf_backend_post_process_headers
+#define elf_backend_post_process_headers NULL
+#endif
#ifndef ELF_MACHINE_ALT1
#define ELF_MACHINE_ALT1 0
@@ -344,6 +347,7 @@ static CONST struct elf_backend_data elfNN_bed =
elf_backend_modify_segment_map,
elf_backend_gc_mark_hook,
elf_backend_gc_sweep_hook,
+ elf_backend_post_process_headers,
elf_backend_ecoff_debug_swap,
ELF_MACHINE_ALT1,
ELF_MACHINE_ALT2,
diff --git a/bfd/hosts/alphalinux.h b/bfd/hosts/alphalinux.h
index d9ba1b7ec6b..09b8d69e788 100644
--- a/bfd/hosts/alphalinux.h
+++ b/bfd/hosts/alphalinux.h
@@ -1,6 +1,6 @@
/* Linux dumps "struct task_struct" at the end of the core-file. This
- structure is currently 920 bytes long, but we allow up to 1024
+ structure is currently 1080 bytes long, but we allow up to 4096
bytes to allow for some future growth. */
-#define TRAD_CORE_EXTRA_SIZE_ALLOWED 1024
+#define TRAD_CORE_EXTRA_SIZE_ALLOWED 4096
#define TRAD_UNIX_CORE_FILE_FAILING_SIGNAL(abfd) \
((abfd)->tdata.trad_core_data->u.signal)
diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
index cb4a4df1ac2..057bba22c1d 100644
--- a/bfd/libbfd-in.h
+++ b/bfd/libbfd-in.h
@@ -1,6 +1,7 @@
/* libbfd.h -- Declarations used by bfd library *implementation*.
(This include file is not for users of the library.)
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+ Free Software Foundation, Inc.
Written by Cygnus Support.
** NOTE: libbfd.h is a GENERATED file. Don't change it; instead,
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index f804bde593c..e395f726af5 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -1,6 +1,7 @@
/* libbfd.h -- Declarations used by bfd library *implementation*.
(This include file is not for users of the library.)
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+ Free Software Foundation, Inc.
Written by Cygnus Support.
** NOTE: libbfd.h is a GENERATED file. Don't change it; instead,
@@ -679,6 +680,10 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_MIPS_GOT_LO16",
"BFD_RELOC_MIPS_CALL_HI16",
"BFD_RELOC_MIPS_CALL_LO16",
+ "BFD_RELOC_MIPS_SUB",
+ "BFD_RELOC_MIPS_GOT_PAGE",
+ "BFD_RELOC_MIPS_GOT_OFST",
+ "BFD_RELOC_MIPS_GOT_DISP",
"BFD_RELOC_386_GOT32",
"BFD_RELOC_386_PLT32",
@@ -836,6 +841,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_MCORE_PCREL_IMM4BY2",
"BFD_RELOC_MCORE_PCREL_32",
"BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2",
+ "BFD_RELOC_MCORE_RVA",
"BFD_RELOC_VTABLE_INHERIT",
"BFD_RELOC_VTABLE_ENTRY",
"@@overflow: BFD_RELOC_UNUSED@@",
diff --git a/bfd/peicode.h b/bfd/peicode.h
index 79d16e5abe9..be47bcac1fc 100644
--- a/bfd/peicode.h
+++ b/bfd/peicode.h
@@ -504,6 +504,7 @@ coff_swap_sym_in (abfd, ext1, in1)
{
in->n_value = 0x0;
+#if 0
/* FIXME: This is clearly wrong. The problem seems to be that
undefined C_SECTION symbols appear in the first object of a
MS generated .lib file, and the symbols are not defined
@@ -518,6 +519,56 @@ coff_swap_sym_in (abfd, ext1, in1)
/* in->n_scnum = 3; */
/* else */
/* in->n_scnum = 2; */
+#else
+ /* Create synthetic empty sections as needed. DJ */
+ if (in->n_scnum == 0)
+ {
+ asection *sec;
+ for (sec=abfd->sections; sec; sec=sec->next)
+ {
+ if (strcmp (sec->name, in->n_name) == 0)
+ {
+ in->n_scnum = sec->target_index;
+ break;
+ }
+ }
+ }
+ if (in->n_scnum == 0)
+ {
+ int unused_section_number = 0;
+ asection *sec;
+ char *name;
+ for (sec=abfd->sections; sec; sec=sec->next)
+ if (unused_section_number <= sec->target_index)
+ unused_section_number = sec->target_index+1;
+
+ name = bfd_alloc (abfd, strlen (in->n_name) + 10);
+ if (name == NULL)
+ return;
+ strcpy (name, in->n_name);
+ sec = bfd_make_section_anyway (abfd, name);
+
+ sec->vma = 0;
+ sec->lma = 0;
+ sec->_cooked_size = 0;
+ sec->_raw_size = 0;
+ sec->filepos = 0;
+ sec->rel_filepos = 0;
+ sec->reloc_count = 0;
+ sec->line_filepos = 0;
+ sec->lineno_count = 0;
+ sec->userdata = NULL;
+ sec->next = (asection *) NULL;
+ sec->flags = 0;
+ sec->alignment_power = 2;
+ sec->flags = SEC_HAS_CONTENTS | SEC_ALLOC | SEC_DATA | SEC_LOAD;
+
+ sec->target_index = unused_section_number;
+
+ in->n_scnum = unused_section_number;
+ }
+ in->n_sclass = C_STAT;
+#endif
}
#ifdef coff_swap_sym_in_hook
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 888581493b4..9e8735e5ed6 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -2028,6 +2028,14 @@ ENUMX
BFD_RELOC_MIPS_CALL_HI16
ENUMX
BFD_RELOC_MIPS_CALL_LO16
+ENUMX
+ BFD_RELOC_MIPS_SUB
+ENUMX
+ BFD_RELOC_MIPS_GOT_PAGE
+ENUMX
+ BFD_RELOC_MIPS_GOT_OFST
+ENUMX
+ BFD_RELOC_MIPS_GOT_DISP
COMMENT
ENUMDOC
MIPS ELF relocations.
@@ -2537,6 +2545,8 @@ ENUMX
BFD_RELOC_MCORE_PCREL_32
ENUMX
BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2
+ENUMX
+ BFD_RELOC_MCORE_RVA
ENUMDOC
Motorola Mcore relocations.
diff --git a/bfd/som.c b/bfd/som.c
index b5786b51ed7..ee1fac09205 100644
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -440,9 +440,7 @@ static const struct fixup_format som_fixup_formats[256] =
1, "Lb4*=Mb1+L*=", /* 0x2b */
2, "Lb4*=Md1+4*=", /* 0x2c */
3, "Ld1+=Me1+=", /* 0x2d */
- /* R_SHORT_PCREL_MODE */
0, "", /* 0x2e */
- /* R_LONG_PCREL_MODE */
0, "", /* 0x2f */
/* R_PCREL_CALL */
0, "L4=RD=Sb=", /* 0x30 */
@@ -459,8 +457,9 @@ static const struct fixup_format som_fixup_formats[256] =
1, "L4=RD8<b+=Sb=",/* 0x3b */
0, "L4=RD8<b+=Sd=",/* 0x3c */
1, "L4=RD8<b+=Sd=",/* 0x3d */
- /* R_RESERVED */
+ /* R_SHORT_PCREL_MODE */
0, "", /* 0x3e */
+ /* R_LONG_PCREL_MODE */
0, "", /* 0x3f */
/* R_ABS_CALL */
0, "L4=RD=Sb=", /* 0x40 */
diff --git a/bfd/targets.c b/bfd/targets.c
index bb6e51d854e..604c2689f38 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -1,5 +1,5 @@
/* Generic target-file-type support for the BFD library.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -507,6 +507,7 @@ extern const bfd_target bfd_elf32_d30v_vec;
extern const bfd_target bfd_elf32_hppa_vec;
extern const bfd_target bfd_elf32_i386_vec;
extern const bfd_target bfd_elf32_i860_vec;
+extern const bfd_target bfd_elf32_i960_vec;
extern const bfd_target bfd_elf32_little_generic_vec;
extern const bfd_target bfd_elf32_littlemips_vec;
extern const bfd_target bfd_elf64_littlemips_vec;
@@ -680,6 +681,7 @@ const bfd_target * const bfd_target_vector[] = {
&bfd_elf32_hppa_vec,
&bfd_elf32_i386_vec,
&bfd_elf32_i860_vec,
+ &bfd_elf32_i960_vec,
&bfd_elf32_little_generic_vec,
&bfd_elf32_littlearc_vec,
&bfd_elf32_littlearm_vec,
diff --git a/bfd/vms-misc.c b/bfd/vms-misc.c
index a5fdae4cc28..81b1fc8c92f 100644
--- a/bfd/vms-misc.c
+++ b/bfd/vms-misc.c
@@ -198,11 +198,12 @@ _bfd_vms_hash_newfunc (entry, table, string)
bfd_set_error (bfd_error_no_memory);
return (struct bfd_hash_entry *)NULL;
}
+ entry = (struct bfd_hash_entry *) ret;
}
/* Call the allocation method of the base class. */
- ret = (vms_symbol_entry *) bfd_hash_newfunc ((struct bfd_hash_entry *)ret, table, string);
+ ret = (vms_symbol_entry *) bfd_hash_newfunc (entry, table, string);
#if VMS_DEBUG
vms_debug (6, "_bfd_vms_hash_newfunc ret %p\n", ret);
#endif
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index b8a3d2725a3..0a273fec595 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,148 @@
+Wed Jun 2 12:34:36 1999 Richard Henderson <rth@cygnus.com>
+
+ * dlltool.c (gen_exp_file): Revert 19990411 change.
+
+Mon May 31 09:56:22 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
+
+ * readelf.c (process_relocs): Determine type of reloc from
+ DT_PLTREL and from section type.
+
+1999-05-29 Nick Clifton <nickc@cygnus.com>
+
+ * readelf.c (get_elf_class): Display unknown class number.
+ (get_data_encoding): Display unknown encoding number.
+ (get_osabi_name): Display unknown ABI number.
+ (process_file_header): Display unknown version number.
+
+1999-05-29 Nick Clifton <nickc@cygnus.com>
+
+ * readelf.c (dump_relocations): Fix typo.
+
+1999-05-28 Nick Clifton <nickc@cygnus.com>
+
+ * readelf.c (dump_relocations): Add extra parameter: is_rela to
+ specify the kind of relocations to be dumped. Call guess_is_rela
+ if this parameter has a value of UNKNOWN.
+ (guess_is_rela): New function: Guess the kind of reloc being used
+ baced on the machine number.
+ (process_relocs): Determine type of reloc before calling
+ dump_relocations.
+
+1999-05-28 Ian Lance Taylor <ian@zembu.com>
+
+ * readelf.c: Include "elf/i960.h".
+ (dump_relocations): Handle EM_960.
+
+Thu May 27 11:58:33 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
+
+ * objcopy.c (copy_archive): Preserve dates of archive members if
+ requested.
+
+ * readelf.c (dump_relocations): Always print the addend on RELA
+ systems even if there is no symbol.
+ (process_program_headers): Reset dynamic_size before looping
+ through the program headers.
+ (process_version_sections): Cast sh_offset to unsigned long for
+ printing in case bfd_vma is wider.
+ (process_symbol_table): Use get_symbol_index_type when printing
+ st_shndx.
+
+1999-05-17 DJ Delorie <dj@cygnus.com>
+
+ * windres.c: add verbose option
+ (main): process verbose option
+ * resrc.c (look_for_default): new. Look for the default
+ preprocessor in a given location.
+ (read_rc_file): for foo/bar-windres, look for foo/bar-gcc,
+ foo/gcc (in case of foo/windres), and then gcc (the old default).
+
+1999-05-16 Nick Clifton <nickc@cygnus.com>
+
+ * dlltool.c (deduce_name): New function: Deduce name of program to
+ run.
+ (mcore_elf_out_file): New variable: Name of mcore-elf output file.
+ (mcore_elf_linker): New variable: Name of linker to use.
+ (mcore_elf_linker_flags): New variable: Linker flags to pass.
+ (scan_obj_file): Cache filenames if necessary.
+ (usage): Document new command line options.
+ (main): Support new command line options: -M (generate an
+ mcore-elf output file) -L (name of linker to use) -F (flags to
+ pass to linker).
+ (mcore_elf_cache_filename): Store a filename in a cache.
+ (mcore_elf_gen_out_file): New function: Generate an output file
+ per the mcore-elf spec.
+
+1999-05-15 Nick Clifton <nickc@cygnus.com>
+
+ * configure.in (BUILD_MISC): Build dlltool for mcore
+ * configure: Regenerate.
+ * dlltool.c: Update example in comment.
+ (DLLTOOL_MCORE): Define.
+ (DLLTOOL_MCORE_ELF): Define.
+ (DRECTVE_SECTION_NAME): Define.
+ (mcore_be_jtab, mcore_le_jtab): Binary for performing an mcore
+ jump to address.
+ (mtable): Add entries for mcore variants.
+ (rvaafter, rvabefore, asm_prefix): Add mcore suppport.
+ (scan_drectve_symbols): Use DRECTVE_SECTION_NAME.
+ (make_head, make_tail): Cope if file cannot be created.
+ (usage): Improve layout.
+
+1999-05-13 DJ Delorie <dj@cygnus.com>
+
+ * rclex.l: add code to suppress certain output from cpp, replace
+ all returns with MAYBE_RETURN
+ (MAYBE_RETURN): new, implement the suppression by returning
+ IGNORED_TOKEN as needed.
+ (cpp_line): remember which file we're in, mark data from included
+ *.h files for suppression.
+ * rcparse.y (input): allow IGNORED_TOKEN outside of known constructs
+
+1999-05-10 DJ Delorie <dj@cygnus.com>
+
+ * windres.c (quot): Quote shell metacharacters in a string
+ (main): quote parameters to cpp that might have metacharacters in
+ them. Allow -D as an alias for --define to allow for sharing make
+ macros with gcc.
+
+ * objdump.c (dump_reloc_set): don't core if howto->name is NULL
+
+ * Makefile.am: Give rescoff.c a cpu-specific -D so it can set
+ the correct BFD.
+ * Makefile.in: ditto
+ * rescoff.c (write_coff_file): Set the correct BFD
+
+1999-05-06 Ian Lance Taylor <ian@zembu.com>
+
+ * rename.c (smart_rename): Fix test of whether file exists.
+
+1999-05-06 Nick Clifton <nickc@cygnus.com>
+
+ * objdump.c (disassemble_data): Set display_endian based on target
+ endianism.
+
+1999-05-05 Catherine Moore <clm@cygnus.com>
+
+ * dlltool.c (interwork): Remove.
+ (arm_interwork_jtab): Use bx insn.
+ (thumb_jtab): Likewise.
+ (MARM_INTERWORK): New machine type.
+ (rvaafter): Handle it.
+ (rvabefore) Likewise.
+ (asm_prefix): Likewise.
+ (gen_exp_type): Check machine type instead of
+ interwork flag.
+ (make_one_lib_file): Likewise.
+ (make_head): Likewise.
+ (make_tail): Likewise.
+ (usage): Update machine types.
+ (main): Remove -interwork support.
+
+1999-05-05 Catherine Moore <clm@cygnus.com>
+
+ * readelf.c (get_machine_flags): Check for EF_CPU32.
+ (get_data_encoding): Fix typo.
+
1999-04-26 Tom Tromey <tromey@cygnus.com>
* aclocal.m4, configure: Updated for new version of libtool.
diff --git a/binutils/Makefile.am b/binutils/Makefile.am
index 4f3014f3287..f24ad920bc2 100644
--- a/binutils/Makefile.am
+++ b/binutils/Makefile.am
@@ -240,6 +240,9 @@ dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
dlltool.o:dlltool.c
$(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/dlltool.c
+rescoff.o:rescoff.c
+ $(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/rescoff.c
+
coffdump_SOURCES = coffdump.c coffgrok.c $(BULIBS)
sysdump_SOURCES = sysdump.c $(BULIBS)
diff --git a/binutils/Makefile.in b/binutils/Makefile.in
index c32ae4d7234..54796164a33 100644
--- a/binutils/Makefile.in
+++ b/binutils/Makefile.in
@@ -1125,6 +1125,9 @@ sysinfo.o: sysinfo.c
dlltool.o:dlltool.c
$(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/dlltool.c
+rescoff.o:rescoff.c
+ $(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/rescoff.c
+
# coff/sym.h and coff/ecoff.h won't be found by the automatic dependency
# scripts, since they are only included conditionally.
nlmconv.o: nlmconv.c $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
diff --git a/binutils/NEWS b/binutils/NEWS
index 76dcebdda08..0bde43a1e4d 100644
--- a/binutils/NEWS
+++ b/binutils/NEWS
@@ -2,8 +2,8 @@
Changes in binutils 2.10:
-* objdump support for -mi386:intel which causes disassembly to be displayed with
- intel syntax.
+* objdump support for -mi386:intel which causes disassembly to be displayed
+ with intel syntax.
* New program: readelf. This displays the contents of ELF format files,
regardless of target machine.
diff --git a/binutils/binutils.texi b/binutils/binutils.texi
index 5f7c646b275..b431a95a3dd 100644
--- a/binutils/binutils.texi
+++ b/binutils/binutils.texi
@@ -2048,10 +2048,15 @@ Specify an include directory to use when reading an @code{rc} file.
option. @code{windres} will also search this directory when looking for
files named in the @code{rc} file.
+@item -D @var{target}
@item --define @var{sym[=val]}
Specify a @code{-D} option to pass to the preprocessor when reading an
@code{rc} file.
+@item -v
+Enable verbose mode. This tells you what the preprocessor is if you
+didn't specify one.
+
@item --language @var{val}
Specify the default language to use when reading an @code{rc} file.
@var{val} should be a hexadecimal language code. The low eight bits are
diff --git a/binutils/configure b/binutils/configure
index 594e154f303..175aaefb82a 100755
--- a/binutils/configure
+++ b/binutils/configure
@@ -5102,6 +5102,15 @@ do
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
;;
+ mcore-*pe)
+ BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
+ DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
+ BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
+ ;;
+ mcore-*elf)
+ BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
+ DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
+ ;;
esac
fi
done
diff --git a/binutils/configure.in b/binutils/configure.in
index 298dcd89c64..878a6c6f685 100644
--- a/binutils/configure.in
+++ b/binutils/configure.in
@@ -189,6 +189,15 @@ changequote([,])dnl
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
;;
+ mcore-*pe)
+ BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
+ DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
+ BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
+ ;;
+ mcore-*elf)
+ BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
+ DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
+ ;;
esac
fi
done
diff --git a/binutils/dlltool.c b/binutils/dlltool.c
index ed5cf5e3fcc..2ba81354aed 100644
--- a/binutils/dlltool.c
+++ b/binutils/dlltool.c
@@ -121,16 +121,16 @@
printf ("hello from the dll and the other entry point %s\n", s);
}
- printf()
+ int printf (void)
{
return 9;
}
- main.c
-
- void main()
+ themain.c:
+ int main (void)
{
- cdef();
+ cdef ();
+ return 0;
}
thedll.def
@@ -164,7 +164,7 @@
gcc -c themain.c
# link the executable with the import library
- ld -e main -Tthemain.ld -o themain.exe themain.o thedll.a
+ gcc -o themain.exe themain.o thedll.a
*/
@@ -236,6 +236,15 @@
#include "coff/internal.h"
#endif
+
+/* Forward references. */
+static char * deduce_name (char *);
+
+#ifdef DLLTOOL_MCORE_ELF
+static void mcore_elf_cache_filename (char *);
+static void mcore_elf_gen_out_file (void);
+#endif
+
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#else /* ! HAVE_SYS_WAIT_H */
@@ -304,7 +313,7 @@ typedef struct iheadt
static iheadtype *import_list = NULL;
-static char *as_name = "as";
+static char *as_name = NULL;
static char * as_flags = "";
static int no_idata4;
@@ -319,10 +328,6 @@ static int add_indirect = 0;
static int add_underscore = 0;
static int dontdeltemps = 0;
-#ifdef DLLTOOL_ARM
-static int interwork = 0;
-#endif
-
/* True if we should export all symbols. Otherwise, we only export
symbols listed in .drectve sections or in the def file. */
static boolean export_all_symbols;
@@ -345,10 +350,6 @@ static int verbose;
static FILE *output_def;
static FILE *base_file;
-#ifdef DLLTOOL_BEOS
-static const char *mname = "beos";
-#endif
-
#ifdef DLLTOOL_ARM
static const char *mname = "arm";
#endif
@@ -361,6 +362,23 @@ static const char *mname = "i386";
static const char *mname = "ppc";
#endif
+#ifdef DLLTOOL_MCORE
+static const char * mname = "mcore";
+#endif
+
+#ifdef DLLTOOL_MCORE_ELF
+static const char * mname = "mcore-elf";
+static char * mcore_elf_out_file = NULL;
+static char * mcore_elf_linker = NULL;
+static char * mcore_elf_linker_flags = NULL;
+
+#define DRECTVE_SECTION_NAME ((machine == MMCORE_ELF || machine == MMCORE_ELF_LE) ? ".exports" : ".drectve")
+#endif
+
+#ifndef DRECTVE_SECTION_NAME
+#define DRECTVE_SECTION_NAME ".drectve"
+#endif
+
#define PATHMAX 250 /* What's the right name for this ? */
#define TMP_ASM "dc.s"
@@ -370,8 +388,7 @@ static const char *mname = "ppc";
#define TMP_TAIL_O "dt.o"
#define TMP_STUB "ds"
-/* This bit of assemly does jmp * ....
-s set how_jtab_roff to mark where the 32bit abs branch should go */
+/* This bit of assemly does jmp * .... */
static const unsigned char i386_jtab[] =
{
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x90, 0x90
@@ -379,22 +396,44 @@ static const unsigned char i386_jtab[] =
static const unsigned char arm_jtab[] =
{
- 0x00, 0xc0, 0x9f, 0xe5,
- 0x00, 0xf0, 0x9c, 0xe5,
+ 0x00, 0xc0, 0x9f, 0xe5, /* ldr ip, [pc] */
+ 0x00, 0xf0, 0x9c, 0xe5, /* ldr pc, [ip] */
+ 0, 0, 0, 0
+};
+
+static const unsigned char arm_interwork_jtab[] =
+{
+ 0x04, 0xc0, 0x9f, 0xe5, /* ldr ip, [pc] */
+ 0x00, 0xc0, 0x9c, 0xe5, /* ldr ip, [ip] */
+ 0x1c, 0xff, 0x2f, 0xe1, /* bx ip */
0, 0, 0, 0
};
static const unsigned char thumb_jtab[] =
{
- 0xc0, 0xb4,
- 0x02, 0x4e,
- 0x36, 0x68,
- 0x01, 0x96,
- 0x40, 0xbd,
- 0xc0, 0x46,
+ 0x40, 0xb4, /* push {r6} */
+ 0x02, 0x4e, /* ldr r6, [pc, #8] */
+ 0x36, 0x68, /* ldr r6, [r6] */
+ 0xb4, 0x46, /* mov ip, r6 */
+ 0x40, 0xbc, /* pop {r6} */
+ 0x60, 0x47, /* bx ip */
0, 0, 0, 0
};
+static const unsigned char mcore_be_jtab[] =
+{
+ 0x70, 0x01, /* jmpi 1 */
+ 0x12, 0x11, /* nop */
+ 0x00, 0x00, 0x00, 0x00 /* <address> */
+};
+
+static const unsigned char mcore_le_jtab[] =
+{
+ 0x01, 0x70, /* jmpi 1 */
+ 0x11, 0x12, /* nop */
+ 0x00, 0x00, 0x00, 0x00 /* <address> */
+};
+
/* This is the glue sequence for PowerPC PE. There is a */
/* tocrel16-tocdefn reloc against the first instruction. */
/* We also need a IMGLUE reloc against the glue function */
@@ -469,12 +508,52 @@ mtable[] =
{
#define MTHUMB 3
"thumb", ".byte", ".short", ".long", ".asciz", "@",
- "push\t{r6, r7}\n\tldr\tr6, [pc, #8]\n\tldr\tr6, [r6]\n\tstr\tr6, [sp, #4]\n\tpop\t{r6, pc}\n\tnop",
+ "push\t{r6}\n\tldr\tr6, [pc, #8]\n\tldr\tr6, [r6]\n\tmov\tip, r6\n\tpop\t{r6}\n\tbx\tip",
".global", ".space", ".align\t2",".align\t4","pe-arm-little", bfd_arch_arm,
thumb_jtab, sizeof (thumb_jtab), 12
}
,
-{ 0}
+#define MARM_INTERWORK 4
+ {
+ "arm_interwork", ".byte", ".short", ".long", ".asciz", "@",
+ "ldr\tip,[pc]\n\tldr\tip,[ip]\n\tbx\tip\n\t.long",
+ ".global", ".space", ".align\t2",".align\t4","pe-arm-little", bfd_arch_arm,
+ arm_interwork_jtab, sizeof (arm_interwork_jtab), 12
+ }
+ ,
+ {
+#define MMCORE_BE 5
+ "mcore", ".byte", ".short", ".long", ".asciz", "//",
+ "jmpi\t1\n\tnop\n\t.long",
+ ".global", ".space", ".align\t2",".align\t4","pe-mcore-big", bfd_arch_mcore,
+ mcore_be_jtab, sizeof (mcore_be_jtab), 8
+ }
+ ,
+ {
+#define MMCORE_LE 6
+ "mcore-le", ".byte", ".short", ".long", ".asciz", "//",
+ "jmpi\t1\n\tnop\n\t.long",
+ ".global", ".space", ".align\t2",".align\t4","pe-mcore-little", bfd_arch_mcore,
+ mcore_le_jtab, sizeof (mcore_le_jtab), 8
+ }
+ ,
+ {
+#define MMCORE_ELF 7
+ "mcore-elf", ".byte", ".short", ".long", ".asciz", "//",
+ "jmpi\t1\n\tnop\n\t.long",
+ ".global", ".space", ".align\t2",".align\t4","elf32-mcore-big", bfd_arch_mcore,
+ mcore_be_jtab, sizeof (mcore_be_jtab), 8
+ }
+ ,
+ {
+#define MMCORE_ELF_LE 8
+ "mcore-elf-le", ".byte", ".short", ".long", ".asciz", "//",
+ "jmpi\t1\n\tnop\n\t.long",
+ ".global", ".space", ".align\t2",".align\t4","elf32-mcore-little", bfd_arch_mcore,
+ mcore_le_jtab, sizeof (mcore_le_jtab), 8
+ }
+ ,
+ { 0}
};
typedef struct dlist
@@ -621,6 +700,11 @@ rvaafter (machine)
case M386:
case MPPC:
case MTHUMB:
+ case MARM_INTERWORK:
+ case MMCORE_BE:
+ case MMCORE_LE:
+ case MMCORE_ELF:
+ case MMCORE_ELF_LE:
break;
default:
/* xgettext:c-format */
@@ -640,6 +724,11 @@ rvabefore (machine)
case M386:
case MPPC:
case MTHUMB:
+ case MARM_INTERWORK:
+ case MMCORE_BE:
+ case MMCORE_LE:
+ case MMCORE_ELF:
+ case MMCORE_ELF_LE:
return ".rva\t";
default:
/* xgettext:c-format */
@@ -658,6 +747,11 @@ asm_prefix (machine)
case MARM:
case MPPC:
case MTHUMB:
+ case MARM_INTERWORK:
+ case MMCORE_BE:
+ case MMCORE_LE:
+ case MMCORE_ELF:
+ case MMCORE_ELF_LE:
break;
case M386:
return "_";
@@ -681,12 +775,12 @@ asm_prefix (machine)
#define ASM_RVA_BEFORE rvabefore(machine)
#define ASM_RVA_AFTER rvaafter(machine)
#define ASM_PREFIX asm_prefix(machine)
-#define ASM_ALIGN_LONG mtable[machine].how_align_long
+#define ASM_ALIGN_LONG mtable[machine].how_align_long
#define HOW_BFD_TARGET 0 /* always default*/
-#define HOW_BFD_ARCH mtable[machine].how_bfd_arch
-#define HOW_JTAB mtable[machine].how_jtab
-#define HOW_JTAB_SIZE mtable[machine].how_jtab_size
-#define HOW_JTAB_ROFF mtable[machine].how_jtab_roff
+#define HOW_BFD_ARCH mtable[machine].how_bfd_arch
+#define HOW_JTAB mtable[machine].how_jtab
+#define HOW_JTAB_SIZE mtable[machine].how_jtab_size
+#define HOW_JTAB_ROFF mtable[machine].how_jtab_roff
static char **oav;
void
@@ -1071,9 +1165,9 @@ scan_drectve_symbols (abfd)
char * buf;
char * p;
char * e;
-
+
/* Look for .drectve's */
- s = bfd_get_section_by_name (abfd, ".drectve");
+ s = bfd_get_section_by_name (abfd, DRECTVE_SECTION_NAME);
if (s == NULL)
return;
@@ -1084,8 +1178,8 @@ scan_drectve_symbols (abfd)
bfd_get_section_contents (abfd, s, buf, 0, size);
/* xgettext:c-format */
- inform (_("Sucking in info from .drective section in %s\n"),
- bfd_get_filename (abfd));
+ inform (_("Sucking in info from %s section in %s\n"),
+ DRECTVE_SECTION_NAME, bfd_get_filename (abfd));
/* Search for -export: strings */
p = buf;
@@ -1327,7 +1421,7 @@ scan_open_obj_file (abfd)
/* FIXME: we ought to read in and block out the base relocations */
/* xgettext:c-format */
- inform (_("%s: Done reading %s\n"), bfd_get_filename (abfd));
+ inform (_("Done reading %s\n"), bfd_get_filename (abfd));
}
static void
@@ -1353,10 +1447,20 @@ scan_obj_file (filename)
bfd_close (arfile);
arfile = bfd_openr_next_archived_file (f, arfile);
}
+
+#ifdef DLLTOOL_MCORE_ELF
+ if (mcore_elf_out_file)
+ inform (_("Cannot produce mcore-elf dll from archive file: %s"), filename);
+#endif
}
else if (bfd_check_format (f, bfd_object))
{
scan_open_obj_file (f);
+
+#ifdef DLLTOOL_MCORE_ELF
+ if (mcore_elf_out_file)
+ mcore_elf_cache_filename ((char *) filename);
+#endif
}
bfd_close (f);
@@ -1647,8 +1751,8 @@ gen_exp_file ()
}
}
fprintf (f, "\t%s%s%s%s\t%s %d\n", ASM_RVA_BEFORE,
- ASM_PREFIX,
- exp->internal_name, ASM_RVA_AFTER, ASM_C, exp->ordinal);
+ ASM_PREFIX,
+ exp->internal_name, ASM_RVA_AFTER, ASM_C, exp->ordinal);
i++;
}
@@ -1678,12 +1782,13 @@ gen_exp_file ()
if (a_list)
{
- fprintf (f, "\t.section .drectve\n");
+ fprintf (f, "\t.section %s\n", DRECTVE_SECTION_NAME);
for (dl = a_list; dl; dl = dl->next)
{
fprintf (f, "\t%s\t\"%s\"\n", ASM_TEXT, dl->text);
}
}
+
if (d_list)
{
fprintf (f, "\t.section .rdata\n");
@@ -1765,8 +1870,6 @@ gen_exp_file ()
int src;
int dst = 0;
int last = -1;
- int totsize = 0;
-
qsort (copy, num_entries, sizeof (long), sfunc);
/* Delete duplcates */
for (src = 0; src < num_entries; src++)
@@ -1780,31 +1883,18 @@ gen_exp_file ()
on_page = 0;
for (j = 0; j < num_entries; j++)
{
- totsize += 2;
addr = copy[j];
if ((addr & PAGE_MASK) != page_addr)
{
- totsize += 8 + (on_page & 1)*2;
flush_page (f, need, page_addr, on_page);
on_page = 0;
page_addr = addr & PAGE_MASK;
}
need[on_page++] = addr;
}
-
- /* Pad the section to an even 32-byte boundary. This will make
- the BeOS loader much happier, and shouldn't matter for other
- OSes. */
- while ((totsize + 8 + (on_page & 1)*2) % 32 != 0)
- {
- /* 0x0000 is an absolute relocation that should be ignored. */
- need[on_page++] = 0x0000;
- totsize += 2;
- }
-
flush_page (f, need, page_addr, on_page);
- /* fprintf (f, "\t%s\t0,0\t%s End\n", ASM_LONG, ASM_C);*/
+/* fprintf (f, "\t%s\t0,0\t%s End\n", ASM_LONG, ASM_C);*/
}
}
@@ -1816,7 +1906,7 @@ gen_exp_file ()
sprintf (outfile, "%s -o %s %s", as_flags, exp_name, TMP_ASM);
#ifdef DLLTOOL_ARM
- if (interwork)
+ if (machine == MARM_INTERWORK || machine == MTHUMB)
strcat (outfile, " -mthumb-interwork");
#endif
@@ -2043,7 +2133,7 @@ make_one_lib_file (exp, i)
as_flags, prefix, i, prefix, i);
#ifdef DLLTOOL_ARM
- if (interwork)
+ if (machine == MARM_INTERWORK || machine == MTHUMB)
strcat (outfile, " -mthumb-interwork");
#endif
@@ -2087,7 +2177,7 @@ make_one_lib_file (exp, i)
bfd_set_arch_mach (abfd, HOW_BFD_ARCH, 0);
#ifdef DLLTOOL_ARM
- if (interwork)
+ if (machine == MARM_INTERWORK || machine == MTHUMB)
bfd_set_private_flags (abfd, F_INTERWORK);
#endif
@@ -2462,6 +2552,12 @@ make_head ()
{
FILE * f = fopen (TMP_HEAD_S, FOPEN_WT);
+ if (f == NULL)
+ {
+ fatal (_("failed to open temporary head file: %s"), TMP_HEAD_S);
+ return NULL;
+ }
+
fprintf (f, "%s IMAGE_IMPORT_DESCRIPTOR\n", ASM_C);
fprintf (f, "\t.section .idata$2\n");
@@ -2493,6 +2589,7 @@ make_head ()
fprintf (f, "\t%s\t0\n", ASM_LONG);
fprintf (f, "fthunk:\n");
}
+
if (!no_idata4)
{
fprintf (f, "\t.section\t.idata$4\n");
@@ -2501,12 +2598,13 @@ make_head ()
fprintf (f, "\t.section .idata$4\n");
fprintf (f, "hname:\n");
}
+
fclose (f);
sprintf (outfile, "%s -o %s %s", as_flags, TMP_HEAD_O, TMP_HEAD_S);
#ifdef DLLTOOL_ARM
- if (interwork)
+ if (machine == MARM_INTERWORK || machine == MTHUMB)
strcat (outfile, " -mthumb-interwork");
#endif
@@ -2520,11 +2618,18 @@ make_tail ()
{
FILE * f = fopen (TMP_TAIL_S, FOPEN_WT);
+ if (f == NULL)
+ {
+ fatal (_("failed to open temporary tail file: %s"), TMP_TAIL_S);
+ return NULL;
+ }
+
if (!no_idata4)
{
fprintf (f, "\t.section .idata$4\n");
fprintf (f, "\t%s\t0\n", ASM_LONG);
}
+
if (!no_idata5)
{
fprintf (f, "\t.section .idata$5\n");
@@ -2565,7 +2670,7 @@ make_tail ()
sprintf (outfile, "%s -o %s %s", as_flags, TMP_TAIL_O, TMP_TAIL_S);
#ifdef DLLTOOL_ARM
- if (interwork)
+ if (machine == MARM_INTERWORK || MTHUMB)
strcat (outfile, " -mthumb-interwork");
#endif
@@ -2938,17 +3043,18 @@ usage (file, status)
/* xgetext:c-format */
fprintf (file, _("Usage %s <options> <object-files>\n"), program_name);
/* xgetext:c-format */
- fprintf (file, _(" -m --machine <machine> Create {arm, i386, ppc, thumb} DLL. [default: %s]\n"), mname);
+ fprintf (file, _(" -m --machine <machine> Create as DLL for <machine>. [default: %s]\n"), mname);
+ fprintf (file, _(" possible <machine>: arm[_interwork], i386, mcore[-elf][-le], ppc, thumb\n"));
fprintf (file, _(" -e --output-exp <outname> Generate an export file.\n"));
fprintf (file, _(" -l --output-lib <outname> Generate an interface library.\n"));
fprintf (file, _(" -a --add-indirect Add dll indirects to export file.\n"));
fprintf (file, _(" -D --dllname <name> Name of input dll to put into interface lib.\n"));
fprintf (file, _(" -d --input-def <deffile> Name of .def file to be read in.\n"));
fprintf (file, _(" -z --output-def <deffile> Name of .def file to be created.\n"));
- fprintf (file, _(" --export-all-symbols Export all symbols to .def\n"));
- fprintf (file, _(" --no-export-all-symbols Only export listed symbols\n"));
- fprintf (file, _(" --exclude-symbols <list> Don't export <list>\n"));
- fprintf (file, _(" --no-default-excludes Clear default exclude symbols\n"));
+ fprintf (file, _(" --export-all-symbols Export all symbols to .def\n"));
+ fprintf (file, _(" --no-export-all-symbols Only export listed symbols\n"));
+ fprintf (file, _(" --exclude-symbols <list> Don't export <list>\n"));
+ fprintf (file, _(" --no-default-excludes Clear default exclude symbols\n"));
fprintf (file, _(" -b --base-file <basefile> Read linker generated base file.\n"));
fprintf (file, _(" -x --no-idata4 Don't generate idata$4 section.\n"));
fprintf (file, _(" -c --no-idata5 Don't generate idata$5 section.\n"));
@@ -2957,14 +3063,15 @@ usage (file, status)
fprintf (file, _(" -A --add-stdcall-alias Add aliases without @<n>.\n"));
fprintf (file, _(" -S --as <name> Use <name> for assembler.\n"));
fprintf (file, _(" -f --as-flags <flags> Pass <flags> to the assembler.\n"));
-#ifdef DLLTOOL_ARM
- fprintf (file, _(" -i --interwork Support ARM/Thumb interworking.\n"));
-#endif
fprintf (file, _(" -n --no-delete Keep temp files (repeat for extra preservation).\n"));
fprintf (file, _(" -v --verbose Be verbose.\n"));
fprintf (file, _(" -V --version Display the program version.\n"));
fprintf (file, _(" -h --help Display this information.\n"));
-
+#ifdef DLLTOOL_MCORE_ELF
+ fprintf (file, _(" -M --mcore-elf <outname> Process mcore-elf object files into <outname>.\n"));
+ fprintf (file, _(" -L --linker <name> Use <name> as the linker.\n"));
+ fprintf (file, _(" -F --linker-flags <flags> Pass <flags> to the linker.\n"));
+#endif
exit (status);
}
@@ -2972,15 +3079,13 @@ usage (file, status)
#define OPTION_NO_EXPORT_ALL_SYMS (OPTION_EXPORT_ALL_SYMS + 1)
#define OPTION_EXCLUDE_SYMS (OPTION_NO_EXPORT_ALL_SYMS + 1)
#define OPTION_NO_DEFAULT_EXCLUDES (OPTION_EXCLUDE_SYMS + 1)
-#define OPTION_NO_IDATA4 'x'
-#define OPTION_NO_IDATA5 'c'
static const struct option long_options[] =
{
{"no-delete", no_argument, NULL, 'n'},
{"dllname", required_argument, NULL, 'D'},
- {"no-idata4", no_argument, NULL, OPTION_NO_IDATA4},
- {"no-idata5", no_argument, NULL, OPTION_NO_IDATA5},
+ {"no-idata4", no_argument, NULL, 'x'},
+ {"no-idata5", no_argument, NULL, 'c'},
{"output-exp", required_argument, NULL, 'e'},
{"output-def", required_argument, NULL, 'z'},
{"export-all-symbols", no_argument, NULL, OPTION_EXPORT_ALL_SYMS},
@@ -3001,9 +3106,7 @@ static const struct option long_options[] =
{"base-file", required_argument, NULL, 'b'},
{"as", required_argument, NULL, 'S'},
{"as-flags", required_argument, NULL, 'f'},
-#ifdef DLLTOOL_ARM
- {"interwork", no_argument, NULL, 'i'},
-#endif
+ {"mcore-elf", required_argument, NULL, 'M'},
{0}
};
@@ -3024,18 +3127,17 @@ main (ac, av)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- while ((c = getopt_long (ac, av, "xcz:S:aD:l:e:nkAvVb:Uh?m:d:f:i",
+ while ((c = getopt_long (ac, av,
+#ifdef DLLTOOL_MCORE_ELF
+ "m:e:l:aD:d:z:b:xcuUkAS:f:nvVhM:L:F:",
+#else
+ "m:e:l:aD:d:z:b:xcuUkAS:f:nvVh",
+#endif
long_options, 0))
!= EOF)
{
switch (c)
{
- case OPTION_NO_IDATA4:
- no_idata4 = 1;
- break;
- case OPTION_NO_IDATA5:
- no_idata5 = 1;
- break;
case OPTION_EXPORT_ALL_SYMS:
export_all_symbols = true;
break;
@@ -3048,6 +3150,12 @@ main (ac, av)
case OPTION_NO_DEFAULT_EXCLUDES:
do_default_excludes = false;
break;
+ case 'x':
+ no_idata4 = 1;
+ break;
+ case 'c':
+ no_idata5 = 1;
+ break;
case 'S':
as_name = optarg;
break;
@@ -3085,18 +3193,6 @@ main (ac, av)
case 'V':
print_version (program_name);
break;
-#ifdef DLLTOOL_ARM
- case 'i':
- interwork = 1;
- break;
-#endif
- case 'y':
-#if 0
- /* We don't currently define YYDEBUG when building
- defparse.y. */
- yydebug = 1;
-#endif
- break;
case 'U':
add_underscore = 1;
break;
@@ -3120,6 +3216,17 @@ main (ac, av)
fatal (_("Unable to open base-file: %s"), optarg);
break;
+#ifdef DLLTOOL_MCORE_ELF
+ case 'M':
+ mcore_elf_out_file = optarg;
+ break;
+ case 'L':
+ mcore_elf_linker = optarg;
+ break;
+ case 'F':
+ mcore_elf_linker_flags = optarg;
+ break;
+#endif
default:
usage (stderr, 1);
break;
@@ -3127,10 +3234,8 @@ main (ac, av)
}
for (i = 0; mtable[i].type; i++)
- {
if (strcmp (mtable[i].type, mname) == 0)
break;
- }
if (!mtable[i].type)
/* xgettext:c-format */
@@ -3138,12 +3243,6 @@ main (ac, av)
machine = i;
-#ifdef DLLTOOL_ARM
- /* Always enable interworking for Thumb targets. */
- if (machine == MTHUMB && (! interwork))
- interwork = 1;
-#endif
-
if (!dll_name && exp_name)
{
int len = strlen (exp_name) + 5;
@@ -3152,6 +3251,9 @@ main (ac, av)
strcat (dll_name, ".dll");
}
+ if (as_name == NULL)
+ as_name = deduce_name ("as");
+
/* Don't use the default exclude list if we're reading only the
symbols in the .drectve section. The default excludes are meant
to avoid exporting DLL entry point and Cygwin32 impure_ptr. */
@@ -3195,5 +3297,136 @@ main (ac, av)
if (output_def)
gen_def_file ();
+#ifdef DLLTOOL_MCORE_ELF
+ if (mcore_elf_out_file)
+ mcore_elf_gen_out_file ();
+#endif
+
return 0;
}
+
+/* Deduce the name of the program we are want to invoke.
+ PROG_NAME is the basic name of the program we want to run,
+ eg "as" or "ld". The catch is that we might want actually
+ run "i386-pe-as" or "ppc-pe-ld". We detect this case by
+ examining the name used to invoke dlltool itself. If
+ dlltool is actually called <foo>-<bar>-dlltool then we
+ prepend <foo>-<bar> to the default name. */
+static char *
+deduce_name (char * prog_name)
+{
+ /* Use our own static array to hold the constructed name
+ rather than the outfile[] array, as that array may
+ already be in use. */
+ static char new_name[32];
+ char * p;
+
+ p = strrchr (program_name, '-');
+
+ if (p == NULL)
+ return prog_name;
+
+ /* assert (strlen (program_name) < 32); */
+
+ strcpy (new_name, program_name);
+
+ new_name [(p - program_name) + 1] = 0;
+
+ strcat (new_name, prog_name);
+
+ return new_name;
+}
+
+#ifdef DLLTOOL_MCORE_ELF
+typedef struct fname_cache
+{
+ char * filename;
+ struct fname_cache * next;
+}
+fname_cache;
+
+static fname_cache fnames;
+
+static void
+mcore_elf_cache_filename (char * filename)
+{
+ fname_cache * ptr;
+
+ ptr = & fnames;
+
+ while (ptr->next != NULL)
+ ptr = ptr->next;
+
+ ptr->filename = filename;
+ ptr->next = (fname_cache *) malloc (sizeof (fname_cache));
+ if (ptr->next != NULL)
+ ptr->next->next = NULL;
+}
+
+static void
+mcore_elf_gen_out_file (void)
+{
+ fname_cache * ptr;
+
+ /* Step one. Run 'ld -r' on the input object files in order to resolve
+ any internal references and to generate a single .exports section. */
+ ptr = & fnames;
+
+ strcpy (outfile, "-r ");
+
+ if (mcore_elf_linker_flags != NULL)
+ strcat (outfile, mcore_elf_linker_flags);
+
+ while (ptr->next != NULL)
+ {
+ /* Check for overrun: what the hell, it's only cpu cycles... */
+ if (strlen (outfile) + strlen (ptr->filename) + 2 >= sizeof (outfile))
+ {
+ fatal (_("buffer overflow\n"));
+ return;
+ }
+
+ strcat (outfile, ptr->filename);
+ strcat (outfile, " ");
+
+ ptr = ptr->next;
+ }
+
+ strcat (outfile, "-o mcoreelf.tmp");
+
+ if (mcore_elf_linker == NULL)
+ mcore_elf_linker = deduce_name ("ld");
+
+ run (mcore_elf_linker, outfile);
+
+ /* Step two. Create a .exp file and a .lib file from the temporary file.
+ Do this by recursively invoking dlltool....*/
+ sprintf (outfile, "-S %s", as_name);
+
+ strcat (outfile, " -e mcoreelf.exp -l mcoreelf.lib mcoreelf.tmp");
+
+ if (verbose)
+ strcat (outfile, " -v");
+
+ if (dontdeltemps)
+ strcat (outfile, " -n");
+
+ if (dontdeltemps > 1)
+ strcat (outfile, " -n");
+
+ /* XXX - FIME: ought to check/copy other command line options as well. */
+
+ run (program_name, outfile);
+
+ /* Step four. Feed the two new files to ld -shared. */
+ strcpy (outfile, "-shared ");
+
+ if (mcore_elf_linker_flags)
+ strcat (outfile, mcore_elf_linker_flags);
+
+ strcat (outfile, " mcoreelf.exp mcoreelf.lib -o ");
+ strcat (outfile, mcore_elf_out_file);
+
+ run (mcore_elf_linker, outfile);
+}
+#endif /* DLLTOOL_MCORE_ELF */
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 5fd77775d70..5e6d6836f43 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -962,6 +962,16 @@ copy_archive (ibfd, obfd, output_target)
(char *) NULL);
bfd *output_bfd = bfd_openw (output_name, output_target);
bfd *last_element;
+ struct stat buf;
+ int stat_status = 0;
+
+ if (preserve_dates)
+ {
+ stat_status = bfd_stat_arch_elt (this_element, &buf);
+ if (stat_status != 0)
+ non_fatal (_("internal stat error on %s"),
+ bfd_get_filename (this_element));
+ }
l = (struct name_list *) xmalloc (sizeof (struct name_list));
l->name = output_name;
@@ -984,6 +994,9 @@ copy_archive (ibfd, obfd, output_target)
status = 1;
}
+ if (preserve_dates && stat_status == 0)
+ set_times (output_name, &buf);
+
/* Open the newly output file and attach to our list. */
output_bfd = bfd_openr (output_name, output_target);
diff --git a/binutils/objdump.c b/binutils/objdump.c
index 3f9e8c4c3f6..5baf235ebb8 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -1560,9 +1560,9 @@ disassemble_data (abfd)
disasm_info.arch = bfd_get_arch (abfd);
disasm_info.mach = bfd_get_mach (abfd);
if (bfd_big_endian (abfd))
- disasm_info.endian = BFD_ENDIAN_BIG;
+ disasm_info.display_endian = disasm_info.endian = BFD_ENDIAN_BIG;
else if (bfd_little_endian (abfd))
- disasm_info.endian = BFD_ENDIAN_LITTLE;
+ disasm_info.display_endian = disasm_info.endian = BFD_ENDIAN_LITTLE;
else
/* ??? Aborting here seems too drastic. We could default to big or little
instead. */
@@ -2468,7 +2468,10 @@ dump_reloc_set (abfd, sec, relpp, relcount)
if (sym_name)
{
printf_vma (q->address);
- printf (" %-16s ", q->howto->name);
+ if (q->howto->name)
+ printf (" %-16s ", q->howto->name);
+ else
+ printf (" %-16d ", q->howto->type);
objdump_print_symname (abfd, (struct disassemble_info *) NULL,
*q->sym_ptr_ptr);
}
diff --git a/binutils/rclex.l b/binutils/rclex.l
index 06a66077f28..47b479b20b6 100644
--- a/binutils/rclex.l
+++ b/binutils/rclex.l
@@ -37,6 +37,23 @@
static int rcdata_mode;
+/* Whether we are supressing lines from cpp (including windows.h or
+ headers from your C sources may bring in externs and typedefs).
+ When active, we return IGNORED_TOKEN, which lets us ignore these
+ outside of resource constructs. Thus, it isn't required to protect
+ all the non-preprocessor lines in your header files with #ifdef
+ RC_INVOKED. It also means your RC file can't include other RC
+ files if they're named "*.h". Sorry. Name them *.rch or whatever. */
+
+static int suppress_cpp_data;
+
+#define MAYBE_RETURN(x) return suppress_cpp_data ? IGNORED_TOKEN : (x)
+
+/* The first filename we detect in the cpp output. We use this to
+ tell included files from the original file. */
+
+static char *initial_fn;
+
/* List of allocated strings. */
struct alloc_string
@@ -57,82 +74,82 @@ static char *get_string PARAMS ((int));
%%
-"BEGIN" { return BEG; }
-"{" { return BEG; }
-"END" { return END; }
-"}" { return END; }
-"ACCELERATORS" { return ACCELERATORS; }
-"VIRTKEY" { return VIRTKEY; }
-"ASCII" { return ASCII; }
-"NOINVERT" { return NOINVERT; }
-"SHIFT" { return SHIFT; }
-"CONTROL" { return CONTROL; }
-"ALT" { return ALT; }
-"BITMAP" { return BITMAP; }
-"CURSOR" { return CURSOR; }
-"DIALOG" { return DIALOG; }
-"DIALOGEX" { return DIALOGEX; }
-"EXSTYLE" { return EXSTYLE; }
-"CAPTION" { return CAPTION; }
-"CLASS" { return CLASS; }
-"STYLE" { return STYLE; }
-"AUTO3STATE" { return AUTO3STATE; }
-"AUTOCHECKBOX" { return AUTOCHECKBOX; }
-"AUTORADIOBUTTON" { return AUTORADIOBUTTON; }
-"CHECKBOX" { return CHECKBOX; }
-"COMBOBOX" { return COMBOBOX; }
-"CTEXT" { return CTEXT; }
-"DEFPUSHBUTTON" { return DEFPUSHBUTTON; }
-"EDITTEXT" { return EDITTEXT; }
-"GROUPBOX" { return GROUPBOX; }
-"LISTBOX" { return LISTBOX; }
-"LTEXT" { return LTEXT; }
-"PUSHBOX" { return PUSHBOX; }
-"PUSHBUTTON" { return PUSHBUTTON; }
-"RADIOBUTTON" { return RADIOBUTTON; }
-"RTEXT" { return RTEXT; }
-"SCROLLBAR" { return SCROLLBAR; }
-"STATE3" { return STATE3; }
-"USERBUTTON" { return USERBUTTON; }
-"BEDIT" { return BEDIT; }
-"HEDIT" { return HEDIT; }
-"IEDIT" { return IEDIT; }
-"FONT" { return FONT; }
-"ICON" { return ICON; }
-"LANGUAGE" { return LANGUAGE; }
-"CHARACTERISTICS" { return CHARACTERISTICS; }
-"VERSION" { return VERSIONK; }
-"MENU" { return MENU; }
-"MENUEX" { return MENUEX; }
-"MENUITEM" { return MENUITEM; }
-"SEPARATOR" { return SEPARATOR; }
-"POPUP" { return POPUP; }
-"CHECKED" { return CHECKED; }
-"GRAYED" { return GRAYED; }
-"HELP" { return HELP; }
-"INACTIVE" { return INACTIVE; }
-"MENUBARBREAK" { return MENUBARBREAK; }
-"MENUBREAK" { return MENUBREAK; }
-"MESSAGETABLE" { return MESSAGETABLE; }
-"RCDATA" { return RCDATA; }
-"STRINGTABLE" { return STRINGTABLE; }
-"VERSIONINFO" { return VERSIONINFO; }
-"FILEVERSION" { return FILEVERSION; }
-"PRODUCTVERSION" { return PRODUCTVERSION; }
-"FILEFLAGSMASK" { return FILEFLAGSMASK; }
-"FILEFLAGS" { return FILEFLAGS; }
-"FILEOS" { return FILEOS; }
-"FILETYPE" { return FILETYPE; }
-"FILESUBTYPE" { return FILESUBTYPE; }
-"VALUE" { return VALUE; }
-"MOVEABLE" { return MOVEABLE; }
-"FIXED" { return FIXED; }
-"PURE" { return PURE; }
-"IMPURE" { return IMPURE; }
-"PRELOAD" { return PRELOAD; }
-"LOADONCALL" { return LOADONCALL; }
-"DISCARDABLE" { return DISCARDABLE; }
-"NOT" { return NOT; }
+"BEGIN" { MAYBE_RETURN (BEG); }
+"{" { MAYBE_RETURN (BEG); }
+"END" { MAYBE_RETURN (END); }
+"}" { MAYBE_RETURN (END); }
+"ACCELERATORS" { MAYBE_RETURN (ACCELERATORS); }
+"VIRTKEY" { MAYBE_RETURN (VIRTKEY); }
+"ASCII" { MAYBE_RETURN (ASCII); }
+"NOINVERT" { MAYBE_RETURN (NOINVERT); }
+"SHIFT" { MAYBE_RETURN (SHIFT); }
+"CONTROL" { MAYBE_RETURN (CONTROL); }
+"ALT" { MAYBE_RETURN (ALT); }
+"BITMAP" { MAYBE_RETURN (BITMAP); }
+"CURSOR" { MAYBE_RETURN (CURSOR); }
+"DIALOG" { MAYBE_RETURN (DIALOG); }
+"DIALOGEX" { MAYBE_RETURN (DIALOGEX); }
+"EXSTYLE" { MAYBE_RETURN (EXSTYLE); }
+"CAPTION" { MAYBE_RETURN (CAPTION); }
+"CLASS" { MAYBE_RETURN (CLASS); }
+"STYLE" { MAYBE_RETURN (STYLE); }
+"AUTO3STATE" { MAYBE_RETURN (AUTO3STATE); }
+"AUTOCHECKBOX" { MAYBE_RETURN (AUTOCHECKBOX); }
+"AUTORADIOBUTTON" { MAYBE_RETURN (AUTORADIOBUTTON); }
+"CHECKBOX" { MAYBE_RETURN (CHECKBOX); }
+"COMBOBOX" { MAYBE_RETURN (COMBOBOX); }
+"CTEXT" { MAYBE_RETURN (CTEXT); }
+"DEFPUSHBUTTON" { MAYBE_RETURN (DEFPUSHBUTTON); }
+"EDITTEXT" { MAYBE_RETURN (EDITTEXT); }
+"GROUPBOX" { MAYBE_RETURN (GROUPBOX); }
+"LISTBOX" { MAYBE_RETURN (LISTBOX); }
+"LTEXT" { MAYBE_RETURN (LTEXT); }
+"PUSHBOX" { MAYBE_RETURN (PUSHBOX); }
+"PUSHBUTTON" { MAYBE_RETURN (PUSHBUTTON); }
+"RADIOBUTTON" { MAYBE_RETURN (RADIOBUTTON); }
+"RTEXT" { MAYBE_RETURN (RTEXT); }
+"SCROLLBAR" { MAYBE_RETURN (SCROLLBAR); }
+"STATE3" { MAYBE_RETURN (STATE3); }
+"USERBUTTON" { MAYBE_RETURN (USERBUTTON); }
+"BEDIT" { MAYBE_RETURN (BEDIT); }
+"HEDIT" { MAYBE_RETURN (HEDIT); }
+"IEDIT" { MAYBE_RETURN (IEDIT); }
+"FONT" { MAYBE_RETURN (FONT); }
+"ICON" { MAYBE_RETURN (ICON); }
+"LANGUAGE" { MAYBE_RETURN (LANGUAGE); }
+"CHARACTERISTICS" { MAYBE_RETURN (CHARACTERISTICS); }
+"VERSION" { MAYBE_RETURN (VERSIONK); }
+"MENU" { MAYBE_RETURN (MENU); }
+"MENUEX" { MAYBE_RETURN (MENUEX); }
+"MENUITEM" { MAYBE_RETURN (MENUITEM); }
+"SEPARATOR" { MAYBE_RETURN (SEPARATOR); }
+"POPUP" { MAYBE_RETURN (POPUP); }
+"CHECKED" { MAYBE_RETURN (CHECKED); }
+"GRAYED" { MAYBE_RETURN (GRAYED); }
+"HELP" { MAYBE_RETURN (HELP); }
+"INACTIVE" { MAYBE_RETURN (INACTIVE); }
+"MENUBARBREAK" { MAYBE_RETURN (MENUBARBREAK); }
+"MENUBREAK" { MAYBE_RETURN (MENUBREAK); }
+"MESSAGETABLE" { MAYBE_RETURN (MESSAGETABLE); }
+"RCDATA" { MAYBE_RETURN (RCDATA); }
+"STRINGTABLE" { MAYBE_RETURN (STRINGTABLE); }
+"VERSIONINFO" { MAYBE_RETURN (VERSIONINFO); }
+"FILEVERSION" { MAYBE_RETURN (FILEVERSION); }
+"PRODUCTVERSION" { MAYBE_RETURN (PRODUCTVERSION); }
+"FILEFLAGSMASK" { MAYBE_RETURN (FILEFLAGSMASK); }
+"FILEFLAGS" { MAYBE_RETURN (FILEFLAGS); }
+"FILEOS" { MAYBE_RETURN (FILEOS); }
+"FILETYPE" { MAYBE_RETURN (FILETYPE); }
+"FILESUBTYPE" { MAYBE_RETURN (FILESUBTYPE); }
+"VALUE" { MAYBE_RETURN (VALUE); }
+"MOVEABLE" { MAYBE_RETURN (MOVEABLE); }
+"FIXED" { MAYBE_RETURN (FIXED); }
+"PURE" { MAYBE_RETURN (PURE); }
+"IMPURE" { MAYBE_RETURN (IMPURE); }
+"PRELOAD" { MAYBE_RETURN (PRELOAD); }
+"LOADONCALL" { MAYBE_RETURN (LOADONCALL); }
+"DISCARDABLE" { MAYBE_RETURN (DISCARDABLE); }
+"NOT" { MAYBE_RETURN (NOT); }
"BLOCK"[ \t\n]*"\""[^\#\n]*"\"" {
char *s, *send;
@@ -146,11 +163,11 @@ static char *get_string PARAMS ((int));
if (strncmp (s, "StringFileInfo",
sizeof "StringFileInfo" - 1) == 0
&& s + sizeof "StringFileInfo" - 1 == send)
- return BLOCKSTRINGFILEINFO;
+ MAYBE_RETURN (BLOCKSTRINGFILEINFO);
else if (strncmp (s, "VarFileInfo",
sizeof "VarFileInfo" - 1) == 0
&& s + sizeof "VarFileInfo" - 1 == send)
- return BLOCKVARFILEINFO;
+ MAYBE_RETURN (BLOCKVARFILEINFO);
else
{
char *r;
@@ -159,7 +176,7 @@ static char *get_string PARAMS ((int));
strncpy (r, s, send - s);
r[send - s] = '\0';
yylval.s = r;
- return BLOCK;
+ MAYBE_RETURN (BLOCK);
}
}
@@ -170,13 +187,13 @@ static char *get_string PARAMS ((int));
[0-9][x0-9A-Fa-f]*L {
yylval.i.val = strtoul (yytext, 0, 0);
yylval.i.dword = 1;
- return NUMBER;
+ MAYBE_RETURN (NUMBER);
}
[0-9][x0-9A-Fa-f]* {
yylval.i.val = strtoul (yytext, 0, 0);
yylval.i.dword = 0;
- return NUMBER;
+ MAYBE_RETURN (NUMBER);
}
("\""[^\"\n]*"\""[ \t]*)+ {
@@ -187,13 +204,13 @@ static char *get_string PARAMS ((int));
if (! rcdata_mode)
{
yylval.s = s;
- return QUOTEDSTRING;
+ MAYBE_RETURN (QUOTEDSTRING);
}
else
{
yylval.ss.length = length;
yylval.ss.s = s;
- return SIZEDSTRING;
+ MAYBE_RETURN (SIZEDSTRING);
}
}
@@ -209,12 +226,12 @@ static char *get_string PARAMS ((int));
s = get_string (strlen (yytext) + 1);
strcpy (s, yytext);
yylval.s = s;
- return STRING;
+ MAYBE_RETURN (STRING);
}
[\n] { ++rc_lineno; }
[ \t\r]+ { /* ignore whitespace */ }
-. { return *yytext; }
+. { MAYBE_RETURN (*yytext); }
%%
#ifndef yywrap
@@ -263,6 +280,20 @@ cpp_line (s)
free (rc_filename);
rc_filename = fn;
+
+ if (!initial_fn)
+ {
+ initial_fn = xmalloc (strlen (fn) + 1);
+ strcpy(initial_fn, fn);
+ }
+
+ /* Allow the initial file, regardless of name. Suppress all other
+ files if they end in ".h" (this allows included "*.rc") */
+ if (strcmp (initial_fn, fn) == 0
+ || strcmp (fn + strlen (fn) - 2, ".h") != 0)
+ suppress_cpp_data = 0;
+ else
+ suppress_cpp_data = 1;
}
/* Handle a quoted string. The quotes are stripped. A pair of quotes
diff --git a/binutils/rcparse.y b/binutils/rcparse.y
index 67079a5fd81..03cbbdc5b67 100644
--- a/binutils/rcparse.y
+++ b/binutils/rcparse.y
@@ -122,6 +122,7 @@ static unsigned long class;
%token <s> QUOTEDSTRING STRING
%token <i> NUMBER
%token <ss> SIZEDSTRING
+%token IGNORED_TOKEN
%type <pacc> acc_entries
%type <acc> acc_entry acc_event
@@ -167,6 +168,7 @@ input:
| input newcmd stringtable
| input newcmd user
| input newcmd versioninfo
+ | input newcmd IGNORED_TOKEN
;
newcmd:
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 549bf1a68b6..8c69d961e78 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -58,6 +58,7 @@
#include "elf/arc.h"
#include "elf/fr30.h"
#include "elf/mcore.h"
+#include "elf/i960.h"
#include "bucomm.h"
#include "getopt.h"
@@ -117,7 +118,7 @@ unsigned int num_dump_sects = 0;
static unsigned long (* byte_get) PARAMS ((unsigned char *, int));
static const char * get_mips_dynamic_type PARAMS ((unsigned long type));
static const char * get_dynamic_type PARAMS ((unsigned long type));
-static int dump_relocations PARAMS ((FILE *, unsigned long, unsigned long, Elf_Internal_Sym *, char *));
+static int dump_relocations PARAMS ((FILE *, unsigned long, unsigned long, Elf_Internal_Sym *, char *, int));
static char * get_file_type PARAMS ((unsigned e_type));
static char * get_machine_name PARAMS ((unsigned e_machine));
static char * get_machine_data PARAMS ((unsigned e_data));
@@ -173,9 +174,16 @@ static void request_dump PARAMS ((unsigned int, char));
static const char * get_elf_class PARAMS ((unsigned char));
static const char * get_data_encoding PARAMS ((unsigned char));
static const char * get_osabi_name PARAMS ((unsigned char));
+static int guess_is_rela PARAMS ((unsigned long));
typedef int Elf32_Word;
+#ifndef TRUE
+#define TRUE 1
+#define FALSE 0
+#endif
+#define UNKNOWN -1
+
#define SECTION_NAME(X) (string_table + (X)->sh_name)
#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) /* Reverse order! */
@@ -328,57 +336,24 @@ byte_get_big_endian (field, size)
}
-/* Display the contents of the relocation data
- found at the specified offset. */
+/* Guess the relocation sized based on the sized commonly used by the specific machine. */
static int
-dump_relocations (file, rel_offset, rel_size, symtab, strtab)
- FILE * file;
- unsigned long rel_offset;
- unsigned long rel_size;
- Elf_Internal_Sym * symtab;
- char * strtab;
+guess_is_rela (e_machine)
+ unsigned long e_machine;
{
- unsigned int i;
- int is_rela;
- Elf_Internal_Rel * rels;
- Elf_Internal_Rela * relas;
-
-
- /* Compute number of relocations and read them in. */
- switch (elf_header.e_machine)
+ switch (e_machine)
{
/* Targets that use REL relocations. */
case EM_ARM:
case EM_386:
case EM_486:
+ case EM_960:
case EM_CYGNUS_M32R:
case EM_CYGNUS_D10V:
case EM_MIPS:
case EM_MIPS_RS4_BE:
- {
- Elf32_External_Rel * erels;
-
- GET_DATA_ALLOC (rel_offset, rel_size, erels,
- Elf32_External_Rel *, "relocs");
-
- rel_size = rel_size / sizeof (Elf32_External_Rel);
-
- rels = (Elf_Internal_Rel *) malloc (rel_size *
- sizeof (Elf_Internal_Rel));
-
- for (i = 0; i < rel_size; i++)
- {
- rels[i].r_offset = BYTE_GET (erels[i].r_offset);
- rels[i].r_info = BYTE_GET (erels[i].r_info);
- }
-
- free (erels);
-
- is_rela = 0;
- relas = (Elf_Internal_Rela *) rels;
- }
- break;
-
+ return FALSE;
+
/* Targets that use RELA relocations. */
case EM_68K:
case EM_SPARC:
@@ -391,34 +366,89 @@ dump_relocations (file, rel_offset, rel_size, symtab, strtab)
case EM_SH:
case EM_ALPHA:
case EM_MCORE:
- {
- Elf32_External_Rela * erelas;
-
- GET_DATA_ALLOC (rel_offset, rel_size, erelas,
- Elf32_External_Rela *, "relocs");
-
- rel_size = rel_size / sizeof (Elf32_External_Rela);
-
- relas = (Elf_Internal_Rela *) malloc (rel_size *
- sizeof (Elf_Internal_Rela));
+ return TRUE;
+
+ default:
+ warn (_("Don't know about relocations on this machine architecture\n"));
+ return FALSE;
+ }
+}
- for (i = 0; i < rel_size; i++)
- {
- relas[i].r_offset = BYTE_GET (erelas[i].r_offset);
- relas[i].r_info = BYTE_GET (erelas[i].r_info);
- relas[i].r_addend = BYTE_GET (erelas[i].r_addend);
- }
+/* Display the contents of the relocation data
+ found at the specified offset. */
+static int
+dump_relocations (file, rel_offset, rel_size, symtab, strtab, is_rela)
+ FILE * file;
+ unsigned long rel_offset;
+ unsigned long rel_size;
+ Elf_Internal_Sym * symtab;
+ char * strtab;
+ int is_rela;
+{
+ unsigned int i;
+ Elf_Internal_Rel * rels;
+ Elf_Internal_Rela * relas;
- free (erelas);
+
+ if (is_rela == UNKNOWN)
+ is_rela = guess_is_rela (elf_header.e_machine);
- is_rela = 1;
- rels = (Elf_Internal_Rel *) relas;
- }
- break;
+ if (is_rela)
+ {
+ Elf32_External_Rela * erelas;
+
+ GET_DATA_ALLOC (rel_offset, rel_size, erelas,
+ Elf32_External_Rela *, "relocs");
+
+ rel_size = rel_size / sizeof (Elf32_External_Rela);
+
+ relas = (Elf_Internal_Rela *) malloc (rel_size *
+ sizeof (Elf_Internal_Rela));
+
+ if (relas == NULL)
+ {
+ error(_("out of memory parsing relocs"));
+ return 0;
+ }
+
+ for (i = 0; i < rel_size; i++)
+ {
+ relas[i].r_offset = BYTE_GET (erelas[i].r_offset);
+ relas[i].r_info = BYTE_GET (erelas[i].r_info);
+ relas[i].r_addend = BYTE_GET (erelas[i].r_addend);
+ }
+
+ free (erelas);
+
+ rels = (Elf_Internal_Rel *) relas;
+ }
+ else
+ {
+ Elf32_External_Rel * erels;
+ unsigned long saved_rel_size = rel_size;
- default:
- warn (_("Don't know about relocations on this machine architecture\n"));
- return 0;
+ GET_DATA_ALLOC (rel_offset, rel_size, erels,
+ Elf32_External_Rel *, "relocs");
+
+ rel_size = rel_size / sizeof (Elf32_External_Rel);
+
+ rels = (Elf_Internal_Rel *) malloc (rel_size *
+ sizeof (Elf_Internal_Rel));
+ if (rels == NULL)
+ {
+ error(_("out of memory parsing relocs"));
+ return 0;
+ }
+
+ for (i = 0; i < rel_size; i++)
+ {
+ rels[i].r_offset = BYTE_GET (erels[i].r_offset);
+ rels[i].r_info = BYTE_GET (erels[i].r_info);
+ }
+
+ free (erels);
+
+ relas = (Elf_Internal_Rela *) rels;
}
if (is_rela)
@@ -467,6 +497,10 @@ dump_relocations (file, rel_offset, rel_size, symtab, strtab)
rtype = elf_m68k_reloc_type (ELF32_R_TYPE (info));
break;
+ case EM_960:
+ rtype = elf_i960_reloc_type (ELF32_R_TYPE (info));
+ break;
+
case EM_SPARC:
rtype = elf_sparc_reloc_type (ELF32_R_TYPE (info));
break;
@@ -555,6 +589,8 @@ dump_relocations (file, rel_offset, rel_size, symtab, strtab)
if (is_rela)
printf (" + %lx", (unsigned long) relas [i].r_addend);
}
+ else if (is_rela)
+ printf ("%34c%lx", ' ', (unsigned long) relas[i].r_addend);
putchar ('\n');
}
@@ -810,6 +846,11 @@ get_machine_flags (e_flags, e_machine)
default:
break;
+ case EM_68K:
+ if (e_flags & EF_CPU32)
+ strcat (buf, ", cpu32");
+ break;
+
case EM_PPC:
if (e_flags & EF_PPC_EMB)
strcat (buf, ", emb");
@@ -1312,12 +1353,16 @@ static const char *
get_elf_class (elf_class)
unsigned char elf_class;
{
+ static char buff [32];
+
switch (elf_class)
{
case ELFCLASSNONE: return _("none");
case ELFCLASS32: return _("ELF32");
case ELFCLASS64: return _("ELF64");
- default: return _("<unknown>");
+ default:
+ sprintf (buff, _("<unknown: %lx>"), elf_class);
+ return buff;
}
}
@@ -1325,12 +1370,16 @@ static const char *
get_data_encoding (encoding)
unsigned char encoding;
{
+ static char buff [32];
+
switch (encoding)
{
case ELFDATANONE: return _("none");
- case ELFDATA2LSB: return _("2's compilment, little endian");
- case ELFDATA2MSB: return _("2's compilment, big endian");
- default: return _("<unknown>");
+ case ELFDATA2LSB: return _("2's complement, little endian");
+ case ELFDATA2MSB: return _("2's complement, big endian");
+ default:
+ sprintf (buff, _("<unknown: %lx>"), encoding);
+ return buff;
}
}
@@ -1338,12 +1387,16 @@ static const char *
get_osabi_name (osabi)
unsigned char osabi;
{
+ static char buff [32];
+
switch (osabi)
{
case ELFOSABI_SYSV: return _("UNIX - System V");
case ELFOSABI_HPUX: return _("UNIX - HP-UX");
case ELFOSABI_STANDALONE: return _("Standalone App");
- default: return _("<unknown>");
+ default:
+ sprintf (buff, _("<unknown: %lx>"), osabi);
+ return buff;
}
}
@@ -1377,7 +1430,8 @@ process_file_header ()
printf (_(" Version: %d %s\n"),
elf_header.e_ident [EI_VERSION],
elf_header.e_ident [EI_VERSION] == EV_CURRENT ? "(current)" :
- elf_header.e_ident [EI_VERSION] != EV_NONE ? "<unknown>" : "");
+ elf_header.e_ident [EI_VERSION] != EV_NONE ? "<unknown: %lx>" : "",
+ elf_header.e_ident [EI_VERSION]);
printf (_(" OS/ABI: %s\n"),
get_osabi_name (elf_header.e_ident [EI_OSABI]));
printf (_(" ABI Version: %d\n"),
@@ -1490,6 +1544,7 @@ process_program_headers (file)
loadaddr = -1;
dynamic_addr = 0;
+ dynamic_size = 0;
for (i = 0, segment = program_headers;
i < elf_header.e_phnum;
@@ -1813,6 +1868,8 @@ process_relocs (file)
if (do_using_dynamic)
{
+ int is_rela;
+
rel_size = 0;
rel_offset = 0;
@@ -1820,16 +1877,30 @@ process_relocs (file)
{
rel_offset = dynamic_info[DT_REL];
rel_size = dynamic_info[DT_RELSZ];
+ is_rela = FALSE;
}
else if (dynamic_info [DT_RELA])
{
rel_offset = dynamic_info[DT_RELA];
rel_size = dynamic_info[DT_RELASZ];
+ is_rela = TRUE;
}
else if (dynamic_info[DT_JMPREL])
{
rel_offset = dynamic_info[DT_JMPREL];
rel_size = dynamic_info[DT_PLTRELSZ];
+ switch (dynamic_info[DT_PLTREL])
+ {
+ case DT_REL:
+ is_rela = FALSE;
+ break;
+ case DT_RELA:
+ is_rela = TRUE;
+ break;
+ default:
+ is_rela = UNKNOWN;
+ break;
+ }
}
if (rel_size)
@@ -1839,7 +1910,7 @@ process_relocs (file)
rel_offset, rel_size);
dump_relocations (file, rel_offset - loadaddr, rel_size,
- dynamic_symbols, dynamic_strings);
+ dynamic_symbols, dynamic_strings, is_rela);
}
else
printf (_("\nThere are no dynamic relocations in this file.\n"));
@@ -1867,13 +1938,18 @@ process_relocs (file)
Elf32_Internal_Shdr * symsec;
Elf_Internal_Sym * symtab;
char * strtab;
-
+ int is_rela;
+
printf (_("\nRelocation section "));
if (string_table == NULL)
- printf ("%d", section->sh_name);
+ {
+ printf ("%d", section->sh_name);
+ }
else
- printf ("'%s'", SECTION_NAME (section));
+ {
+ printf ("'%s'", SECTION_NAME (section));
+ }
printf (_(" at offset 0x%lx contains %lu entries:\n"),
rel_offset, (unsigned long) (rel_size / section->sh_entsize));
@@ -1890,8 +1966,10 @@ process_relocs (file)
GET_DATA_ALLOC (strsec->sh_offset, strsec->sh_size, strtab,
char *, "string table");
+
+ is_rela = section->sh_type == SHT_RELA;
- dump_relocations (file, rel_offset, rel_size, symtab, strtab);
+ dump_relocations (file, rel_offset, rel_size, symtab, strtab, is_rela);
free (strtab);
free (symtab);
@@ -2502,7 +2580,7 @@ process_version_sections (file)
printf (_(" Addr: 0x"));
printf_vma (section->sh_addr);
printf (_(" Offset: %#08lx Link: %lx (%s)\n"),
- section->sh_offset, section->sh_link,
+ (unsigned long) section->sh_offset, section->sh_link,
SECTION_NAME (section_headers + section->sh_link));
GET_DATA_ALLOC (section->sh_offset, section->sh_size,
@@ -2590,7 +2668,7 @@ process_version_sections (file)
printf (_(" Addr: 0x"));
printf_vma (section->sh_addr);
printf (_(" Offset: %#08lx Link to section: %ld (%s)\n"),
- section->sh_offset, section->sh_link,
+ (unsigned long) section->sh_offset, section->sh_link,
SECTION_NAME (section_headers + section->sh_link));
GET_DATA_ALLOC (section->sh_offset, section->sh_size,
@@ -2691,7 +2769,7 @@ process_version_sections (file)
printf (_(" Addr: "));
printf_vma (section->sh_addr);
printf (_(" Offset: %#08lx Link: %lx (%s)\n"),
- section->sh_offset, section->sh_link,
+ (unsigned long) section->sh_offset, section->sh_link,
SECTION_NAME (link_section));
GET_DATA_ALLOC (version_info [DT_VERSIONTAGIDX (DT_VERSYM)]
@@ -3195,14 +3273,7 @@ process_symbol_table (file)
get_symbol_binding (ELF_ST_BIND (psym->st_info)),
psym->st_other);
- if (psym->st_shndx == 0)
- fputs (" UND", stdout);
- else if ((psym->st_shndx & 0xffff) == 0xfff1)
- fputs (" ABS", stdout);
- else if ((psym->st_shndx & 0xffff) == 0xfff2)
- fputs (" COM", stdout);
- else
- printf ("%4x", psym->st_shndx);
+ printf ("%4s", get_symbol_index_type (psym->st_shndx));
printf (" %s", strtab + psym->st_name);
diff --git a/binutils/rename.c b/binutils/rename.c
index fdc7263d1fc..f8314fbd095 100644
--- a/binutils/rename.c
+++ b/binutils/rename.c
@@ -139,17 +139,17 @@ smart_rename (from, to, preserve_dates)
const char *to;
int preserve_dates;
{
- int exists;
+ boolean exists;
struct stat s;
int ret = 0;
- exists = lstat (to, &s);
+ exists = lstat (to, &s) == 0;
#if defined (_WIN32) && !defined (__CYGWIN32__)
/* Win32, unlike unix, will not erase `to' in `rename(from, to)' but
fail instead. Also, chown is not present. */
- if (exists == 0)
+ if (exists)
remove (to);
ret = rename (from, to);
@@ -163,7 +163,7 @@ smart_rename (from, to, preserve_dates)
#else
/* Use rename only if TO is not a symbolic link and has
only one hard link. */
- if (exists < 0 || (!S_ISLNK (s.st_mode) && s.st_nlink == 1))
+ if (! exists || (!S_ISLNK (s.st_mode) && s.st_nlink == 1))
{
ret = rename (from, to);
if (ret == 0)
diff --git a/binutils/rescoff.c b/binutils/rescoff.c
index 9a028c73053..fe2487a396f 100644
--- a/binutils/rescoff.c
+++ b/binutils/rescoff.c
@@ -447,9 +447,14 @@ write_coff_file (filename, target, resources)
if (! bfd_set_format (abfd, bfd_object))
bfd_fatal ("bfd_set_format");
+#ifdef DLLTOOL_ARM
+ if (! bfd_set_arch_mach (abfd, bfd_arch_arm, 0))
+ bfd_fatal ("bfd_set_arch_mach(arm)");
+#else
/* FIXME: This is obviously i386 specific. */
if (! bfd_set_arch_mach (abfd, bfd_arch_i386, 0))
- bfd_fatal ("bfd_set_arch_mach");
+ bfd_fatal ("bfd_set_arch_mach(i386)");
+#endif /* arm */
if (! bfd_set_file_flags (abfd, HAS_SYMS | HAS_RELOC))
bfd_fatal ("bfd_set_file_flags");
diff --git a/binutils/resrc.c b/binutils/resrc.c
index 9ba3c117807..41c9ccacfbe 100644
--- a/binutils/resrc.c
+++ b/binutils/resrc.c
@@ -120,6 +120,52 @@ static void get_data
PARAMS ((FILE *, unsigned char *, unsigned long, const char *));
static void define_fontdirs PARAMS ((void));
+/* look for the preprocessor program */
+
+FILE *
+look_for_default (cmd, prefix, end_prefix, preprocargs, filename)
+ char *cmd;
+ char *prefix;
+ int end_prefix;
+ char *preprocargs;
+ char *filename;
+{
+ char *path = getenv ("PATH");
+ char *space;
+ int found;
+ struct stat s;
+
+ strcpy (cmd, prefix);
+
+ sprintf (cmd+end_prefix, "%s", DEFAULT_PREPROCESSOR);
+ space = strchr (cmd+end_prefix, ' ');
+ if (space)
+ *space = 0;
+
+ if (strchr (cmd, '/'))
+ {
+ found = stat (cmd, &s);
+
+ if (found < 0)
+ {
+ if (verbose)
+ fprintf (stderr, "Tried `%s'\n", cmd);
+ return 0;
+ }
+ }
+
+ strcpy (cmd, prefix);
+
+ sprintf (cmd+end_prefix, "%s %s %s",
+ DEFAULT_PREPROCESSOR, preprocargs, filename);
+
+ if (verbose)
+ fprintf (stderr, "Using `%s'\n", cmd);
+
+ cpp_pipe = popen (cmd, FOPEN_RT);
+ return cpp_pipe;
+}
+
/* Read an rc file. */
struct res_directory *
@@ -131,21 +177,78 @@ read_rc_file (filename, preprocessor, preprocargs, language)
{
char *cmd;
- if (preprocessor == NULL)
- preprocessor = DEFAULT_PREPROCESSOR;
-
if (preprocargs == NULL)
preprocargs = "";
if (filename == NULL)
filename = "-";
- cmd = xmalloc (strlen (preprocessor)
- + strlen (preprocargs)
- + strlen (filename)
- + 10);
- sprintf (cmd, "%s %s %s", preprocessor, preprocargs, filename);
+ if (preprocessor)
+ {
+ cmd = xmalloc (strlen (preprocessor)
+ + strlen (preprocargs)
+ + strlen (filename)
+ + 10);
+ sprintf (cmd, "%s %s %s", preprocessor, preprocargs, filename);
- cpp_pipe = popen (cmd, FOPEN_RT);
+ cpp_pipe = popen (cmd, FOPEN_RT);
+ }
+ else
+ {
+ char *dash, *slash, *cp;
+
+ preprocessor = DEFAULT_PREPROCESSOR;
+
+ cmd = xmalloc (strlen (program_name)
+ + strlen (preprocessor)
+ + strlen (preprocargs)
+ + strlen (filename)
+ + 10);
+
+
+ dash = slash = 0;
+ for (cp=program_name; *cp; cp++)
+ {
+ if (*cp == '-')
+ dash = cp;
+ if (
+#if defined(__DJGPP__) || defined (__CYGWIN__) || defined(__WIN32__)
+ *cp == ':' || *cp == '\\' ||
+#endif
+ *cp == '/')
+ {
+ slash = cp;
+ dash = 0;
+ }
+ }
+
+ cpp_pipe = 0;
+
+ if (dash)
+ {
+ /* First, try looking for a prefixed gcc in the windres
+ directory, with the same prefix as windres */
+
+ cpp_pipe = look_for_default (cmd, program_name, dash-program_name+1,
+ preprocargs, filename);
+ }
+
+ if (slash && !cpp_pipe)
+ {
+ /* Next, try looking for a gcc in the same directory as
+ that windres */
+
+ cpp_pipe = look_for_default (cmd, program_name, slash-program_name+1,
+ preprocargs, filename);
+ }
+
+ if (!cpp_pipe)
+ {
+ /* Sigh, try the default */
+
+ cpp_pipe = look_for_default (cmd, "", 0, preprocargs, filename);
+ }
+
+ }
if (cpp_pipe == NULL)
fatal (_("can't popen `%s': %s"), cmd, strerror (errno));
free (cmd);
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog
index 15a0577791f..98208508f62 100644
--- a/binutils/testsuite/ChangeLog
+++ b/binutils/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+1999-05-28 Ian Lance Taylor <ian@zembu.com>
+
+ * binutils-all/readelf.h: Update for changes of 1999-04-08.
+
1999-03-12 Nick Clifton <nickc@cygnus.com>
* binutils-all/readelf.wi: Remove FR30 specific componnts.
diff --git a/binutils/testsuite/binutils-all/readelf.h b/binutils/testsuite/binutils-all/readelf.h
index 555afe9a7a2..0f2a9ac4ecf 100644
--- a/binutils/testsuite/binutils-all/readelf.h
+++ b/binutils/testsuite/binutils-all/readelf.h
@@ -1,5 +1,10 @@
ELF Header:
Magic: 7f 45 4c 46 0[12] 0[12] 01 00 00 00 00 00 00 00 00 00
+ Class: ELF[36][24]
+ Data: 2's complement,.* endian
+ Version: 1 \(current\)
+ OS/ABI: .*
+ ABI Version: .*
Type: REL \(Relocatable file\)
Machine: .*
Version: 0x1
diff --git a/binutils/windres.c b/binutils/windres.c
index 7de28c259e6..990db903311 100644
--- a/binutils/windres.c
+++ b/binutils/windres.c
@@ -46,6 +46,10 @@
#include <ctype.h>
#include <time.h>
+/* used by resrc.c at least */
+
+int verbose = 0;
+
/* An enumeration of format types. */
enum res_format
@@ -122,6 +126,7 @@ static const struct option long_options[] =
{"output-format", required_argument, 0, 'O'},
{"preprocessor", required_argument, 0, OPTION_PREPROCESSOR},
{"target", required_argument, 0, 'F'},
+ {"verbose", no_argument, 0, 'v'},
{"version", no_argument, 0, OPTION_VERSION},
{"yydebug", no_argument, 0, OPTION_YYDEBUG},
{0, no_argument, 0, 0}
@@ -705,7 +710,9 @@ Options:\n\
-F TARGET, --target TARGET Specify COFF target\n\
--preprocessor PROGRAM Program to use to preprocess rc file\n\
--include-dir DIR Include directory when preprocessing rc file\n\
- --define SYM[=VAL] Define SYM when preprocessing rc file\n\
+ -DSYM[=VAL], --define SYM[=VAL]\n\
+ Define SYM when preprocessing rc file\n\
+ -v Verbose - tells you what it's doing\n\n
--language VAL Set language when reading rc file\n"));
#ifdef YYDEBUG
fprintf (stream, _("\
@@ -724,6 +731,34 @@ No input-file is stdin, default rc. No output-file is stdout, default rc.\n"));
exit (status);
}
+/* Quote characters that will confuse the shell when we run the preprocessor */
+static const char *quot (string)
+ const char *string;
+{
+ static char *buf = 0;
+ static int buflen = 0;
+ int slen = strlen (string);
+ const char *src;
+ char *dest;
+
+ if ((buflen < slen * 2 + 2) || !buf)
+ {
+ buflen = slen * 2 + 2;
+ if (buf)
+ free (buf);
+ buf = (char *) xmalloc (buflen);
+ }
+
+ for (src=string, dest=buf; *src; src++, dest++)
+ {
+ if (*src == '(' || *src == ')' || *src == ' ')
+ *dest++ = '\\';
+ *dest = *src;
+ }
+ *dest = 0;
+ return buf;
+}
+
/* The main function. */
int
@@ -739,6 +774,7 @@ main (argc, argv)
char *target;
char *preprocessor;
char *preprocargs;
+ const char *quotedarg;
int language;
struct res_directory *resources;
@@ -765,7 +801,7 @@ main (argc, argv)
preprocargs = NULL;
language = -1;
- while ((c = getopt_long (argc, argv, "i:o:I:O:F:", long_options,
+ while ((c = getopt_long (argc, argv, "i:o:I:O:F:D:v", long_options,
(int *) 0)) != EOF)
{
switch (c)
@@ -794,35 +830,44 @@ main (argc, argv)
preprocessor = optarg;
break;
+ case 'D':
case OPTION_DEFINE:
if (preprocargs == NULL)
{
- preprocargs = xmalloc (strlen (optarg) + 3);
- sprintf (preprocargs, "-D%s", optarg);
+ quotedarg = quot (optarg);
+ preprocargs = xmalloc (strlen (quotedarg) + 3);
+ sprintf (preprocargs, "-D%s", quotedarg);
}
else
{
char *n;
- n = xmalloc (strlen (preprocargs) + strlen (optarg) + 4);
- sprintf (n, "%s -D%s", preprocargs, optarg);
+ quotedarg = quot (optarg);
+ n = xmalloc (strlen (preprocargs) + strlen (quotedarg) + 4);
+ sprintf (n, "%s -D%s", preprocargs, quotedarg);
free (preprocargs);
preprocargs = n;
}
break;
+ case 'v':
+ verbose ++;
+ break;
+
case OPTION_INCLUDE_DIR:
if (preprocargs == NULL)
{
- preprocargs = xmalloc (strlen (optarg) + 3);
- sprintf (preprocargs, "-I%s", optarg);
+ quotedarg = quot (optarg);
+ preprocargs = xmalloc (strlen (quotedarg) + 3);
+ sprintf (preprocargs, "-I%s", quotedarg);
}
else
{
char *n;
- n = xmalloc (strlen (preprocargs) + strlen (optarg) + 4);
- sprintf (n, "%s -I%s", preprocargs, optarg);
+ quotedarg = quot (optarg);
+ n = xmalloc (strlen (preprocargs) + strlen (quotedarg) + 4);
+ sprintf (n, "%s -I%s", preprocargs, quotedarg);
free (preprocargs);
preprocargs = n;
}
diff --git a/binutils/windres.h b/binutils/windres.h
index a3c789abd02..db43dd51c98 100644
--- a/binutils/windres.h
+++ b/binutils/windres.h
@@ -742,6 +742,8 @@ struct bindata
unsigned char *data;
};
+extern int verbose;
+
/* Function declarations. */
extern struct res_directory *read_rc_file
diff --git a/config.guess b/config.guess
index 3c75a80de33..885f6612027 100755
--- a/config.guess
+++ b/config.guess
@@ -576,7 +576,7 @@ EOF
sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
- elf32ppc)
+ elf32ppc | elf32ppclinux)
# Determine Lib Version
cat >dummy.c <<EOF
#include <features.h>
diff --git a/config.sub b/config.sub
index 3d4f5fd21b1..d996fe15e21 100755
--- a/config.sub
+++ b/config.sub
@@ -64,18 +64,6 @@ case $1 in
;;
esac
-# CYGNUS LOCAL marketing-names
-# Here we handle any "marketing" names - translating them to
-# standard triplets
-case $1 in
- mips-tx39-elf)
- set mipstx39-unknown-elf
- ;;
- *)
- ;;
-esac
-# END CYGNUS LOCAL marketing-names
-
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
@@ -110,13 +98,13 @@ case $os in
os=
basic_machine=$1
;;
- -sim | -cisco | -oki | -wec | -winbond ) # EGCS LOCAL
+ -sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
;;
- -scout) # EGCS LOCAL
+ -scout)
;;
- -wrs) # EGCS LOCAL
+ -wrs)
os=vxworks
basic_machine=$1
;;
@@ -175,65 +163,18 @@ case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
- | arme[lb] | pyramid | mn10200 | mn10300 \
- | tron | a29k | 580 | i960 | h8300 \
+ | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
+ | 580 | i960 | h8300 \
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
- | alpha | alphaev[45678] | alphaev56 | alphapca5[67] \
+ | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
- | 1750a | dsp16xx | pdp11 \
- | mips64 | mipsel | mips64el | mips64orion | mips64orionel \
- | mipstx39 | mipstx39el \
- | sparc | sparclet | sparclite | sparc64 | sparc86x | v850 \
- | c4x)
- basic_machine=$basic_machine-unknown
- ;;
- m88110 | m680[012346]0 | m683?2 | m68360 | m5200 | z8k | v70 \
- | h8500 | w65 | fr30 | mcore) # CYGNUS / EGCS LOCAL
- basic_machine=$basic_machine-unknown
- ;;
- strongarm) # CYGNUS LOCAL nickc/strongarm
- basic_machine=$basic_machine-unknown
- ;;
- thumb)
- basic_machine=$basic_machine-unknown
- ;;
- # CYGNUS LOCAL vr4111/gavin
- mips64vr4111 | mips64vr4111el)
- basic_machine=$basic_machine-unknown
- ;;
- # END CYGNUS LOCAL vr4111/gavin
- mips64vr4300 | mips64vr4300el) # EGCS LOCAL jsmith/vr4300
- basic_machine=$basic_machine-unknown
- ;;
- mips64vr4100 | mips64vr4100el) # EGCS LOCAL jsmith/vr4100
- basic_machine=$basic_machine-unknown
- ;;
- mips64vr5000 | mips64vr5000el) # EGCS LOCAL ian/vr5000
- basic_machine=$basic_machine-unknown
- ;;
- mips16)
- basic_machine=$basic_machine-unknown
- ;;
- tic30) # CYGNUS LOCAL ian/tic30
- basic_machine=$basic_machine-unknown
- ;;
- c30) # CYGNUS LOCAL ian/tic30
- basic_machine=tic30-unknown
- ;;
-
- tic80) # CYGNUS LOCAL fnf/TIc80
- basic_machine=$basic_machine-unknown
- ;;
- v850e) # CYGNUS LOCAL jtc/v850
- basic_machine=$basic_machine-unknown
- ;;
- v850ea) # CYGNUS LOCAL jtc/v850
- basic_machine=$basic_machine-unknown
- ;;
- d10v)
- basic_machine=$basic_machine-unknown
- ;;
- d30v) # CYGNUS LOCAL hunt/d30v
+ | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
+ | mips64orion | mips64orionel | mipstx39 | mipstx39el \
+ | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
+ | mips64vr5000 | miprs64vr5000el \
+ | m88110 | m680[012346]0 | m683?2 | m68360 | m5200 | z8k | v70 \
+ | sparc | sparclet | sparclite | sparc64 | sparc86x | sparcv9 \
+ | thumb | v850 | c4x | d10v | h8500 | w65)
basic_machine=$basic_machine-unknown
;;
# We use `pc' rather than `unknown'
@@ -251,54 +192,24 @@ case $basic_machine in
vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
- | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
+ | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
| xmp-* | ymp-* \
- | hppa-* | hppa1.0-* | hppa1.1-* \
- | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
- | alpha-* | alphaev[45678]-* | alphaev56-* | alphapca5[67]-* \
- | we32k-* | cydra-* | ns16k-* | pn-* | np1-* \
- | xps100-* | clipper-* | orion-* \
+ | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
+ | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
+ | clipper-* | orion-* \
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
- | sparc64-* | sparcv9-* | sparc86x-* | mips64-* | mipsel-* \
- | mips64el-* | mips64orion-* | mips64orionel-* \
+ | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
+ | mips64el-* | mips64orion-* | mips64orionel-* \
+ | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
| mipstx39-* | mipstx39el-* \
- | f301-* | arm*-* \
- | fr30-* | mcore-*) # CYGNUS LOCAL
- ;;
- m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | h8500-* | d10v-*) # EGCS LOCAL
- ;;
- strongarm-*) # CYGNUS LOCAL nickc/strongarm
- ;;
- thumb-*) # EGCS LOCAL angela/thumb
- ;;
- v850-*) # EGCS LOCAL
- ;;
- v850e-*) # CYGNUS LOCAL
- ;;
- v850ea-*) # CYGNUS LOCAL
- ;;
- d30v-*) # EGCS LOCAL
- ;;
- # CYGNUS LOCAL vr4111/gavin
- mips64vr4111-* | mips64vr4111el-*)
- ;;
- # END CYGNUS LOCAL vr4111/gavin
- mips64vr4300-* | mips64vr4300el-*) # EGCS LOCAL jsmith/vr4300
- ;;
- mips64vr4100-* | mips64vr4100el-*) # EGCS LOCAL jsmith/vr4100
- ;;
- mips16-*) # EGCS LOCAL krk/mips16
- ;;
- tic30-*) # EGCS LOCAL ian/tic30
- ;;
- c30-*) # EGCS LOCAL ian/tic30
- basic_machine=tic30-unknown
- ;;
- tic80-*) # CYGNUS LOCAL fnf/TIc80
+ | f301-* | arm*-* | t3e-* \
+ | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
+ | thumb-* | v850-* | d30v-* | tic30-* | c30-* )
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
- 386bsd) # EGCS LOCAL
+ 386bsd)
basic_machine=i386-unknown
os=-bsd
;;
@@ -308,11 +219,11 @@ case $basic_machine in
3b*)
basic_machine=we32k-att
;;
- a29khif) # EGCS LOCAL
+ a29khif)
basic_machine=a29k-amd
os=-udi
;;
- adobe68k) # EGCS LOCAL
+ adobe68k)
basic_machine=m68010-adobe
os=-scout
;;
@@ -345,7 +256,7 @@ case $basic_machine in
basic_machine=m68k-apollo
os=-sysv
;;
- apollo68bsd) # EGCS LOCAL
+ apollo68bsd)
basic_machine=m68k-apollo
os=-bsd
;;
@@ -425,7 +336,7 @@ case $basic_machine in
encore | umax | mmax)
basic_machine=ns32k-encore
;;
- es1800 | OSE68k | ose68k | ose | OSE) # EGCS LOCAL
+ es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
os=-ose
;;
@@ -447,11 +358,11 @@ case $basic_machine in
basic_machine=h8300-hitachi
os=-hms
;;
- h8300xray) # EGCS LOCAL
+ h8300xray)
basic_machine=h8300-hitachi
os=-xray
;;
- h8500hms) # EGCS LOCAL
+ h8500hms)
basic_machine=h8500-hitachi
os=-hms
;;
@@ -470,22 +381,6 @@ case $basic_machine in
basic_machine=m68k-hp
os=-hpux
;;
- w89k-*) # EGCS LOCAL
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- op50n-*) # EGCS LOCAL
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- op60c-*) # EGCS LOCAL
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- hppro) # EGCS LOCAL
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
;;
@@ -495,22 +390,21 @@ case $basic_machine in
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9] )
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
basic_machine=hppa1.0-hp
;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9] )
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
basic_machine=hppa1.1-hp
;;
- hp9k78[0-9] | hp78[0-9] )
+ hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | \
- hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893 )
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
- hp9k8[0-9][13679] | hp8[0-9][13679] )
+ hp9k8[0-9][13679] | hp8[0-9][13679])
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
@@ -519,10 +413,14 @@ case $basic_machine in
hppa-next)
os=-nextstep3
;;
- hppaosf) # EGCS LOCAL
+ hppaosf)
basic_machine=hppa1.1-hp
os=-osf
;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
os=-mvs
@@ -544,15 +442,15 @@ case $basic_machine in
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
- i386mach) # EGCS LOCAL
+ i386mach)
basic_machine=i386-mach
os=-mach
;;
- i386-vsta | vsta) # EGCS LOCAL
+ i386-vsta | vsta)
basic_machine=i386-unknown
os=-vsta
;;
- i386-go32 | go32) # EGCS LOCAL
+ i386-go32 | go32)
basic_machine=i386-unknown
os=-go32
;;
@@ -588,6 +486,10 @@ case $basic_machine in
miniframe)
basic_machine=m68000-convergent
;;
+ *mint | *MiNT)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
mipsel*-linux*)
basic_machine=mipsel-unknown
os=-linux-gnu
@@ -602,12 +504,12 @@ case $basic_machine in
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
- monitor) # EGCS LOCAL
+ monitor)
basic_machine=m68k-rom68k
os=-coff
;;
- msdos) # EGCS LOCAL
- basic_machine=i386-unknown
+ msdos)
+ basic_machine=i386-unknown
os=-msdos
;;
ncr3000)
@@ -615,7 +517,7 @@ case $basic_machine in
os=-sysv4
;;
netbsd386)
- basic_machine=i386-unknown # EGCS LOCAL
+ basic_machine=i386-unknown
os=-netbsd
;;
netwinder)
@@ -634,7 +536,7 @@ case $basic_machine in
basic_machine=mips-sony
os=-newsos
;;
- necv70) # EGCS LOCAL
+ necv70)
basic_machine=v70-nec
os=-sysv
;;
@@ -663,18 +565,22 @@ case $basic_machine in
basic_machine=i960-intel
os=-nindy
;;
- mon960) # EGCS LOCAL
+ mon960)
basic_machine=i960-intel
os=-mon960
;;
np1)
basic_machine=np1-gould
;;
- OSE68000 | ose68000) # EGCS LOCAL
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
;;
- os68k) # EGCS LOCAL
+ os68k)
basic_machine=m68k-none
os=-os68k
;;
@@ -704,10 +610,10 @@ case $basic_machine in
pentiumii | pentium2)
basic_machine=i786-pc
;;
- pentium-* | p5-* | k5-* | nexen-*)
+ pentium-* | p5-* | k5-* | k6-* | nexen-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
- pentiumpro-* | p6-* | k6-* | 6x86-*)
+ pentiumpro-* | p6-* | 6x86-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-*)
@@ -731,7 +637,7 @@ case $basic_machine in
ps2)
basic_machine=i386-ibm
;;
- rom68k) # EGCS LOCAL
+ rom68k)
basic_machine=m68k-rom68k
os=-coff
;;
@@ -741,7 +647,7 @@ case $basic_machine in
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
- sa29200) # EGCS LOCAL
+ sa29200)
basic_machine=a29k-amd
os=-udi
;;
@@ -752,7 +658,7 @@ case $basic_machine in
basic_machine=sh-hitachi
os=-hms
;;
- sparclite-wrs) # EGCS LOCAL
+ sparclite-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
@@ -763,10 +669,10 @@ case $basic_machine in
spur)
basic_machine=spur-unknown
;;
- st2000) # EGCS LOCAL
+ st2000)
basic_machine=m68k-tandem
;;
- stratus) # EGCS LOCAL
+ stratus)
basic_machine=i860-stratus
os=-sysv4
;;
@@ -814,6 +720,10 @@ case $basic_machine in
basic_machine=i386-sequent
os=-dynix
;;
+ t3e)
+ basic_machine=t3e-cray
+ os=-unicos
+ ;;
tx39)
basic_machine=mipstx39-unknown
;;
@@ -831,7 +741,7 @@ case $basic_machine in
basic_machine=a29k-nyu
os=-sym1
;;
- v810 | necv810) # EGCS LOCAL
+ v810 | necv810)
basic_machine=v810-nec
os=-none
;;
@@ -858,9 +768,13 @@ case $basic_machine in
basic_machine=a29k-wrs
os=-vxworks
;;
- w65*) # EGCS LOCAL
- basic_machine=w65-wdc
- os=-none
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
;;
xmp)
basic_machine=xmp-cray
@@ -869,7 +783,7 @@ case $basic_machine in
xps | xps100)
basic_machine=xps100-honeywell
;;
- z8k-*-coff) # EGCS LOCAL
+ z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
;;
@@ -880,13 +794,13 @@ case $basic_machine in
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
- w89k) # EGCS LOCAL
+ w89k)
basic_machine=hppa1.1-winbond
;;
- op50n) # EGCS LOCAL
+ op50n)
basic_machine=hppa1.1-oki
;;
- op60c) # EGCS LOCAL
+ op60c)
basic_machine=hppa1.1-oki
;;
mips)
@@ -923,16 +837,16 @@ case $basic_machine in
orion105)
basic_machine=clipper-highlevel
;;
- mac | mpw | mac-mpw) # EGCS LOCAL
+ mac | mpw | mac-mpw)
basic_machine=m68k-apple
;;
- pmac | pmac-mpw) # EGCS LOCAL
+ pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
- c4x*)
- basic_machine=c4x-none
- os=-coff
- ;;
+ c4x*)
+ basic_machine=c4x-none
+ os=-coff
+ ;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
@@ -991,18 +905,16 @@ case $os in
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* )
+ | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
- # EGCS LOCAL
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
- | -macos* | -mpw* | -magic* | -mon960* | -lnews* )
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+ | -macos* | -mpw* | -magic* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
- # END EGCS LOCAL
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
@@ -1027,7 +939,7 @@ case $os in
-acis*)
os=-aos
;;
- -386bsd) # EGCS LOCAL
+ -386bsd)
os=-bsd
;;
-ctix* | -uts*)
@@ -1061,15 +973,18 @@ case $os in
# This must come after -sysvr4.
-sysv*)
;;
- -ose*) # EGCS LOCAL
+ -ose*)
os=-ose
;;
- -es1800*) # EGCS LOCAL
+ -es1800*)
os=-ose
;;
-xenix)
os=-xenix
;;
+ -*mint | -*MiNT)
+ os=-mint
+ ;;
-none)
;;
*)
@@ -1119,15 +1034,15 @@ case $basic_machine in
# default.
# os=-sunos4
;;
- m68*-cisco) # EGCS LOCAL
+ m68*-cisco)
os=-aout
;;
- mips*-cisco) # EGCS LOCAL
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
os=-elf
;;
- mips*-*) # EGCS LOCAL
- os=-elf
- ;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
@@ -1140,13 +1055,13 @@ case $basic_machine in
*-ibm)
os=-aix
;;
- *-wec) # EGCS LOCAL
+ *-wec)
os=-proelf
;;
- *-winbond) # EGCS LOCAL
+ *-winbond)
os=-proelf
;;
- *-oki) # EGCS LOCAL
+ *-oki)
os=-proelf
;;
*-hp)
@@ -1212,15 +1127,18 @@ case $basic_machine in
f301-fujitsu)
os=-uxpv
;;
- *-rom68k) # EGCS LOCAL
+ *-rom68k)
os=-coff
;;
- *-*bug) # EGCS LOCAL
+ *-*bug)
os=-coff
;;
- *-apple) # EGCS LOCAL
+ *-apple)
os=-macos
;;
+ *-atari*)
+ os=-mint
+ ;;
*)
os=-none
;;
@@ -1278,12 +1196,15 @@ case $basic_machine in
-aux*)
vendor=apple
;;
- -hms*) # EGCS LOCAL
+ -hms*)
vendor=hitachi
;;
- -mpw* | -macos*) # EGCS LOCAL
+ -mpw* | -macos*)
vendor=apple
;;
+ -*mint | -*MiNT)
+ vendor=atari
+ ;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 852b6c7787d..f698fd0c323 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,140 @@
+1999-05-28 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-arm.c (md_apply_fix3): Add pipeline offset into reloc
+ addend unless the target uses an old ABI.
+
+Mon May 24 13:36:55 1999 Doug Evans <devans@canuck.cygnus.com>
+
+ -Wchar-subscripts cleanup
+ * listing.c (listing_newline): Use unsigned char variable, so
+ calls to isascii,iscntrl are correct.
+ * atof-generic.c (atof_generic): Cast arg to isdigit, et. al. with
+ (unsigned char).
+ * ecoff.c (ecoff_directive_ent,ecoff_stab): Ditto.
+ * config/obj-elf.c (obj_elf_vtable_inherit): Ditto.
+ * config/tc-mips.c (mips_ip,mips16_ip): Ditto.
+ (my_getSmallExpression,get_number,s_mips_ent): Ditto.
+
+1999-05-28 Torbjorn Granlund <tege@matematik.su.se>
+
+ * config/tc-m68k.c (m68k_ip): Check for disallowed index register
+ width for Coldfire.
+ (arch_coldfire_p): New #define.
+ (m68k_ip, m68k_init_after_args): Use arch_coldfire_p.
+
+1999-05-28 Linus Nordberg <linus.nordberg@canit.se>
+
+ * config/tc-m68k.c (install_operand): Add places `n', `o'.
+
+ * config/tc-m68k.c (m68k_ip): Add formats `E', `G', `H'.
+ (install_operand): Add place `N'.
+ (init_table): Add registers ACC, MACSR, MASK.
+
+ * config/m68k-parse.h (m68k_register): Add ACC, MACSR, MASK.
+
+ * config/tc-m68k.c: Change mcf5200 --> mcf.
+ (archs): Add mcf5206e, mcf5307.
+ (m68k_ip): Add format `u'.
+ (install_operand): Add place `m', `M', `h'.
+ (init_table): Add upper/lower registers.
+
+ * config/m68k-parse.h (m68k_register): Add upper/lower registers.
+
+1999-05-28 Martin Dorey <mdorey@madge.com>
+
+ * config/tc-i960.c: Several minor changes to add ELF and
+ BFD_ASSEMBLER support.
+ * config/tc-i960.h: Likewise.
+ * configure.in (i960-*-elf*): New target.
+ * aclocal.m4, configure: Rebuild.
+
+1999-05-25 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * config/tc-i386.c (md_apply_fix3): Only do 1999-05-17 fx_pcrel
+ reloc changes when defined(BFD_ASSEMBLER).
+
+1999-05-17 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * config/tc-i386.c (tc_gen_reloc): Remove F and MAP macros.
+
+ * write.c (write_print_statistics): Output to file, not stderr.
+
+ * expr.c (generic_bignum_to_int32,64): Prototype.
+
+ * read.c (s_lcomm_internal, sizeof_sleb128, sizeof_uleb128,
+ output_sleb128, output_uleb128, output_big_sleb128,
+ output_big_uleb128, output_big_leb128): Prototype.
+ (output_big_sleb128, output_big_uleb128): Make inline.
+ (output_big_leb128): Remove inline
+
+ From Maciej W. Rozycki <macro@ds2.pg.gda.pl>
+ * config/tc-i386.c (md_apply_fix3): Convert BFD_RELOC_16 with
+ fx_pcrel set to BFD_RELOC_16_PCREL. Similarly for BFD_RELOC_8.
+ Handle BFD_RELOC_16_PCREL and BFD_RELOC_8_PCREL. Return changed
+ value for correct overflow check in write.c:fixup_segment.
+ * write.c (fixup_segment): Move bitfield overflow checks to after
+ the md_apply_fix call.
+ * config/obj-coff.c (fixup_segment): Likewise.
+ * doc/internals.texi (CPU backend): Mention md_apply_fix modifying
+ valueT *val argument.
+
+Fri May 14 10:52:13 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
+
+ * config/atof-ieee.c (gen_to_words): Correctly round a
+ denormalized number. Fix off-by-one in range checking for
+ exponent in a denormal.
+
+1999-05-10 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-mcore.c (parse_reg): Accept 'sp' as a valid register
+ name.
+
+Thu May 13 09:46:59 1999 Joel Sherrill (joel@OARcorp.com)
+
+ * configure.in (i386-*-rtemself*, sh-*-rtemself*): New targets.
+
+1999-05-12 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * config/tc-i386.h (InvMem): New flag. Add to AnyMem.
+ (ReverseRegRegmem): Remove.
+ (ImmExt): New flag. Renumber some of the opcode_modifier bits.
+ * config/tc-i386.c (md_assemble): Test for PIII SIMD and AMD
+ 3DNow! via ImmExt opcode_modifier. Remove ReverseRegRegmem
+ kludge.
+
+ From Doug Ledford <dledford@redhat.com>
+ * config/tc-i386.h (RegXMM): New for P/III.
+ * config/tc-i386.c: Add support for P/III.
+
+Sat May 8 23:28:50 1999 Richard Henderson <rth@cygnus.com>
+
+ * config/tc-ppc.c (md_parse_option): Recognize -mppc64bridge.
+ (md_begin): Allow ppc32 insns in ppc64bridge mode.
+ (ppc_insert_operand): Accept SIGNOPT in ppc64 mode.
+
+Thu May 6 23:13:39 1999 Richard Henderson <rth@cygnus.com>
+
+ * config/tc-i386.c (i386_immediate): Skip whitespace before
+ complaining about junk after expression.
+ (i386_displacement): Likewise.
+
+Thu May 6 19:50:14 1999 Richard Henderson <rth@cygnus.com>
+
+ * symbols.c (symbol_find_base): Use memcpy instead of strcpy.
+ Don't copy before downcaseing.
+
+1999-05-05 Catherine Moore <clm@cygnus.com>
+
+ * tc-m68k.c: Include elf/m68k.h.
+ (m68k_elf_final_processing): New routine.
+ * tc-m68k.h (elf_tc_final_processing m68k_elf_final_processing):
+ Define.
+
+Mon May 3 10:26:03 1999 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-hppa.c (md_apply_fix): Handle 22 bit fmt insn like a
+ 17 bit fmt insn.
+
1999-04-30 Nick Clifton <nickc@cygnus.com>
* config/tc-mcore.c (mcore_s_section): Dump literals before
diff --git a/gas/Makefile.am b/gas/Makefile.am
index 688f21ccc69..b1fc38f610a 100644
--- a/gas/Makefile.am
+++ b/gas/Makefile.am
@@ -1051,7 +1051,8 @@ TCDEP_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \
TCDEP_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h
+ subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h \
+ $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h
TCDEP_m68k_hp300 = $(srcdir)/config/obj-hp300.h $(srcdir)/config/obj-aout.h \
$(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \
$(INCDIR)/obstack.h subsegs.h $(INCDIR)/opcode/m68k.h \
diff --git a/gas/Makefile.in b/gas/Makefile.in
index 244fff2ef31..7dc689ad64c 100644
--- a/gas/Makefile.in
+++ b/gas/Makefile.in
@@ -95,6 +95,7 @@ POSUB = @POSUB@
RANLIB = @RANLIB@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
+USE_SYMBOL_UNDERSCORE = @USE_SYMBOL_UNDERSCORE@
VERSION = @VERSION@
atof = @atof@
cgen_cpu_prefix = @cgen_cpu_prefix@
@@ -748,7 +749,8 @@ TCDEP_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \
TCDEP_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h
+ subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h \
+ $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h
TCDEP_m68k_hp300 = $(srcdir)/config/obj-hp300.h $(srcdir)/config/obj-aout.h \
$(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \
@@ -1629,7 +1631,7 @@ configure configure.in gdbinit.in itbl-lex.c itbl-parse.c
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
+TAR = gtar
GZIP_ENV = --best
SOURCES = $(itbl_test_SOURCES) $(as_new_SOURCES) $(EXTRA_as_new_SOURCES) $(gasp_new_SOURCES)
OBJECTS = $(itbl_test_OBJECTS) $(as_new_OBJECTS) $(gasp_new_OBJECTS)
diff --git a/gas/NEWS b/gas/NEWS
index 08440763526..6017d5875c0 100644
--- a/gas/NEWS
+++ b/gas/NEWS
@@ -22,6 +22,8 @@ Mitsubishi D30V support added.
Texas Instruments c80 (tms320c80) support added.
+i960 ELF support added.
+
Changes in 2.9:
Texas Instruments c30 (tms320c30) support added.
diff --git a/gas/aclocal.m4 b/gas/aclocal.m4
index 1c6d60cb238..ebbe468df4d 100644
--- a/gas/aclocal.m4
+++ b/gas/aclocal.m4
@@ -160,26 +160,58 @@ fi
AC_SUBST($1)])
-# serial 25 AM_PROG_LIBTOOL
-AC_DEFUN(AM_PROG_LIBTOOL,
-[AC_REQUIRE([AM_ENABLE_SHARED])dnl
-AC_REQUIRE([AM_ENABLE_STATIC])dnl
+# serial 35 AC_PROG_LIBTOOL
+AC_DEFUN(AC_PROG_LIBTOOL,
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+
+# Save cache, so that ltconfig can load it
+AC_CACHE_SAVE
+
+# Actually configure libtool. ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
+DLLTOOL="$DLLTOOL" AS="$AS" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
+|| AC_MSG_ERROR([libtool configure failed])
+
+# Reload cache, that may have been modified by ltconfig
+AC_CACHE_LOAD
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+])
+
+AC_DEFUN(AC_LIBTOOL_SETUP,
+[AC_PREREQ(2.13)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AM_PROG_LD])dnl
-AC_REQUIRE([AM_PROG_NM])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+AC_REQUIRE([AC_SYS_NM_PARSE])dnl
+AC_REQUIRE([AC_SYS_SYMBOL_UNDERSCORE])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
dnl
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
# Check for any special flags to pass to ltconfig.
-libtool_flags=
+libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen"
test "$silent" = yes && libtool_flags="$libtool_flags --silent"
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
@@ -208,37 +240,46 @@ case "$host" in
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
;;
*-*-cygwin*)
- AM_SYS_LIBTOOL_CYGWIN
+ AC_SYS_LIBTOOL_CYGWIN
;;
esac
-# Actually configure libtool. ac_aux_dir is where install-sh is found.
-CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
-LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
-DLLTOOL="$DLLTOOL" AS="$AS" \
-${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
-|| AC_MSG_ERROR([libtool configure failed])
+# enable the --disable-libtool-lock switch
-# Redirect the config.log output again, so that the ltconfig log is not
-# clobbered by the next message.
-exec 5>>./config.log
+AC_ARG_ENABLE(libtool-lock,
+[ --disable-libtool-lock force libtool not to do file locking],
+need_locks=$enableval,
+need_locks=yes)
+
+if test x"$need_locks" = xno; then
+ libtool_flags="$libtool_flags --disable-lock"
+fi
])
-# AM_ENABLE_SHARED - implement the --enable-shared flag
-# Usage: AM_ENABLE_SHARED[(DEFAULT)]
+# AC_LIBTOOL_DLOPEN - check for dlopen support
+AC_DEFUN(AC_LIBTOOL_DLOPEN, [lt_dlopen=yes])
+
+# AC_ENABLE_SHARED - implement the --enable-shared flag
+# Usage: AC_ENABLE_SHARED[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
-AC_DEFUN(AM_ENABLE_SHARED,
-[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_DEFUN(AC_ENABLE_SHARED,
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(shared,
changequote(<<, >>)dnl
-<< --enable-shared[=PKGS] build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT],
+<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
@@ -256,26 +297,22 @@ no) enable_shared=no ;;
IFS="$ac_save_ifs"
;;
esac],
-enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
+enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
])
-# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
-AC_DEFUN(AM_DISABLE_SHARED,
-[AM_ENABLE_SHARED(no)])
-
-# AM_DISABLE_STATIC - set the default static flag to --disable-static
-AC_DEFUN(AM_DISABLE_STATIC,
-[AM_ENABLE_STATIC(no)])
+# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
+AC_DEFUN(AC_DISABLE_SHARED,
+[AC_ENABLE_SHARED(no)])
-# AM_ENABLE_STATIC - implement the --enable-static flag
-# Usage: AM_ENABLE_STATIC[(DEFAULT)]
+# AC_ENABLE_STATIC - implement the --enable-static flag
+# Usage: AC_ENABLE_STATIC[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
-AC_DEFUN(AM_ENABLE_STATIC,
-[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_DEFUN(AC_ENABLE_STATIC,
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(static,
changequote(<<, >>)dnl
-<< --enable-static[=PKGS] build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT],
+<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
@@ -293,28 +330,74 @@ no) enable_static=no ;;
IFS="$ac_save_ifs"
;;
esac],
-enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
+enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
+])
+
+# AC_DISABLE_STATIC - set the default static flag to --disable-static
+AC_DEFUN(AC_DISABLE_STATIC,
+[AC_ENABLE_STATIC(no)])
+
+
+# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
+# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN(AC_ENABLE_FAST_INSTALL,
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(fast-install,
+changequote(<<, >>)dnl
+<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
+changequote([, ])dnl
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
])
+# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
+AC_DEFUN(AC_DISABLE_FAST_INSTALL,
+[AC_ENABLE_FAST_INSTALL(no)])
-# AM_PROG_LD - find the path to the GNU or non-GNU linker
-AC_DEFUN(AM_PROG_LD,
+
+# AC_PROG_LD - find the path to the GNU or non-GNU linker
+AC_DEFUN(AC_PROG_LD,
[AC_ARG_WITH(gnu-ld,
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
ac_prog=ld
if test "$ac_cv_prog_gcc" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by GCC])
ac_prog=`($CC -print-prog-name=ld) 2>&5`
case "$ac_prog" in
- # Accept absolute paths.
+ # Accept absolute paths.
changequote(,)dnl
- /* | [A-Za-z]:\\*)
+ /* | [A-Za-z]:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
changequote([,])dnl
- test -z "$LD" && LD="$ac_prog"
- ;;
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
@@ -342,7 +425,7 @@ AC_CACHE_VAL(ac_cv_path_LD,
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
- test "$with_gnu_ld" != yes && break
+ test "$with_gnu_ld" != yes && break
fi
fi
done
@@ -358,10 +441,10 @@ else
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_SUBST(LD)
-AM_PROG_LD_GNU
+AC_PROG_LD_GNU
])
-AC_DEFUN(AM_PROG_LD_GNU,
+AC_DEFUN(AC_PROG_LD_GNU,
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
@@ -371,8 +454,8 @@ else
fi])
])
-# AM_PROG_NM - find the path to a BSD-compatible name lister
-AC_DEFUN(AM_PROG_NM,
+# AC_PROG_NM - find the path to a BSD-compatible name lister
+AC_DEFUN(AC_PROG_NM,
[AC_MSG_CHECKING([for BSD-compatible nm])
AC_CACHE_VAL(ac_cv_path_NM,
[if test -n "$NM"; then
@@ -380,20 +463,22 @@ AC_CACHE_VAL(ac_cv_path_NM,
ac_cv_path_NM="$NM"
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/nm; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -B"
+ ac_cv_path_NM="$ac_dir/nm -B"
+ break
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -p"
+ ac_cv_path_NM="$ac_dir/nm -p"
+ break
else
- ac_cv_path_NM="$ac_dir/nm"
+ ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
fi
- break
fi
done
IFS="$ac_save_ifs"
@@ -404,12 +489,280 @@ AC_MSG_RESULT([$NM])
AC_SUBST(NM)
])
-# AM_SYS_LIBTOOL_CYGWIN - find tools needed on cygwin
-AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN,
+# AC_SYS_NM_PARSE - Check for command to grab the raw symbol name followed
+# by C symbol name from nm.
+AC_DEFUN(AC_SYS_NM_PARSE,
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output])
+AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
+[# These are sane defaults that work on at least a few old systems.
+# {They come from Ultrix. What could be older than Ultrix?!! ;)}
+
+changequote(,)dnl
+# Character class describing NM global symbol codes.
+ac_symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+ac_symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+
+# Define system-specific variables.
+case "$host_os" in
+aix*)
+ ac_symcode='[BCDT]'
+ ;;
+cygwin* | mingw*)
+ ac_symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
+ ;;
+irix*)
+ ac_symcode='[BCDEGRST]'
+ ;;
+solaris*)
+ ac_symcode='[BDT]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
+ ac_symcode='[ABCDGISTW]'
+fi
+changequote([,])dnl
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+ ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
+
+ # Check to see that the pipe works correctly.
+ ac_pipe_works=no
+ rm -f conftest.$ac_ext
+ cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func;return 0;}
+EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ ac_nlist=conftest.nm
+
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
+
+ # Try sorting and uniquifying the output.
+ if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
+ mv -f "$ac_nlist"T "$ac_nlist"
+ else
+ rm -f "$ac_nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
+ if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
+ cat <<EOF > conftest.c
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
+
+ cat <<EOF >> conftest.c
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr_t address;
+}
+changequote(,)dnl
+lt_preloaded_symbols[] =
+changequote([,])dnl
+{
+EOF
+ sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
+ cat <<\EOF >> conftest.c
+ {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftestm.$ac_objext
+ ac_save_LIBS="$LIBS"
+ ac_save_CFLAGS="$CFLAGS"
+ LIBS="conftestm.$ac_objext"
+ CFLAGS="$CFLAGS$no_builtin_flag"
+ if AC_TRY_EVAL(ac_link) && test -s conftest; then
+ ac_pipe_works=yes
+ else
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat conftest.c >&AC_FD_CC
+ fi
+ LIBS="$ac_save_LIBS"
+ CFLAGS="$ac_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
+ fi
+ else
+ echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
+ fi
+ else
+ echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
+ fi
+ else
+ echo "$progname: failed program was:" >&AC_FD_CC
+ cat conftest.c >&AC_FD_CC
+ fi
+ rm -rf conftest*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$ac_pipe_works" = yes; then
+ if test x"$ac_symprfx" = x"_"; then
+ ac_cv_sys_symbol_underscore=yes
+ else
+ ac_cv_sys_symbol_underscore=no
+ fi
+ break
+ else
+ ac_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+
+ac_result=yes
+if test -z "$ac_cv_sys_global_symbol_pipe"; then
+ ac_result=no
+fi
+AC_MSG_RESULT($ac_result)
+])
+
+# AC_SYS_LIBTOOL_CYGWIN - find tools needed on cygwin
+AC_DEFUN(AC_SYS_LIBTOOL_CYGWIN,
[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(AS, as, false)
])
+# AC_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
+# with an underscore?
+AC_DEFUN(AC_SYS_SYMBOL_UNDERSCORE,
+[AC_REQUIRE([AC_PROG_NM])dnl
+AC_REQUIRE([AC_SYS_NM_PARSE])dnl
+AC_MSG_CHECKING([for _ prefix in compiled symbols])
+AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
+[ac_cv_sys_symbol_underscore=no
+cat > conftest.$ac_ext <<EOF
+void nm_test_func(){}
+int main(){nm_test_func;return 0;}
+EOF
+if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ ac_nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
+ # See whether the symbols have a leading underscore.
+ if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
+ ac_cv_sys_symbol_underscore=yes
+ else
+ if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
+ :
+ else
+ echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
+ fi
+ fi
+ else
+ echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
+ fi
+else
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat conftest.c >&AC_FD_CC
+fi
+rm -rf conftest*
+])
+AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
+USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
+AC_SUBST(USE_SYMBOL_UNDERSCORE)dnl
+])
+
+# AC_CHECK_LIBM - check for math library
+AC_DEFUN(AC_CHECK_LIBM, [
+AC_CHECK_LIB(mw, _mwvalidcheckl)
+AC_CHECK_LIB(m, cos)
+])
+
+# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl convenience library, adds --enable-ltdl-convenience to
+# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
+# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
+# to be `${top_builddir}/libltdl'. Make sure you start DIR with
+# '${top_builddir}/' (note the single quotes!) if your package is not
+# flat, and, if you're not using automake, define top_builddir as
+# appropriate in the Makefiles.
+AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [
+ case "$enable_ltdl_convenience" in
+ no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+ "") enable_ltdl_convenience=yes
+ ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+ esac
+ LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
+])
+
+# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl installable library, and adds --enable-ltdl-install to
+# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
+# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
+# to be `${top_builddir}/libltdl'. Make sure you start DIR with
+# '${top_builddir}/' (note the single quotes!) if your package is not
+# flat, and, if you're not using automake, define top_builddir as
+# appropriate in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [
+ AC_CHECK_LIB(ltdl, main, LIBLTDL="-lltdl", [
+ case "$enable_ltdl_install" in
+ no) AC_MSG_WARN([libltdl not installed, but installation disabled]) ;;
+ "") enable_ltdl_install=yes
+ ac_configure_args="$ac_configure_args --enable-ltdl-install" ;;
+ esac
+ ])
+ if test x"$enable_ltdl_install" != x"no"; then
+ LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
+ fi
+])
+
+dnl old names
+AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
+AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
+AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
+AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
+AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
+AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
+AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
+AC_DEFUN(AM_SYS_NM_PARSE, [indir([AC_SYS_NM_PARSE])])dnl
+AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE, [indir([AC_SYS_SYMBOL_UNDERSCORE])])dnl
+AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN, [indir([AC_SYS_LIBTOOL_CYGWIN])])dnl
+
# Like AC_CONFIG_HEADER, but automatically create stamp file.
AC_DEFUN(AM_CONFIG_HEADER,
diff --git a/gas/atof-generic.c b/gas/atof-generic.c
index 316f665a454..de29f21341f 100644
--- a/gas/atof-generic.c
+++ b/gas/atof-generic.c
@@ -220,7 +220,7 @@ atof_generic (address_of_string_pointer,
&& (!c || !strchr (string_of_decimal_exponent_marks, c)));
p++)
{
- if (isdigit (c))
+ if (isdigit ((unsigned char) c))
{
/* This may be retracted below. */
number_of_digits_after_decimal++;
diff --git a/gas/config/atof-ieee.c b/gas/config/atof-ieee.c
index d586e3a85e3..fbf0ffb62c9 100644
--- a/gas/config/atof-ieee.c
+++ b/gas/config/atof-ieee.c
@@ -460,7 +460,7 @@ gen_to_words (words, precision, exponent_bits)
/* Bigger than one littlenum */
num_bits -= (LITTLENUM_NUMBER_OF_BITS - 1) - exponent_bits;
*lp++ = word1;
- if (num_bits + exponent_bits + 1 >= precision * LITTLENUM_NUMBER_OF_BITS)
+ if (num_bits + exponent_bits + 1 > precision * LITTLENUM_NUMBER_OF_BITS)
{
/* Exponent overflow */
make_invalid_floating_point_number (words);
@@ -501,7 +501,7 @@ gen_to_words (words, precision, exponent_bits)
if (next_bits (1))
{
--lp;
- if (prec_bits > LITTLENUM_NUMBER_OF_BITS)
+ if (prec_bits >= LITTLENUM_NUMBER_OF_BITS)
{
int n = 0;
int tmp_bits;
@@ -515,7 +515,19 @@ gen_to_words (words, precision, exponent_bits)
--n;
tmp_bits -= LITTLENUM_NUMBER_OF_BITS;
}
- if (tmp_bits > LITTLENUM_NUMBER_OF_BITS || (lp[n] & mask[tmp_bits]) != mask[tmp_bits])
+ if (tmp_bits > LITTLENUM_NUMBER_OF_BITS
+ || (lp[n] & mask[tmp_bits]) != mask[tmp_bits]
+ || (prec_bits != (precision * LITTLENUM_NUMBER_OF_BITS
+ - exponent_bits - 1)
+#ifdef TC_I386
+ /* An extended precision float with only the integer
+ bit set would be invalid. That must be converted
+ to the smallest normalized number. */
+ && !(precision == X_PRECISION
+ && prec_bits == (precision * LITTLENUM_NUMBER_OF_BITS
+ - exponent_bits - 2))
+#endif
+ ))
{
unsigned long carry;
@@ -539,11 +551,18 @@ gen_to_words (words, precision, exponent_bits)
<< ((LITTLENUM_NUMBER_OF_BITS - 1)
- exponent_bits));
*lp++ = word1;
+#ifdef TC_I386
+ /* Set the integer bit in the extended precision format.
+ This cannot happen on the m68k where the mantissa
+ just overflows into the integer bit above. */
+ if (precision == X_PRECISION)
+ *lp++ = 1 << (LITTLENUM_NUMBER_OF_BITS - 1);
+#endif
while (lp < words_end)
*lp++ = 0;
}
}
- else if ((*lp & mask[prec_bits]) != mask[prec_bits])
+ else
*lp += 1;
}
diff --git a/gas/config/m68k-parse.h b/gas/config/m68k-parse.h
index e13134212e4..cdb5f60eb53 100644
--- a/gas/config/m68k-parse.h
+++ b/gas/config/m68k-parse.h
@@ -1,5 +1,6 @@
/* m68k-parse.h -- header file for m68k assembler
- Copyright (C) 1987, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1987, 91, 92, 93, 94, 95, 96, 1999
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -83,6 +84,9 @@ enum m68k_register
ZPC, /* Hack for Program space, but 0 addressing */
SR, /* Status Reg */
CCR, /* Condition code Reg */
+ ACC, /* Accumulator Reg */
+ MACSR, /* MAC Status Reg */
+ MASK, /* Modulus Reg */
/* These have to be grouped together for the movec instruction to work. */
USP, /* User Stack Pointer */
@@ -165,6 +169,44 @@ enum m68k_register
ZADDR5,
ZADDR6,
ZADDR7,
+
+ /* Upper and lower half of data and address registers. Order *must*
+ be DATAxL, ADDRxL, DATAxU, ADDRxU. */
+ DATA0L, /* lower half of data registers */
+ DATA1L,
+ DATA2L,
+ DATA3L,
+ DATA4L,
+ DATA5L,
+ DATA6L,
+ DATA7L,
+
+ ADDR0L, /* lower half of address registers */
+ ADDR1L,
+ ADDR2L,
+ ADDR3L,
+ ADDR4L,
+ ADDR5L,
+ ADDR6L,
+ ADDR7L,
+
+ DATA0U, /* upper half of data registers */
+ DATA1U,
+ DATA2U,
+ DATA3U,
+ DATA4U,
+ DATA5U,
+ DATA6U,
+ DATA7U,
+
+ ADDR0U, /* upper half of address registers */
+ ADDR1U,
+ ADDR2U,
+ ADDR3U,
+ ADDR4U,
+ ADDR5U,
+ ADDR6U,
+ ADDR7U,
};
/* Size information. */
diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c
index 5639fbed966..e8e3df92188 100644
--- a/gas/config/obj-coff.c
+++ b/gas/config/obj-coff.c
@@ -4258,6 +4258,12 @@ fixup_segment (segP, this_segment_type)
#endif
} /* if pcrel */
+#ifdef MD_APPLY_FIX3
+ md_apply_fix3 (fixP, (valueT *) &add_number, this_segment_type);
+#else
+ md_apply_fix (fixP, add_number);
+#endif
+
if (!fixP->fx_bit_fixP && ! fixP->fx_no_overflow)
{
#ifndef TC_M88K
@@ -4294,13 +4300,6 @@ fixup_segment (segP, this_segment_type)
(unsigned long) (fragP->fr_address + where));
#endif
} /* not a bit fix */
- /* Once this fix has been applied, we don't have to output
- anything nothing more need be done. */
-#ifdef MD_APPLY_FIX3
- md_apply_fix3 (fixP, (valueT *) &add_number, this_segment_type);
-#else
- md_apply_fix (fixP, add_number);
-#endif
} /* For each fixS in this segment. */
} /* fixup_segment() */
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index f50c4b7257a..4ff8950d4b6 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -1037,7 +1037,7 @@ obj_elf_vtable_inherit (ignore)
if (input_line_pointer[0] == '0'
&& (input_line_pointer[1] == '\0'
- || isspace(input_line_pointer[1])))
+ || isspace ((unsigned char) input_line_pointer[1])))
{
psym = section_symbol (absolute_section);
++input_line_pointer;
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index d898bf0ecd0..3d0460011ef 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -486,7 +486,7 @@ static valueT md_chars_to_number PARAMS ((char *, int));
static void insert_reg_alias PARAMS ((char *, int));
static void output_inst PARAMS ((char *));
#ifdef OBJ_ELF
-static bfd_reloc_code_real_type arm_parse_reloc(void);
+static bfd_reloc_code_real_type arm_parse_reloc PARAMS ((void));
#endif
/* ARM instructions take 4bytes in the object file, Thumb instructions
@@ -5010,8 +5010,7 @@ md_atof (type, litP, sizeP)
return 0;
}
-/* The knowledge of the PC's pipeline offset is built into the relocs
- for the ELF port and into the insns themselves for the COFF port. */
+/* The knowledge of the PC's pipeline offset is built into the insns themselves. */
long
md_pcrel_from (fixP)
fixS * fixP;
@@ -5028,7 +5027,7 @@ md_pcrel_from (fixP)
for the calculation */
return (fixP->fx_where + fixP->fx_frag->fr_address) & ~3;
}
-
+
return fixP->fx_where + fixP->fx_frag->fr_address;
}
@@ -5179,7 +5178,8 @@ md_apply_fix3 (fixP, val, seg)
&& S_IS_DEFINED (fixP->fx_addsy)
&& S_GET_SEGMENT (fixP->fx_addsy) != seg)
{
- if (fixP->fx_r_type == BFD_RELOC_ARM_PCREL_BRANCH)
+ if (target_oabi
+ && fixP->fx_r_type == BFD_RELOC_ARM_PCREL_BRANCH)
value = 0;
else
value += md_pcrel_from (fixP);
@@ -5315,14 +5315,12 @@ md_apply_fix3 (fixP, val, seg)
case BFD_RELOC_ARM_PCREL_BRANCH:
newval = md_chars_to_number (buf, INSN_SIZE);
+
#ifdef OBJ_ELF
- newval &= 0xff000000;
if (! target_oabi)
value = fixP->fx_offset;
- else
-#else
- value = (value >> 2) & 0x00ffffff;
#endif
+ value = (value >> 2) & 0x00ffffff;
value = (value + (newval & 0x00ffffff)) & 0x00ffffff;
newval = value | (newval & 0xff000000);
md_number_to_chars (buf, newval, INSN_SIZE);
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c
index 8785de8769d..c0f532c3626 100644
--- a/gas/config/tc-hppa.c
+++ b/gas/config/tc-hppa.c
@@ -3039,7 +3039,7 @@ md_apply_fix (fixP, valp)
&& fmt != 32
#endif
)
- new_val = ((fmt == 12 || fmt == 17) ? 8 : 0);
+ new_val = ((fmt == 12 || fmt == 17 || fmt == 22) ? 8 : 0);
#ifdef OBJ_SOM
/* These field selectors imply that we do not want an addend. */
else if (hppa_fixP->fx_r_field == e_psel
@@ -3048,7 +3048,7 @@ md_apply_fix (fixP, valp)
|| hppa_fixP->fx_r_field == e_tsel
|| hppa_fixP->fx_r_field == e_rtsel
|| hppa_fixP->fx_r_field == e_ltsel)
- new_val = ((fmt == 12 || fmt == 17) ? 8 : 0);
+ new_val = ((fmt == 12 || fmt == 17 || fmt == 22) ? 8 : 0);
/* This is truely disgusting. The machine independent code blindly
adds in the value of the symbol being relocated against. Damn! */
else if (fmt == 32
@@ -3063,13 +3063,13 @@ md_apply_fix (fixP, valp)
/* Handle pc-relative exceptions from above. */
#define arg_reloc_stub_needed(CALLER, CALLEE) \
((CALLEE) && (CALLER) && ((CALLEE) != (CALLER)))
- if ((fmt == 12 || fmt == 17)
+ if ((fmt == 12 || fmt == 17 || fmt == 22)
&& fixP->fx_addsy
&& fixP->fx_pcrel
&& !arg_reloc_stub_needed ((long) ((obj_symbol_type *)
fixP->fx_addsy->bsym)->tc_data.ap.hppa_arg_reloc,
hppa_fixP->fx_arg_reloc)
- && ((int)(*valp) > -262144 && (int)(*valp) < 262143)
+ && (((int)(*valp) > -262144 && (int)(*valp) < 262143) && fmt != 22)
&& S_GET_SEGMENT (fixP->fx_addsy) == hppa_fixP->segment
&& !(fixP->fx_subsy
&& S_GET_SEGMENT (fixP->fx_subsy) != hppa_fixP->segment))
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 7149d711b93..b06298ee8a2 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -740,7 +740,7 @@ pi (line, x)
pt (x->types[i]);
fprintf (stdout, "\n");
if (x->types[i]
- & (Reg | SReg2 | SReg3 | Control | Debug | Test | RegMMX))
+ & (Reg | SReg2 | SReg3 | Control | Debug | Test | RegMMX | RegXMM))
fprintf (stdout, "%s\n", x->regs[i]->reg_name);
if (x->types[i] & Imm)
pe (x->imms[i]);
@@ -835,6 +835,7 @@ type_names[] =
{ Acc, "Acc" },
{ JumpAbsolute, "Jump Absolute" },
{ RegMMX, "rMMX" },
+ { RegXMM, "rXMM" },
{ EsSeg, "es" },
{ 0, "" }
};
@@ -1552,8 +1553,10 @@ md_assemble (line)
continue;
}
/* Any other register is bad */
- if (i.types[op] & (Reg | RegMMX | Control | Debug | Test
- | FloatReg | FloatAcc | SReg2 | SReg3))
+ if (i.types[op] & (Reg | RegMMX | RegXMM
+ | SReg2 | SReg3
+ | Control | Debug | Test
+ | FloatReg | FloatAcc))
{
as_bad (_("`%%%s' not allowed with `%s%c'"),
i.regs[op]->reg_name,
@@ -1740,12 +1743,12 @@ md_assemble (line)
}
}
- if (i.tm.base_opcode == AMD_3DNOW_OPCODE)
+ if (i.tm.opcode_modifier & ImmExt)
{
- /* These AMD specific instructions have an opcode suffix which
- is coded in the same place as an 8-bit immediate field
- would be. Here we fake an 8-bit immediate operand from the
- opcode suffix stored in tm.extension_opcode. */
+ /* These AMD 3DNow! and Intel Katmai New Instructions have an
+ opcode suffix which is coded in the same place as an 8-bit
+ immediate field would be. Here we fake an 8-bit immediate
+ operand from the opcode suffix stored in tm.extension_opcode. */
expressionS *exp;
@@ -1822,37 +1825,21 @@ md_assemble (line)
{
unsigned int source, dest;
source = ((i.types[0]
- & (Reg
- | SReg2
- | SReg3
- | Control
- | Debug
- | Test
- | RegMMX))
+ & (Reg | RegMMX | RegXMM
+ | SReg2 | SReg3
+ | Control | Debug | Test))
? 0 : 1);
dest = source + 1;
- /* Certain instructions expect the destination to be
- in the i.rm.reg field. This is by far the
- exceptional case. For these instructions, if the
- source operand is a register, we must reverse the
- i.rm.reg and i.rm.regmem fields. We accomplish
- this by pretending that the two register operands
- were given in the reverse order. */
- if (i.tm.opcode_modifier & ReverseRegRegmem)
- {
- const reg_entry *tmp = i.regs[source];
- i.regs[source] = i.regs[dest];
- i.regs[dest] = tmp;
- }
-
i.rm.mode = 3;
- /* We must be careful to make sure that all
- segment/control/test/debug/MMX registers go into
- the i.rm.reg field (despite whether they are
- source or destination operands). */
- if (i.regs[dest]->reg_type
- & (SReg2 | SReg3 | Control | Debug | Test | RegMMX))
+ /* One of the register operands will be encoded in the
+ i.tm.reg field, the other in the combined i.tm.mode
+ and i.tm.regmem fields. If no form of this
+ instruction supports a memory destination operand,
+ then we assume the source operand may sometimes be
+ a memory operand and so we need to store the
+ destination in the i.rm.reg field. */
+ if ((i.tm.operand_types[dest] & AnyMem) == 0)
{
i.rm.reg = i.regs[dest]->reg_num;
i.rm.regmem = i.regs[source]->reg_num;
@@ -1999,12 +1986,14 @@ md_assemble (line)
{
unsigned int op =
((i.types[0]
- & (Reg | SReg2 | SReg3 | Control | Debug
- | Test | RegMMX))
+ & (Reg | RegMMX | RegXMM
+ | SReg2 | SReg3
+ | Control | Debug | Test))
? 0
: ((i.types[1]
- & (Reg | SReg2 | SReg3 | Control | Debug
- | Test | RegMMX))
+ & (Reg | RegMMX | RegXMM
+ | SReg2 | SReg3
+ | Control | Debug | Test))
? 1
: 2));
/* If there is an extension opcode to put here, the
@@ -2602,6 +2591,7 @@ i386_immediate (imm_start)
exp_seg = expression (exp);
+ SKIP_WHITESPACE ();
if (*input_line_pointer)
as_bad (_("Ignoring junk `%s' after expression"), input_line_pointer);
@@ -2847,6 +2837,7 @@ i386_displacement (disp_start, disp_end)
}
#endif
+ SKIP_WHITESPACE ();
if (*input_line_pointer)
as_bad (_("Ignoring junk `%s' after expression"),
input_line_pointer);
@@ -3915,15 +3906,31 @@ md_apply_fix3 (fixP, valp, seg)
register char *p = fixP->fx_where + fixP->fx_frag->fr_literal;
valueT value = *valp;
- if (fixP->fx_r_type == BFD_RELOC_32 && fixP->fx_pcrel)
- fixP->fx_r_type = BFD_RELOC_32_PCREL;
-
#if defined (BFD_ASSEMBLER) && !defined (TE_Mach)
+ if (fixP->fx_pcrel)
+ {
+ switch (fixP->fx_r_type)
+ {
+ case BFD_RELOC_32:
+ fixP->fx_r_type = BFD_RELOC_32_PCREL;
+ break;
+ case BFD_RELOC_16:
+ fixP->fx_r_type = BFD_RELOC_16_PCREL;
+ break;
+ case BFD_RELOC_8:
+ fixP->fx_r_type = BFD_RELOC_8_PCREL;
+ break;
+ }
+ }
+
/*
* This is a hack. There should be a better way to
* handle this.
*/
- if (fixP->fx_r_type == BFD_RELOC_32_PCREL && fixP->fx_addsy)
+ if ((fixP->fx_r_type == BFD_RELOC_32_PCREL
+ || fixP->fx_r_type == BFD_RELOC_16_PCREL
+ || fixP->fx_r_type == BFD_RELOC_8_PCREL)
+ && fixP->fx_addsy)
{
#ifndef OBJ_AOUT
if (OUTPUT_FLAVOR == bfd_target_elf_flavour
@@ -4023,9 +4030,9 @@ md_apply_fix3 (fixP, valp, seg)
default:
break;
}
-#endif
-
-#endif
+#endif /* defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) */
+ *valp = value;
+#endif /* defined (BFD_ASSEMBLER) && !defined (TE_Mach) */
md_number_to_chars (p, value, fixP->fx_size);
return 1;
@@ -4324,9 +4331,6 @@ i386_validate_fix (fixp)
}
}
-#define F(SZ,PCREL) (((SZ) << 1) + (PCREL))
-#define MAP(SZ,PCREL,TYPE) case F(SZ,PCREL): code = (TYPE); break
-
arelent *
tc_gen_reloc (section, fixp)
asection *section;
@@ -4347,27 +4351,35 @@ tc_gen_reloc (section, fixp)
code = fixp->fx_r_type;
break;
default:
- switch (F (fixp->fx_size, fixp->fx_pcrel))
+ if (fixp->fx_pcrel)
{
- MAP (1, 0, BFD_RELOC_8);
- MAP (2, 0, BFD_RELOC_16);
- MAP (4, 0, BFD_RELOC_32);
- MAP (1, 1, BFD_RELOC_8_PCREL);
- MAP (2, 1, BFD_RELOC_16_PCREL);
- MAP (4, 1, BFD_RELOC_32_PCREL);
- default:
- if (fixp->fx_pcrel)
- as_bad (_("Can not do %d byte pc-relative relocation"),
- fixp->fx_size);
- else
- as_bad (_("Can not do %d byte relocation"), fixp->fx_size);
- code = BFD_RELOC_32;
- break;
+ switch (fixp->fx_size)
+ {
+ default:
+ as_bad (_("Can not do %d byte pc-relative relocation"),
+ fixp->fx_size);
+ code = BFD_RELOC_32_PCREL;
+ break;
+ case 1: code = BFD_RELOC_8_PCREL; break;
+ case 2: code = BFD_RELOC_16_PCREL; break;
+ case 4: code = BFD_RELOC_32_PCREL; break;
+ }
+ }
+ else
+ {
+ switch (fixp->fx_size)
+ {
+ default:
+ as_bad (_("Can not do %d byte relocation"), fixp->fx_size);
+ code = BFD_RELOC_32;
+ break;
+ case 1: code = BFD_RELOC_8; break;
+ case 2: code = BFD_RELOC_16; break;
+ case 4: code = BFD_RELOC_32; break;
+ }
}
break;
}
-#undef MAP
-#undef F
if (code == BFD_RELOC_32
&& GOT_symbol
@@ -4470,6 +4482,6 @@ tc_coff_sizemachdep (frag)
#endif /* I386COFF */
-#endif /* BFD_ASSEMBLER? */
+#endif /* ! BFD_ASSEMBLER */
/* end of tc-i386.c */
diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h
index d876d61b6f2..112e4bc61b0 100644
--- a/gas/config/tc-i386.h
+++ b/gas/config/tc-i386.h
@@ -270,14 +270,21 @@ extern const char extra_symbol_chars[];
#define Acc 0x200000 /* Accumulator %al or %ax or %eax */
#define JumpAbsolute 0x400000
#define RegMMX 0x800000 /* MMX register */
-#define EsSeg 0x1000000 /* String insn operand with fixed es segment */
+#define RegXMM 0x1000000 /* XMM registers in PIII */
+#define EsSeg 0x2000000 /* String insn operand with fixed es segment */
+/* InvMem is for instructions with a modrm byte that only allow a
+ general register encoding in the i.tm.mode and i.tm.regmem fields,
+ eg. control reg moves. They really ought to support a memory form,
+ but don't, so we add an InvMem flag to the register operand to
+ indicate that it should be encoded in the i.tm.regmem field. */
+#define InvMem 0x4000000
#define Reg (Reg8|Reg16|Reg32) /* gen'l register */
#define WordReg (Reg16|Reg32)
#define ImplicitRegister (InOutPortReg|ShiftCount|Acc|FloatAcc)
#define Imm (Imm8|Imm8S|Imm16|Imm32) /* gen'l immediate */
#define Disp (Disp8|Disp16|Disp32) /* General displacement */
-#define AnyMem (Disp|BaseIndex) /* General memory */
+#define AnyMem (Disp|BaseIndex|InvMem) /* General memory */
/* The following aliases are defined because the opcode table
carefully specifies the allowed memory types for each instruction.
At the moment we can only tell a memory reference size by the
@@ -323,7 +330,6 @@ typedef struct
#define D 0x2 /* D = 0 if Reg --> Regmem;
D = 1 if Regmem --> Reg: MUST BE 0x2 */
#define Modrm 0x4
-#define ReverseRegRegmem 0x8 /* swap reg,regmem fields for 2 reg case */
#define FloatR 0x8 /* src/dest swap for floats: MUST BE 0x8 */
#define ShortForm 0x10 /* register is in low 3 bits of opcode */
#define FloatMF 0x20 /* FP insn memory format bit, sized by 0x4 */
@@ -341,12 +347,13 @@ typedef struct
#define No_wSuf 0x20000 /* w suffix on instruction illegal */
#define No_lSuf 0x40000 /* l suffix on instruction illegal */
#define No_sSuf 0x80000 /* s suffix on instruction illegal */
-#define FWait 0x100000 /* instruction needs FWAIT */
-#define IsString 0x200000 /* quick test for string instructions */
-#define regKludge 0x400000 /* fake an extra reg operand for clr, imul */
-#define IsPrefix 0x800000 /* opcode is a prefix */
-#define No_dSuf 0x1000000 /* d suffix on instruction illegal */
-#define No_xSuf 0x2000000 /* x suffix on instruction illegal */
+#define No_dSuf 0x100000 /* d suffix on instruction illegal */
+#define No_xSuf 0x200000 /* x suffix on instruction illegal */
+#define FWait 0x400000 /* instruction needs FWAIT */
+#define IsString 0x800000 /* quick test for string instructions */
+#define regKludge 0x1000000 /* fake an extra reg operand for clr, imul */
+#define IsPrefix 0x2000000 /* opcode is a prefix */
+#define ImmExt 0x4000000 /* instruction has extension in 8 bit imm */
#define Ugh 0x80000000 /* deprecated fp insn, gets a warning */
/* operand_types[i] describes the type of operand i. This is made
diff --git a/gas/config/tc-i960.c b/gas/config/tc-i960.c
index 936b6621994..a4e8497fc2d 100644
--- a/gas/config/tc-i960.c
+++ b/gas/config/tc-i960.c
@@ -1,5 +1,5 @@
/* tc-i960.c - All the i80960-specific stuff
- Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
This file is part of GAS.
@@ -101,7 +101,22 @@
#define TC_S_FORCE_TO_SYSPROC(s) (S_SET_STORAGE_CLASS((s), C_SCALL))
#else /* ! OBJ_COFF */
-you lose;
+#ifdef OBJ_ELF
+#define TC_S_IS_SYSPROC(s) 0
+
+#define TC_S_IS_BALNAME(s) 0
+#define TC_S_IS_CALLNAME(s) 0
+#define TC_S_IS_BADPROC(s) 0
+
+#define TC_S_SET_SYSPROC(s, p)
+#define TC_S_GET_SYSPROC(s) 0
+
+#define TC_S_FORCE_TO_BALNAME(s)
+#define TC_S_FORCE_TO_CALLNAME(s)
+#define TC_S_FORCE_TO_SYSPROC(s)
+#else
+ #error COFF, a.out, b.out, and ELF are the only supported formats.
+#endif /* ! OBJ_ELF */
#endif /* ! OBJ_COFF */
#endif /* ! OBJ_A/BOUT */
@@ -1009,7 +1024,6 @@ md_show_usage (stream)
}
-#ifndef BFD_ASSEMBLER
/*****************************************************************************
md_convert_frag:
Called by base assembler after address relaxation is finished: modify
@@ -1023,11 +1037,19 @@ md_show_usage (stream)
Replace the cobr with a two instructions (a compare and a branch).
*************************************************************************** */
+#ifndef BFD_ASSEMBLER
void
md_convert_frag (headers, seg, fragP)
object_headers *headers;
segT seg;
fragS *fragP;
+#else
+void
+md_convert_frag (abfd, sec, fragP)
+ bfd *abfd;
+ segT sec;
+ fragS *fragP;
+#endif
{
fixS *fixP; /* Structure describing needed address fix */
@@ -1082,6 +1104,7 @@ md_estimate_size_before_relax (fragP, segment_type)
return 0;
} /* md_estimate_size_before_relax() */
+#if defined(OBJ_AOUT) | defined(OBJ_BOUT)
/*****************************************************************************
md_ri_to_chars:
@@ -1096,7 +1119,8 @@ md_estimate_size_before_relax (fragP, segment_type)
does do the reordering (Ian Taylor 28 Aug 92).
*************************************************************************** */
-void
+
+static void
md_ri_to_chars (where, ri)
char *where;
struct relocation_info *ri;
@@ -1114,7 +1138,8 @@ md_ri_to_chars (where, ri)
| (ri->r_callj << 6));
}
-#endif /* BFD_ASSEMBLER */
+#endif /* defined(OBJ_AOUT) | defined(OBJ_BOUT) */
+
/* FOLLOWING ARE THE LOCAL ROUTINES, IN ALPHABETICAL ORDER */
@@ -2819,11 +2844,21 @@ md_pcrel_from (fixP)
return fixP->fx_where + fixP->fx_frag->fr_address;
}
+#ifdef BFD_ASSEMBLER
+int
+md_apply_fix (fixP, valp)
+ fixS *fixP;
+ valueT *valp;
+#else
void
md_apply_fix (fixP, val)
fixS *fixP;
long val;
+#endif
{
+#ifdef BFD_ASSEMBLER
+ long val = *valp;
+#endif
char *place = fixP->fx_where + fixP->fx_frag->fr_literal;
if (!fixP->fx_bit_fixP)
@@ -2833,11 +2868,39 @@ md_apply_fix (fixP, val)
if (fixP->fx_bsr)
val = 0;
+#ifdef OBJ_ELF
+ /* For ELF, we always emit relocations for external or weak
+ symbols. */
+ if (fixP->fx_addsy != NULL
+ && (S_IS_EXTERNAL (fixP->fx_addsy)
+ || S_IS_WEAK (fixP->fx_addsy)))
+ val = 0;
+#endif
+
fixP->fx_addnumber = val;
+
+#ifdef BFD_ASSEMBLER
+ /* HACK: With REL relocations this causes the offset in the code
+ to be doubled.
+
+ Guess: val is the old offset in the code, addnumber gets
+ passed back to md_gen_reloc() where it gets assigned to
+ addend, which the backend then writes back to the code (as
+ we're using REL, not RELA relocations). COFF must be working
+ without this hack, but I don't see how or why.
+
+ apeppere and martindo 22-10-1998. */
+ fixP->fx_addnumber = 0;
+#endif
+
md_number_to_imm (place, val, fixP->fx_size, fixP);
}
else
md_number_to_field (place, val, fixP->fx_bit_fixP);
+
+#ifdef BFD_ASSEMBLER
+ return 0;
+#endif
}
#if defined(OBJ_AOUT) | defined(OBJ_BOUT)
@@ -2937,8 +3000,14 @@ md_section_align (seg, addr)
segT seg;
valueT addr; /* Address to be rounded up */
{
- return ((addr + (1 << section_alignment[(int) seg]) - 1) & (-1 << section_alignment[(int) seg]));
-} /* md_section_align() */
+ int align;
+#ifdef BFD_ASSEMBLER
+ align = bfd_get_section_alignment (stdoutput, seg);
+#else
+ align = section_alignment[(int) seg];
+#endif
+ return (addr + (1 << align) - 1) & (-1 << align);
+}
extern int coff_flags;
@@ -3007,6 +3076,8 @@ tc_headers_hook (headers)
#endif /* OBJ_COFF */
+#ifndef BFD_ASSEMBLER
+
/* Things going on here:
For bout, We need to assure a couple of simplifying
@@ -3066,6 +3137,8 @@ tc_crawl_symbol_chain (headers)
} /* walk the symbol chain */
}
+#endif /* ! BFD_ASSEMBLER */
+
/* For aout or bout, the bal immediately follows the call.
For coff, we cheat and store a pointer to the bal symbol in the
@@ -3105,7 +3178,7 @@ tc_set_bal_of_call (callP, balP)
} /* if not in order */
#else /* ! OBJ_ABOUT */
- (as yet unwritten.);
+ as_fatal ("Only supported for a.out, b.out, or COFF");
#endif /* ! OBJ_ABOUT */
#endif /* ! OBJ_COFF */
}
@@ -3124,7 +3197,7 @@ tc_get_bal_of_call (callP)
#ifdef OBJ_ABOUT
retval = symbol_next (callP);
#else
- (as yet unwritten.);
+ as_fatal ("Only supported for a.out, b.out, or COFF");
#endif /* ! OBJ_ABOUT */
#endif /* ! OBJ_COFF */
@@ -3228,4 +3301,67 @@ i960_validate_fix (fixP, this_segment_type, add_symbolPP)
return 0;
}
+#ifdef BFD_ASSEMBLER
+
+/* From cgen.c: */
+
+static short
+tc_bfd_fix2rtype (fixP)
+ fixS *fixP;
+{
+#if 0
+ if (fixP->fx_bsr)
+ abort ();
+#endif
+
+ if (fixP->fx_pcrel == 0 && fixP->fx_size == 4)
+ return BFD_RELOC_32;
+
+ if (fixP->fx_pcrel != 0 && fixP->fx_size == 4)
+ return BFD_RELOC_24_PCREL;
+
+ abort ();
+ return 0;
+}
+
+/* Translate internal representation of relocation info to BFD target
+ format.
+
+ FIXME: To what extent can we get all relevant targets to use this? */
+
+arelent *
+tc_gen_reloc (section, fixP)
+ asection *section;
+ fixS *fixP;
+{
+ arelent * reloc;
+
+ reloc = (arelent *) xmalloc (sizeof (arelent));
+
+ /* HACK: Is this right? */
+ fixP->fx_r_type = tc_bfd_fix2rtype (fixP);
+
+ reloc->howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
+ if (reloc->howto == (reloc_howto_type *) NULL)
+ {
+ as_bad_where (fixP->fx_file, fixP->fx_line,
+ "internal error: can't export reloc type %d (`%s')",
+ fixP->fx_r_type,
+ bfd_get_reloc_code_name (fixP->fx_r_type));
+ return NULL;
+ }
+
+ assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
+
+ reloc->sym_ptr_ptr = &fixP->fx_addsy->bsym;
+ reloc->address = fixP->fx_frag->fr_address + fixP->fx_where;
+ reloc->addend = fixP->fx_addnumber;
+
+ return reloc;
+}
+
+/* end from cgen.c */
+
+#endif /* BFD_ASSEMBLER */
+
/* end of tc-i960.c */
diff --git a/gas/config/tc-i960.h b/gas/config/tc-i960.h
index f60696751f0..e4152336d90 100644
--- a/gas/config/tc-i960.h
+++ b/gas/config/tc-i960.h
@@ -1,5 +1,5 @@
/* tc-i960.h - Basic 80960 instruction formats.
- Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -22,6 +22,11 @@
#ifndef TC_I960
#define TC_I960 1
+#ifdef OBJ_ELF
+#define TARGET_FORMAT "elf32-i960"
+#define TARGET_ARCH bfd_arch_i960
+#endif
+
#define TARGET_BYTES_BIG_ENDIAN 0
#define WORKING_DOT_WORD
@@ -139,7 +144,23 @@ extern int i960_validate_fix PARAMS ((struct fix *, segT, struct symbol **));
#define TC_VALIDATE_FIX(FIXP,SEGTYPE,LABEL) \
if (i960_validate_fix (FIXP, SEGTYPE, &add_symbolP) != 0) goto LABEL
+#ifdef OBJ_ELF
+#define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \
+ ((FIX)->fx_addsy == NULL \
+ || (! S_IS_EXTERNAL ((FIX)->fx_addsy) \
+ && ! S_IS_WEAK ((FIX)->fx_addsy) \
+ && S_IS_DEFINED ((FIX)->fx_addsy) \
+ && ! S_IS_COMMON ((FIX)->fx_addsy)))
+#endif
+
+#ifndef OBJ_ELF
#define tc_fix_adjustable(FIXP) ((FIXP)->fx_bsr == 0)
+#else
+#define tc_fix_adjustable(FIXP) \
+ ((FIXP)->fx_bsr == 0 \
+ && ! S_IS_EXTERNAL ((FIXP)->fx_addsy) \
+ && ! S_IS_WEAK ((FIXP)->fx_addsy))
+#endif
extern void brtab_emit PARAMS ((void));
#define md_end() brtab_emit ()
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c
index 856dd4ec264..e1e1bc27593 100644
--- a/gas/config/tc-m68k.c
+++ b/gas/config/tc-m68k.c
@@ -1,5 +1,5 @@
/* tc-m68k.c -- Assemble for the m68k family
- Copyright (C) 1987, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright (C) 1987, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -27,6 +27,10 @@
#include "opcode/m68k.h"
#include "m68k-parse.h"
+#if defined (OBJ_ELF)
+#include "elf/m68k.h"
+#endif
+
/* This string holds the chars that always start a comment. If the
pre-processor is disabled, these aren't very useful. The macro
tc_comment_chars points to this. We use this, rather than the
@@ -189,7 +193,7 @@ static const enum m68k_register m68060_control_regs[] = {
USP, VBR, URP, SRP, PCR,
0
};
-static const enum m68k_register mcf5200_control_regs[] = {
+static const enum m68k_register mcf_control_regs[] = {
CACR, TC, ITT0, ITT1, DTT0, DTT1, VBR, ROMBAR,
RAMBAR0, RAMBAR1, MBAR,
0
@@ -247,9 +251,10 @@ struct m68k_it
reloc[5]; /* Five is enough??? */
};
-#define cpu_of_arch(x) ((x) & (m68000up|mcf5200))
+#define cpu_of_arch(x) ((x) & (m68000up|mcf))
#define float_of_arch(x) ((x) & mfloat)
#define mmu_of_arch(x) ((x) & mmmu)
+#define arch_coldfire_p(x) (((x) & mcf) != 0)
/* Macros for determining if cpu supports a specific addressing mode */
#define HAVE_LONG_BRANCH(x) ((x) & (m68020|m68030|m68040|m68060|cpu32))
@@ -391,6 +396,8 @@ static const struct m68k_cpu archs[] = {
{ m68881, "68881", 0 },
{ m68851, "68851", 0 },
{ mcf5200, "5200", 0 },
+ { mcf5206e, "5206e", 0 },
+ { mcf5307, "5307", 0},
/* Aliases (effectively, so far as gas is concerned) for the above
cpus. */
{ m68020, "68k", 1 },
@@ -418,6 +425,9 @@ static const struct m68k_cpu archs[] = {
{ cpu32, "68349", 1 },
{ cpu32, "68360", 1 },
{ m68881, "68882", 1 },
+ { mcf5200, "5202", 1 },
+ { mcf5200, "5204", 1 },
+ { mcf5200, "5206", 1 },
};
static const int n_archs = sizeof (archs) / sizeof (archs[0]);
@@ -1471,11 +1481,26 @@ m68k_ip (instring)
losing++;
break;
+ case 'E':
+ if (opP->reg != ACC)
+ losing++;
+ break;
+
case 'F':
if (opP->mode != FPREG)
losing++;
break;
+ case 'G':
+ if (opP->reg != MACSR)
+ losing++;
+ break;
+
+ case 'H':
+ if (opP->reg != MASK)
+ losing++;
+ break;
+
case 'I':
if (opP->mode != CONTROL
|| opP->reg < COP0
@@ -1737,6 +1762,19 @@ m68k_ip (instring)
++losing;
break;
+ case 'u':
+ if (opP->reg < DATA0L || opP->reg > ADDR7U)
+ losing++;
+ /* FIXME: kludge instead of fixing parser:
+ upper/lower registers are *not* CONTROL
+ registers, but ordinary ones. */
+ if ((opP->reg >= DATA0L && opP->reg <= DATA7L)
+ || (opP->reg >= DATA0U && opP->reg <= DATA7U))
+ opP->mode = DREG;
+ else
+ opP->mode = AREG;
+ break;
+
default:
abort ();
} /* switch on type of operand */
@@ -1994,11 +2032,11 @@ m68k_ip (instring)
&& ((opP->disp.size == SIZE_UNSPEC
&& flag_short_refs == 0
&& cpu_of_arch (current_architecture) >= m68020
- && cpu_of_arch (current_architecture) != mcf5200)
+ && ! arch_coldfire_p (current_architecture))
|| opP->disp.size == SIZE_LONG)))
{
if (cpu_of_arch (current_architecture) < m68020
- || cpu_of_arch (current_architecture) == mcf5200)
+ || arch_coldfire_p (current_architecture))
opP->error =
_("displacement too large for this architecture; needs 68020 or higher");
if (opP->reg == PC)
@@ -2107,12 +2145,16 @@ m68k_ip (instring)
if ((opP->index.scale != 1
&& cpu_of_arch (current_architecture) < m68020)
|| (opP->index.scale == 8
- && current_architecture == mcf5200))
+ && arch_coldfire_p (current_architecture)))
{
opP->error =
_("scale factor invalid on this architecture; needs cpu32 or 68020 or higher");
}
+ if (arch_coldfire_p (current_architecture)
+ && opP->index.size == SIZE_WORD)
+ opP->error = _("invalid index size for coldfire");
+
switch (opP->index.scale)
{
case 1:
@@ -2144,7 +2186,7 @@ m68k_ip (instring)
{
if (siz1 == SIZE_BYTE
|| cpu_of_arch (current_architecture) < m68020
- || cpu_of_arch (current_architecture) == mcf5200
+ || arch_coldfire_p (current_architecture)
|| (siz1 == SIZE_UNSPEC
&& ! isvar (&opP->disp)
&& issbyte (baseo)))
@@ -2211,7 +2253,7 @@ m68k_ip (instring)
/* It isn't simple. */
if (cpu_of_arch (current_architecture) < m68020
- || cpu_of_arch (current_architecture) == mcf5200)
+ || arch_coldfire_p (current_architecture))
opP->error =
_("invalid operand mode for this architecture; needs 68020 or higher");
@@ -2570,10 +2612,17 @@ m68k_ip (instring)
install_operand (s[1], opP->reg - DATA);
break;
+ case 'E': /* Ignore it */
+ break;
+
case 'F':
install_operand (s[1], opP->reg - FP0);
break;
+ case 'G': /* Ignore it */
+ case 'H':
+ break;
+
case 'I':
tmpreg = opP->reg - COP0;
install_operand (s[1], tmpreg);
@@ -2901,6 +2950,11 @@ m68k_ip (instring)
addword (tmpreg >> 16);
addword (tmpreg & 0xFFFF);
break;
+ case 'u':
+ install_operand (s[1], opP->reg - DATA0L);
+ opP->reg -= (DATA0L);
+ opP->reg &= 0x0F; /* remove upper/lower bit */
+ break;
default:
abort ();
}
@@ -3040,6 +3094,30 @@ install_operand (mode, val)
the_ins.opcode[1] = (val >> 16);
the_ins.opcode[2] = val & 0xffff;
break;
+ case 'm':
+ the_ins.opcode[0] |= ((val & 0x8) << (6 - 3));
+ the_ins.opcode[0] |= ((val & 0x7) << 9);
+ the_ins.opcode[1] |= ((val & 0x10) << (7 - 4));
+ break;
+ case 'n':
+ the_ins.opcode[0] |= ((val & 0x8) << (6 - 3));
+ the_ins.opcode[0] |= ((val & 0x7) << 9);
+ break;
+ case 'o':
+ the_ins.opcode[1] |= val << 12;
+ the_ins.opcode[1] |= ((val & 0x10) << (7 - 4));
+ break;
+ case 'M':
+ the_ins.opcode[0] |= (val & 0xF);
+ the_ins.opcode[1] |= ((val & 0x10) << (6 - 4));
+ break;
+ case 'N':
+ the_ins.opcode[1] |= (val & 0xF);
+ the_ins.opcode[1] |= ((val & 0x10) << (6 - 4));
+ break;
+ case 'h':
+ the_ins.opcode[1] |= ((val != 1) << 10);
+ break;
case 'c':
default:
as_fatal (_("failed sanity check."));
@@ -3241,6 +3319,10 @@ static const struct init_entry init_table[] =
{ "ccr", CCR },
{ "cc", CCR },
+ { "acc", ACC },
+ { "macsr", MACSR },
+ { "mask", MASK },
+
/* control registers */
{ "sfc", SFC }, /* Source Function Code */
{ "sfcr", SFC },
@@ -3345,6 +3427,43 @@ static const struct init_entry init_table[] =
{ "za6", ZADDR6 },
{ "za7", ZADDR7 },
+ /* Upper and lower data and address registers, used by macw and msacw. */
+ { "d0l", DATA0L },
+ { "d1l", DATA1L },
+ { "d2l", DATA2L },
+ { "d3l", DATA3L },
+ { "d4l", DATA4L },
+ { "d5l", DATA5L },
+ { "d6l", DATA6L },
+ { "d7l", DATA7L },
+
+ { "a0l", ADDR0L },
+ { "a1l", ADDR1L },
+ { "a2l", ADDR2L },
+ { "a3l", ADDR3L },
+ { "a4l", ADDR4L },
+ { "a5l", ADDR5L },
+ { "a6l", ADDR6L },
+ { "a7l", ADDR7L },
+
+ { "d0u", DATA0U },
+ { "d1u", DATA1U },
+ { "d2u", DATA2U },
+ { "d3u", DATA3U },
+ { "d4u", DATA4U },
+ { "d5u", DATA5U },
+ { "d6u", DATA6U },
+ { "d7u", DATA7U },
+
+ { "a0u", ADDR0U },
+ { "a1u", ADDR1U },
+ { "a2u", ADDR2U },
+ { "a3u", ADDR3U },
+ { "a4u", ADDR4U },
+ { "a5u", ADDR5U },
+ { "a6u", ADDR6U },
+ { "a7u", ADDR7U },
+
{ 0, 0 }
};
@@ -3779,7 +3898,9 @@ select_control_regs ()
control_regs = cpu32_control_regs;
break;
case mcf5200:
- control_regs = mcf5200_control_regs;
+ case mcf5206e:
+ case mcf5307:
+ control_regs = mcf_control_regs;
break;
default:
abort ();
@@ -3853,7 +3974,7 @@ m68k_init_after_args ()
select_control_regs ();
if (cpu_of_arch (current_architecture) < m68020
- || cpu_of_arch (current_architecture) == mcf5200)
+ || arch_coldfire_p (current_architecture))
md_relax_table[TAB (PCINDEX, BYTE)].rlx_more = 0;
}
@@ -7005,5 +7126,12 @@ tc_coff_sizemachdep (frag)
#endif
#endif
-
+#ifdef OBJ_ELF
+void m68k_elf_final_processing()
+{
+ /* Set file-specific flags if this is a cpu32 processor */
+ if (cpu_of_arch (current_architecture) & cpu32)
+ elf_elfheader (stdoutput)->e_flags |= EF_CPU32;
+}
+#endif
/* end of tc-m68k.c */
diff --git a/gas/config/tc-m68k.h b/gas/config/tc-m68k.h
index bc8308abca4..f9a5ef98beb 100644
--- a/gas/config/tc-m68k.h
+++ b/gas/config/tc-m68k.h
@@ -176,6 +176,8 @@ while (0)
#define tc_fix_adjustable(X) tc_m68k_fix_adjustable(X)
extern int tc_m68k_fix_adjustable PARAMS ((struct fix *));
+#define elf_tc_final_processing m68k_elf_final_processing
+extern void m68k_elf_final_processing PARAMS ((void));
#endif
#define TC_FORCE_RELOCATION(FIX) \
diff --git a/gas/config/tc-mcore.c b/gas/config/tc-mcore.c
index 7e784354eab..4c12f9974e5 100644
--- a/gas/config/tc-mcore.c
+++ b/gas/config/tc-mcore.c
@@ -61,8 +61,8 @@ static void mcore_s_section PARAMS ((int));
object. They should use MCORE_INST_XXX macros to get the opcodes
and then use these two macros to crack the MCORE_INST value into
the appropriate byte values. */
-#define INST_BYTE0(x) (((x) >> 8) & 0xFF)
-#define INST_BYTE1(x) ((x) & 0xFF)
+#define INST_BYTE0(x) (((x) >> 8) & 0xFF)
+#define INST_BYTE1(x) ((x) & 0xFF)
const char comment_chars[] = "#/";
const char line_separator_chars[] = ";";
@@ -70,7 +70,6 @@ const char line_comment_chars[] = "#/";
const int md_reloc_size = 8;
-static int relax; /* set if -relax seen */
static int do_jsri2bsr = 0; /* change here from 1 by Cruess 19 August 97 */
static int sifilter_mode = 0;
@@ -394,7 +393,7 @@ parse_reg (s, reg)
}
else if ( tolower (s[0]) == 's'
&& tolower (s[1]) == 'p'
- && (isspace (s[2]) || s[2] == ','))
+ && ! isalnum (s[2]))
{
* reg = 0;
return s + 2;
@@ -533,6 +532,9 @@ make_name (s, p, n)
s[7] = 0;
}
+#define POOL_END_LABEL ".LE"
+#define POOL_START_LABEL ".LS"
+
static void
dump_literals (isforce)
int isforce;
@@ -550,7 +552,7 @@ dump_literals (isforce)
char * output;
char brarname[8];
- make_name (brarname, ".YP.", poolnumber);
+ make_name (brarname, POOL_END_LABEL, poolnumber);
brarsym = symbol_make (brarname);
@@ -642,7 +644,7 @@ enter_literal (e, ispcrel)
if (++ poolnumber > 0xFFFF)
as_fatal (_("more than 65K literal pools"));
- make_name (poolname, ".XP.", poolnumber);
+ make_name (poolname, POOL_START_LABEL, poolnumber);
poolsym = symbol_make (poolname);
symbol_table_insert (poolsym);
poolspan = 0;
@@ -877,8 +879,8 @@ md_assemble (str)
fixes problem of an interrupt during a jmp.. */
if (sifilter_mode)
{
- output[0] = (inst >> 8);
- output[1] = (inst);
+ output[0] = INST_BYTE0 (inst);
+ output[1] = INST_BYTE1 (inst);
output = frag_more (2);
}
break;
@@ -896,20 +898,20 @@ md_assemble (str)
{
/* Replace with: bsr .+2 ; addi r15,6; jmp rx ; jmp rx */
inst = MCORE_INST_BSR; /* with 0 displacement */
- output[0] = (inst >> 8);
- output[1] = (inst);
+ output[0] = INST_BYTE0 (inst);
+ output[1] = INST_BYTE1 (inst);
output = frag_more (2);
inst = MCORE_INST_ADDI;
inst |= 15; /* addi r15,6 */
inst |= (6 - 1) << 4; /* over the jmp's */
- output[0] = (inst >> 8);
- output[1] = (inst);
+ output[0] = INST_BYTE0 (inst);
+ output[1] = INST_BYTE1 (inst);
output = frag_more (2);
inst = MCORE_INST_JMP | reg;
- output[0] = (inst >> 8);
- output[1] = (inst);
+ output[0] = INST_BYTE0 (inst);
+ output[1] = INST_BYTE1 (inst);
output = frag_more (2); /* 2nd emitted in fallthru */
}
@@ -1496,8 +1498,8 @@ md_assemble (str)
as_bad (_("unimplemented opcode \"%s\""), name);
}
- output[0] = inst >> 8;
- output[1] = inst;
+ output[0] = INST_BYTE0 (inst);
+ output[1] = INST_BYTE1 (inst);
check_literals (opcode->transfer, isize);
}
@@ -1531,7 +1533,7 @@ md_atof (type, litP, sizeP)
{
int prec;
LITTLENUM_TYPE words[MAX_LITTLENUMS];
- LITTLENUM_TYPE * wordP;
+ int i;
char * t;
char * atof_ieee ();
@@ -1573,26 +1575,25 @@ md_atof (type, litP, sizeP)
*sizeP = prec * sizeof (LITTLENUM_TYPE);
- for (wordP = words; prec--;)
- {
- md_number_to_chars (litP, (long) (*wordP++), sizeof (LITTLENUM_TYPE));
- litP += sizeof (LITTLENUM_TYPE);
- }
+ for (i = 0; i < prec; i++)
+ {
+ md_number_to_chars (litP, (valueT) words[i],
+ sizeof (LITTLENUM_TYPE));
+ litP += sizeof (LITTLENUM_TYPE);
+ }
return 0;
}
CONST char * md_shortopts = "";
-#define OPTION_RELAX (OPTION_MD_BASE)
-#define OPTION_JSRI2BSR_ON (OPTION_MD_BASE + 1)
-#define OPTION_JSRI2BSR_OFF (OPTION_MD_BASE + 2)
-#define OPTION_SIFILTER_ON (OPTION_MD_BASE + 3)
-#define OPTION_SIFILTER_OFF (OPTION_MD_BASE + 4)
+#define OPTION_JSRI2BSR_ON (OPTION_MD_BASE + 0)
+#define OPTION_JSRI2BSR_OFF (OPTION_MD_BASE + 1)
+#define OPTION_SIFILTER_ON (OPTION_MD_BASE + 2)
+#define OPTION_SIFILTER_OFF (OPTION_MD_BASE + 3)
struct option md_longopts[] =
{
- { "relax", no_argument, NULL, OPTION_RELAX},
{ "no-jsri2bsr", no_argument, NULL, OPTION_JSRI2BSR_OFF},
{ "jsri2bsr", no_argument, NULL, OPTION_JSRI2BSR_ON},
{ "sifilter", no_argument, NULL, OPTION_SIFILTER_ON},
@@ -1613,7 +1614,6 @@ md_parse_option (c, arg)
switch (c)
{
- case OPTION_RELAX: relax = 1; break;
case OPTION_JSRI2BSR_ON: do_jsri2bsr = 1; break;
case OPTION_JSRI2BSR_OFF: do_jsri2bsr = 0; break;
case OPTION_SIFILTER_ON: sifilter_mode = 1; break;
@@ -1630,9 +1630,8 @@ md_show_usage (stream)
{
fprintf (stream, _("\
MCORE specific options:\n\
- -{no-}jsri2bsr {dis}able jsri to bsr transformation (def: off)\n\
- -{no-}sifilter {dis}able silicon filter behavior (def: off)\n\
- -relax alter jump instructions for long displacements\n"));
+ -{no-}jsri2bsr {dis}able jsri to bsr transformation (def: dis)\n\
+ -{no-}sifilter {dis}able silicon filter behavior (def: dis)"));
}
int md_short_jump_size;
@@ -1683,14 +1682,17 @@ md_convert_frag (abfd, sec, fragP)
int disp = targ_addr - next_inst;
if (disp & 1)
- as_bad (_("odd displacement at %x"), next_inst - 2);
+ as_bad (_("odd displacement at %x"), next_inst - 2);
disp >>= 1;
- t0 = buffer[0] & 0xF8;
+ {
+ t0 = buffer[0] & 0xF8;
- md_number_to_chars (buffer, disp, 2);
+ md_number_to_chars (buffer, disp, 2);
+
+ buffer[0] = (buffer[0] & 0x07) | t0;
+ }
- buffer[0] = (buffer[0] & 0x07) | t0;
fragP->fr_fix += 2;
fragP->fr_var = 0;
}
@@ -1712,15 +1714,18 @@ md_convert_frag (abfd, sec, fragP)
int first_inst = fragP->fr_fix + fragP->fr_address;
int needpad = (first_inst & 3);
- buffer[0] ^= 0x08; /* Toggle T/F bit */
+ buffer[0] ^= 0x08; /* Toggle T/F bit */
buffer[2] = INST_BYTE0 (MCORE_INST_JMPI); /* Build jmpi */
buffer[3] = INST_BYTE1 (MCORE_INST_JMPI);
if (needpad)
{
- buffer[1] = 4; /* branch over jmpi, pad, and ptr */
- buffer[3] = 1; /* jmpi offset of 1 gets the pointer */
+ {
+ buffer[1] = 4; /* branch over jmpi, pad, and ptr */
+ buffer[3] = 1; /* jmpi offset of 1 gets the pointer */
+ }
+
buffer[4] = 0; /* alignment/pad */
buffer[5] = 0;
buffer[6] = 0; /* space for 32 bit address */
@@ -1740,8 +1745,11 @@ md_convert_frag (abfd, sec, fragP)
shrinking the fragment. '3' is the amount of code that
we inserted here, but '4' is right for the space we reserved
for this fragment. */
- buffer[1] = 3; /* branch over jmpi, and ptr */
- buffer[3] = 0; /* jmpi offset of 0 gets the pointer */
+ {
+ buffer[1] = 3; /* branch over jmpi, and ptr */
+ buffer[3] = 0; /* jmpi offset of 0 gets the pointer */
+ }
+
buffer[4] = 0; /* space for 32 bit address */
buffer[5] = 0;
buffer[6] = 0;
@@ -1752,12 +1760,12 @@ md_convert_frag (abfd, sec, fragP)
fragP->fr_symbol, fragP->fr_offset, 0, BFD_RELOC_32);
fragP->fr_fix += C32_LEN;
- /* frag is actually shorter (see the other side of this ifdef)
- but gas isn't prepared for that. We have to re-adjust
+ /* Frag is actually shorter (see the other side of this ifdef)
+ but gas isn't prepared for that. We have to re-adjust
the branch displacement so that it goes beyond the
full length of the fragment, not just what we actually
filled in. */
- buffer[1] = 4; /* jmpi, ptr, and the 'tail pad' */
+ buffer[1] = 4; /* jmpi, ptr, and the 'tail pad' */
}
fragP->fr_var = 0;
@@ -1782,7 +1790,7 @@ md_convert_frag (abfd, sec, fragP)
if (needpad)
{
- buffer[1] = 1; /* jmpi offset of 1 since padded */
+ buffer[1] = 1; /* jmpi offset of 1 since padded */
buffer[2] = 0; /* alignment */
buffer[3] = 0;
buffer[4] = 0; /* space for 32 bit address */
@@ -1798,7 +1806,7 @@ md_convert_frag (abfd, sec, fragP)
}
else
{
- buffer[1] = 0; /* jmpi offset of 0 if no pad */
+ buffer[1] = 0; /* jmpi offset of 0 if no pad */
buffer[2] = 0; /* space for 32 bit address */
buffer[3] = 0;
buffer[4] = 0;
@@ -1865,9 +1873,9 @@ md_apply_fix3 (fixP, valp, segment)
as_bad_where (file, fixP->fx_line,
_("pcrel for branch to %s too far (0x%x)"),
symname, val);
- buf[0] |= ((val >> 8) & 0x7);
- buf[1] |= (val & 0xff);
- break;
+ buf[0] |= ((val >> 8) & 0x7);
+ buf[1] |= (val & 0xff);
+ break;
case BFD_RELOC_MCORE_PCREL_IMM8BY4: /* lower 8 bits of 2 byte opcode */
val += 3;
@@ -1878,14 +1886,14 @@ md_apply_fix3 (fixP, valp, segment)
symname, val);
else
buf[1] |= (val & 0xff);
- break;
+ break;
case BFD_RELOC_MCORE_PCREL_IMM4BY2: /* loopt instruction */
if ((val < -32) || (val > -2))
as_bad_where (file, fixP->fx_line,
_("pcrel for loopt too far (0x%x)"), val);
val /= 2;
- buf[1] |= (val & 0xf);
+ buf[1] |= (val & 0xf);
break;
case BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2:
@@ -1898,8 +1906,8 @@ md_apply_fix3 (fixP, valp, segment)
nval |= MCORE_INST_BSR;
/* REPLACE the instruction, don't just modify it. */
- buf[0] = ((nval >> 8) & 0xff);
- buf[1] = (nval & 0xff);
+ buf[0] = INST_BYTE0 (nval);
+ buf[1] = INST_BYTE1 (nval);
}
else
fixP->fx_done = 0;
@@ -1923,21 +1931,14 @@ md_apply_fix3 (fixP, valp, segment)
#endif
{
if (fixP->fx_size == 4)
- {
- *buf++ = val >> 24;
- *buf++ = val >> 16;
- *buf++ = val >> 8;
- *buf = val;
- }
+ ;
else if (fixP->fx_size == 2 && val >= -32768 && val <= 32767)
- {
- *buf++ = val >> 8;
- *buf = val;
- }
+ ;
else if (fixP->fx_size == 1 && val >= -256 && val <= 255)
- *buf = val;
+ ;
else
abort ();
+ md_number_to_chars (buf, val, fixP->fx_size);
}
break;
}
@@ -2022,21 +2023,20 @@ md_estimate_size_before_relax (fragP, segment_type)
}
/* Put number into target byte order */
-
void
md_number_to_chars (ptr, use, nbytes)
char * ptr;
valueT use;
int nbytes;
{
- switch (nbytes)
- {
- case 4: *ptr++ = (use >> 24) & 0xff; /* fall through */
- case 3: *ptr++ = (use >> 16) & 0xff; /* fall through */
- case 2: *ptr++ = (use >> 8) & 0xff; /* fall through */
- case 1: *ptr++ = (use >> 0) & 0xff; break;
- default: abort ();
- }
+ switch (nbytes)
+ {
+ case 4: *ptr++ = (use >> 24) & 0xff; /* fall through */
+ case 3: *ptr++ = (use >> 16) & 0xff; /* fall through */
+ case 2: *ptr++ = (use >> 8) & 0xff; /* fall through */
+ case 1: *ptr++ = (use >> 0) & 0xff; break;
+ default: abort ();
+ }
}
/* Round up a section size to the appropriate boundary. */
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 3d865fd9777..c25f0576e6d 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -6956,13 +6956,13 @@ mips_ip (str, ip)
/* If the instruction contains a '.', we first try to match an instruction
including the '.'. Then we try again without the '.'. */
insn = NULL;
- for (s = str; *s != '\0' && !isspace(*s); ++s)
+ for (s = str; *s != '\0' && !isspace ((unsigned char) *s); ++s)
continue;
/* If we stopped on whitespace, then replace the whitespace with null for
the call to hash_find. Save the character we replaced just in case we
have to re-parse the instruction. */
- if (isspace (*s))
+ if (isspace ((unsigned char) *s))
{
save_c = *s;
*s++ = '\0';
@@ -6980,7 +6980,7 @@ mips_ip (str, ip)
*(--s) = save_c;
/* Scan up to the first '.' or whitespace. */
- for (s = str; *s != '\0' && *s != '.' && !isspace (*s); ++s)
+ for (s = str; *s != '\0' && *s != '.' && !isspace ((unsigned char) *s); ++s)
continue;
/* If we did not find a '.', then we can quit now. */
@@ -7246,7 +7246,7 @@ mips_ip (str, ip)
if (s[0] == '$')
{
- if (isdigit (s[1]))
+ if (isdigit ((unsigned char) s[1]))
{
++s;
regno = 0;
@@ -7256,7 +7256,7 @@ mips_ip (str, ip)
regno += *s - '0';
++s;
}
- while (isdigit (*s));
+ while (isdigit ((unsigned char) *s));
if (regno > 31)
as_bad (_("Invalid register number (%d)"), regno);
}
@@ -7406,7 +7406,7 @@ mips_ip (str, ip)
case 'V':
case 'W':
s_reset = s;
- if (s[0] == '$' && s[1] == 'f' && isdigit (s[2]))
+ if (s[0] == '$' && s[1] == 'f' && isdigit ((unsigned char) s[2]))
{
s += 2;
regno = 0;
@@ -7416,7 +7416,7 @@ mips_ip (str, ip)
regno += *s - '0';
++s;
}
- while (isdigit (*s));
+ while (isdigit ((unsigned char) *s));
if (regno > 31)
as_bad (_("Invalid float register number (%d)"), regno);
@@ -7848,7 +7848,7 @@ mips_ip (str, ip)
regno += *s - '0';
++s;
}
- while (isdigit (*s));
+ while (isdigit ((unsigned char) *s));
if (regno > 7)
as_bad (_("invalid condition code register $fcc%d"), regno);
if (*args == 'N')
@@ -7901,7 +7901,7 @@ mips16_ip (str, ip)
mips16_small = false;
mips16_ext = false;
- for (s = str; islower (*s); ++s)
+ for (s = str; islower ((unsigned char) *s); ++s)
;
switch (*s)
{
@@ -8034,7 +8034,7 @@ mips16_ip (str, ip)
if (s[0] != '$')
break;
s_reset = s;
- if (isdigit (s[1]))
+ if (isdigit ((unsigned char) s[1]))
{
++s;
regno = 0;
@@ -8044,7 +8044,7 @@ mips16_ip (str, ip)
regno += *s - '0';
++s;
}
- while (isdigit (*s));
+ while (isdigit ((unsigned char) *s));
if (regno > 31)
{
as_bad (_("invalid register number (%d)"), regno);
@@ -8315,7 +8315,7 @@ mips16_ip (str, ip)
++s;
}
reg1 = 0;
- while (isdigit (*s))
+ while (isdigit ((unsigned char) *s))
{
reg1 *= 10;
reg1 += *s - '0';
@@ -8342,7 +8342,7 @@ mips16_ip (str, ip)
}
}
reg2 = 0;
- while (isdigit (*s))
+ while (isdigit ((unsigned char) *s))
{
reg2 *= 10;
reg2 += *s - '0';
@@ -8626,9 +8626,9 @@ my_getSmallExpression (ep, str)
;
if (sp - 4 >= str && sp[-1] == RP)
{
- if (isdigit (sp[-2]))
+ if (isdigit ((unsigned char) sp[-2]))
{
- for (sp -= 3; sp >= str && isdigit (*sp); sp--)
+ for (sp -= 3; sp >= str && isdigit ((unsigned char) *sp); sp--)
;
if (*sp == '$' && sp > str && sp[-1] == LP)
{
@@ -11472,14 +11472,14 @@ get_number ()
++input_line_pointer;
negative = 1;
}
- if (!isdigit (*input_line_pointer))
+ if (!isdigit ((unsigned char) *input_line_pointer))
as_bad (_("Expected simple number."));
if (input_line_pointer[0] == '0')
{
if (input_line_pointer[1] == 'x')
{
input_line_pointer += 2;
- while (isxdigit (*input_line_pointer))
+ while (isxdigit ((unsigned char) *input_line_pointer))
{
val <<= 4;
val |= hex_value (*input_line_pointer++);
@@ -11489,7 +11489,7 @@ get_number ()
else
{
++input_line_pointer;
- while (isdigit (*input_line_pointer))
+ while (isdigit ((unsigned char) *input_line_pointer))
{
val <<= 3;
val |= *input_line_pointer++ - '0';
@@ -11497,14 +11497,14 @@ get_number ()
return negative ? -val : val;
}
}
- if (!isdigit (*input_line_pointer))
+ if (!isdigit ((unsigned char) *input_line_pointer))
{
printf (_(" *input_line_pointer == '%c' 0x%02x\n"),
*input_line_pointer, *input_line_pointer);
as_warn (_("Invalid number"));
return -1;
}
- while (isdigit (*input_line_pointer))
+ while (isdigit ((unsigned char) *input_line_pointer))
{
val *= 10;
val += *input_line_pointer++ - '0';
@@ -11630,7 +11630,8 @@ s_mips_ent (aent)
if (*input_line_pointer == ',')
input_line_pointer++;
SKIP_WHITESPACE ();
- if (isdigit (*input_line_pointer) || *input_line_pointer == '-')
+ if (isdigit ((unsigned char) *input_line_pointer)
+ || *input_line_pointer == '-')
number = get_number ();
#ifdef BFD_ASSEMBLER
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index 8c31ba64153..0270ceb0f13 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -766,6 +766,11 @@ md_parse_option (c, arg)
ppc_cpu = PPC_OPCODE_PPC;
ppc_size = PPC_OPCODE_64;
}
+ else if (strcmp (arg, "ppc64bridge") == 0)
+ {
+ ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_64_BRIDGE;
+ ppc_size = PPC_OPCODE_64;
+ }
/* -mcom means assemble for the common intersection between Power
and PowerPC. At present, we just allow the union, rather
than the intersection. */
@@ -872,6 +877,7 @@ PowerPC options:\n\
-mppc, -mppc32, -m403, -m603, -m604\n\
generate code for Motorola PowerPC 603/604\n\
-mppc64, -m620 generate code for Motorola PowerPC 620\n\
+-mppc64bridge generate code for PowerPC 64, including bridge insns\n\
-mcom generate code Power/PowerPC common instructions\n\
-many generate code for any architecture (PWR/PWRX/PPC)\n\
-mregnames Allow symbolic names for registers\n\
@@ -972,7 +978,8 @@ md_begin ()
if ((op->flags & ppc_cpu) != 0
&& ((op->flags & (PPC_OPCODE_32 | PPC_OPCODE_64)) == 0
- || (op->flags & (PPC_OPCODE_32 | PPC_OPCODE_64)) == ppc_size))
+ || (op->flags & (PPC_OPCODE_32 | PPC_OPCODE_64)) == ppc_size
+ || (ppc_cpu & PPC_OPCODE_64_BRIDGE) != 0))
{
const char *retval;
@@ -1056,8 +1063,7 @@ ppc_insert_operand (insn, operand, val, file, line)
if ((operand->flags & PPC_OPERAND_SIGNED) != 0)
{
- if ((operand->flags & PPC_OPERAND_SIGNOPT) != 0
- && ppc_size == PPC_OPCODE_32)
+ if ((operand->flags & PPC_OPERAND_SIGNOPT) != 0)
max = (1 << operand->bits) - 1;
else
max = (1 << (operand->bits - 1)) - 1;
diff --git a/gas/configure b/gas/configure
index b8eefe4a591..0b5ecb17f99 100755
--- a/gas/configure
+++ b/gas/configure
@@ -16,8 +16,12 @@ ac_help="$ac_help
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 force libtool not to do file locking"
+ac_help="$ac_help
--enable-bfd-assembler use BFD back end for writing object files"
ac_help="$ac_help
targets alternative target configurations besides the primary"
@@ -588,7 +592,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:592: checking host system type" >&5
+echo "configure:596: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -609,7 +613,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:613: checking target system type" >&5
+echo "configure:617: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -627,7 +631,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:631: checking build system type" >&5
+echo "configure:635: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -662,7 +666,7 @@ test "$host_alias" != "$target_alias" &&
# 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:666: checking for a BSD compatible install" >&5
+echo "configure:670: 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
@@ -715,7 +719,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:719: checking whether build environment is sane" >&5
+echo "configure:723: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@@ -772,7 +776,7 @@ test "$program_suffix" != NONE &&
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:776: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:780: 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
@@ -818,7 +822,7 @@ EOF
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:822: checking for working aclocal" >&5
+echo "configure:826: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -831,7 +835,7 @@ else
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:835: checking for working autoconf" >&5
+echo "configure:839: 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.
@@ -844,7 +848,7 @@ else
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:848: checking for working automake" >&5
+echo "configure:852: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -857,7 +861,7 @@ else
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:861: checking for working autoheader" >&5
+echo "configure:865: 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.
@@ -870,7 +874,7 @@ else
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:874: checking for working makeinfo" >&5
+echo "configure:878: 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.
@@ -930,10 +934,33 @@ else
enable_static=yes
fi
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+ enableval="$enable_fast_install"
+ p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_fast_install=yes
+fi
+
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:937: checking for $ac_word" >&5
+echo "configure:964: 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
@@ -963,7 +990,7 @@ 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:967: checking for $ac_word" >&5
+echo "configure:994: 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
@@ -993,7 +1020,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:997: checking for $ac_word" >&5
+echo "configure:1024: 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
@@ -1044,7 +1071,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:1048: checking for $ac_word" >&5
+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
@@ -1076,7 +1103,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1080: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1107: 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.
@@ -1087,12 +1114,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 1091 "configure"
+#line 1118 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1123: \"$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
@@ -1118,12 +1145,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:1122: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1149: 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:1127: checking whether we are using GNU C" >&5
+echo "configure:1154: 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
@@ -1132,7 +1159,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1136: \"$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:1163: \"$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
@@ -1151,7 +1178,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:1155: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1182: 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
@@ -1190,18 +1217,23 @@ else
with_gnu_ld=no
fi
-
ac_prog=ld
if test "$ac_cv_prog_gcc" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1199: checking for ld used by GCC" >&5
+echo "configure:1225: checking for ld used by GCC" >&5
ac_prog=`($CC -print-prog-name=ld) 2>&5`
case "$ac_prog" in
- # Accept absolute paths.
- /* | [A-Za-z]:\\*)
- test -z "$LD" && LD="$ac_prog"
- ;;
+ # Accept absolute paths.
+ /* | [A-Za-z]:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
@@ -1213,10 +1245,10 @@ echo "configure:1199: checking for ld used by GCC" >&5
esac
elif test "$with_gnu_ld" = yes; then
echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1217: checking for GNU ld" >&5
+echo "configure:1249: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1220: checking for non-GNU ld" >&5
+echo "configure:1252: checking for non-GNU ld" >&5
fi
if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1233,7 +1265,7 @@ else
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
- test "$with_gnu_ld" != yes && break
+ test "$with_gnu_ld" != yes && break
fi
fi
done
@@ -1252,7 +1284,7 @@ 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:1256: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1288: checking if the linker ($LD) is GNU ld" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1268,7 +1300,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1272: checking for BSD-compatible nm" >&5
+echo "configure:1304: checking for BSD-compatible nm" >&5
if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1277,20 +1309,22 @@ else
ac_cv_path_NM="$NM"
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/nm; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -B"
+ ac_cv_path_NM="$ac_dir/nm -B"
+ break
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -p"
+ ac_cv_path_NM="$ac_dir/nm -p"
+ break
else
- ac_cv_path_NM="$ac_dir/nm"
+ ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
fi
- break
fi
done
IFS="$ac_save_ifs"
@@ -1302,8 +1336,212 @@ NM="$ac_cv_path_NM"
echo "$ac_t""$NM" 1>&6
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
+echo "configure:1342: checking command to parse $NM output" >&5
+if eval "test \"`echo '$''{'ac_cv_sys_global_symbol_pipe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # These are sane defaults that work on at least a few old systems.
+# {They come from Ultrix. What could be older than Ultrix?!! ;)}
+
+# Character class describing NM global symbol codes.
+ac_symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+ac_symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+
+# Define system-specific variables.
+case "$host_os" in
+aix*)
+ ac_symcode='[BCDT]'
+ ;;
+cygwin* | mingw*)
+ ac_symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
+ ;;
+irix*)
+ ac_symcode='[BCDEGRST]'
+ ;;
+solaris*)
+ ac_symcode='[BDT]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
+ ac_symcode='[ABCDGISTW]'
+fi
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+ ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.* \($ac_symcode\) *\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
+
+ # Check to see that the pipe works correctly.
+ ac_pipe_works=no
+ rm -f conftest.$ac_ext
+ cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func;return 0;}
+EOF
+
+ if { (eval echo configure:1405: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ # Now try to grab the symbols.
+ ac_nlist=conftest.nm
+
+ if { (eval echo configure:1409: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+
+ # Try sorting and uniquifying the output.
+ if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
+ mv -f "$ac_nlist"T "$ac_nlist"
+ else
+ rm -f "$ac_nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
+ if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
+ cat <<EOF > conftest.c
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
+
+ cat <<EOF >> conftest.c
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+ sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
+ cat <<\EOF >> conftest.c
+ {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftestm.$ac_objext
+ ac_save_LIBS="$LIBS"
+ ac_save_CFLAGS="$CFLAGS"
+ LIBS="conftestm.$ac_objext"
+ CFLAGS="$CFLAGS$no_builtin_flag"
+ if { (eval echo configure:1461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ ac_pipe_works=yes
+ else
+ echo "configure: failed program was:" >&5
+ cat conftest.c >&5
+ fi
+ LIBS="$ac_save_LIBS"
+ CFLAGS="$ac_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $ac_nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $ac_nlist" >&5
+ fi
+ else
+ echo "cannot run $ac_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.c >&5
+ fi
+ rm -rf conftest*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$ac_pipe_works" = yes; then
+ if test x"$ac_symprfx" = x"_"; then
+ ac_cv_sys_symbol_underscore=yes
+ else
+ ac_cv_sys_symbol_underscore=no
+ fi
+ break
+ else
+ ac_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+
+ac_result=yes
+if test -z "$ac_cv_sys_global_symbol_pipe"; then
+ ac_result=no
+fi
+echo "$ac_t""$ac_result" 1>&6
+
+echo $ac_n "checking for _ prefix in compiled symbols""... $ac_c" 1>&6
+echo "configure:1507: checking for _ prefix in compiled symbols" >&5
+if eval "test \"`echo '$''{'ac_cv_sys_symbol_underscore'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_cv_sys_symbol_underscore=no
+cat > conftest.$ac_ext <<EOF
+void nm_test_func(){}
+int main(){nm_test_func;return 0;}
+EOF
+if { (eval echo configure:1516: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ # Now try to grab the symbols.
+ ac_nlist=conftest.nm
+ if { (eval echo configure:1519: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+ # See whether the symbols have a leading underscore.
+ if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
+ ac_cv_sys_symbol_underscore=yes
+ else
+ if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
+ :
+ else
+ echo "configure: cannot find nm_test_func in $ac_nlist" >&5
+ fi
+ fi
+ else
+ echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&5
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.c >&5
+fi
+rm -rf conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_sys_symbol_underscore" 1>&6
+USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
+
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1307: checking whether ln -s works" >&5
+echo "configure:1545: 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
@@ -1329,13 +1567,13 @@ else
ac_tool_prefix=
fi
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
# Check for any special flags to pass to ltconfig.
-libtool_flags=
+libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen"
test "$silent" = yes && libtool_flags="$libtool_flags --silent"
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
@@ -1345,8 +1583,8 @@ test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
case "$host" in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 1349 "configure"' > conftest.$ac_ext
- if { (eval echo configure:1350: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ echo '#line 1587 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:1588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*32-bit*)
LD="${LD-ld} -32"
@@ -1364,14 +1602,45 @@ case "$host" in
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
+ echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
+echo "configure:1609: checking whether the C compiler needs -belf" >&5
+if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1614 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:1621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ lt_cv_cc_needs_belf=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ lt_cv_cc_needs_belf=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
;;
*-*-cygwin*)
# Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ac_tool_prefix}dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1375: checking for $ac_word" >&5
+echo "configure:1644: 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
@@ -1403,7 +1672,7 @@ if test -n "$ac_tool_prefix"; 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:1407: checking for $ac_word" >&5
+echo "configure:1676: 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
@@ -1438,7 +1707,7 @@ fi
# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
set dummy ${ac_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1442: checking for $ac_word" >&5
+echo "configure:1711: 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
@@ -1470,7 +1739,7 @@ if test -n "$ac_tool_prefix"; 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:1474: checking for $ac_word" >&5
+echo "configure:1743: 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
@@ -1507,6 +1776,71 @@ fi
esac
+# enable the --disable-libtool-lock switch
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval="$enable_libtool_lock"
+ need_locks=$enableval
+else
+ need_locks=yes
+fi
+
+
+if test x"$need_locks" = xno; then
+ libtool_flags="$libtool_flags --disable-lock"
+fi
+
+
+# Save cache, so that ltconfig can load it
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+
# Actually configure libtool. ac_aux_dir is where install-sh is found.
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
@@ -1515,6 +1849,22 @@ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
+# Reload cache, that may have been modified by ltconfig
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
# Redirect the config.log output again, so that the ltconfig log is not
# clobbered by the next message.
exec 5>>./config.log
@@ -1714,6 +2064,7 @@ EOF
i386-*-vsta) fmt=aout ;;
i386-*-msdosdjgpp* | i386-*-go32* | i386-go32-rtems*)
fmt=coff em=go32;;
+ i386-*-rtemself*) fmt=elf ;;
i386-*-rtems*) fmt=coff ;;
i386-*-gnu*) fmt=elf ;;
i386-*-mach*)
@@ -1732,6 +2083,7 @@ EOF
i960-*-vxworks5.0) fmt=bout ;;
i960-*-vxworks5.*) fmt=coff em=ic960 ;;
i960-*-vxworks*) fmt=bout ;;
+ i960-*-elf*) fmt=elf ;;
m32r-*-*) fmt=elf bfd_gas=yes ;;
@@ -1817,6 +2169,7 @@ EOF
sh-*-elf*) fmt=elf ;;
sh-*-coff*) fmt=coff ;;
+ sh-*-rtemself*) fmt=elf ;;
sh-*-rtems*) fmt=coff ;;
ns32k-pc532-mach* | ns32k-pc532-ux*) fmt=aout em=pc532mach ;;
@@ -2305,7 +2658,7 @@ EOF
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2323: checking for $ac_word" >&5
+echo "configure:2662: 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
@@ -2335,7 +2688,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:2353: checking for $ac_word" >&5
+echo "configure:2692: 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
@@ -2386,7 +2739,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:2404: checking for $ac_word" >&5
+echo "configure:2743: 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
@@ -2418,7 +2771,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2436: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2775: 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.
@@ -2429,12 +2782,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 2447 "configure"
+#line 2786 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:2452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2791: \"$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
@@ -2460,12 +2813,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:2478: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2817: 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:2483: checking whether we are using GNU C" >&5
+echo "configure:2822: 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
@@ -2474,7 +2827,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2492: \"$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:2831: \"$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
@@ -2493,7 +2846,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:2511: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2850: 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
@@ -2530,7 +2883,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:2548: checking for $ac_word" >&5
+echo "configure:2887: 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
@@ -2561,7 +2914,7 @@ done
test -n "$YACC" || YACC="yacc"
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2579: checking how to run the C preprocessor" >&5
+echo "configure:2918: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -2576,13 +2929,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 2594 "configure"
+#line 2933 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2600: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2939: \"$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
:
@@ -2593,13 +2946,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 2611 "configure"
+#line 2950 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2617: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2956: \"$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
:
@@ -2610,13 +2963,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 2628 "configure"
+#line 2967 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2634: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2973: \"$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
:
@@ -2646,7 +2999,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:2664: checking for $ac_word" >&5
+echo "configure:3003: 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
@@ -2679,7 +3032,7 @@ 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:2697: checking for $ac_word" >&5
+echo "configure:3036: 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
@@ -2713,7 +3066,7 @@ then
*) ac_lib=l ;;
esac
echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:2731: checking for yywrap in -l$ac_lib" >&5
+echo "configure:3070: 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
@@ -2721,7 +3074,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$ac_lib $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2739 "configure"
+#line 3078 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2732,7 +3085,7 @@ int main() {
yywrap()
; return 0; }
EOF
-if { (eval echo configure:2750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3089: \"$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
@@ -2755,7 +3108,7 @@ fi
fi
echo $ac_n "checking lex output file root""... $ac_c" 1>&6
-echo "configure:2773: checking lex output file root" >&5
+echo "configure:3112: checking lex output file root" >&5
if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2776,7 +3129,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6
LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
-echo "configure:2794: checking whether yytext is a pointer" >&5
+echo "configure:3133: checking whether yytext is a pointer" >&5
if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2788,14 +3141,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
ac_save_LIBS="$LIBS"
LIBS="$LIBS $LEXLIB"
cat > conftest.$ac_ext <<EOF
-#line 2806 "configure"
+#line 3145 "configure"
#include "confdefs.h"
`cat $LEX_OUTPUT_ROOT.c`
int main() {
; return 0; }
EOF
-if { (eval echo configure:2813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_prog_lex_yytext_pointer=yes
else
@@ -2819,7 +3172,7 @@ fi
ALL_LINGUAS=
echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:2837: checking for POSIXized ISC" >&5
+echo "configure:3176: checking for POSIXized ISC" >&5
if test -d /etc/conf/kconfig.d &&
grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
@@ -2840,12 +3193,12 @@ else
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2858: checking for ANSI C header files" >&5
+echo "configure:3197: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2863 "configure"
+#line 3202 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2853,7 +3206,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3210: \"$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*
@@ -2870,7 +3223,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 2888 "configure"
+#line 3227 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2888,7 +3241,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 2906 "configure"
+#line 3245 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2909,7 +3262,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2927 "configure"
+#line 3266 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2920,7 +3273,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2944,12 +3297,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2962: checking for working const" >&5
+echo "configure:3301: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2967 "configure"
+#line 3306 "configure"
#include "confdefs.h"
int main() {
@@ -2998,7 +3351,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:3016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -3019,21 +3372,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:3037: checking for inline" >&5
+echo "configure:3376: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 3044 "configure"
+#line 3383 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:3051: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -3059,12 +3412,12 @@ EOF
esac
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:3077: checking for off_t" >&5
+echo "configure:3416: 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 <<EOF
-#line 3082 "configure"
+#line 3421 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -3092,12 +3445,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3110: checking for size_t" >&5
+echo "configure:3449: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3115 "configure"
+#line 3454 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -3127,19 +3480,19 @@ fi
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:3145: checking for working alloca.h" >&5
+echo "configure:3484: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3150 "configure"
+#line 3489 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:3157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3496: \"$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
@@ -3160,12 +3513,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:3178: checking for alloca" >&5
+echo "configure:3517: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3183 "configure"
+#line 3522 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -3193,7 +3546,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:3211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -3225,12 +3578,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:3243: checking whether alloca needs Cray hooks" >&5
+echo "configure:3582: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3248 "configure"
+#line 3587 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -3255,12 +3608,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3273: checking for $ac_func" >&5
+echo "configure:3612: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3278 "configure"
+#line 3617 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3283,7 +3636,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3640: \"$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
@@ -3310,7 +3663,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:3328: checking stack direction for C alloca" >&5
+echo "configure:3667: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3318,7 +3671,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 3336 "configure"
+#line 3675 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -3337,7 +3690,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:3355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -3362,17 +3715,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3380: checking for $ac_hdr" >&5
+echo "configure:3719: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3385 "configure"
+#line 3724 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3390: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3729: \"$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*
@@ -3401,12 +3754,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3419: checking for $ac_func" >&5
+echo "configure:3758: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3424 "configure"
+#line 3763 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3429,7 +3782,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3786: \"$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
@@ -3454,7 +3807,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:3472: checking for working mmap" >&5
+echo "configure:3811: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3462,7 +3815,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 3480 "configure"
+#line 3819 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -3602,7 +3955,7 @@ main()
}
EOF
-if { (eval echo configure:3620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -3630,17 +3983,17 @@ unistd.h values.h sys/param.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3648: checking for $ac_hdr" >&5
+echo "configure:3987: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3653 "configure"
+#line 3992 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3658: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3997: \"$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*
@@ -3670,12 +4023,12 @@ done
__argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3688: checking for $ac_func" >&5
+echo "configure:4027: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3693 "configure"
+#line 4032 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3698,7 +4051,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4055: \"$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
@@ -3727,12 +4080,12 @@ done
for ac_func in stpcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3745: checking for $ac_func" >&5
+echo "configure:4084: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3750 "configure"
+#line 4089 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3755,7 +4108,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3789,19 +4142,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:3807: checking for LC_MESSAGES" >&5
+echo "configure:4146: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3812 "configure"
+#line 4151 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:3819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_val_LC_MESSAGES=yes
else
@@ -3822,7 +4175,7 @@ EOF
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:3840: checking whether NLS is requested" >&5
+echo "configure:4179: checking whether NLS is requested" >&5
# Check whether --enable-nls or --disable-nls was given.
if test "${enable_nls+set}" = set; then
enableval="$enable_nls"
@@ -3842,7 +4195,7 @@ fi
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:3860: checking whether included gettext is requested" >&5
+echo "configure:4199: checking whether included gettext is requested" >&5
# Check whether --with-included-gettext or --without-included-gettext was given.
if test "${with_included_gettext+set}" = set; then
withval="$with_included_gettext"
@@ -3861,17 +4214,17 @@ fi
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:3879: checking for libintl.h" >&5
+echo "configure:4218: checking for libintl.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3884 "configure"
+#line 4223 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3889: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4228: \"$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*
@@ -3888,19 +4241,19 @@ fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:3906: checking for gettext in libc" >&5
+echo "configure:4245: checking for gettext in libc" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3911 "configure"
+#line 4250 "configure"
#include "confdefs.h"
#include <libintl.h>
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:3918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gettext_libc=yes
else
@@ -3916,7 +4269,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
if test "$gt_cv_func_gettext_libc" != "yes"; then
echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:3934: checking for bindtextdomain in -lintl" >&5
+echo "configure:4273: 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
@@ -3924,7 +4277,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3942 "configure"
+#line 4281 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3935,7 +4288,7 @@ int main() {
bindtextdomain()
; return 0; }
EOF
-if { (eval echo configure:3953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4292: \"$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
@@ -3951,19 +4304,19 @@ fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:3969: checking for gettext in libintl" >&5
+echo "configure:4308: checking for gettext in libintl" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3974 "configure"
+#line 4313 "configure"
#include "confdefs.h"
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:3981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gettext_libintl=yes
else
@@ -3991,7 +4344,7 @@ EOF
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4009: checking for $ac_word" >&5
+echo "configure:4348: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4025,12 +4378,12 @@ fi
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4043: checking for $ac_func" >&5
+echo "configure:4382: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4048 "configure"
+#line 4387 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4053,7 +4406,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4410: \"$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
@@ -4080,7 +4433,7 @@ done
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4098: checking for $ac_word" >&5
+echo "configure:4437: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4116,7 +4469,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4134: checking for $ac_word" >&5
+echo "configure:4473: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4148,7 +4501,7 @@ else
fi
cat > conftest.$ac_ext <<EOF
-#line 4166 "configure"
+#line 4505 "configure"
#include "confdefs.h"
int main() {
@@ -4156,7 +4509,7 @@ extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:4174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
CATOBJEXT=.gmo
DATADIRNAME=share
@@ -4188,7 +4541,7 @@ fi
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4206: checking for $ac_word" >&5
+echo "configure:4545: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4222,7 +4575,7 @@ fi
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4240: checking for $ac_word" >&5
+echo "configure:4579: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4258,7 +4611,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4276: checking for $ac_word" >&5
+echo "configure:4615: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4348,7 +4701,7 @@ fi
LINGUAS=
else
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:4366: checking for catalogs to be installed" >&5
+echo "configure:4705: checking for catalogs to be installed" >&5
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
@@ -4376,17 +4729,17 @@ echo "configure:4366: checking for catalogs to be installed" >&5
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:4394: checking for linux/version.h" >&5
+echo "configure:4733: checking for linux/version.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4399 "configure"
+#line 4738 "configure"
#include "confdefs.h"
#include <linux/version.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4743: \"$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*
@@ -4449,7 +4802,7 @@ fi
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:4467: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:4806: 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"
@@ -4472,12 +4825,12 @@ fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:4490: checking for Cygwin environment" >&5
+echo "configure:4829: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4495 "configure"
+#line 4834 "configure"
#include "confdefs.h"
int main() {
@@ -4488,7 +4841,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:4506: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4845: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -4505,19 +4858,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:4523: checking for mingw32 environment" >&5
+echo "configure:4862: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4528 "configure"
+#line 4867 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:4535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -4536,7 +4889,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:4554: checking for executable suffix" >&5
+echo "configure:4893: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4546,7 +4899,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:4564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:4903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj | *.ilk | *.pdb) ;;
@@ -4571,17 +4924,17 @@ for ac_hdr in string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h e
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4589: checking for $ac_hdr" >&5
+echo "configure:4928: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4594 "configure"
+#line 4933 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4599: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4938: \"$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*
@@ -4611,7 +4964,7 @@ done
# Put this here so that autoconf's "cross-compiling" message doesn't confuse
# people who are not cross-compiling but are compiling cross-assemblers.
echo $ac_n "checking whether compiling a cross-assembler""... $ac_c" 1>&6
-echo "configure:4629: checking whether compiling a cross-assembler" >&5
+echo "configure:4968: checking whether compiling a cross-assembler" >&5
if test "${host}" = "${target}"; then
cross_gas=no
else
@@ -4626,19 +4979,19 @@ echo "$ac_t""$cross_gas" 1>&6
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:4644: checking for working alloca.h" >&5
+echo "configure:4983: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4649 "configure"
+#line 4988 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:4656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4995: \"$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
@@ -4659,12 +5012,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:4677: checking for alloca" >&5
+echo "configure:5016: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4682 "configure"
+#line 5021 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -4692,7 +5045,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:4710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -4724,12 +5077,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:4742: checking whether alloca needs Cray hooks" >&5
+echo "configure:5081: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4747 "configure"
+#line 5086 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -4754,12 +5107,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4772: checking for $ac_func" >&5
+echo "configure:5111: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4777 "configure"
+#line 5116 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4782,7 +5135,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5139: \"$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
@@ -4809,7 +5162,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:4827: checking stack direction for C alloca" >&5
+echo "configure:5166: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4817,7 +5170,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 4835 "configure"
+#line 5174 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -4836,7 +5189,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:4854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -4858,21 +5211,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:4876: checking for inline" >&5
+echo "configure:5215: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 4883 "configure"
+#line 5222 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:4890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5229: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -4902,12 +5255,12 @@ esac
for ac_func in unlink remove
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4920: checking for $ac_func" >&5
+echo "configure:5259: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4925 "configure"
+#line 5264 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4930,7 +5283,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5287: \"$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
@@ -4959,12 +5312,12 @@ done
for ac_func in sbrk
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4977: checking for $ac_func" >&5
+echo "configure:5316: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4982 "configure"
+#line 5321 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4987,7 +5340,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -5016,12 +5369,12 @@ done
# enough, but on some of those systems, the assert macro relies on requoting
# working properly!
echo $ac_n "checking for working assert macro""... $ac_c" 1>&6
-echo "configure:5034: checking for working assert macro" >&5
+echo "configure:5373: checking for working assert macro" >&5
if eval "test \"`echo '$''{'gas_cv_assert_ok'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5039 "configure"
+#line 5378 "configure"
#include "confdefs.h"
#include <assert.h>
#include <stdio.h>
@@ -5037,7 +5390,7 @@ assert (a == b
; return 0; }
EOF
-if { (eval echo configure:5055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gas_cv_assert_ok=yes
else
@@ -5078,12 +5431,12 @@ gas_test_headers="
"
echo $ac_n "checking whether declaration is required for strstr""... $ac_c" 1>&6
-echo "configure:5096: checking whether declaration is required for strstr" >&5
+echo "configure:5435: checking whether declaration is required for strstr" >&5
if eval "test \"`echo '$''{'gas_cv_decl_needed_strstr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5101 "configure"
+#line 5440 "configure"
#include "confdefs.h"
$gas_test_headers
int main() {
@@ -5094,7 +5447,7 @@ x = (f) strstr;
; return 0; }
EOF
-if { (eval echo configure:5112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gas_cv_decl_needed_strstr=no
else
@@ -5115,12 +5468,12 @@ fi
echo $ac_n "checking whether declaration is required for malloc""... $ac_c" 1>&6
-echo "configure:5133: checking whether declaration is required for malloc" >&5
+echo "configure:5472: checking whether declaration is required for malloc" >&5
if eval "test \"`echo '$''{'gas_cv_decl_needed_malloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5138 "configure"
+#line 5477 "configure"
#include "confdefs.h"
$gas_test_headers
int main() {
@@ -5131,7 +5484,7 @@ x = (f) malloc;
; return 0; }
EOF
-if { (eval echo configure:5149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gas_cv_decl_needed_malloc=no
else
@@ -5152,12 +5505,12 @@ fi
echo $ac_n "checking whether declaration is required for free""... $ac_c" 1>&6
-echo "configure:5170: checking whether declaration is required for free" >&5
+echo "configure:5509: checking whether declaration is required for free" >&5
if eval "test \"`echo '$''{'gas_cv_decl_needed_free'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5175 "configure"
+#line 5514 "configure"
#include "confdefs.h"
$gas_test_headers
int main() {
@@ -5168,7 +5521,7 @@ x = (f) free;
; return 0; }
EOF
-if { (eval echo configure:5186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gas_cv_decl_needed_free=no
else
@@ -5189,12 +5542,12 @@ fi
echo $ac_n "checking whether declaration is required for sbrk""... $ac_c" 1>&6
-echo "configure:5207: checking whether declaration is required for sbrk" >&5
+echo "configure:5546: checking whether declaration is required for sbrk" >&5
if eval "test \"`echo '$''{'gas_cv_decl_needed_sbrk'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5212 "configure"
+#line 5551 "configure"
#include "confdefs.h"
$gas_test_headers
int main() {
@@ -5205,7 +5558,7 @@ x = (f) sbrk;
; return 0; }
EOF
-if { (eval echo configure:5223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gas_cv_decl_needed_sbrk=no
else
@@ -5226,12 +5579,12 @@ fi
echo $ac_n "checking whether declaration is required for environ""... $ac_c" 1>&6
-echo "configure:5244: checking whether declaration is required for environ" >&5
+echo "configure:5583: checking whether declaration is required for environ" >&5
if eval "test \"`echo '$''{'gas_cv_decl_needed_environ'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5249 "configure"
+#line 5588 "configure"
#include "confdefs.h"
$gas_test_headers
int main() {
@@ -5242,7 +5595,7 @@ x = (f) environ;
; return 0; }
EOF
-if { (eval echo configure:5260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gas_cv_decl_needed_environ=no
else
@@ -5266,12 +5619,12 @@ fi
# for it?
echo $ac_n "checking whether declaration is required for errno""... $ac_c" 1>&6
-echo "configure:5284: checking whether declaration is required for errno" >&5
+echo "configure:5623: checking whether declaration is required for errno" >&5
if eval "test \"`echo '$''{'gas_cv_decl_needed_errno'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5289 "configure"
+#line 5628 "configure"
#include "confdefs.h"
#ifdef HAVE_ERRNO_H
@@ -5286,7 +5639,7 @@ x = (f) errno;
; return 0; }
EOF
-if { (eval echo configure:5304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gas_cv_decl_needed_errno=no
else
@@ -5471,10 +5824,11 @@ s%@RANLIB@%$RANLIB%g
s%@CC@%$CC%g
s%@LD@%$LD%g
s%@NM@%$NM%g
+s%@USE_SYMBOL_UNDERSCORE@%$USE_SYMBOL_UNDERSCORE%g
s%@LN_S@%$LN_S%g
-s%@LIBTOOL@%$LIBTOOL%g
s%@DLLTOOL@%$DLLTOOL%g
s%@AS@%$AS%g
+s%@LIBTOOL@%$LIBTOOL%g
s%@cgen_cpu_prefix@%$cgen_cpu_prefix%g
s%@extra_objects@%$extra_objects%g
s%@target_cpu_type@%$target_cpu_type%g
diff --git a/gas/configure.in b/gas/configure.in
index 4d847ba9af4..f022063273e 100644
--- a/gas/configure.in
+++ b/gas/configure.in
@@ -190,6 +190,7 @@ changequote([,])dnl
i386-*-vsta) fmt=aout ;;
i386-*-msdosdjgpp* | i386-*-go32* | i386-go32-rtems*)
fmt=coff em=go32;;
+ i386-*-rtemself*) fmt=elf ;;
i386-*-rtems*) fmt=coff ;;
i386-*-gnu*) fmt=elf ;;
i386-*-mach*)
@@ -208,6 +209,7 @@ changequote([,])dnl
i960-*-vxworks5.0) fmt=bout ;;
i960-*-vxworks5.*) fmt=coff em=ic960 ;;
i960-*-vxworks*) fmt=bout ;;
+ i960-*-elf*) fmt=elf ;;
m32r-*-*) fmt=elf bfd_gas=yes ;;
@@ -289,6 +291,7 @@ changequote([,])dnl
sh-*-elf*) fmt=elf ;;
sh-*-coff*) fmt=coff ;;
+ sh-*-rtemself*) fmt=elf ;;
sh-*-rtems*) fmt=coff ;;
ns32k-pc532-mach* | ns32k-pc532-ux*) fmt=aout em=pc532mach ;;
diff --git a/gas/doc/internals.texi b/gas/doc/internals.texi
index dd3b4ab15eb..48d49e06495 100644
--- a/gas/doc/internals.texi
+++ b/gas/doc/internals.texi
@@ -1034,7 +1034,10 @@ It may also create any necessary relocations.
@item md_apply_fix
@cindex md_apply_fix
GAS will call this for each fixup. It should store the correct value in the
-object file.
+object file. @code{fixup_segment} performs a generic overflow check on the
+@code{valueT *val} argument after @code{md_apply_fix} returns. If the overflow
+check is relevant for the target machine, then @code{md_apply_fix} should
+modify @code{valueT *val}, typically to the value stored in the object file.
@item TC_HANDLES_FX_DONE
@cindex TC_HANDLES_FX_DONE
diff --git a/gas/ecoff.c b/gas/ecoff.c
index c3c9375527a..d127f52f75e 100644
--- a/gas/ecoff.c
+++ b/gas/ecoff.c
@@ -3122,7 +3122,8 @@ ecoff_directive_ent (ignore)
++input_line_pointer;
SKIP_WHITESPACE ();
}
- if (isdigit (*input_line_pointer) || *input_line_pointer == '-')
+ if (isdigit ((unsigned char) *input_line_pointer)
+ || *input_line_pointer == '-')
(void) get_absolute_expression ();
demand_empty_rest_of_line ();
@@ -3565,7 +3566,7 @@ ecoff_stab (sec, what, string, type, other, desc)
listing_source_file (string);
#endif
- if (isdigit (*input_line_pointer)
+ if (isdigit ((unsigned char) *input_line_pointer)
|| *input_line_pointer == '-'
|| *input_line_pointer == '+')
{
diff --git a/gas/expr.c b/gas/expr.c
index d5d55fd3e6e..b49720c134f 100644
--- a/gas/expr.c
+++ b/gas/expr.c
@@ -34,6 +34,10 @@
#include "obstack.h"
static void floating_constant PARAMS ((expressionS * expressionP));
+static valueT generic_bignum_to_int32 PARAMS ((void));
+#ifdef BFD64
+static valueT generic_bignum_to_int64 PARAMS ((void));
+#endif
static void integer_constant PARAMS ((int radix, expressionS * expressionP));
static void mri_char_constant PARAMS ((expressionS *));
static void current_location PARAMS ((expressionS *));
diff --git a/gas/hash.h b/gas/hash.h
index fb229c8086a..98eb3475225 100644
--- a/gas/hash.h
+++ b/gas/hash.h
@@ -42,4 +42,4 @@ void hash_print_statistics PARAMS ((FILE *, const char *,
struct hash_control *));
#endif /* #ifdef hashH */
-/* end of hash.c */
+/* end of hash.h */
diff --git a/gas/listing.c b/gas/listing.c
index e2b173be7d6..4305cbdacab 100644
--- a/gas/listing.c
+++ b/gas/listing.c
@@ -375,7 +375,7 @@ listing_newline (ps)
while (--len)
{
- char c = * src ++;
+ unsigned char c = * src ++;
/* Omit control characters in the listing. */
if (isascii (c) && ! iscntrl (c))
diff --git a/gas/read.c b/gas/read.c
index 7fee24161eb..abee749b5d5 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -211,7 +211,15 @@ static void cons_worker PARAMS ((int, int));
static int scrub_from_string PARAMS ((char **));
static void do_align PARAMS ((int, char *, int, int));
static void s_align PARAMS ((int, int));
+static void s_lcomm_internal PARAMS ((int, int));
static int hex_float PARAMS ((int, char *));
+static inline int sizeof_sleb128 PARAMS ((offsetT));
+static inline int sizeof_uleb128 PARAMS ((valueT));
+static inline int output_sleb128 PARAMS ((char *, offsetT));
+static inline int output_uleb128 PARAMS ((char *, valueT));
+static inline int output_big_sleb128 PARAMS ((char *, LITTLENUM_TYPE *, int));
+static inline int output_big_uleb128 PARAMS ((char *, LITTLENUM_TYPE *, int));
+static int output_big_leb128 PARAMS ((char *, LITTLENUM_TYPE *, int, int));
static void do_org PARAMS ((segT, expressionS *, int));
char *demand_copy_string PARAMS ((int *lenP));
static segT get_segmented_expression PARAMS ((expressionS *expP));
@@ -4207,7 +4215,7 @@ output_leb128 (p, value, sign)
we don't output for NULL values of P. It isn't really as critical as
for "normal" values that this be streamlined. */
-static int
+static inline int
output_big_sleb128 (p, bignum, size)
char *p;
LITTLENUM_TYPE *bignum;
@@ -4253,7 +4261,7 @@ output_big_sleb128 (p, bignum, size)
return p - orig;
}
-static int
+static inline int
output_big_uleb128 (p, bignum, size)
char *p;
LITTLENUM_TYPE *bignum;
@@ -4295,7 +4303,7 @@ output_big_uleb128 (p, bignum, size)
return p - orig;
}
-static inline int
+static int
output_big_leb128 (p, bignum, size, sign)
char *p;
LITTLENUM_TYPE *bignum;
diff --git a/gas/symbols.c b/gas/symbols.c
index a1cde6a7de2..8a05e1f8c43 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -456,23 +456,30 @@ symbol_find_base (name, strip_underscore)
#ifdef tc_canonicalize_symbol_name
{
char *copy;
+ size_t len = strlen (name) + 1;
- copy = (char *) alloca (strlen (name) + 1);
- strcpy (copy, name);
+ copy = (char *) alloca (len);
+ memcpy (copy, name, len);
name = tc_canonicalize_symbol_name (copy);
}
#endif
if (! symbols_case_sensitive)
{
- unsigned char *copy;
-
- copy = (unsigned char *) alloca (strlen (name) + 1);
- strcpy (copy, name);
- name = (const char *) copy;
- for (; *copy != '\0'; copy++)
- if (islower (*copy))
- *copy = toupper (*copy);
+ char *copy;
+ const char *orig;
+ unsigned char c;
+
+ orig = name;
+ name = copy = (char *) alloca (strlen (name) + 1);
+
+ while ((c = *orig++) != '\0')
+ {
+ if (islower (c))
+ c = toupper (c);
+ *copy++ = c;
+ }
+ *copy = '\0';
}
return ((symbolS *) hash_find (sy_hash, name));
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index d8f865680e5..6d017bc72ec 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,26 @@
+1999-05-28 Ian Lance Taylor <ian@zembu.com>
+
+ * gas/vtable/vtable.exp: Don't run test for i960 yet.
+
+1999-05-17 Nick Clifton <nickc@cygnus.com>
+
+ * gas/mcore/allinsn.d: Updated to match latest objdump output.
+
+1999-05-12 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * gas/i386/opcode.d: Modify callw to suit disasm fix.
+
+ * gas/i386/amd.d: Modify a '(bad)' to SIMD instruction.
+
+ * gas/i386/amd.s: Pad to multiple of 8
+ * gas/i386/amd.d: Here too.
+
+ * gas/i386/prefix.[sd]: Align with nops
+ * gas/i386/reloc.[sd]: Here too.
+
+ * gas/i386/katmai.[sd]: New for PIII SIMD
+ * gas/i386/i386.exp: Call it.
+
1999-05-02 Nick Clifton <nickc@cygnus.com>
* gas/mcore/allinsn.d: Update to match latest assembler
diff --git a/gas/testsuite/gas/i386/amd.d b/gas/testsuite/gas/i386/amd.d
index 2fe8b0e8b28..68f6f7728a9 100644
--- a/gas/testsuite/gas/i386/amd.d
+++ b/gas/testsuite/gas/i386/amd.d
@@ -29,9 +29,12 @@ Disassembly of section .text:
6b: 0f 0f ce 0d [ ]*pi2fd %mm6,%mm1
6f: 0f 0f d7 b7 [ ]*pfmulhrw %mm7,%mm2
73: 2e 0f [ ]*\(bad\)
- 75: 0f 54 [ ]*\(bad\)
- 77: c3 [ ]*ret
+ 75: 0f 54 c3 [ ]*andps %xmm3,%xmm0
78: 07 [ ]*pop %es
79: c3 [ ]*ret
7a: 90 [ ]*nop
7b: 90 [ ]*nop
+ 7c: 90 [ ]*nop
+ 7d: 90 [ ]*nop
+ 7e: 90 [ ]*nop
+ 7f: 90 [ ]*nop
diff --git a/gas/testsuite/gas/i386/amd.s b/gas/testsuite/gas/i386/amd.s
index 5e4d581f08e..af4cd452daa 100644
--- a/gas/testsuite/gas/i386/amd.s
+++ b/gas/testsuite/gas/i386/amd.s
@@ -28,6 +28,5 @@
# Everything's good bar the opcode suffix
.byte 0x2e, 0x0f, 0x0f, 0x54, 0xc3, 0x07, 0xc3
-# to make us insensitive to alignment
- nop
- nop
+# Pad out to a good alignment
+ .byte 0x90,0x90,0x90,0x90,0x90,0x90
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index cef1ff7ac0a..44049f75dc5 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -24,6 +24,7 @@ if [istarget "i*86-*-*"] then {
run_dump_test "opcode"
run_dump_test "prefix"
run_dump_test "amd"
+ run_dump_test "katmai"
# The reloc and white tests require support for 8 and 16 bit
# relocs, so we only run them for ELF targets.
diff --git a/gas/testsuite/gas/i386/katmai.d b/gas/testsuite/gas/i386/katmai.d
new file mode 100644
index 00000000000..a130e0c4af2
--- /dev/null
+++ b/gas/testsuite/gas/i386/katmai.d
@@ -0,0 +1,176 @@
+#objdump: -dw
+#name: i386 katmai
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+0+000 <.text>:
+ 0: 0f 58 01 [ ]*addps \(%ecx\),%xmm0
+ 3: 0f 58 ca [ ]*addps %xmm2,%xmm1
+ 6: f3 0f 58 13 [ ]*addss \(%ebx\),%xmm2
+ a: f3 0f 58 dc [ ]*addss %xmm4,%xmm3
+ e: 0f 55 65 00 [ ]*andnps 0x0\(%ebp\),%xmm4
+ 12: 0f 55 ee [ ]*andnps %xmm6,%xmm5
+ 15: 0f 54 37 [ ]*andps \(%edi\),%xmm6
+ 18: 0f 54 f8 [ ]*andps %xmm0,%xmm7
+ 1b: 0f c2 c1 02 [ ]*cmpleps %xmm1,%xmm0
+ 1f: 0f c2 0a 03 [ ]*cmpunordps \(%edx\),%xmm1
+ 23: f3 0f c2 d2 04 [ ]*cmpneqss %xmm2,%xmm2
+ 28: f3 0f c2 1c 24 05 [ ]*cmpnltss \(%esp,1\),%xmm3
+ 2e: 0f c2 e5 06 [ ]*cmpnleps %xmm5,%xmm4
+ 32: 0f c2 2e 07 [ ]*cmpordps \(%esi\),%xmm5
+ 36: f3 0f c2 f7 00 [ ]*cmpeqss %xmm7,%xmm6
+ 3b: f3 0f c2 38 01 [ ]*cmpltss \(%eax\),%xmm7
+ 40: 0f c2 c1 00 [ ]*cmpeqps %xmm1,%xmm0
+ 44: 0f c2 0a 00 [ ]*cmpeqps \(%edx\),%xmm1
+ 48: f3 0f c2 d2 00 [ ]*cmpeqss %xmm2,%xmm2
+ 4d: f3 0f c2 1c 24 00 [ ]*cmpeqss \(%esp,1\),%xmm3
+ 53: 0f c2 e5 01 [ ]*cmpltps %xmm5,%xmm4
+ 57: 0f c2 2e 01 [ ]*cmpltps \(%esi\),%xmm5
+ 5b: f3 0f c2 f7 01 [ ]*cmpltss %xmm7,%xmm6
+ 60: f3 0f c2 38 01 [ ]*cmpltss \(%eax\),%xmm7
+ 65: 0f c2 01 02 [ ]*cmpleps \(%ecx\),%xmm0
+ 69: 0f c2 ca 02 [ ]*cmpleps %xmm2,%xmm1
+ 6d: f3 0f c2 13 02 [ ]*cmpless \(%ebx\),%xmm2
+ 72: f3 0f c2 dc 02 [ ]*cmpless %xmm4,%xmm3
+ 77: 0f c2 65 00 03 [ ]*cmpunordps 0x0\(%ebp\),%xmm4
+ 7c: 0f c2 ee 03 [ ]*cmpunordps %xmm6,%xmm5
+ 80: f3 0f c2 37 03 [ ]*cmpunordss \(%edi\),%xmm6
+ 85: f3 0f c2 f8 03 [ ]*cmpunordss %xmm0,%xmm7
+ 8a: 0f c2 c1 04 [ ]*cmpneqps %xmm1,%xmm0
+ 8e: 0f c2 0a 04 [ ]*cmpneqps \(%edx\),%xmm1
+ 92: f3 0f c2 d2 04 [ ]*cmpneqss %xmm2,%xmm2
+ 97: f3 0f c2 1c 24 04 [ ]*cmpneqss \(%esp,1\),%xmm3
+ 9d: 0f c2 e5 05 [ ]*cmpnltps %xmm5,%xmm4
+ a1: 0f c2 2e 05 [ ]*cmpnltps \(%esi\),%xmm5
+ a5: f3 0f c2 f7 05 [ ]*cmpnltss %xmm7,%xmm6
+ aa: f3 0f c2 38 05 [ ]*cmpnltss \(%eax\),%xmm7
+ af: 0f c2 01 06 [ ]*cmpnleps \(%ecx\),%xmm0
+ b3: 0f c2 ca 06 [ ]*cmpnleps %xmm2,%xmm1
+ b7: f3 0f c2 13 06 [ ]*cmpnless \(%ebx\),%xmm2
+ bc: f3 0f c2 dc 06 [ ]*cmpnless %xmm4,%xmm3
+ c1: 0f c2 65 00 07 [ ]*cmpordps 0x0\(%ebp\),%xmm4
+ c6: 0f c2 ee 07 [ ]*cmpordps %xmm6,%xmm5
+ ca: f3 0f c2 37 07 [ ]*cmpordss \(%edi\),%xmm6
+ cf: f3 0f c2 f8 07 [ ]*cmpordss %xmm0,%xmm7
+ d4: 0f 2f c1 [ ]*comiss %xmm1,%xmm0
+ d7: 0f 2f 0a [ ]*comiss \(%edx\),%xmm1
+ da: 0f 2a d3 [ ]*cvtpi2ps %mm3,%xmm2
+ dd: 0f 2a 1c 24 [ ]*cvtpi2ps \(%esp,1\),%xmm3
+ e1: f3 0f 2a e5 [ ]*cvtsi2ss %ebp,%xmm4
+ e5: f3 0f 2a 2e [ ]*cvtsi2ss \(%esi\),%xmm5
+ e9: 0f 2d f7 [ ]*cvtps2pi %xmm7,%mm6
+ ec: 0f 2d 38 [ ]*cvtps2pi \(%eax\),%mm7
+ ef: f3 0f 2d 01 [ ]*cvtss2si \(%ecx\),%eax
+ f3: f3 0f 2d ca [ ]*cvtss2si %xmm2,%ecx
+ f7: 0f 2c 13 [ ]*cvttps2pi \(%ebx\),%mm2
+ fa: 0f 2c dc [ ]*cvttps2pi %xmm4,%mm3
+ fd: f3 0f 2c 65 00 [ ]*cvttss2si 0x0\(%ebp\),%esp
+ 102: f3 0f 2c ee [ ]*cvttss2si %xmm6,%ebp
+ 106: 0f 5e c1 [ ]*divps %xmm1,%xmm0
+ 109: 0f 5e 0a [ ]*divps \(%edx\),%xmm1
+ 10c: f3 0f 5e d3 [ ]*divss %xmm3,%xmm2
+ 110: f3 0f 5e 1c 24 [ ]*divss \(%esp,1\),%xmm3
+ 115: 0f ae 55 00 [ ]*ldmxcsr 0x0\(%ebp\)
+ 119: 0f ae 1e [ ]*stmxcsr \(%esi\)
+ 11c: 0f ae f8 [ ]*sfence
+ 11f: 0f 5f c1 [ ]*maxps %xmm1,%xmm0
+ 122: 0f 5f 0a [ ]*maxps \(%edx\),%xmm1
+ 125: f3 0f 5f d3 [ ]*maxss %xmm3,%xmm2
+ 129: f3 0f 5f 1c 24 [ ]*maxss \(%esp,1\),%xmm3
+ 12e: 0f 5d e5 [ ]*minps %xmm5,%xmm4
+ 131: 0f 5d 2e [ ]*minps \(%esi\),%xmm5
+ 134: f3 0f 5d f7 [ ]*minss %xmm7,%xmm6
+ 138: f3 0f 5d 38 [ ]*minss \(%eax\),%xmm7
+ 13c: 0f 28 c1 [ ]*movaps %xmm1,%xmm0
+ 13f: 0f 29 11 [ ]*movaps %xmm2,\(%ecx\)
+ 142: 0f 28 12 [ ]*movaps \(%edx\),%xmm2
+ 145: 0f 16 dc [ ]*movlhps %xmm4,%xmm3
+ 148: 0f 17 2c 24 [ ]*movhps %xmm5,\(%esp,1\)
+ 14c: 0f 16 2e [ ]*movhps \(%esi\),%xmm5
+ 14f: 0f 12 f7 [ ]*movhlps %xmm7,%xmm6
+ 152: 0f 13 07 [ ]*movlps %xmm0,\(%edi\)
+ 155: 0f 12 00 [ ]*movlps \(%eax\),%xmm0
+ 158: 0f 50 ca [ ]*movmskps %xmm2,%ecx
+ 15b: 0f 10 d3 [ ]*movups %xmm3,%xmm2
+ 15e: 0f 11 22 [ ]*movups %xmm4,\(%edx\)
+ 161: 0f 10 65 00 [ ]*movups 0x0\(%ebp\),%xmm4
+ 165: f3 0f 10 ee [ ]*movss %xmm6,%xmm5
+ 169: f3 0f 11 3e [ ]*movss %xmm7,\(%esi\)
+ 16d: f3 0f 10 38 [ ]*movss \(%eax\),%xmm7
+ 171: 0f 59 c1 [ ]*mulps %xmm1,%xmm0
+ 174: 0f 59 0a [ ]*mulps \(%edx\),%xmm1
+ 177: f3 0f 59 d2 [ ]*mulss %xmm2,%xmm2
+ 17b: f3 0f 59 1c 24 [ ]*mulss \(%esp,1\),%xmm3
+ 180: 0f 56 e5 [ ]*orps %xmm5,%xmm4
+ 183: 0f 56 2e [ ]*orps \(%esi\),%xmm5
+ 186: 0f 53 f7 [ ]*rcpps %xmm7,%xmm6
+ 189: 0f 53 38 [ ]*rcpps \(%eax\),%xmm7
+ 18c: f3 0f 53 01 [ ]*rcpss \(%ecx\),%xmm0
+ 190: f3 0f 53 ca [ ]*rcpss %xmm2,%xmm1
+ 194: 0f 52 13 [ ]*rsqrtps \(%ebx\),%xmm2
+ 197: 0f 52 dc [ ]*rsqrtps %xmm4,%xmm3
+ 19a: f3 0f 52 65 00 [ ]*rsqrtss 0x0\(%ebp\),%xmm4
+ 19f: f3 0f 52 ee [ ]*rsqrtss %xmm6,%xmm5
+ 1a3: 0f c6 37 02 [ ]*shufps \$0x2,\(%edi\),%xmm6
+ 1a7: 0f c6 f8 03 [ ]*shufps \$0x3,%xmm0,%xmm7
+ 1ab: 0f 51 c1 [ ]*sqrtps %xmm1,%xmm0
+ 1ae: 0f 51 0a [ ]*sqrtps \(%edx\),%xmm1
+ 1b1: f3 0f 51 d2 [ ]*sqrtss %xmm2,%xmm2
+ 1b5: f3 0f 51 1c 24 [ ]*sqrtss \(%esp,1\),%xmm3
+ 1ba: 0f 5c e5 [ ]*subps %xmm5,%xmm4
+ 1bd: 0f 5c 2e [ ]*subps \(%esi\),%xmm5
+ 1c0: f3 0f 5c f7 [ ]*subss %xmm7,%xmm6
+ 1c4: f3 0f 5c 38 [ ]*subss \(%eax\),%xmm7
+ 1c8: 0f 2e 01 [ ]*ucomiss \(%ecx\),%xmm0
+ 1cb: 0f 2e ca [ ]*ucomiss %xmm2,%xmm1
+ 1ce: 0f 15 13 [ ]*unpckhps \(%ebx\),%xmm2
+ 1d1: 0f 15 dc [ ]*unpckhps %xmm4,%xmm3
+ 1d4: 0f 14 65 00 [ ]*unpcklps 0x0\(%ebp\),%xmm4
+ 1d8: 0f 14 ee [ ]*unpcklps %xmm6,%xmm5
+ 1db: 0f 57 37 [ ]*xorps \(%edi\),%xmm6
+ 1de: 0f 57 f8 [ ]*xorps %xmm0,%xmm7
+ 1e1: 0f e0 c1 [ ]*pavgb %mm1,%mm0
+ 1e4: 0f e0 0a [ ]*pavgb \(%edx\),%mm1
+ 1e7: 0f e3 d3 [ ]*pavgw %mm3,%mm2
+ 1ea: 0f e3 1c 24 [ ]*pavgw \(%esp,1\),%mm3
+ 1ee: 0f c5 c8 00 [ ]*pextrw \$0x0,%mm1,%eax
+ 1f2: 0f c4 09 01 [ ]*pinsrw \$0x1,\(%ecx\),%mm1
+ 1f6: 0f c4 d2 02 [ ]*pinsrw \$0x2,%edx,%mm2
+ 1fa: 0f ee c1 [ ]*pmaxsw %mm1,%mm0
+ 1fd: 0f ee 0a [ ]*pmaxsw \(%edx\),%mm1
+ 200: 0f de d2 [ ]*pmaxub %mm2,%mm2
+ 203: 0f de 1c 24 [ ]*pmaxub \(%esp,1\),%mm3
+ 207: 0f ea e5 [ ]*pminsw %mm5,%mm4
+ 20a: 0f ea 2e [ ]*pminsw \(%esi\),%mm5
+ 20d: 0f da f7 [ ]*pminub %mm7,%mm6
+ 210: 0f da 38 [ ]*pminub \(%eax\),%mm7
+ 213: 0f d7 e8 [ ]*pmovmskb %mm5,%eax
+ 216: 0f e4 e5 [ ]*pmulhuw %mm5,%mm4
+ 219: 0f e4 2e [ ]*pmulhuw \(%esi\),%mm5
+ 21c: 0f f6 f7 [ ]*psadbw %mm7,%mm6
+ 21f: 0f f6 38 [ ]*psadbw \(%eax\),%mm7
+ 222: 0f 70 da 01 [ ]*pshufw \$0x1,%mm2,%mm3
+ 226: 0f 70 75 00 04 [ ]*pshufw \$0x4,0x0\(%ebp\),%mm6
+ 22b: 0f f7 c7 [ ]*maskmovq %mm7,%mm0
+ 22e: 0f 2b 33 [ ]*movntps %xmm6,\(%ebx\)
+ 231: 0f e7 10 [ ]*movntq %mm2,\(%eax\)
+ 234: 0f 18 06 [ ]*prefetchnta \(%esi\)
+ 237: 0f 18 0c 98 [ ]*prefetcht0 \(%eax,%ebx,4\)
+ 23b: 0f 18 12 [ ]*prefetcht1 \(%edx\)
+ 23e: 0f 18 19 [ ]*prefetcht2 \(%ecx\)
+ 241: 2e 0f [ ]*\(bad\)
+ 243: c2 0a 08 [ ]*ret \$0x80a
+ 246: 90 [ ]*nop
+ 247: 90 [ ]*nop
+ 248: 65 0f [ ]*sfence.*\(bad\).*
+ 24a: ae [ ]*scas %es:\(%edi\),%al
+ 24b: ff 90 90 90 90 90 [ ]*call \*0x90909090\(%eax\)
+ 251: 90 [ ]*nop
+ 252: 90 [ ]*nop
+ 253: 90 [ ]*nop
+ 254: 90 [ ]*nop
+ 255: 90 [ ]*nop
+ 256: 90 [ ]*nop
+ 257: 90 [ ]*nop
diff --git a/gas/testsuite/gas/i386/katmai.s b/gas/testsuite/gas/i386/katmai.s
new file mode 100644
index 00000000000..426b2c7b5e7
--- /dev/null
+++ b/gas/testsuite/gas/i386/katmai.s
@@ -0,0 +1,166 @@
+#PIII SIMD instructions
+
+.text
+ addps (%ecx),%xmm0
+ addps %xmm2,%xmm1
+ addss (%ebx),%xmm2
+ addss %xmm4,%xmm3
+ andnps 0x0(%ebp),%xmm4
+ andnps %xmm6,%xmm5
+ andps (%edi),%xmm6
+ andps %xmm0,%xmm7
+ cmpps $0x2,%xmm1,%xmm0
+ cmpps $0x3,(%edx),%xmm1
+ cmpss $0x4,%xmm2,%xmm2
+ cmpss $0x5,(%esp,1),%xmm3
+ cmpps $0x6,%xmm5,%xmm4
+ cmpps $0x7,(%esi),%xmm5
+ cmpss $0x0,%xmm7,%xmm6
+ cmpss $0x1,(%eax),%xmm7
+ cmpeqps %xmm1,%xmm0
+ cmpeqps (%edx),%xmm1
+ cmpeqss %xmm2,%xmm2
+ cmpeqss (%esp,1),%xmm3
+ cmpltps %xmm5,%xmm4
+ cmpltps (%esi),%xmm5
+ cmpltss %xmm7,%xmm6
+ cmpltss (%eax),%xmm7
+ cmpleps (%ecx),%xmm0
+ cmpleps %xmm2,%xmm1
+ cmpless (%ebx),%xmm2
+ cmpless %xmm4,%xmm3
+ cmpunordps 0x0(%ebp),%xmm4
+ cmpunordps %xmm6,%xmm5
+ cmpunordss (%edi),%xmm6
+ cmpunordss %xmm0,%xmm7
+ cmpneqps %xmm1,%xmm0
+ cmpneqps (%edx),%xmm1
+ cmpneqss %xmm2,%xmm2
+ cmpneqss (%esp,1),%xmm3
+ cmpnltps %xmm5,%xmm4
+ cmpnltps (%esi),%xmm5
+ cmpnltss %xmm7,%xmm6
+ cmpnltss (%eax),%xmm7
+ cmpnleps (%ecx),%xmm0
+ cmpnleps %xmm2,%xmm1
+ cmpnless (%ebx),%xmm2
+ cmpnless %xmm4,%xmm3
+ cmpordps 0x0(%ebp),%xmm4
+ cmpordps %xmm6,%xmm5
+ cmpordss (%edi),%xmm6
+ cmpordss %xmm0,%xmm7
+ comiss %xmm1,%xmm0
+ comiss (%edx),%xmm1
+ cvtpi2ps %mm3,%xmm2
+ cvtpi2ps (%esp,1),%xmm3
+ cvtsi2ss %ebp,%xmm4
+ cvtsi2ss (%esi),%xmm5
+ cvtps2pi %xmm7,%mm6
+ cvtps2pi (%eax),%mm7
+ cvtss2si (%ecx),%eax
+ cvtss2si %xmm2,%ecx
+ cvttps2pi (%ebx),%mm2
+ cvttps2pi %xmm4,%mm3
+ cvttss2si 0x0(%ebp),%esp
+ cvttss2si %xmm6,%ebp
+ divps %xmm1,%xmm0
+ divps (%edx),%xmm1
+ divss %xmm3,%xmm2
+ divss (%esp,1),%xmm3
+ ldmxcsr 0x0(%ebp)
+ stmxcsr (%esi)
+ sfence
+ maxps %xmm1,%xmm0
+ maxps (%edx),%xmm1
+ maxss %xmm3,%xmm2
+ maxss (%esp,1),%xmm3
+ minps %xmm5,%xmm4
+ minps (%esi),%xmm5
+ minss %xmm7,%xmm6
+ minss (%eax),%xmm7
+ movaps %xmm1,%xmm0
+ movaps %xmm2,(%ecx)
+ movaps (%edx),%xmm2
+ movlhps %xmm4,%xmm3
+ movhps %xmm5,(%esp,1)
+ movhps (%esi),%xmm5
+ movhlps %xmm7,%xmm6
+ movlps %xmm0,(%edi)
+ movlps (%eax),%xmm0
+ movmskps %xmm2,%ecx
+ movups %xmm3,%xmm2
+ movups %xmm4,(%edx)
+ movups 0x0(%ebp),%xmm4
+ movss %xmm6,%xmm5
+ movss %xmm7,(%esi)
+ movss (%eax),%xmm7
+ mulps %xmm1,%xmm0
+ mulps (%edx),%xmm1
+ mulss %xmm2,%xmm2
+ mulss (%esp,1),%xmm3
+ orps %xmm5,%xmm4
+ orps (%esi),%xmm5
+ rcpps %xmm7,%xmm6
+ rcpps (%eax),%xmm7
+ rcpss (%ecx),%xmm0
+ rcpss %xmm2,%xmm1
+ rsqrtps (%ebx),%xmm2
+ rsqrtps %xmm4,%xmm3
+ rsqrtss 0x0(%ebp),%xmm4
+ rsqrtss %xmm6,%xmm5
+ shufps $0x2,(%edi),%xmm6
+ shufps $0x3,%xmm0,%xmm7
+ sqrtps %xmm1,%xmm0
+ sqrtps (%edx),%xmm1
+ sqrtss %xmm2,%xmm2
+ sqrtss (%esp,1),%xmm3
+ subps %xmm5,%xmm4
+ subps (%esi),%xmm5
+ subss %xmm7,%xmm6
+ subss (%eax),%xmm7
+ ucomiss (%ecx),%xmm0
+ ucomiss %xmm2,%xmm1
+ unpckhps (%ebx),%xmm2
+ unpckhps %xmm4,%xmm3
+ unpcklps 0x0(%ebp),%xmm4
+ unpcklps %xmm6,%xmm5
+ xorps (%edi),%xmm6
+ xorps %xmm0,%xmm7
+ pavgb %mm1,%mm0
+ pavgb (%edx),%mm1
+ pavgw %mm3,%mm2
+ pavgw (%esp,1),%mm3
+ pextrw $0x0,%mm1,%eax
+ pinsrw $0x1,(%ecx),%mm1
+ pinsrw $0x2,%edx,%mm2
+ pmaxsw %mm1,%mm0
+ pmaxsw (%edx),%mm1
+ pmaxub %mm2,%mm2
+ pmaxub (%esp,1),%mm3
+ pminsw %mm5,%mm4
+ pminsw (%esi),%mm5
+ pminub %mm7,%mm6
+ pminub (%eax),%mm7
+ pmovmskb %mm5,%eax
+ pmulhuw %mm5,%mm4
+ pmulhuw (%esi),%mm5
+ psadbw %mm7,%mm6
+ psadbw (%eax),%mm7
+ pshufw $0x1,%mm2,%mm3
+ pshufw $0x4,0x0(%ebp),%mm6
+ maskmovq %mm7,%mm0
+ movntps %xmm6,(%ebx)
+ movntq %mm2,(%eax)
+ prefetchnta (%esi)
+ prefetcht0 (%eax,%ebx,4)
+ prefetcht1 (%edx)
+ prefetcht2 (%ecx)
+
+# A SIMD instruction with a bad extension byte
+.byte 0x2E,0x0F,0xC2,0x0A,0x08
+ nop
+ nop
+# A bad sfence modrm byte
+.byte 0x65,0x0F,0xAE,0xff
+# Pad out to goo alignment
+.byte 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90
diff --git a/gas/testsuite/gas/i386/opcode.d b/gas/testsuite/gas/i386/opcode.d
index fc3c158a161..6df49d77eb6 100644
--- a/gas/testsuite/gas/i386/opcode.d
+++ b/gas/testsuite/gas/i386/opcode.d
@@ -526,7 +526,7 @@ Disassembly of section .text:
879: 66 d3 90 90 90 90 90 [ ]*rclw %cl,0x90909090\(%eax\)
880: 66 e5 90 [ ]*in \$0x90,%ax
883: 66 e7 90 [ ]*out %ax,\$0x90
- 886: 66 e8 8f 90 [ ]*callw (0x)?ffff9919.*
+ 886: 66 e8 8f 90 [ ]*callw (0x)?9919.*
88a: 66 ea 90 90 90 90 [ ]*ljmpw \$0x9090,\$0x9090
890: 66 ed [ ]*in \(%dx\),%ax
892: 66 ef [ ]*out %ax,\(%dx\)
diff --git a/gas/testsuite/gas/i386/prefix.d b/gas/testsuite/gas/i386/prefix.d
index 054b658a3cf..61eba812a41 100644
--- a/gas/testsuite/gas/i386/prefix.d
+++ b/gas/testsuite/gas/i386/prefix.d
@@ -12,4 +12,4 @@ Disassembly of section .text:
b: 9b df e0 [ ]*fstsw %ax
e: 9b 67 df e0 [ ]*addr16 fstsw %ax
12: f3 67 66 36 a7 [ ]*repz addr16 cmpsw %es:\(%di\),%ss:\(%si\)
- ...
+ 17: 90 [ ]*nop
diff --git a/gas/testsuite/gas/i386/prefix.s b/gas/testsuite/gas/i386/prefix.s
index 043d31068ad..a998b415b1f 100644
--- a/gas/testsuite/gas/i386/prefix.s
+++ b/gas/testsuite/gas/i386/prefix.s
@@ -7,5 +7,5 @@ foo:
addr16 fstsw %ax
addr16 rep cmpsw %es:(%di),%ss:(%si)
- # Get a good alignment.
- .byte 0
+# Get a good alignment.
+ nop
diff --git a/gas/testsuite/gas/i386/reloc.d b/gas/testsuite/gas/i386/reloc.d
index c7903dd8d21..f0354ff0b87 100644
--- a/gas/testsuite/gas/i386/reloc.d
+++ b/gas/testsuite/gas/i386/reloc.d
@@ -13,3 +13,8 @@ Disassembly of section .text:
12: 69 d2 00 00 00 00 [ ]*imul \$0x0,%edx,%edx 14: R_386_32 .text
18: 9a 00 00 00 00 00 00 [ ]*lcall \$0x0,\$0x0 19: R_386_32 .text
1f: 66 68 00 00 [ ]*pushw \$0x0 21: R_386_16 .text
+ 23: 90 [ ]*nop
+ 24: 90 [ ]*nop
+ 25: 90 [ ]*nop
+ 26: 90 [ ]*nop
+ 27: 90 [ ]*nop
diff --git a/gas/testsuite/gas/i386/reloc.s b/gas/testsuite/gas/i386/reloc.s
index 13ee930db72..2bf95b69a63 100644
--- a/gas/testsuite/gas/i386/reloc.s
+++ b/gas/testsuite/gas/i386/reloc.s
@@ -6,3 +6,6 @@ foo: mov $foo, %bl
imul $foo, %edx
lcall $0, $foo
pushw $foo
+
+# Pad out to a good alignment
+ .byte 0x90,0x90,0x90,0x90,0x90
diff --git a/gas/testsuite/gas/mcore/allinsn.d b/gas/testsuite/gas/mcore/allinsn.d
index 913d8f51fe7..ea4cedcce87 100644
--- a/gas/testsuite/gas/mcore/allinsn.d
+++ b/gas/testsuite/gas/mcore/allinsn.d
@@ -7,394 +7,393 @@
Disassembly of section .text:
0+000 <abs>:
- 0: 01 e0 abs r0
+ 0: 01e0 abs r0
0+002 <addc>:
- 2: 06 21 addc r1, r2
+ 2: 0621 addc r1, r2
0+004 <addi>:
- 4: 20 03 addi r3, 1
+ 4: 2003 addi r3, 1
0+006 <addu>:
- 6: 1c 54 addu r4, r5
+ 6: 1c54 addu r4, r5
0+008 <and>:
- 8: 16 76 and r6, r7
+ 8: 1676 and r6, r7
0+00a <andi>:
- a: 2e 28 andi r8, 2
+ a: 2e28 andi r8, 2
0+00c <andn>:
- c: 1f a9 andn r9, r10
+ c: 1fa9 andn r9, r10
0+00e <asr>:
- e: 1a cb asr r11, r12
+ e: 1acb asr r11, r12
0+010 <asrc>:
- 10: 3a 0d asrc r13
+ 10: 3a0d asrc r13
0+012 <asri>:
- 12: 3b fe asri r14, 31
+ 12: 3bfe asri r14, 31
0+014 <bclri>:
- 14: 30 0f bclri r15, 0
+ 14: 300f bclri r15, 0
0+016 <bf>:
- 16: ef f4 bf 0x0
+ 16: eff4 bf 0x0
0+018 <bgeni>:
- 18: 32 70 bgeni r0, 7
+ 18: 3270 bgeni r0, 7
0+01a <BGENI>:
- 1a: 32 80 bgeni r0, 8
+ 1a: 3280 bgeni r0, 8
0+01c <BGENi>:
- 1c: 33 f0 bgeni r0, 31
+ 1c: 33f0 bgeni r0, 31
0+01e <bgenr>:
- 1e: 13 21 bgenr r1, r2
+ 1e: 1321 bgenr r1, r2
0+020 <bkpt>:
...
0+022 <bmaski>:
- 22: 2c 83 bmaski r3, 8
+ 22: 2c83 bmaski r3, 8
0+024 <BMASKI>:
- 24: 2d f3 bmaski r3, 31
+ 24: 2df3 bmaski r3, 31
0+026 <br>:
- 26: f7 ff br 0x26
+ 26: f7ff br 0x26
0+028 <brev>:
- 28: 00 f4 brev r4
+ 28: 00f4 brev r4
0+02a <bseti>:
- 2a: 35 e5 bseti r5, 30
+ 2a: 35e5 bseti r5, 30
0+02c <bsr>:
- 2c: ff e9 bsr 0x0
+ 2c: ffe9 bsr 0x0
0+02e <bt>:
- 2e: e7 e8 bt 0x0
+ 2e: e7e8 bt 0x0
0+030 <btsti>:
- 30: 37 b6 btsti r6, 27
+ 30: 37b6 btsti r6, 27
0+032 <clrc>:
- 32: 0f 00 cmpne r0, r0
+ 32: 0f00 cmpne r0, r0
0+034 <clrf>:
- 34: 01 d7 clrf r7
+ 34: 01d7 clrf r7
0+036 <clrt>:
- 36: 01 c8 clrt r8
+ 36: 01c8 clrt r8
0+038 <cmphs>:
- 38: 0c a9 cmphs r9, r10
+ 38: 0ca9 cmphs r9, r10
0+03a <cmplt>:
- 3a: 0d cb cmplt r11, r12
+ 3a: 0dcb cmplt r11, r12
0+03c <cmplei>:
- 3c: 22 eb cmplti r11, 15
+ 3c: 22eb cmplti r11, 15
0+03e <cmplti>:
- 3e: 23 fd cmplti r13, 32
+ 3e: 23fd cmplti r13, 32
0+040 <cmpne>:
- 40: 0f fe cmpne r14, r15
+ 40: 0ffe cmpne r14, r15
0+042 <cmpnei>:
- 42: 2a 00 cmpnei r0, 0
+ 42: 2a00 cmpnei r0, 0
0+044 <decf>:
- 44: 00 91 decf r1
+ 44: 0091 decf r1
0+046 <decgt>:
- 46: 01 a2 decgt r2
+ 46: 01a2 decgt r2
0+048 <declt>:
- 48: 01 83 declt r3
+ 48: 0183 declt r3
0+04a <decne>:
- 4a: 01 b4 decne r4
+ 4a: 01b4 decne r4
0+04c <dect>:
- 4c: 00 85 dect r5
+ 4c: 0085 dect r5
0+04e <divs>:
- 4e: 32 16 divs r6, r1
+ 4e: 3216 divs r6, r1
0+050 <divu>:
- 50: 2c 18 divu r8, r1
+ 50: 2c18 divu r8, r1
0+052 <doze>:
- 52: 00 06 doze
+ 52: 0006 doze
0+054 <ff1>:
- 54: 00 ea ff1 r10
+ 54: 00ea ff1 r10
0+056 <incf>:
- 56: 00 bb incf r11
+ 56: 00bb incf r11
0+058 <inct>:
- 58: 00 ac inct r12
+ 58: 00ac inct r12
0+05a <ixh>:
- 5a: 1d ed ixh r13, r14
+ 5a: 1ded ixh r13, r14
0+05c <ixw>:
- 5c: 15 0f ixw r15, r0
+ 5c: 150f ixw r15, r0
0+05e <jbf>:
- 5e: ef d0 bf 0x0
+ 5e: efd0 bf 0x0
0+060 <jbr>:
- 60: f0 0e br 0x7e
+ 60: f00e br 0x7e
0+062 <jbsr>:
- 62: 7f 0a jsri 0x.*
+ 62: 7f0a jsri 0x.*
0+064 <jbt>:
- 64: e0 0c bt 0x7e
+ 64: e00c bt 0x7e
0+066 <jmp>:
- 66: 00 c1 jmp r1
+ 66: 00c1 jmp r1
0+068 <jmpi>:
- 68: 70 09 jmpi 0x.*
+ 68: 7009 jmpi 0x.*
0+06a <jsr>:
- 6a: 00 d2 jsr r2
+ 6a: 00d2 jsr r2
0+06c <jsri>:
- 6c: 7f 08 jsri 0x.*
+ 6c: 7f08 jsri 0x.*
0+06e <ld.b>:
- 6e: a3 04 ldb r3, \(r4, 0\)
+ 6e: a304 ldb r3, \(r4, 0\)
0+070 <ld.h>:
- 70: c5 16 ldh r5, \(r6, 2\)
+ 70: c516 ldh r5, \(r6, 2\)
0+072 <ld.w>:
- 72: 87 18 ld r7, \(r8, 4\)
+ 72: 8718 ld r7, \(r8, 4\)
0+074 <ldb>:
- 74: a9 fa ldb r9, \(r10, 15\)
+ 74: a9fa ldb r9, \(r10, 15\)
0+076 <ldh>:
- 76: cb fc ldh r11, \(r12, 30\)
+ 76: cbfc ldh r11, \(r12, 30\)
0+078 <ld>:
- 78: 8d 5e ld r13, \(r14, 20\)
+ 78: 8d5e ld r13, \(r14, 20\)
0+07a <ldw>:
- 7a: 8d fe ld r13, \(r14, 60\)
+ 7a: 8dfe ld r13, \(r14, 60\)
0+07c <ldm>:
- 7c: 00 62 ldm r2-r15, \(r0\)
+ 7c: 0062 ldm r2-r15, \(r0\)
0+07e <fooloop>:
- 7e: 00 41 ldq r4-r7, \(r1\)
+ 7e: 0041 ldq r4-r7, \(r1\)
0+080 <loopt>:
- 80: 04 8e loopt r8, 0x64
+ 80: 048e loopt r8, 0x64
0+082 <LRW>:
- 82: 79 03 lrw r9, 0x.*
+ 82: 7903 lrw r9, 0x.*
0+084 <lrw>:
- 84: 79 04 lrw r9, 0x4321
+ 84: 7904 lrw r9, 0x4321
0+086 <foolit>:
- 86: 12 34 mov r4, r3
+ 86: 1234 mov r4, r3
0+088 <lsl>:
- 88: 1b ba lsl r10, r11
+ 88: 1bba lsl r10, r11
0+08a <lslc>:
- 8a: 3c 0c lslc r12
+ 8a: 3c0c lslc r12
-0+08c <.XP0001>:
...
8c: ADDR32 .text
90: ADDR32 .text.*
- 94: 00 00 bkpt
- 96: 43 21 .word 0x4321
+ 94: 0000 bkpt
+ 96: 4321 .short 0x4321
0+098 <lsli>:
- 98: 3d fd lsli r13, 31
+ 98: 3dfd lsli r13, 31
0+09a <lsr>:
- 9a: 0b fe lsr r14, r15
+ 9a: 0bfe lsr r14, r15
0+09c <lsrc>:
- 9c: 3e 00 lsrc r0
+ 9c: 3e00 lsrc r0
0+09e <lsri>:
- 9e: 3e 11 lsri r1, 1
+ 9e: 3e11 lsri r1, 1
0+0a0 <mclri>:
- a0: 30 64 bclri r4, 6
+ a0: 3064 bclri r4, 6
0+0a2 <mfcr>:
- a2: 10 02 mfcr r2, psr
+ a2: 1002 mfcr r2, psr
0+0a4 <mov>:
- a4: 12 43 mov r3, r4
+ a4: 1243 mov r3, r4
0+0a6 <movf>:
- a6: 0a 65 movf r5, r6
+ a6: 0a65 movf r5, r6
0+0a8 <movi>:
- a8: 67 f7 movi r7, 127
+ a8: 67f7 movi r7, 127
0+0aa <movt>:
- aa: 02 98 movt r8, r9
+ aa: 0298 movt r8, r9
0+0ac <mtcr>:
- ac: 18 0a mtcr r10, psr
+ ac: 180a mtcr r10, psr
0+0ae <mult>:
- ae: 03 cb mult r11, r12
+ ae: 03cb mult r11, r12
0+0b0 <mvc>:
- b0: 00 2d mvc r13
+ b0: 002d mvc r13
0+0b2 <mvcv>:
- b2: 00 3e mvcv r14
+ b2: 003e mvcv r14
0+0b4 <neg>:
- b4: 28 02 rsubi r2, 0
+ b4: 2802 rsubi r2, 0
0+0b6 <not>:
- b6: 01 ff not r15
+ b6: 01ff not r15
0+0b8 <or>:
- b8: 1e 10 or r0, r1
+ b8: 1e10 or r0, r1
0+0ba <rfi>:
- ba: 00 03 rfi
+ ba: 0003 rfi
0+0bc <rolc>:
- bc: 06 66 addc r6, r6
+ bc: 0666 addc r6, r6
0+0be <rori>:
- be: 39 a9 rotli r9, 26
+ be: 39a9 rotli r9, 26
0+0c0 <rotlc>:
- c0: 06 66 addc r6, r6
+ c0: 0666 addc r6, r6
0+0c2 <rotli>:
- c2: 38 a2 rotli r2, 10
+ c2: 38a2 rotli r2, 10
0+0c4 <rotri>:
- c4: 39 a9 rotli r9, 26
+ c4: 39a9 rotli r9, 26
0+0c6 <rsub>:
- c6: 14 43 rsub r3, r4
+ c6: 1443 rsub r3, r4
0+0c8 <rsubi>:
- c8: 28 05 rsubi r5, 0
+ c8: 2805 rsubi r5, 0
0+0ca <rte>:
- ca: 00 02 rte
+ ca: 0002 rte
0+0cc <rts>:
- cc: 00 cf jmp r15
+ cc: 00cf jmp r15
0+0ce <setc>:
- ce: 0c 00 cmphs r0, r0
+ ce: 0c00 cmphs r0, r0
0+0d0 <sextb>:
- d0: 01 56 sextb r6
+ d0: 0156 sextb r6
0+0d2 <sexth>:
- d2: 01 77 sexth r7
+ d2: 0177 sexth r7
0+0d4 <st.b>:
- d4: b8 09 stb r8, \(r9, 0\)
+ d4: b809 stb r8, \(r9, 0\)
0+0d6 <st.h>:
- d6: da 1b sth r10, \(r11, 2\)
+ d6: da1b sth r10, \(r11, 2\)
0+0d8 <st.w>:
- d8: 9c 1d st r12, \(r13, 4\)
+ d8: 9c1d st r12, \(r13, 4\)
0+0da <stb>:
- da: be ff stb r14, \(r15, 15\)
+ da: beff stb r14, \(r15, 15\)
0+0dc <sth>:
- dc: d0 f1 sth r0, \(r1, 30\)
+ dc: d0f1 sth r0, \(r1, 30\)
0+0de <stw>:
- de: 92 f3 st r2, \(r3, 60\)
+ de: 92f3 st r2, \(r3, 60\)
0+0e0 <st>:
- e0: 94 05 st r4, \(r5, 0\)
+ e0: 9405 st r4, \(r5, 0\)
0+0e2 <stm>:
- e2: 00 7e stm r14-r15, \(r0\)
+ e2: 007e stm r14-r15, \(r0\)
0+0e4 <stop>:
- e4: 00 04 stop
+ e4: 0004 stop
0+0e6 <stq>:
- e6: 00 51 stq r4-r7, \(r1\)
+ e6: 0051 stq r4-r7, \(r1\)
0+0e8 <subc>:
- e8: 07 d7 subc r7, r13
+ e8: 07d7 subc r7, r13
0+0ea <subi>:
- ea: 25 fe subi r14, 32
+ ea: 25fe subi r14, 32
0+0ec <subu>:
- ec: 05 39 subu r9, r3
+ ec: 0539 subu r9, r3
0+0ee <sync>:
- ee: 00 01 sync
+ ee: 0001 sync
0+0f0 <tstlt>:
- f0: 37 f5 btsti r5, 31
+ f0: 37f5 btsti r5, 31
0+0f2 <tstne>:
- f2: 2a 07 cmpnei r7, 0
+ f2: 2a07 cmpnei r7, 0
0+0f4 <trap>:
- f4: 00 0a trap 2
+ f4: 000a trap 2
0+0f6 <tst>:
- f6: 0e ee tst r14, r14
+ f6: 0eee tst r14, r14
0+0f8 <tstnbz>:
- f8: 01 92 tstnbz r2
+ f8: 0192 tstnbz r2
0+0fa <wait>:
- fa: 00 05 wait
+ fa: 0005 wait
0+0fc <xor>:
- fc: 17 0f xor r15, r0
+ fc: 170f xor r15, r0
0+0fe <xsr>:
- fe: 38 0b xsr r11
+ fe: 380b xsr r11
0+0100 <xtrb0>:
- 100: 01 31 xtrb0 r1, r1
+ 100: 0131 xtrb0 r1, r1
0+0102 <xtrb1>:
- 102: 01 22 xtrb1 r1, r2
+ 102: 0122 xtrb1 r1, r2
0+0104 <xtrb2>:
- 104: 01 10 xtrb2 r1, r0
+ 104: 0110 xtrb2 r1, r0
0+0106 <xtrb3>:
- 106: 01 0d xtrb3 r1, r13
+ 106: 010d xtrb3 r1, r13
0+0108 <zextb>:
- 108: 01 48 zextb r8
+ 108: 0148 zextb r8
0+010a <zexth>:
- 10a: 01 64 zexth r4
- 10c: 0f 00 cmpne r0, r0
- 10e: 0f 00 cmpne r0, r0
+ 10a: 0164 zexth r4
+ 10c: 0f00 cmpne r0, r0
+ 10e: 0f00 cmpne r0, r0
diff --git a/gas/testsuite/gas/vtable/vtable.exp b/gas/testsuite/gas/vtable/vtable.exp
index 5d144515247..6ecc973f893 100644
--- a/gas/testsuite/gas/vtable/vtable.exp
+++ b/gas/testsuite/gas/vtable/vtable.exp
@@ -23,6 +23,11 @@ if {[istarget "*-*-elf*"] || [istarget "*-*-linux*"]} then {
return
}
+ # not yet supported by i960
+ if {[istarget "i960-*-*"]} {
+ return
+ }
+
run_dump_test "inherit0"
run_list_test "inherit1" "-al"
diff --git a/gas/write.c b/gas/write.c
index 18e6e103f94..13f78b9ebe8 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -2707,6 +2707,27 @@ fixup_segment (fixP, this_segment_type)
}
}
+ if (!fixP->fx_done)
+ {
+#ifdef MD_APPLY_FIX3
+ md_apply_fix3 (fixP, &add_number, this_segment_type);
+#else
+#ifdef BFD_ASSEMBLER
+ md_apply_fix (fixP, &add_number);
+#else
+ md_apply_fix (fixP, add_number);
+#endif
+#endif
+
+#ifndef TC_HANDLES_FX_DONE
+ /* If the tc-* files haven't been converted, assume it's handling
+ it the old way, where a null fx_addsy means that the fix has
+ been applied completely, and no further work is needed. */
+ if (fixP->fx_addsy == 0 && fixP->fx_pcrel == 0)
+ fixP->fx_done = 1;
+#endif
+ }
+
if (!fixP->fx_bit_fixP && !fixP->fx_no_overflow && size > 0)
{
if ((size_t) size < sizeof (valueT))
@@ -2755,26 +2776,6 @@ fixup_segment (fixP, this_segment_type)
#endif
} /* not a bit fix */
- if (!fixP->fx_done)
- {
-#ifdef MD_APPLY_FIX3
- md_apply_fix3 (fixP, &add_number, this_segment_type);
-#else
-#ifdef BFD_ASSEMBLER
- md_apply_fix (fixP, &add_number);
-#else
- md_apply_fix (fixP, add_number);
-#endif
-#endif
-
-#ifndef TC_HANDLES_FX_DONE
- /* If the tc-* files haven't been converted, assume it's handling
- it the old way, where a null fx_addsy means that the fix has
- been applied completely, and no further work is needed. */
- if (fixP->fx_addsy == 0 && fixP->fx_pcrel == 0)
- fixP->fx_done = 1;
-#endif
- }
#ifdef TC_VALIDATE_FIX
skip: ;
#endif
@@ -2824,7 +2825,7 @@ void
write_print_statistics (file)
FILE *file;
{
- fprintf (stderr, "fixups: %d\n", n_fixups);
+ fprintf (file, "fixups: %d\n", n_fixups);
}
/* for debugging */
diff --git a/include/coff/ChangeLog b/include/coff/ChangeLog
index 8ad6e0cec4a..b6c35ab313e 100644
--- a/include/coff/ChangeLog
+++ b/include/coff/ChangeLog
@@ -1,3 +1,13 @@
+Mon May 17 13:35:35 1999 Stan Cox <scox@cygnus.com>
+
+ * coff/arm.h (F_PIC, F_ARM_2, F_ARM_2a, F_ARM_3, F_ARM_3M,
+ F_ARM_4, F_ARM_4T, F_APCS26): Changed values to distinguish
+ F_ARM_2a, F_ARM_3M, F_ARM_4T.
+
+1999-05-15 Nick Clifton <nickc@cygnus.com>
+
+ * mcore.h (IMAGE_REL_MCORE_RVA): Define.
+
1999-04-21 Nick Clifton <nickc@cygnus.com>
* mcore.h (GET_LINENO_LNNO): New macro.
diff --git a/include/coff/arm.h b/include/coff/arm.h
index dd578b1a76a..e5d78d69367 100644
--- a/include/coff/arm.h
+++ b/include/coff/arm.h
@@ -44,16 +44,17 @@ struct external_filehdr {
/* Bits stored in flags field of the internal_f structure */
#define F_INTERWORK (0x0010)
-#define F_PIC_INT (0x0020)
#define F_APCS_FLOAT (0x0040)
-#define F_ARM_ARCHITECTURE_MASK (0x0c00)
-#define F_ARM_2 (0x0000)
-#define F_ARM_2a (0x0000)
-#define F_ARM_3 (0x0400)
-#define F_ARM_3M (0x0400)
-#define F_ARM_4 (0x0800)
-#define F_ARM_4T (0x0c00)
-#define F_APCS26 (0x4000)
+#define F_PIC (0x0080)
+#define F_APCS26 (0x1000)
+#define F_ARM_ARCHITECTURE_MASK (0x4000+0x0800+0x0400)
+#define F_ARM_2 (0x0400)
+#define F_ARM_2a (0x0800)
+#define F_ARM_3 (0x0c00)
+#define F_ARM_3M (0x4000)
+#define F_ARM_4 (0x4400)
+#define F_ARM_4T (0x4800)
+#define F_ARM_spare (0x4c00)
/*
* ARMMAGIC ought to encoded the procesor type,
diff --git a/include/coff/mcore.h b/include/coff/mcore.h
index 974b62e1630..f31894796d3 100644
--- a/include/coff/mcore.h
+++ b/include/coff/mcore.h
@@ -32,6 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define IMAGE_REL_MCORE_PCREL_IMM4BY2 0x0004
#define IMAGE_REL_MCORE_PCREL_32 0x0005
#define IMAGE_REL_MCORE_PCREL_JSR_IMM11BY2 0x0006
+#define IMAGE_REL_MCORE_RVA 0x0007
#define PEMCORE
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index deaccd412e2..86b34bc87b7 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,29 @@
+1999-05-29 Nick Clifton <nickc@cygnus.com>
+
+ * common.h (ELFOSABI_ARM): Define.
+
+1999-05-28 Nick Clifton <nickc@cygnus.com>
+
+ * reloc-macros.h: Update comment.
+
+1999-05-28 Ian Lance Taylor <ian@zembu.com>
+
+ * i960.h: New file.
+
+1999-05-16 Nick Clifton <nickc@cygnus.com>
+
+ * mcore.h (R_MCORE_COPY): Define.
+ (R_MCORE_GLOB_DAT): Define.
+ (R_MCORE_JUMP_SLOT): Define.
+
+1999-05-15 Nick Clifton <nickc@cygnus.com>
+
+ * mcore.h (R_MCORE_RELATIVE): Define.
+
+999-05-05 Catherine Moore <clm@cygnus.com>
+
+ * m68k.h (EF_CPU32): Define.
+
1999-04-21 Nick Clifton <nickc@cygnus.com>
* reloc-macros.h (START_RELOC_NUMBERS): Prepend an underscore to
diff --git a/include/elf/common.h b/include/elf/common.h
index cda3ba0d9d5..5274d45114f 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -60,6 +60,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define ELFOSABI_SYSV 0 /* UNIX System V ABI */
#define ELFOSABI_HPUX 1 /* HP-UX operating system */
#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */
+#define ELFOSABI_ARM 97 /* ARM */
#define EI_ABIVERSION 8 /* ABI version */
diff --git a/include/elf/i960.h b/include/elf/i960.h
new file mode 100644
index 00000000000..7939d289942
--- /dev/null
+++ b/include/elf/i960.h
@@ -0,0 +1,37 @@
+/* Intel 960 ELF support for BFD.
+ Copyright (C) 1999 Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef _ELF_I960_H
+#define _ELF_I960_H
+
+#include "reloc-macros.h"
+
+START_RELOC_NUMBERS (elf_i960_reloc_type)
+ RELOC_NUMBER (R_960_NONE, 0)
+ RELOC_NUMBER (R_960_12, 1)
+ RELOC_NUMBER (R_960_32, 2)
+ RELOC_NUMBER (R_960_IP24, 3)
+ RELOC_NUMBER (R_960_SUB, 4)
+ RELOC_NUMBER (R_960_OPTCALL, 5)
+ RELOC_NUMBER (R_960_OPTCALLX, 6)
+ RELOC_NUMBER (R_960_OPTCALLXA, 7)
+ EMPTY_RELOC (R_960_max)
+END_RELOC_NUMBERS
+
+#endif /* _ELF_I960_H */
diff --git a/include/elf/m68k.h b/include/elf/m68k.h
index db31cdcda45..f872e0fcf85 100644
--- a/include/elf/m68k.h
+++ b/include/elf/m68k.h
@@ -54,3 +54,5 @@ START_RELOC_NUMBERS (elf_m68k_reloc_type)
END_RELOC_NUMBERS
#endif
+
+#define EF_CPU32 0x00810000
diff --git a/include/elf/mcore.h b/include/elf/mcore.h
index a7c4dad112d..068a93a5dd4 100644
--- a/include/elf/mcore.h
+++ b/include/elf/mcore.h
@@ -34,6 +34,10 @@ START_RELOC_NUMBERS (elf_mcore_reloc_type)
RELOC_NUMBER (R_MCORE_PCRELJSR_IMM11BY2, 6)
RELOC_NUMBER (R_MCORE_GNU_VTINHERIT, 7)
RELOC_NUMBER (R_MCORE_GNU_VTENTRY, 8)
+ RELOC_NUMBER (R_MCORE_RELATIVE, 9)
+ RELOC_NUMBER (R_MCORE_COPY, 10)
+ RELOC_NUMBER (R_MCORE_GLOB_DAT, 11)
+ RELOC_NUMBER (R_MCORE_JUMP_SLOT, 12)
EMPTY_RELOC (R_MCORE_max)
END_RELOC_NUMBERS
diff --git a/include/elf/reloc-macros.h b/include/elf/reloc-macros.h
index 976229129c0..42174caeeae 100644
--- a/include/elf/reloc-macros.h
+++ b/include/elf/reloc-macros.h
@@ -46,8 +46,8 @@
If RELOC_MACROS_GEN_FUNC *is* defined, then instead the
following function will be generated:
- static char * foo PARAMS ((unsigned long rtype));
- static char *
+ static const char * foo PARAMS ((unsigned long rtype));
+ static const char *
foo (rtype)
unsigned long rtype;
{
diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog
index 79bc3cc7cb8..f589e5e8aec 100644
--- a/include/opcode/ChangeLog
+++ b/include/opcode/ChangeLog
@@ -1,3 +1,41 @@
+Fri May 28 15:26:11 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa.h (pa_opcodes): Move integer arithmetic instructions after
+ integer logical instructions.
+
+1999-05-28 Linus Nordberg <linus.nordberg@canit.se>
+
+ * m68k.h: Document new formats `E', `G', `H' and new places `N',
+ `n', `o'.
+
+ * m68k.h: Define mcf5206e, mcf5307, mcf. Document new format `u'
+ and new places `m', `M', `h'.
+
+Thu May 27 04:13:54 1999 Joel Sherrill (joel@OARcorp.com
+
+ * hppa.h (pa_opcodes): Add several processor specific system
+ instructions.
+
+Wed May 26 16:57:44 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa.h (pa_opcodes): Add second entry for "comb", "comib",
+ "addb", and "addib" to be used by the disassembler.
+
+1999-05-12 Alan Modra <alan@apri.levels.unisa.edu.au>
+
+ * i386.h (ReverseModrm): Remove all occurences.
+ (InvMem): Add to control/debug/test mov insns, movhlps, movlhps,
+ movmskps, pextrw, pmovmskb, maskmovq.
+ Change NoSuf to FP on all MMX, XMM and AMD insns as these all
+ ignore the data size prefix.
+
+ * i386.h (i386_optab, i386_regtab): Add support for PIII SIMD.
+ Mostly stolen from Doug Ledford <dledford@redhat.com>
+
+Sat May 8 23:27:35 1999 Richard Henderson <rth@cygnus.com>
+
+ * ppc.h (PPC_OPCODE_64_BRIDGE): New.
+
1999-04-14 Doug Evans <devans@casey.cygnus.com>
* cgen.h (CGEN_ATTR): Delete member num_nonbools.
diff --git a/include/opcode/hppa.h b/include/opcode/hppa.h
index 30ccb6ccffc..858b65a6c68 100644
--- a/include/opcode/hppa.h
+++ b/include/opcode/hppa.h
@@ -184,9 +184,21 @@ static const struct pa_opcode pa_opcodes[] =
{ "b", 0xe8000000, 0xffe0e000, "nW", pa10}, /* bl foo,r0 */
{ "ldi", 0x34000000, 0xffe0c000, "j,x", pa10}, /* ldo val(r0),r */
{ "comib", 0x84000000, 0xfc000000, "?n5,b,w", pa10}, /* comib{tf}*/
+/* This entry is for the disassembler only. It will never be used by
+ assembler. */
+{ "comib", 0x8c000000, 0xfc000000, "?n5,b,w", pa10}, /* comib{tf}*/
{ "comb", 0x80000000, 0xfc000000, "?nx,b,w", pa10}, /* comb{tf} */
+/* This entry is for the disassembler only. It will never be used by
+ assembler. */
+{ "comb", 0x88000000, 0xfc000000, "?nx,b,w", pa10}, /* comb{tf} */
{ "addb", 0xa0000000, 0xfc000000, "@nx,b,w", pa10}, /* addb{tf} */
+/* This entry is for the disassembler only. It will never be used by
+ assembler. */
+{ "addb", 0xa8000000, 0xfc000000, "@nx,b,w", pa10},
{ "addib", 0xa4000000, 0xfc000000, "@n5,b,w", pa10}, /* addib{tf}*/
+/* This entry is for the disassembler only. It will never be used by
+ assembler. */
+{ "addib", 0xac000000, 0xfc000000, "@n5,b,w", pa10}, /* addib{tf}*/
{ "nop", 0x08000240, 0xffffffff, "", pa10}, /* or 0,0,0 */
{ "copy", 0x08000240, 0xffe0ffe0, "x,t", pa10}, /* or r,0,t */
{ "mtsar", 0x01601840, 0xffe0ffff, "x", pa10}, /* mtctl r,cr11 */
@@ -264,27 +276,6 @@ static const struct pa_opcode pa_opcodes[] =
/* Computation Instructions */
-{ "add", 0x08000600, 0xfc000fe0, "dx,b,t", pa10},
-{ "addl", 0x08000a00, 0xfc000fe0, "dx,b,t", pa10},
-{ "addo", 0x08000e00, 0xfc000fe0, "dx,b,t", pa10},
-{ "addc", 0x08000700, 0xfc000fe0, "dx,b,t", pa10},
-{ "addco", 0x08000f00, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh1add", 0x08000640, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh1addl", 0x08000a40, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh1addo", 0x08000e40, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh2add", 0x08000680, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh2addl", 0x08000a80, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh2addo", 0x08000e80, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh3add", 0x080006c0, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh3addl", 0x08000ac0, 0xfc000fe0, "dx,b,t", pa10},
-{ "sh3addo", 0x08000ec0, 0xfc000fe0, "dx,b,t", pa10},
-{ "sub", 0x08000400, 0xfc000fe0, "ax,b,t", pa10},
-{ "subo", 0x08000c00, 0xfc000fe0, "ax,b,t", pa10},
-{ "subb", 0x08000500, 0xfc000fe0, "ax,b,t", pa10},
-{ "subbo", 0x08000d00, 0xfc000fe0, "ax,b,t", pa10},
-{ "subt", 0x080004c0, 0xfc000fe0, "ax,b,t", pa10},
-{ "subto", 0x08000cc0, 0xfc000fe0, "ax,b,t", pa10},
-{ "ds", 0x08000440, 0xfc000fe0, "ax,b,t", pa10},
{ "comclr", 0x08000880, 0xfc000fe0, "ax,b,t", pa10},
{ "or", 0x08000240, 0xfc000fe0, "&x,b,t", pa10},
{ "xor", 0x08000280, 0xfc000fe0, "&x,b,t", pa10},
@@ -299,9 +290,30 @@ static const struct pa_opcode pa_opcodes[] =
{ "addio", 0xb4000800, 0xfc000800, "di,b,x", pa10},
{ "addit", 0xb0000000, 0xfc000800, "di,b,x", pa10},
{ "addito", 0xb0000800, 0xfc000800, "di,b,x", pa10},
+{ "add", 0x08000600, 0xfc000fe0, "dx,b,t", pa10},
+{ "addl", 0x08000a00, 0xfc000fe0, "dx,b,t", pa10},
+{ "addo", 0x08000e00, 0xfc000fe0, "dx,b,t", pa10},
+{ "addc", 0x08000700, 0xfc000fe0, "dx,b,t", pa10},
+{ "addco", 0x08000f00, 0xfc000fe0, "dx,b,t", pa10},
+{ "sub", 0x08000400, 0xfc000fe0, "ax,b,t", pa10},
+{ "subo", 0x08000c00, 0xfc000fe0, "ax,b,t", pa10},
+{ "subb", 0x08000500, 0xfc000fe0, "ax,b,t", pa10},
+{ "subbo", 0x08000d00, 0xfc000fe0, "ax,b,t", pa10},
+{ "subt", 0x080004c0, 0xfc000fe0, "ax,b,t", pa10},
+{ "subto", 0x08000cc0, 0xfc000fe0, "ax,b,t", pa10},
+{ "ds", 0x08000440, 0xfc000fe0, "ax,b,t", pa10},
{ "subi", 0x94000000, 0xfc000800, "ai,b,x", pa10},
{ "subio", 0x94000800, 0xfc000800, "ai,b,x", pa10},
{ "comiclr", 0x90000000, 0xfc000800, "ai,b,x", pa10},
+{ "sh1add", 0x08000640, 0xfc000fe0, "dx,b,t", pa10},
+{ "sh1addl", 0x08000a40, 0xfc000fe0, "dx,b,t", pa10},
+{ "sh1addo", 0x08000e40, 0xfc000fe0, "dx,b,t", pa10},
+{ "sh2add", 0x08000680, 0xfc000fe0, "dx,b,t", pa10},
+{ "sh2addl", 0x08000a80, 0xfc000fe0, "dx,b,t", pa10},
+{ "sh2addo", 0x08000e80, 0xfc000fe0, "dx,b,t", pa10},
+{ "sh3add", 0x080006c0, 0xfc000fe0, "dx,b,t", pa10},
+{ "sh3addl", 0x08000ac0, 0xfc000fe0, "dx,b,t", pa10},
+{ "sh3addo", 0x08000ec0, 0xfc000fe0, "dx,b,t", pa10},
/* Extract and Deposit Instructions */
@@ -378,6 +390,16 @@ static const struct pa_opcode pa_opcodes[] =
{ "fice", 0x040002c0, 0xfc001fdf, "Zx(b)", pa10},
{ "diag", 0x14000000, 0xfc000000, "D", pa10},
+/* 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,^"},
+{ "mfcpu", 0x14001A00, 0xfc00ffff, "^,x"},
+{ "tocen", 0x14403600, 0xffffffff, ""},
+{ "tocdis", 0x14401620, 0xffffffff, ""},
+{ "shdwgr", 0x14402600, 0xffffffff, ""},
+{ "grshdw", 0x14400620, 0xffffffff, ""},
+
/* 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. */
{ "gfw", 0x04001680, 0xfc003fdf, "Zx(s,b)", pa11},
diff --git a/include/opcode/i386.h b/include/opcode/i386.h
index ef8fece15e1..41f2412d65f 100644
--- a/include/opcode/i386.h
+++ b/include/opcode/i386.h
@@ -42,7 +42,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static const template i386_optab[] = {
#define X None
-#define ReverseModrm (ReverseRegRegmem|Modrm)
#define NoSuf (No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_dSuf|No_xSuf)
#define b_Suf (No_wSuf|No_lSuf|No_sSuf|No_dSuf|No_xSuf)
#define w_Suf (No_bSuf|No_lSuf|No_sSuf|No_dSuf|No_xSuf)
@@ -84,26 +83,26 @@ static const template i386_optab[] = {
{ "mov", 2, 0x8c, X, wl_Suf|Modrm, { SReg3|SReg2, WordReg|WordMem, 0 } },
{ "mov", 2, 0x8e, X, wl_Suf|Modrm|IgnoreSize, { WordReg|WordMem, SReg3|SReg2, 0 } },
/* move to/from control debug registers */
-{ "mov", 2, 0x0f20, X, l_Suf|D|Modrm|IgnoreSize, { Control, Reg32, 0} },
-{ "mov", 2, 0x0f21, X, l_Suf|D|Modrm|IgnoreSize, { Debug, Reg32, 0} },
-{ "mov", 2, 0x0f24, X, l_Suf|D|Modrm|IgnoreSize, { Test, Reg32, 0} },
+{ "mov", 2, 0x0f20, X, l_Suf|D|Modrm|IgnoreSize, { Control, Reg32|InvMem, 0} },
+{ "mov", 2, 0x0f21, X, l_Suf|D|Modrm|IgnoreSize, { Debug, Reg32|InvMem, 0} },
+{ "mov", 2, 0x0f24, X, l_Suf|D|Modrm|IgnoreSize, { Test, Reg32|InvMem, 0} },
/* move with sign extend */
/* "movsbl" & "movsbw" must not be unified into "movsb" to avoid
conflict with the "movs" string move instruction. */
-{"movsbl", 2, 0x0fbe, X, NoSuf|ReverseModrm, { Reg8|ByteMem, Reg32, 0} },
-{"movsbw", 2, 0x0fbe, X, NoSuf|ReverseModrm, { Reg8|ByteMem, Reg16, 0} },
-{"movswl", 2, 0x0fbf, X, NoSuf|ReverseModrm, { Reg16|ShortMem, Reg32, 0} },
+{"movsbl", 2, 0x0fbe, X, NoSuf|Modrm, { Reg8|ByteMem, Reg32, 0} },
+{"movsbw", 2, 0x0fbe, X, NoSuf|Modrm, { Reg8|ByteMem, Reg16, 0} },
+{"movswl", 2, 0x0fbf, X, NoSuf|Modrm, { Reg16|ShortMem, Reg32, 0} },
/* Intel Syntax */
-{"movsx", 2, 0x0fbf, X, w_Suf|ReverseModrm|IgnoreSize, { Reg16|ShortMem, Reg32, 0} },
-{"movsx", 2, 0x0fbe, X, b_Suf|ReverseModrm, { Reg8|ByteMem, WordReg, 0} },
+{"movsx", 2, 0x0fbf, X, w_Suf|Modrm|IgnoreSize, { Reg16|ShortMem, Reg32, 0} },
+{"movsx", 2, 0x0fbe, X, b_Suf|Modrm, { Reg8|ByteMem, WordReg, 0} },
/* move with zero extend */
-{"movzb", 2, 0x0fb6, X, wl_Suf|ReverseModrm, { Reg8|ByteMem, WordReg, 0} },
-{"movzwl", 2, 0x0fb7, X, NoSuf|ReverseModrm, { Reg16|ShortMem, Reg32, 0} },
+{"movzb", 2, 0x0fb6, X, wl_Suf|Modrm, { Reg8|ByteMem, WordReg, 0} },
+{"movzwl", 2, 0x0fb7, X, NoSuf|Modrm, { Reg16|ShortMem, Reg32, 0} },
/* Intel Syntax */
-{"movzx", 2, 0x0fb7, X, w_Suf|ReverseModrm|IgnoreSize, { Reg16|ShortMem, Reg32, 0} },
-{"movzx", 2, 0x0fb6, X, b_Suf|ReverseModrm, { Reg8|ByteMem, WordReg, 0} },
+{"movzx", 2, 0x0fb7, X, w_Suf|Modrm|IgnoreSize, { Reg16|ShortMem, Reg32, 0} },
+{"movzx", 2, 0x0fb6, X, b_Suf|Modrm, { Reg8|ByteMem, WordReg, 0} },
/* push instructions */
{"push", 1, 0x50, X, wl_Suf|ShortForm, { WordReg,0,0 } },
@@ -250,9 +249,9 @@ static const template i386_optab[] = {
These multiplies can only be selected with single operand forms. */
{"mul", 1, 0xf6, 4, bwl_Suf|W|Modrm, { Reg|AnyMem, 0, 0} },
{"imul", 1, 0xf6, 5, bwl_Suf|W|Modrm, { Reg|AnyMem, 0, 0} },
-{"imul", 2, 0x0faf, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"imul", 3, 0x6b, X, wl_Suf|ReverseModrm, { Imm8S, WordReg|WordMem, WordReg} },
-{"imul", 3, 0x69, X, wl_Suf|ReverseModrm, { Imm16|Imm32, WordReg|WordMem, WordReg} },
+{"imul", 2, 0x0faf, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"imul", 3, 0x6b, X, wl_Suf|Modrm, { Imm8S, WordReg|WordMem, WordReg} },
+{"imul", 3, 0x69, X, wl_Suf|Modrm, { Imm16|Imm32, WordReg|WordMem, WordReg} },
/* imul with 2 operands mimics imul with 3 by putting the register in
both i.rm.reg & i.rm.regmem fields. regKludge enables this
transformation. */
@@ -448,8 +447,8 @@ static const template i386_optab[] = {
{"xlat", 1, 0xd7, X, b_Suf|IsString, { AnyMem, 0, 0} },
/* bit manipulation */
-{"bsf", 2, 0x0fbc, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"bsr", 2, 0x0fbd, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
+{"bsf", 2, 0x0fbc, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"bsr", 2, 0x0fbd, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
{"bt", 2, 0x0fa3, X, wl_Suf|Modrm, { WordReg, WordReg|WordMem, 0} },
{"bt", 2, 0x0fba, 4, wl_Suf|Modrm, { Imm8, WordReg|WordMem, 0} },
{"btc", 2, 0x0fbb, X, wl_Suf|Modrm, { WordReg, WordReg|WordMem, 0} },
@@ -479,12 +478,12 @@ static const template i386_optab[] = {
/* protection control */
{"arpl", 2, 0x63, X, NoSuf|Modrm|IgnoreSize,{ Reg16, Reg16|ShortMem, 0} },
-{"lar", 2, 0x0f02, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
+{"lar", 2, 0x0f02, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
{"lgdt", 1, 0x0f01, 2, wl_Suf|Modrm, { WordMem, 0, 0} },
{"lidt", 1, 0x0f01, 3, wl_Suf|Modrm, { WordMem, 0, 0} },
{"lldt", 1, 0x0f00, 2, NoSuf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
{"lmsw", 1, 0x0f01, 6, NoSuf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
-{"lsl", 2, 0x0f03, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
+{"lsl", 2, 0x0f03, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
{"ltr", 1, 0x0f00, 3, NoSuf|Modrm|IgnoreSize,{ Reg16|ShortMem, 0, 0} },
{"sgdt", 1, 0x0f01, 0, wl_Suf|Modrm, { WordMem, 0, 0} },
@@ -794,34 +793,34 @@ static const template i386_optab[] = {
{"ud2a", 0, 0x0f0b, X, NoSuf, { 0, 0, 0} }, /* alias for ud2 */
{"ud2b", 0, 0x0fb9, X, NoSuf, { 0, 0, 0} }, /* 2nd. official undefined instr. */
-{"cmovo", 2, 0x0f40, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovno", 2, 0x0f41, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovb", 2, 0x0f42, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovc", 2, 0x0f42, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovnae", 2, 0x0f42, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovae", 2, 0x0f43, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovnc", 2, 0x0f43, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovnb", 2, 0x0f43, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmove", 2, 0x0f44, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovz", 2, 0x0f44, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovne", 2, 0x0f45, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovnz", 2, 0x0f45, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovbe", 2, 0x0f46, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovna", 2, 0x0f46, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmova", 2, 0x0f47, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovnbe", 2, 0x0f47, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovs", 2, 0x0f48, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovns", 2, 0x0f49, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovp", 2, 0x0f4a, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovnp", 2, 0x0f4b, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovl", 2, 0x0f4c, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovnge", 2, 0x0f4c, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovge", 2, 0x0f4d, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovnl", 2, 0x0f4d, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovle", 2, 0x0f4e, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovng", 2, 0x0f4e, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovg", 2, 0x0f4f, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
-{"cmovnle", 2, 0x0f4f, X, wl_Suf|ReverseModrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovo", 2, 0x0f40, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovno", 2, 0x0f41, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovb", 2, 0x0f42, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovc", 2, 0x0f42, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovnae", 2, 0x0f42, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovae", 2, 0x0f43, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovnc", 2, 0x0f43, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovnb", 2, 0x0f43, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmove", 2, 0x0f44, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovz", 2, 0x0f44, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovne", 2, 0x0f45, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovnz", 2, 0x0f45, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovbe", 2, 0x0f46, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovna", 2, 0x0f46, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmova", 2, 0x0f47, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovnbe", 2, 0x0f47, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovs", 2, 0x0f48, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovns", 2, 0x0f49, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovp", 2, 0x0f4a, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovnp", 2, 0x0f4b, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovl", 2, 0x0f4c, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovnge", 2, 0x0f4c, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovge", 2, 0x0f4d, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovnl", 2, 0x0f4d, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovle", 2, 0x0f4e, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovng", 2, 0x0f4e, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovg", 2, 0x0f4f, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
+{"cmovnle", 2, 0x0f4f, X, wl_Suf|Modrm, { WordReg|WordMem, WordReg, 0} },
{"fcmovb", 2, 0xdac0, X, NoSuf|ShortForm, { FloatReg, FloatAcc, 0} },
{"fcmovnae",2, 0xdac0, X, NoSuf|ShortForm, { FloatReg, FloatAcc, 0} },
@@ -853,95 +852,182 @@ static const template i386_optab[] = {
/* MMX instructions. */
-{"emms", 0, 0x0f77, X, NoSuf, { 0, 0, 0 } },
-{"movd", 2, 0x0f6e, X, NoSuf|Modrm, { Reg32|LongMem, RegMMX, 0 } },
-{"movd", 2, 0x0f7e, X, NoSuf|Modrm, { RegMMX, Reg32|LongMem, 0 } },
-{"movq", 2, 0x0f6f, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"movq", 2, 0x0f7f, X, NoSuf|Modrm, { RegMMX, RegMMX|LongMem, 0 } },
-{"packssdw", 2, 0x0f6b, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"packsswb", 2, 0x0f63, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"packuswb", 2, 0x0f67, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"paddb", 2, 0x0ffc, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"paddw", 2, 0x0ffd, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"paddd", 2, 0x0ffe, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"paddsb", 2, 0x0fec, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"paddsw", 2, 0x0fed, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"paddusb", 2, 0x0fdc, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"paddusw", 2, 0x0fdd, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pand", 2, 0x0fdb, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pandn", 2, 0x0fdf, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pcmpeqb", 2, 0x0f74, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pcmpeqw", 2, 0x0f75, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pcmpeqd", 2, 0x0f76, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pcmpgtb", 2, 0x0f64, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pcmpgtw", 2, 0x0f65, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pcmpgtd", 2, 0x0f66, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pmaddwd", 2, 0x0ff5, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pmulhw", 2, 0x0fe5, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pmullw", 2, 0x0fd5, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"por", 2, 0x0feb, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psllw", 2, 0x0ff1, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psllw", 2, 0x0f71, 6, NoSuf|Modrm, { Imm8, RegMMX, 0 } },
-{"pslld", 2, 0x0ff2, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pslld", 2, 0x0f72, 6, NoSuf|Modrm, { Imm8, RegMMX, 0 } },
-{"psllq", 2, 0x0ff3, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psllq", 2, 0x0f73, 6, NoSuf|Modrm, { Imm8, RegMMX, 0 } },
-{"psraw", 2, 0x0fe1, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psraw", 2, 0x0f71, 4, NoSuf|Modrm, { Imm8, RegMMX, 0 } },
-{"psrad", 2, 0x0fe2, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psrad", 2, 0x0f72, 4, NoSuf|Modrm, { Imm8, RegMMX, 0 } },
-{"psrlw", 2, 0x0fd1, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psrlw", 2, 0x0f71, 2, NoSuf|Modrm, { Imm8, RegMMX, 0 } },
-{"psrld", 2, 0x0fd2, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psrld", 2, 0x0f72, 2, NoSuf|Modrm, { Imm8, RegMMX, 0 } },
-{"psrlq", 2, 0x0fd3, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psrlq", 2, 0x0f73, 2, NoSuf|Modrm, { Imm8, RegMMX, 0 } },
-{"psubb", 2, 0x0ff8, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psubw", 2, 0x0ff9, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psubd", 2, 0x0ffa, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psubsb", 2, 0x0fe8, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psubsw", 2, 0x0fe9, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psubusb", 2, 0x0fd8, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"psubusw", 2, 0x0fd9, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"punpckhbw",2, 0x0f68, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"punpckhwd",2, 0x0f69, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"punpckhdq",2, 0x0f6a, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"punpcklbw",2, 0x0f60, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"punpcklwd",2, 0x0f61, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"punpckldq",2, 0x0f62, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pxor", 2, 0x0fef, X, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-
-
+{"emms", 0, 0x0f77, X, FP, { 0, 0, 0 } },
+{"movd", 2, 0x0f6e, X, FP|Modrm, { Reg32|LongMem, RegMMX, 0 } },
+{"movd", 2, 0x0f7e, X, FP|Modrm, { RegMMX, Reg32|LongMem, 0 } },
+{"movq", 2, 0x0f6f, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"movq", 2, 0x0f7f, X, FP|Modrm, { RegMMX, RegMMX|LongMem, 0 } },
+{"packssdw", 2, 0x0f6b, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"packsswb", 2, 0x0f63, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"packuswb", 2, 0x0f67, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"paddb", 2, 0x0ffc, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"paddw", 2, 0x0ffd, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"paddd", 2, 0x0ffe, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"paddsb", 2, 0x0fec, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"paddsw", 2, 0x0fed, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"paddusb", 2, 0x0fdc, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"paddusw", 2, 0x0fdd, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pand", 2, 0x0fdb, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pandn", 2, 0x0fdf, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pcmpeqb", 2, 0x0f74, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pcmpeqw", 2, 0x0f75, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pcmpeqd", 2, 0x0f76, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pcmpgtb", 2, 0x0f64, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pcmpgtw", 2, 0x0f65, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pcmpgtd", 2, 0x0f66, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pmaddwd", 2, 0x0ff5, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pmulhw", 2, 0x0fe5, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pmullw", 2, 0x0fd5, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"por", 2, 0x0feb, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psllw", 2, 0x0ff1, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psllw", 2, 0x0f71, 6, FP|Modrm, { Imm8, RegMMX, 0 } },
+{"pslld", 2, 0x0ff2, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pslld", 2, 0x0f72, 6, FP|Modrm, { Imm8, RegMMX, 0 } },
+{"psllq", 2, 0x0ff3, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psllq", 2, 0x0f73, 6, FP|Modrm, { Imm8, RegMMX, 0 } },
+{"psraw", 2, 0x0fe1, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psraw", 2, 0x0f71, 4, FP|Modrm, { Imm8, RegMMX, 0 } },
+{"psrad", 2, 0x0fe2, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psrad", 2, 0x0f72, 4, FP|Modrm, { Imm8, RegMMX, 0 } },
+{"psrlw", 2, 0x0fd1, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psrlw", 2, 0x0f71, 2, FP|Modrm, { Imm8, RegMMX, 0 } },
+{"psrld", 2, 0x0fd2, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psrld", 2, 0x0f72, 2, FP|Modrm, { Imm8, RegMMX, 0 } },
+{"psrlq", 2, 0x0fd3, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psrlq", 2, 0x0f73, 2, FP|Modrm, { Imm8, RegMMX, 0 } },
+{"psubb", 2, 0x0ff8, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psubw", 2, 0x0ff9, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psubd", 2, 0x0ffa, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psubsb", 2, 0x0fe8, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psubsw", 2, 0x0fe9, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psubusb", 2, 0x0fd8, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"psubusw", 2, 0x0fd9, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"punpckhbw",2, 0x0f68, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"punpckhwd",2, 0x0f69, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"punpckhdq",2, 0x0f6a, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"punpcklbw",2, 0x0f60, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"punpcklwd",2, 0x0f61, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"punpckldq",2, 0x0f62, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+{"pxor", 2, 0x0fef, X, FP|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+
+
+/* PIII Katmai New Instructions / SIMD instructions */
+
+{"addps", 2, 0x0f58, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"addss", 2, 0xf30f58, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"andnps", 2, 0x0f55, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"andps", 2, 0x0f54, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"cmpps", 3, 0x0fc2, X, FP|Modrm, { Imm8, RegXMM|LLongMem, RegXMM } },
+{"cmpss", 3, 0xf30fc2, X, FP|Modrm, { Imm8, RegXMM|WordMem, RegXMM } },
+{"cmpeqps", 2, 0x0fc2, 0, FP|Modrm|ImmExt, { RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpeqss", 2, 0xf30fc2, 0, FP|Modrm|ImmExt, { RegXMM|WordMem, RegXMM, 0 } },
+{"cmpltps", 2, 0x0fc2, 1, FP|Modrm|ImmExt, { RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpltss", 2, 0xf30fc2, 1, FP|Modrm|ImmExt, { RegXMM|WordMem, RegXMM, 0 } },
+{"cmpleps", 2, 0x0fc2, 2, FP|Modrm|ImmExt, { RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpless", 2, 0xf30fc2, 2, FP|Modrm|ImmExt, { RegXMM|WordMem, RegXMM, 0 } },
+{"cmpunordps",2, 0x0fc2, 3, FP|Modrm|ImmExt, { RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpunordss",2, 0xf30fc2, 3, FP|Modrm|ImmExt, { RegXMM|WordMem, RegXMM, 0 } },
+{"cmpneqps", 2, 0x0fc2, 4, FP|Modrm|ImmExt, { RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpneqss", 2, 0xf30fc2, 4, FP|Modrm|ImmExt, { RegXMM|WordMem, RegXMM, 0 } },
+{"cmpnltps", 2, 0x0fc2, 5, FP|Modrm|ImmExt, { RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpnltss", 2, 0xf30fc2, 5, FP|Modrm|ImmExt, { RegXMM|WordMem, RegXMM, 0 } },
+{"cmpnleps", 2, 0x0fc2, 6, FP|Modrm|ImmExt, { RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpnless", 2, 0xf30fc2, 6, FP|Modrm|ImmExt, { RegXMM|WordMem, RegXMM, 0 } },
+{"cmpordps", 2, 0x0fc2, 7, FP|Modrm|ImmExt, { RegXMM|LLongMem, RegXMM, 0 } },
+{"cmpordss", 2, 0xf30fc2, 7, FP|Modrm|ImmExt, { RegXMM|WordMem, RegXMM, 0 } },
+{"comiss", 2, 0x0f2f, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"cvtpi2ps", 2, 0x0f2a, X, FP|Modrm, { RegMMX|LLongMem, RegXMM, 0 } },
+{"cvtsi2ss", 2, 0xf30f2a, X, FP|Modrm, { Reg32|WordMem, RegXMM, 0 } },
+{"cvtps2pi", 2, 0x0f2d, X, FP|Modrm, { RegXMM|LLongMem, RegMMX, 0 } },
+{"cvtss2si", 2, 0xf30f2d, X, FP|Modrm, { RegXMM|WordMem, Reg32, 0 } },
+{"cvttps2pi", 2, 0x0f2c, X, FP|Modrm, { RegXMM|LLongMem, RegMMX, 0 } },
+{"cvttss2si", 2, 0xf30f2c, X, FP|Modrm, { RegXMM|WordMem, Reg32, 0 } },
+{"divps", 2, 0x0f5e, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"divss", 2, 0xf30f5e, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"ldmxcsr", 1, 0x0fae, 2, FP|Modrm, { WordMem, 0, 0 } },
+{"stmxcsr", 1, 0x0fae, 3, FP|Modrm, { WordMem, 0, 0 } },
+{"sfence", 0, 0x0faef8, X, FP, { 0, 0, 0 } },
+{"maxps", 2, 0x0f5f, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"maxss", 2, 0xf30f5f, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"minps", 2, 0x0f5d, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"minss", 2, 0xf30f5d, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"movaps", 2, 0x0f28, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"movaps", 2, 0x0f29, X, FP|Modrm, { RegXMM, RegXMM|LLongMem, 0 } },
+{"movhlps", 2, 0x0f12, X, FP|Modrm, { RegXMM|InvMem, RegXMM, 0 } },
+{"movhps", 2, 0x0f16, X, FP|Modrm, { LLongMem, RegXMM, 0 } },
+{"movhps", 2, 0x0f17, X, FP|Modrm, { RegXMM, LLongMem, 0 } },
+{"movlhps", 2, 0x0f16, X, FP|Modrm, { RegXMM|InvMem, RegXMM, 0 } },
+{"movlps", 2, 0x0f12, X, FP|Modrm, { LLongMem, RegXMM, 0 } },
+{"movlps", 2, 0x0f13, X, FP|Modrm, { RegXMM, LLongMem, 0 } },
+{"movmskps", 2, 0x0f50, X, FP|Modrm, { RegXMM|InvMem, Reg32, 0 } },
+{"movups", 2, 0x0f10, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"movups", 2, 0x0f11, X, FP|Modrm, { RegXMM, RegXMM|LLongMem, 0 } },
+{"movss", 2, 0xf30f10, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"movss", 2, 0xf30f11, X, FP|Modrm, { RegXMM, RegXMM|WordMem, 0 } },
+{"mulps", 2, 0x0f59, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"mulss", 2, 0xf30f59, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"orps", 2, 0x0f56, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"rcpps", 2, 0x0f53, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"rcpss", 2, 0xf30f53, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"rsqrtps", 2, 0x0f52, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"rsqrtss", 2, 0xf30f52, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"shufps", 3, 0x0fc6, X, FP|Modrm, { Imm8, RegXMM|LLongMem, RegXMM } },
+{"sqrtps", 2, 0x0f51, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"sqrtss", 2, 0xf30f51, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"subps", 2, 0x0f5c, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"subss", 2, 0xf30f5c, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"ucomiss", 2, 0x0f2e, X, FP|Modrm, { RegXMM|WordMem, RegXMM, 0 } },
+{"unpckhps", 2, 0x0f15, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"unpcklps", 2, 0x0f14, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"xorps", 2, 0x0f57, X, FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
+{"pavgb", 2, 0x0fe0, X, FP|Modrm, { RegMMX|LLongMem, RegMMX, 0 } },
+{"pavgw", 2, 0x0fe3, X, FP|Modrm, { RegMMX|LLongMem, RegMMX, 0 } },
+{"pextrw", 3, 0x0fc5, X, FP|Modrm, { Imm8, RegMMX, Reg32|InvMem } },
+{"pinsrw", 3, 0x0fc4, X, FP|Modrm, { Imm8, Reg32|ShortMem, RegMMX } },
+{"pmaxsw", 2, 0x0fee, X, FP|Modrm, { RegMMX|LLongMem, RegMMX, 0 } },
+{"pmaxub", 2, 0x0fde, X, FP|Modrm, { RegMMX|LLongMem, RegMMX, 0 } },
+{"pminsw", 2, 0x0fea, X, FP|Modrm, { RegMMX|LLongMem, RegMMX, 0 } },
+{"pminub", 2, 0x0fda, X, FP|Modrm, { RegMMX|LLongMem, RegMMX, 0 } },
+{"pmovmskb", 2, 0x0fd7, X, FP|Modrm, { RegMMX, Reg32|InvMem, 0 } },
+{"pmulhuw", 2, 0x0fe4, X, FP|Modrm, { RegMMX|LLongMem, RegMMX, 0 } },
+{"psadbw", 2, 0x0ff6, X, FP|Modrm, { RegMMX|LLongMem, RegMMX, 0 } },
+{"pshufw", 3, 0x0f70, X, FP|Modrm, { Imm8, RegMMX|LLongMem, RegMMX } },
+{"maskmovq", 2, 0x0ff7, X, FP|Modrm, { RegMMX|InvMem, RegMMX, 0 } },
+{"movntps", 2, 0x0f2b, X, FP|Modrm, { RegXMM, LLongMem, 0 } },
+{"movntq", 2, 0x0fe7, X, FP|Modrm, { RegMMX, LLongMem, 0 } },
+{"prefetchnta", 1, 0x0f18, 0, FP|Modrm, { LLongMem, 0, 0 } },
+{"prefetcht0", 1, 0x0f18, 1, FP|Modrm, { LLongMem, 0, 0 } },
+{"prefetcht1", 1, 0x0f18, 2, FP|Modrm, { LLongMem, 0, 0 } },
+{"prefetcht2", 1, 0x0f18, 3, FP|Modrm, { LLongMem, 0, 0 } },
+
/* AMD 3DNow! instructions */
-#define AMD_3DNOW_OPCODE 0x0f0f
-
-{"prefetch", 1, 0x0f0d, 0, NoSuf|Modrm, { ByteMem, 0, 0 } },
-{"prefetchw",1, 0x0f0d, 1, NoSuf|Modrm, { ByteMem, 0, 0 } },
-{"femms", 0, 0x0f0e, X, NoSuf, { 0, 0, 0 } },
-{"pavgusb", 2, 0x0f0f, 0xbf, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pf2id", 2, 0x0f0f, 0x1d, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfacc", 2, 0x0f0f, 0xae, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfadd", 2, 0x0f0f, 0x9e, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfcmpeq", 2, 0x0f0f, 0xb0, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfcmpge", 2, 0x0f0f, 0x90, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfcmpgt", 2, 0x0f0f, 0xa0, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfmax", 2, 0x0f0f, 0xa4, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfmin", 2, 0x0f0f, 0x94, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfmul", 2, 0x0f0f, 0xb4, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfrcp", 2, 0x0f0f, 0x96, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfrcpit1", 2, 0x0f0f, 0xa6, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfrcpit2", 2, 0x0f0f, 0xb6, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfrsqit1", 2, 0x0f0f, 0xa7, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfrsqrt", 2, 0x0f0f, 0x97, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfsub", 2, 0x0f0f, 0x9a, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pfsubr", 2, 0x0f0f, 0xaa, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pi2fd", 2, 0x0f0f, 0x0d, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
-{"pmulhrw", 2, 0x0f0f, 0xb7, NoSuf|Modrm, { RegMMX|LongMem, RegMMX, 0 } },
+
+{"prefetch", 1, 0x0f0d, 0, FP|Modrm, { ByteMem, 0, 0 } },
+{"prefetchw",1, 0x0f0d, 1, FP|Modrm, { ByteMem, 0, 0 } },
+{"femms", 0, 0x0f0e, X, FP, { 0, 0, 0 } },
+{"pavgusb", 2, 0x0f0f, 0xbf, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pf2id", 2, 0x0f0f, 0x1d, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfacc", 2, 0x0f0f, 0xae, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfadd", 2, 0x0f0f, 0x9e, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfcmpeq", 2, 0x0f0f, 0xb0, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfcmpge", 2, 0x0f0f, 0x90, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfcmpgt", 2, 0x0f0f, 0xa0, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfmax", 2, 0x0f0f, 0xa4, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfmin", 2, 0x0f0f, 0x94, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfmul", 2, 0x0f0f, 0xb4, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfrcp", 2, 0x0f0f, 0x96, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfrcpit1", 2, 0x0f0f, 0xa6, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfrcpit2", 2, 0x0f0f, 0xb6, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfrsqit1", 2, 0x0f0f, 0xa7, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfrsqrt", 2, 0x0f0f, 0x97, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfsub", 2, 0x0f0f, 0x9a, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pfsubr", 2, 0x0f0f, 0xaa, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pi2fd", 2, 0x0f0f, 0x0d, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
+{"pmulhrw", 2, 0x0f0f, 0xb7, FP|Modrm|ImmExt, { RegMMX|LongMem, RegMMX, 0 } },
{NULL, 0, 0, 0, 0, { 0, 0, 0} } /* sentinel */
};
#undef X
-#undef ReverseModrm
#undef NoSuf
#undef b_Suf
#undef w_Suf
@@ -1047,7 +1133,15 @@ static const reg_entry i386_regtab[] = {
{"mm4", RegMMX, 4},
{"mm5", RegMMX, 5},
{"mm6", RegMMX, 6},
- {"mm7", RegMMX, 7}
+ {"mm7", RegMMX, 7},
+ {"xmm0", RegXMM, 0},
+ {"xmm1", RegXMM, 1},
+ {"xmm2", RegXMM, 2},
+ {"xmm3", RegXMM, 3},
+ {"xmm4", RegXMM, 4},
+ {"xmm5", RegXMM, 5},
+ {"xmm6", RegXMM, 6},
+ {"xmm7", RegXMM, 7}
};
#define MAX_REG_NAME_SIZE 8 /* for parsing register names from input */
diff --git a/include/opcode/m68k.h b/include/opcode/m68k.h
index ecb3f95dd96..3208b77f4f0 100644
--- a/include/opcode/m68k.h
+++ b/include/opcode/m68k.h
@@ -1,5 +1,5 @@
/* Opcode table header for m680[01234]0/m6888[12]/m68851.
- Copyright 1989, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation.
+ Copyright 1989, 91, 92, 93, 94, 95, 96, 97, 1999 Free Software Foundation.
This file is part of GDB, GAS, and the GNU binutils.
@@ -36,6 +36,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define m68851 0x080
#define cpu32 0x100 /* e.g., 68332 */
#define mcf5200 0x200
+#define mcf5206e 0x400
+#define mcf5307 0x800
/* handy aliases */
#define m68040up (m68040 | m68060)
@@ -43,6 +45,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define m68020up (m68020 | m68030up)
#define m68010up (m68010 | cpu32 | m68020up)
#define m68000up (m68000 | m68010up)
+#define mcf (mcf5200 | mcf5206e | mcf5307)
#define mfloat (m68881 | m68882 | m68040 | m68060)
#define mmmu (m68851 | m68030 | m68040 | m68060)
@@ -87,7 +90,7 @@ struct m68k_opcode_alias
operand; the second, the place it is stored. */
/* Kinds of operands:
- Characters used: AaBCcDdFfIJkLlMmnOopQqRrSsTtUVvWXYZ0123|*~%;@!&$?/<>#^+-
+ Characters used: AaBCcDdEFfGHIJkLlMmnOopQqRrSsTtU VvWXYZ0123|*~%;@!&$?/<>#^+-
D data register only. Stored as 3 bits.
A address register only. Stored as 3 bits.
@@ -121,6 +124,9 @@ struct m68k_opcode_alias
C the CCR. No need to store it; this is just for filtering validity.
S the SR. No need to store, just as with CCR.
U the USP. No need to store, just as with CCR.
+ E the ACC. No need to store, just as with CCR.
+ G the MACSR. No need to store, just as with CCR.
+ H the MASK. No need to store, just as with CCR.
I Coprocessor ID. Not printed if 1. The Coprocessor ID is always
extracted from the 'd' field of word one, which means that an extended
@@ -170,6 +176,9 @@ struct m68k_opcode_alias
for both caches. Used in cinv and cpush. Always
stored in position "d".
+ u Any register, with ``upper'' or ``lower'' specification. Used
+ in the mac instructions with size word.
+
The remainder are all stored as 6 bits using an address mode and a
register number; they differ in which addressing modes they match.
@@ -260,6 +269,8 @@ struct m68k_opcode_alias
*/
/* Places to put an operand, for non-general operands:
+ Characters used: BbCcDdghijkLlMmNnostWw123456789
+
s source, low bits of first word.
d dest, shifted 9 in first word
1 second word, shifted 12
@@ -293,6 +304,24 @@ struct m68k_opcode_alias
C floating point coprocessor constant - 7 bits. Also used for static
K-factors...
j Movec register #, stored in 12 low bits of second word.
+ m For M[S]ACx; 4 bits split with MSB shifted 6 bits in first word
+ and remaining 3 bits of register shifted 9 bits in first word.
+ Indicate upper/lower in 1 bit shifted 7 bits in second word.
+ Use with `R' or `u' format.
+ n `m' withouth upper/lower indication. (For M[S]ACx; 4 bits split
+ with MSB shifted 6 bits in first word and remaining 3 bits of
+ register shifted 9 bits in first word. No upper/lower
+ indication is done.) Use with `R' or `u' format.
+ o For M[S]ACw; 4 bits shifted 12 in second word (like `1').
+ Indicate upper/lower in 1 bit shifted 7 bits in second word.
+ Use with `R' or `u' format.
+ M For M[S]ACw; 4 bits in low bits of first word. Indicate
+ upper/lower in 1 bit shifted 6 bits in second word. Use with
+ `R' or `u' format.
+ N For M[S]ACw; 4 bits in low bits of second word. Indicate
+ upper/lower in 1 bit shifted 6 bits in second word. Use with
+ `R' or `u' format.
+ h shift indicator (scale factor), 1 bit shifted 10 in second word
Places to put operand, for general operands:
d destination, shifted 6 bits in first word
diff --git a/include/opcode/ppc.h b/include/opcode/ppc.h
index a9e3b24ab30..974f0dfa569 100644
--- a/include/opcode/ppc.h
+++ b/include/opcode/ppc.h
@@ -85,6 +85,9 @@ extern const int powerpc_num_opcodes;
for the assembler's -many option, and it eliminates duplicates). */
#define PPC_OPCODE_ANY (0200)
+/* Opcode is supported as part of the 64-bit bridge. */
+#define PPC_OPCODE_64_BRIDGE (0400)
+
/* A macro to extract the major opcode from an instruction. */
#define PPC_OP(i) (((i) >> 26) & 0x3f)
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 2302da3a89a..b2dc2ba3458 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,19 +1,109 @@
-1999-04-29 Nick Clifton <nickc@cygnus.com>
+1999-05-30 Cort Dougan <cort@attis.cs.nmt.edu>
- * emulparams/elf32mcore.sh (OTHER_BSS_SYMBOLS): Define.
- (OTHER_BSS_END_SYMBOLS): Define.
+ * Makefile.am (ALL_EMULATIONS): Add eelf32ppclinux.o.
+ * configure.tgt (powerpc-*-linux-gnu): Use it.
+ * emulparams/elf32ppclinux.sh: New file.
- * scripttempl/mcorepe.sc: New file: Duplicte of pe.sc with stack
- section added.
+1999-05-29 Ian Lance Taylor <ian@zembu.com>
-1999-04-26 Tom Tromey <tromey@cygnus.com>
+ * ld.texinfo (Options): Clarify that options which refer to files
+ must be properly ordered.
- * aclocal.m4, configure: Updated for new version of libtool.
+1999-05-29 Nick Clifton <nickc@cygnus.com>
+
+ * emultempl/armelf.em (..._parse_args): New function: Parse
+ command line option. Accept arm-elf specific command line option
+ '-p' or '--no-pipeline-knowledge'.
+ (..._list_options): New function: Describe the new command line
+ option.
+ (..._before_allocation): Pass the value of the new variable
+ no_pipeline_knowledge to bfd_elf32_arm_process_before_allocation.
+
+ * emultemp/armelf_oabi.em (..._before_allocation): Pass zero as
+ the third parameter to bfd_elf32_arm_process_before_allocation.
+
+1999-05-28 Nick Clifton <nickc@cygnus.com>
+
+ * lexsup.c (help): Minor formatting changes.
+
+1999-05-28 Martin Dorey <mdorey@madge.com>
+
+ * configure.tgt (i960-*-elf*): New target.
+ * emulparams/elf32_i960.sh: New file.
+ * Makefile.am (ALL_EMULATIONS): Add eelf32_i960.o.
+ (eelf32_i960.c): New target.
+ * Makefile.in: Rebuild.
+
+1999-05-26 Nick Clifton <nickc@cygnus.com>
+
+ * emulparams/armelf_oabi.sh (TEMPLATE_NAME): Set to armelf_oabi.
+
+1999-05-24 Philip Blundell <philb@gnu.org>
+
+ * emultempl/armelf.em (before_parse): Set config.dynamic_link and
+ config.has_shared.
+ * emulparams/armelf.sh (GENERATE_SHLIB_SCRIPT): Define.
+ * emulparams/armelf_linux.sh (GENERATE_SHLIB_SCRIPT): Likewise.
+
+1999-04-13 Philip Blundell <philb@gnu.org>
+
+ * emultempl/armelf.em: Add definitions related to shared objects
+ (copied from elf32.em).
+
+Wed May 19 12:44:26 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
+
+ * Makefile.am (ALL_EMULATIONS): Remove earmlinux.o and
+ earm26linux.o, add earmelf_linux.o and earmelf_linux26.o.
+ * Makefile.in: Regenerated.
+
+1999-05-16 Nick Clifton <nickc@cygnus.com>
-1999-04-22 Nick Clifton <nickc@cygnus.com>
+ * emulparams/elf32mcore.sh (GENERATE_SHLIB_SCRIPT): Define.
+ (TEMPLATE_NAME): Define.
- * emulparams/elf32mcore.sh (OTHER_RELOCATING_SECTIONS): Define to
- generate _stack section.
+Thu May 13 09:48:09 1999 Joel Sherrill (joel@OARcorp.com)
+
+ * configure.tgt (i386-*-rtemself*, sh-*-rtemself*): New targets.
+ (mips*el-*-rtems*, powerpcle-*-rtems*): New targets.
+
+1999-05-10 DJ Delorie <dj@cygnus.com>
+
+ * scripttempl/pe.sc: Specify the output arch, which Ian says is
+ the Right Thing to do.
+
+ * emultempl/pe.em: various changes to parameterize the
+ target-specific information.
+ (gld_i386pe_after_open): Detect and fix MS import libraries
+ by renaming the member objects (which are all named the same).
+
+ * pe-dll.c: various changes to parameterize the target-specific
+ information.
+ (generate_reloc): support relocs more generically to allow for
+ expansion.
+ (pe_exe_build_sections): new; used to add .relocs to .exes
+ (pe_exe_fill_sections): ditto
+
+1999-05-10 Catherine Moore <clm@cygnus.com>
+
+ * emultempl/pe.em (gld_${EMULATION_NAME}_after_open):
+ Check for TARGET_IS_arm_epoc_pe.
+ (gld_${EMULATION_NAME}_before_allocation): Likewise.
+
+1999-05-12 Anthony Green <green@cygnus.com>
+
+ * ldlang.c (walk_wild, walk_wild_file, walk_wild_section,
+ output_section_callback, gc_section_callback): New functions for
+ generic section walks.
+ (wild, lang_gc_wild): Use walk_wild.
+ (wild_file, lang_gc_wild_file): Deleted. Common logic moved to
+ walk_wild_file.
+ (wild_section, lang_gc_wild_section): Deleted. Common logic moved
+ to walk_fild_section. Unique logic moved into callbacks
+ output_section_callback and gc_section_callback.
+
+1999-04-26 Tom Tromey <tromey@cygnus.com>
+
+ * aclocal.m4, configure: Updated for new version of libtool.
1999-04-12 Philip Blundell <pb@nexus.co.uk>
@@ -57,17 +147,6 @@
* ldmain.c (main): Init link_info.no_undefined.
* lexsup.c: Add command-line option --no-undefined.
-1999-04-08 Nick Clifton <nickc@cygnus.com>
-
- * configure.tgt: Add support for MCore targets.
- * Makefile.am: Add support for MCore targets.
- * Makefile.in: Regenerate.
-
- * emulparams/elf32mcore.sh: New file: Definitions for mcore-elf
- target.
- * emulparams/mcorepe.sh: New file: Definitions for mcore-pe
- target.
-
1999-04-06 Ian Lance Taylor <ian@zembu.com>
* ld.h (LC_MESSAGES): Never define.
diff --git a/ld/Makefile.am b/ld/Makefile.am
index 1f02098730d..d7e34a799c8 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -103,8 +103,8 @@ ALL_EMULATIONS = \
earcelf.o \
earmelf.o \
earmelf_oabi.o \
- earmlinux.o \
- earm26linux.o \
+ earmelf_linux.o \
+ earmelf_linux26.o \
earmaoutb.o \
earmaoutl.o \
earmcoff.o \
@@ -117,6 +117,7 @@ ALL_EMULATIONS = \
edelta68.o \
eebmon29k.o \
eelf32_sparc.o \
+ eelf32_i960.o \
eelf32b4300.o \
eelf32bmip.o \
eelf32ebmip.o \
@@ -125,6 +126,7 @@ ALL_EMULATIONS = \
eelf32lmip.o \
eelf32lppc.o \
eelf32ppc.o \
+ eelf32ppclinux.o \
eelf_i386.o \
eelf_i386_be.o \
egld960.o \
@@ -334,6 +336,9 @@ em32relf.c: $(srcdir)/emulparams/m32relf.sh \
eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)"
+eelf32_i960.c: $(srcdir)/emulparams/elf32_i960.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32_i960 "$(tdir_elf32_i960)"
eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)"
@@ -364,6 +369,9 @@ eelf32lsmip.c: $(srcdir)/emulparams/elf32lsmip.sh \
eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ppc "$(tdir_elf32ppc)"
+eelf32ppclinux.c: $(srcdir)/emulparams/elf32ppclinux.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32ppclinux "$(tdir_elf32ppclinux)"
eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)"
diff --git a/ld/Makefile.in b/ld/Makefile.in
index e5961ae226f..e39dd97140f 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
@@ -46,9 +46,10 @@ AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_FLAG =
transform = @program_transform_name@
NORMAL_INSTALL = :
@@ -143,49 +144,19 @@ HOSTING_LIBS = @HOSTING_LIBS@
HOSTING_EMU = -m $(EMUL)
# Setup the testing framework, if you have one
-EXPECT = `if [ -f $$r/../expect/expect ] ; \
- then echo $$r/../expect/expect ; \
- else echo expect ; fi`
+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`
+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 \
- echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \
- else \
- echo $$r/../gcc/xgcc -B$$r/../gcc/; \
- fi; \
- else \
- if [ "@host@" = "@target@" ] ; then \
- echo $(CC); \
- else \
- echo gcc | sed '$(transform)'; \
- fi; \
- fi`
+CC_FOR_TARGET = ` if [ -f $$r/../gcc/xgcc ] ; then if [ -f $$r/../newlib/Makefile ] ; then echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; else echo $$r/../gcc/xgcc -B$$r/../gcc/; fi; else if [ "@host@" = "@target@" ] ; then echo $(CC); else echo gcc | sed '$(transform)'; fi; fi`
CXX = gcc
-CXX_FOR_TARGET = ` \
- if [ -f $$r/../gcc/xgcc ] ; then \
- if [ -f $$r/../newlib/Makefile ] ; then \
- echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \
- else \
- echo $$r/../gcc/xgcc -B$$r/../gcc/; \
- fi; \
- else \
- if [ "@host@" = "@target@" ] ; then \
- echo $(CXX); \
- else \
- echo gcc | sed '$(transform)'; \
- fi; \
- fi`
+CXX_FOR_TARGET = ` if [ -f $$r/../gcc/xgcc ] ; then if [ -f $$r/../newlib/Makefile ] ; then echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; else echo $$r/../gcc/xgcc -B$$r/../gcc/; fi; else if [ "@host@" = "@target@" ] ; then echo $(CXX); else echo gcc | sed '$(transform)'; fi; fi`
noinst_PROGRAMS = ld-new
@@ -198,141 +169,25 @@ INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) -I$(to
BFDLIB = ../bfd/libbfd.la
LIBIBERTY = ../libiberty/libiberty.a
-ALL_EMULATIONS = \
- ea29k.o \
- eaixppc.o \
- eaixrs6.o \
- ealpha.o \
- earcelf.o \
- earmelf.o \
- earmelf_oabi.o \
- earmlinux.o \
- earm26linux.o \
- earmaoutb.o \
- earmaoutl.o \
- earmcoff.o \
- earmpe.o \
- ecoff_sparc.o \
- ed10velf.o \
- ed30velf.o \
- ed30v_e.o \
- ed30v_o.o \
- edelta68.o \
- eebmon29k.o \
- eelf32_sparc.o \
- eelf32b4300.o \
- eelf32bmip.o \
- eelf32ebmip.o \
- eelf32elmip.o \
- eelf32l4300.o \
- eelf32lmip.o \
- eelf32lppc.o \
- eelf32ppc.o \
- eelf_i386.o \
- eelf_i386_be.o \
- egld960.o \
- egld960coff.o \
- eelf32fr30.o \
- eelf32mcore.o \
- ego32.o \
- eh8300.o \
- eh8300h.o \
- eh8300s.o \
- eh8500.o \
- eh8500b.o \
- eh8500c.o \
- eh8500m.o \
- eh8500s.o \
- ehp300bsd.o \
- ehp3hpux.o \
- ehppaelf.o \
- ei386aout.o \
- ei386beos.o \
- ei386bsd.o \
- ei386coff.o \
- ei386go32.o \
- ei386linux.o \
- ei386lynx.o \
- ei386mach.o \
- ei386moss.o \
- ei386msdos.o \
- ei386nbsd.o \
- ei386nw.o \
- ei386pe.o \
- elnk960.o \
- em68k4knbsd.o \
- em68kaout.o \
- em68kaux.o \
- em68kcoff.o \
- em68kelf.o \
- em68klinux.o \
- em68klynx.o \
- em68knbsd.o \
- em68kpsos.o \
- em88kbcs.o \
- emcorepe.o \
- emipsbig.o \
- emipsbsd.o \
- emipsidt.o \
- emipsidtl.o \
- emipslit.o \
- emipslnews.o \
- enews.o \
- ens32knbsd.o \
- epc532macha.o \
- eppcmacos.o \
- eppcnw.o \
- eppcpe.o \
- eriscix.o \
- esa29200.o \
- esh.o \
- eshelf.o \
- eshlelf.o \
- eshl.o \
- esparcaout.o \
- esparclinux.o \
- esparclynx.o \
- esparcnbsd.o \
- est2000.o \
- esun3.o \
- esun4.o \
- etic30aout.o \
- etic30coff.o \
- etic80coff.o \
- evanilla.o \
- evax.o \
- evsta.o \
- ew65.o \
- ez8001.o \
- ez8002.o
-
-
-ALL_64_EMULATIONS = \
- eelf64_sparc.o \
- eelf64alpha.o
-
-
-ALL_EMUL_EXTRA_OFILES = \
- pe-dll.o \
- deffilep.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
+ALL_EMULATIONS = ea29k.o eaixppc.o eaixrs6.o ealpha.o earcelf.o earmelf.o earmelf_oabi.o earmelf_linux.o earmelf_linux26.o earmaoutb.o earmaoutl.o earmcoff.o earmpe.o ecoff_sparc.o ed10velf.o ed30velf.o ed30v_e.o ed30v_o.o edelta68.o eebmon29k.o eelf32_sparc.o eelf32_i960.o eelf32b4300.o eelf32bmip.o eelf32ebmip.o eelf32elmip.o eelf32l4300.o eelf32lmip.o eelf32lppc.o eelf32ppc.o eelf32ppclinux.o eelf_i386.o eelf_i386_be.o egld960.o egld960coff.o eelf32fr30.o eelf32mcore.o ego32.o eh8300.o eh8300h.o eh8300s.o eh8500.o eh8500b.o eh8500c.o eh8500m.o eh8500s.o ehp300bsd.o ehp3hpux.o ehppaelf.o ei386aout.o ei386beos.o ei386bsd.o ei386coff.o ei386go32.o ei386linux.o ei386lynx.o ei386mach.o ei386moss.o ei386msdos.o ei386nbsd.o ei386nw.o ei386pe.o elnk960.o em68k4knbsd.o em68kaout.o em68kaux.o em68kcoff.o em68kelf.o em68klinux.o em68klynx.o em68knbsd.o em68kpsos.o em88kbcs.o emcorepe.o emipsbig.o emipsbsd.o emipsidt.o emipsidtl.o emipslit.o emipslnews.o enews.o ens32knbsd.o epc532macha.o eppcmacos.o eppcnw.o eppcpe.o eriscix.o esa29200.o esh.o eshelf.o eshlelf.o eshl.o esparcaout.o esparclinux.o esparclynx.o esparcnbsd.o est2000.o esun3.o esun4.o etic30aout.o etic30coff.o etic80coff.o evanilla.o evax.o evsta.o ew65.o ez8001.o ez8002.o
+
+
+ALL_64_EMULATIONS = eelf64_sparc.o eelf64alpha.o
+
+
+ALL_EMUL_EXTRA_OFILES = pe-dll.o deffilep.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
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}
+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
@@ -348,8 +203,7 @@ POTFILES = $(CFILES) $(HFILES) $(EMULATION_FILES)
GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ ${EMUL} "@NATIVE_LIB_DIRS@"
GEN_DEPENDS = $(srcdir)/genscripts.sh $(srcdir)/emultempl/stringify.sed
-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_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)
@@ -359,8 +213,7 @@ TESTBFDLIB = @TESTBFDLIB@
MAINTAINERCLEANFILES = ldver.texi
-MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \
- ldemul-list.h crtbegin.o crtend.o ld.log ld.sum
+MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) ldemul-list.h crtbegin.o crtend.o ld.log ld.sum
CLEANFILES = dep.sed .dep .dep1
@@ -407,7 +260,7 @@ ldgram.c ldlex.c
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
+TAR = gtar
GZIP_ENV = --best
SOURCES = $(ld_new_SOURCES)
OBJECTS = $(ld_new_OBJECTS)
@@ -795,7 +648,7 @@ 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 $$/$$file $(distdir)/$$file; \
+ cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
@@ -864,7 +717,7 @@ 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
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
installdirs: installdirs-recursive
installdirs-am:
$(mkinstalldirs) $(DESTDIR)$(mandir)/man1
@@ -1033,6 +886,9 @@ em32relf.c: $(srcdir)/emulparams/m32relf.sh \
eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)"
+eelf32_i960.c: $(srcdir)/emulparams/elf32_i960.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32_i960 "$(tdir_elf32_i960)"
eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)"
@@ -1063,6 +919,9 @@ eelf32lsmip.c: $(srcdir)/emulparams/elf32lsmip.sh \
eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ppc "$(tdir_elf32ppc)"
+eelf32ppclinux.c: $(srcdir)/emulparams/elf32ppclinux.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32ppclinux "$(tdir_elf32ppclinux)"
eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)"
diff --git a/ld/configure.tgt b/ld/configure.tgt
index d0555cebab2..c85d834de8a 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -59,6 +59,7 @@ i960-wrs-vxworks*) targ_emul=gld960 ;;
i960-*-coff) targ_emul=gld960coff ;;
i960-intel-nindy) targ_emul=gld960 ;;
i960-*-rtems*) targ_emul=gld960coff ;;
+i960-*-elf*) targ_emul=elf32_i960 ;;
m32r-*-*) targ_emul=m32relf ;;
m68*-sun-sunos[34]*) targ_emul=sun3 ;;
m68*-wrs-vxworks*) targ_emul=sun3 ;;
@@ -74,6 +75,7 @@ i[3456]86-*-sco*) targ_emul=i386coff ;;
i[3456]86-*-isc*) targ_emul=i386coff ;;
i[3456]86-*-lynxos*) targ_emul=i386lynx ;;
i[3456]86-*-coff) targ_emul=i386coff ;;
+i[3456]86-*-rtemself*) targ_emul=elf_i386 ;;
i[3456]86-*-rtems*) targ_emul=i386coff ;;
i[3456]86-*-bsd) targ_emul=i386bsd ;;
i[3456]86-*-bsd386) targ_emul=i386bsd ;;
@@ -140,7 +142,8 @@ h8500-*-hms* | h8500-*-coff*)
targ_emul=h8500
targ_extra_emuls="h8500s h8500b h8500m h8500c"
;;
-sh-*-elf*) targ_emul=shelf
+sh-*-elf* | sh-*-rtemself*)
+ targ_emul=shelf
targ_extra_emuls="shlelf sh shl"
;;
sh-*-*|sh-*-rtems*) targ_emul=sh; targ_extra_emuls=shl ;;
@@ -186,6 +189,7 @@ mips*vr5000el-*-elf*) targ_emul=elf32l4300 ;;
mips*vr5000-*-elf*) targ_emul=elf32b4300 ;;
mips*el-*-elf*) targ_emul=elf32elmip ;;
mips*-*-elf*) targ_emul=elf32ebmip ;;
+mips*el-*-rtems*) targ_emul=elf32elmip ;;
mips*-*-rtems*) targ_emul=elf32ebmip ;;
mips*-*-vxworks*) targ_emul=elf32ebmip ;;
mips*el-*-linux-gnu*) targ_emul=elf32lsmip
@@ -210,12 +214,14 @@ alpha*-*-netbsd*) targ_emul=elf64alpha ;;
z8k-*-coff) targ_emul=z8002; targ_extra_emuls=z8001 ;;
ns32k-pc532-mach* | ns32k-pc532-ux*) targ_emul=pc532macha ;;
ns32k-pc532-netbsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd ;;
-powerpc-*-elf* | powerpc-*-eabi* | powerpc-*-linux-gnu* | powerpc-*-sysv* \
+powerpc-*-linux-gnu*) targ_emul=elf32ppclinux; targ_extra_emuls=elf32ppc;;
+powerpc-*-elf* | powerpc-*-eabi* | powerpc-*-sysv* \
| powerpc-*-netbsd* | powerpc-*-vxworks*)
targ_emul=elf32ppc ;;
powerpcle-*-elf* | powerpcle-*-eabi* | powerpcle-*-solaris* \
| powerpcle-*-sysv* | powerpcle-*-vxworks*)
targ_emul=elf32lppc ;;
+powerpcle-*-rtems*) targ_emul=elf32leppc ;;
powerpc-*-rtems*) targ_emul=elf32ppc ;;
powerpc-*-macos*) targ_emul=ppcmacos ;;
powerpc-*-netware*) targ_emul=ppcnw ;;
diff --git a/ld/emulparams/armelf.sh b/ld/emulparams/armelf.sh
index 2b8b02bec81..a184b5e9aba 100644
--- a/ld/emulparams/armelf.sh
+++ b/ld/emulparams/armelf.sh
@@ -9,6 +9,7 @@ OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)'
OTHER_BSS_SYMBOLS='__bss_start__ = .;'
OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;'
+GENERATE_SHLIB_SCRIPT=yes
ARCH=arm
MACHINE=
diff --git a/ld/emulparams/armelf_linux.sh b/ld/emulparams/armelf_linux.sh
index 2d7d57bed25..a0d740b2318 100644
--- a/ld/emulparams/armelf_linux.sh
+++ b/ld/emulparams/armelf_linux.sh
@@ -6,6 +6,8 @@ LITTLE_OUTPUT_FORMAT="elf32-littlearm"
MAXPAGESIZE=0x8000
TEMPLATE_NAME=armelf
+GENERATE_SHLIB_SCRIPT=yes
+
OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)'
OTHER_BSS_SYMBOLS='__bss_start__ = .;'
OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;'
diff --git a/ld/emulparams/armelf_oabi.sh b/ld/emulparams/armelf_oabi.sh
index 257753ec88c..d568328d63a 100644
--- a/ld/emulparams/armelf_oabi.sh
+++ b/ld/emulparams/armelf_oabi.sh
@@ -4,7 +4,7 @@ OUTPUT_FORMAT="elf32-littlearm-oabi"
BIG_OUTPUT_FORMAT="elf32-bigarm-oabi"
LITTLE_OUTPUT_FORMAT="elf32-littlearm-oabi"
TEXT_START_ADDR=0x8000
-TEMPLATE_NAME=armelf
+TEMPLATE_NAME=armelf_oabi
OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)'
OTHER_BSS_SYMBOLS='__bss_start__ = .;'
OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;'
diff --git a/ld/emulparams/elf32_i960.sh b/ld/emulparams/elf32_i960.sh
new file mode 100644
index 00000000000..10ec3fa573b
--- /dev/null
+++ b/ld/emulparams/elf32_i960.sh
@@ -0,0 +1,8 @@
+SCRIPT_NAME=elf
+TEMPLATE_NAME=elf32
+OUTPUT_FORMAT="elf32-i960"
+ARCH=i960
+MACHINE=
+TEXT_START_ADDR=0
+EMBEDDED=yes
+MAXPAGESIZE=0x2000
diff --git a/ld/emulparams/elf32mcore.sh b/ld/emulparams/elf32mcore.sh
index 47d960f2413..bd1fdae04c6 100644
--- a/ld/emulparams/elf32mcore.sh
+++ b/ld/emulparams/elf32mcore.sh
@@ -8,13 +8,25 @@ MAXPAGESIZE=0x1000
TEXT_START_ADDR=0
NONPAGED_TEXT_START_ADDR=0
ARCH=mcore
-# 1211 == mov r1,r1
-NOP=0x1211
EMBEDDED=yes
+# There is a problem with the NOP value - it must work for both
+# big endian and little endian systems. Unfortunately there is
+# no symmetrical mcore opcode that functions as a noop. The
+# chosen solution is to use "tst r0, r14". This is a symetrical
+# value, and apart from the corruption of the C bit, it has no other
+# side effects. Since the carry bit is never tested without being
+# explicitly set first, and since the NOP code is only used as a
+# fill value between independantly viable peices of code, it should
+# not matter.
+NOP=0x0e0e
+
OTHER_BSS_SYMBOLS="__bss_start__ = . ;"
OTHER_BSS_END_SYMBOLS="__bss_end__ = . ;"
# Hmmm, there's got to be a better way. This sets the stack to the
# top of the simulator memory (2^19 bytes).
OTHER_RELOCATING_SECTIONS='.stack 0x80000 : { _stack = .; *(.stack) }'
+
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
diff --git a/ld/emulparams/elf32ppclinux.sh b/ld/emulparams/elf32ppclinux.sh
new file mode 100644
index 00000000000..5808e4d61eb
--- /dev/null
+++ b/ld/emulparams/elf32ppclinux.sh
@@ -0,0 +1,8 @@
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+SCRIPT_NAME=elfppc
+OUTPUT_FORMAT="elf32-powerpc"
+TEXT_START_ADDR=0x10000000
+MAXPAGESIZE=0x40000
+ARCH=powerpc
+MACHINE=
diff --git a/ld/emultempl/armcoff.em b/ld/emultempl/armcoff.em
index 9955fdad643..351a4505060 100644
--- a/ld/emultempl/armcoff.em
+++ b/ld/emultempl/armcoff.em
@@ -43,7 +43,7 @@ static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
static void gld${EMULATION_NAME}_before_allocation PARAMS ((void));
static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
static int gld${EMULATION_NAME}_parse_args PARAMS((int, char **));
-static void gld_${EMULATION_NAME}_list_options PARAMS ((FILE *));
+static void gld${EMULATION_NAME}_list_options PARAMS ((FILE *));
/* If true, then interworking stubs which support calls to old, non-interworking
aware ARM code should be generated. */
diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em
index d9409f2ac7c..6512ee38c41 100644
--- a/ld/emultempl/armelf.em
+++ b/ld/emultempl/armelf.em
@@ -1,10 +1,11 @@
# This shell script emits a C file. -*- C -*-
# It does some substitutions.
+ELFSIZE=32
cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* emulate the original gld for the given ${EMULATION_NAME}
- Copyright (C) 1991, 93, 96, 97, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1991, 93, 96, 97, 98, 1999 Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
This file is part of GLD, the Gnu Linker.
@@ -38,10 +39,86 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "ldexp.h"
#include "ldlang.h"
+#include "ldgram.h"
+static boolean gld${EMULATION_NAME}_open_dynamic_archive
+ PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *));
+static void gld${EMULATION_NAME}_after_open PARAMS ((void));
+static void gld${EMULATION_NAME}_check_needed
+ PARAMS ((lang_input_statement_type *));
+static void gld${EMULATION_NAME}_stat_needed
+ PARAMS ((lang_input_statement_type *));
+static boolean gld${EMULATION_NAME}_search_needed
+ PARAMS ((const char *, const char *, int));
+static boolean gld${EMULATION_NAME}_try_needed PARAMS ((const char *, int));
+static void gld${EMULATION_NAME}_vercheck
+ PARAMS ((lang_input_statement_type *));
+static void gld${EMULATION_NAME}_find_statement_assignment
+ PARAMS ((lang_statement_union_type *));
+static void gld${EMULATION_NAME}_find_exp_assignment PARAMS ((etree_type *));
+static boolean gld${EMULATION_NAME}_place_orphan
+ PARAMS ((lang_input_statement_type *, asection *));
+static void gld${EMULATION_NAME}_place_section
+ PARAMS ((lang_statement_union_type *));
static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
static void gld${EMULATION_NAME}_before_allocation PARAMS ((void));
static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
+static int gld${EMULATION_NAME}_parse_args PARAMS((int, char **));
+static void gld${EMULATION_NAME}_list_options PARAMS ((FILE *));
+
+
+static int no_pipeline_knowledge = 0;
+
+static struct option longopts[] =
+{
+ { "no-pipeline-knowledge", no_argument, NULL, 'p'},
+ { NULL, no_argument, NULL, 0 }
+};
+
+static void
+gld${EMULATION_NAME}_list_options (file)
+ FILE * file;
+{
+ fprintf (file, _(" -p --no-pipeline-knowledge Stop the linker knowing about the pipeline length\n"));
+}
+
+static int
+gld${EMULATION_NAME}_parse_args (argc, argv)
+ int argc;
+ char ** argv;
+{
+ int longind;
+ int optc;
+ int prevoptind = optind;
+ int prevopterr = opterr;
+ int wanterror;
+ static int lastoptind = -1;
+
+ if (lastoptind != optind)
+ opterr = 0;
+
+ wanterror = opterr;
+ lastoptind = optind;
+
+ optc = getopt_long_only (argc, argv, "-p", longopts, & longind);
+ opterr = prevopterr;
+
+ switch (optc)
+ {
+ default:
+ if (wanterror)
+ xexit (1);
+ optind = prevoptind;
+ return 0;
+
+ case 'p':
+ no_pipeline_knowledge = 1;
+ break;
+ }
+
+ return 1;
+}
+
static void
gld${EMULATION_NAME}_before_parse ()
@@ -49,6 +126,915 @@ gld${EMULATION_NAME}_before_parse ()
#ifndef TARGET_ /* I.e., if not generic. */
ldfile_set_output_arch ("`echo ${ARCH}`");
#endif /* not TARGET_ */
+ config.dynamic_link = ${DYNAMIC_LINK-true};
+ config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`;
+}
+
+/* Try to open a dynamic archive. This is where we know that ELF
+ dynamic libraries have an extension of .so. */
+
+static boolean
+gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
+ const char *arch;
+ search_dirs_type *search;
+ lang_input_statement_type *entry;
+{
+ const char *filename;
+ char *string;
+
+ if (! entry->is_archive)
+ return false;
+
+ filename = entry->filename;
+
+ string = (char *) xmalloc (strlen (search->name)
+ + strlen (filename)
+ + strlen (arch)
+ + sizeof "/lib.so");
+
+ sprintf (string, "%s/lib%s%s.so", search->name, filename, arch);
+
+ if (! ldfile_try_open_bfd (string, entry))
+ {
+ free (string);
+ return false;
+ }
+
+ entry->filename = string;
+
+ /* We have found a dynamic object to include in the link. The ELF
+ backend linker will create a DT_NEEDED entry in the .dynamic
+ section naming this file. If this file includes a DT_SONAME
+ entry, it will be used. Otherwise, the ELF linker will just use
+ the name of the file. For an archive found by searching, like
+ this one, the DT_NEEDED entry should consist of just the name of
+ the file, without the path information used to find it. Note
+ that we only need to do this if we have a dynamic object; an
+ archive will never be referenced by a DT_NEEDED entry.
+
+ FIXME: This approach--using bfd_elf_set_dt_needed_name--is not
+ very pretty. I haven't been able to think of anything that is
+ pretty, though. */
+ if (bfd_check_format (entry->the_bfd, bfd_object)
+ && (entry->the_bfd->flags & DYNAMIC) != 0)
+ {
+ char *needed_name;
+
+ ASSERT (entry->is_archive && entry->search_dirs_flag);
+ needed_name = (char *) xmalloc (strlen (filename)
+ + strlen (arch)
+ + sizeof "lib.so");
+ sprintf (needed_name, "lib%s%s.so", filename, arch);
+ bfd_elf_set_dt_needed_name (entry->the_bfd, needed_name);
+ }
+
+ return true;
+}
+
+EOF
+if [ "x${host}" = "x${target}" ] ; then
+ if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
+cat >>e${EMULATION_NAME}.c <<EOF
+
+/* For a native linker, check the file /etc/ld.so.conf for directories
+ in which we may find shared libraries. /etc/ld.so.conf is really
+ only meaningful on Linux, but we check it on other systems anyhow. */
+
+static boolean gld${EMULATION_NAME}_check_ld_so_conf
+ PARAMS ((const char *, int));
+
+static boolean
+gld${EMULATION_NAME}_check_ld_so_conf (name, force)
+ const char *name;
+ int force;
+{
+ static boolean initialized;
+ static char *ld_so_conf;
+
+ if (! initialized)
+ {
+ FILE *f;
+
+ f = fopen ("/etc/ld.so.conf", FOPEN_RT);
+ if (f != NULL)
+ {
+ char *b;
+ size_t len, alloc;
+ int c;
+
+ len = 0;
+ alloc = 100;
+ b = (char *) xmalloc (alloc);
+
+ while ((c = getc (f)) != EOF)
+ {
+ if (len + 1 >= alloc)
+ {
+ alloc *= 2;
+ b = (char *) xrealloc (b, alloc);
+ }
+ if (c != ':'
+ && c != ' '
+ && c != '\t'
+ && c != '\n'
+ && c != ',')
+ {
+ b[len] = c;
+ ++len;
+ }
+ else
+ {
+ if (len > 0 && b[len - 1] != ':')
+ {
+ b[len] = ':';
+ ++len;
+ }
+ }
+ }
+
+ if (len > 0 && b[len - 1] == ':')
+ --len;
+
+ if (len > 0)
+ b[len] = '\0';
+ else
+ {
+ free (b);
+ b = NULL;
+ }
+
+ fclose (f);
+
+ ld_so_conf = b;
+ }
+
+ initialized = true;
+ }
+
+ if (ld_so_conf == NULL)
+ return false;
+
+ return gld${EMULATION_NAME}_search_needed (ld_so_conf, name, force);
+}
+
+EOF
+ fi
+fi
+cat >>e${EMULATION_NAME}.c <<EOF
+
+/* These variables are required to pass information back and forth
+ between after_open and check_needed and stat_needed and vercheck. */
+
+static struct bfd_link_needed_list *global_needed;
+static struct stat global_stat;
+static boolean global_found;
+static struct bfd_link_needed_list *global_vercheck_needed;
+static boolean global_vercheck_failed;
+
+static void
+gld${EMULATION_NAME}_after_open ()
+{
+ struct bfd_link_needed_list *needed, *l;
+
+ LANG_FOR_EACH_INPUT_STATEMENT (is)
+ {
+ /* The interworking bfd must be the last one to be processed */
+ if (!is->next)
+ bfd_elf32_arm_get_bfd_for_interworking (is->the_bfd, & link_info);
+ }
+
+ /* We only need to worry about this when doing a final link. */
+ if (link_info.relocateable || link_info.shared)
+ return;
+
+ /* Get the list of files which appear in DT_NEEDED entries in
+ dynamic objects included in the link (often there will be none).
+ For each such file, we want to track down the corresponding
+ library, and include the symbol table in the link. This is what
+ the runtime dynamic linker will do. Tracking the files down here
+ permits one dynamic object to include another without requiring
+ special action by the person doing the link. Note that the
+ needed list can actually grow while we are stepping through this
+ loop. */
+ needed = bfd_elf_get_needed_list (output_bfd, &link_info);
+ for (l = needed; l != NULL; l = l->next)
+ {
+ struct bfd_link_needed_list *ll;
+ int force;
+
+ /* If we've already seen this file, skip it. */
+ for (ll = needed; ll != l; ll = ll->next)
+ if (strcmp (ll->name, l->name) == 0)
+ break;
+ if (ll != l)
+ continue;
+
+ /* See if this file was included in the link explicitly. */
+ global_needed = l;
+ global_found = false;
+ lang_for_each_input_file (gld${EMULATION_NAME}_check_needed);
+ if (global_found)
+ continue;
+
+ /* We need to find this file and include the symbol table. We
+ want to search for the file in the same way that the dynamic
+ linker will search. That means that we want to use
+ rpath_link, rpath, then the environment variable
+ LD_LIBRARY_PATH (native only), then the linker script
+ LIB_SEARCH_DIRS. We do not search using the -L arguments.
+
+ We search twice. The first time, we skip objects which may
+ introduce version mismatches. The second time, we force
+ their use. See gld${EMULATION_NAME}_vercheck comment. */
+ for (force = 0; force < 2; force++)
+ {
+ const char *lib_path;
+ size_t len;
+ search_dirs_type *search;
+
+ if (gld${EMULATION_NAME}_search_needed (command_line.rpath_link,
+ l->name, force))
+ break;
+ if (gld${EMULATION_NAME}_search_needed (command_line.rpath,
+ l->name, force))
+ break;
+ if (command_line.rpath_link == NULL
+ && command_line.rpath == NULL)
+ {
+ lib_path = (const char *) getenv ("LD_RUN_PATH");
+ if (gld${EMULATION_NAME}_search_needed (lib_path, l->name,
+ force))
+ break;
+ }
+EOF
+if [ "x${host}" = "x${target}" ] ; then
+ if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
+cat >>e${EMULATION_NAME}.c <<EOF
+ lib_path = (const char *) getenv ("LD_LIBRARY_PATH");
+ if (gld${EMULATION_NAME}_search_needed (lib_path, l->name, force))
+ break;
+EOF
+ fi
+fi
+cat >>e${EMULATION_NAME}.c <<EOF
+ len = strlen (l->name);
+ for (search = search_head; search != NULL; search = search->next)
+ {
+ char *filename;
+
+ if (search->cmdline)
+ continue;
+ filename = (char *) xmalloc (strlen (search->name) + len + 2);
+ sprintf (filename, "%s/%s", search->name, l->name);
+ if (gld${EMULATION_NAME}_try_needed (filename, force))
+ break;
+ free (filename);
+ }
+ if (search != NULL)
+ break;
+EOF
+if [ "x${host}" = "x${target}" ] ; then
+ if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
+cat >>e${EMULATION_NAME}.c <<EOF
+ if (gld${EMULATION_NAME}_check_ld_so_conf (l->name, force))
+ break;
+EOF
+ fi
+fi
+cat >>e${EMULATION_NAME}.c <<EOF
+ }
+
+ if (force < 2)
+ continue;
+
+ einfo ("%P: warning: %s, needed by %B, not found (try using --rpath)\n",
+ l->name, l->by);
+ }
+}
+
+/* Search for a needed file in a path. */
+
+static boolean
+gld${EMULATION_NAME}_search_needed (path, name, force)
+ const char *path;
+ const char *name;
+ int force;
+{
+ const char *s;
+ size_t len;
+
+ if (path == NULL || *path == '\0')
+ return false;
+ len = strlen (name);
+ while (1)
+ {
+ char *filename, *sset;
+
+ s = strchr (path, ':');
+ if (s == NULL)
+ s = path + strlen (path);
+
+ filename = (char *) xmalloc (s - path + len + 2);
+ if (s == path)
+ sset = filename;
+ else
+ {
+ memcpy (filename, path, s - path);
+ filename[s - path] = '/';
+ sset = filename + (s - path) + 1;
+ }
+ strcpy (sset, name);
+
+ if (gld${EMULATION_NAME}_try_needed (filename, force))
+ return true;
+
+ free (filename);
+
+ if (*s == '\0')
+ break;
+ path = s + 1;
+ }
+
+ return false;
+}
+
+/* This function is called for each possible name for a dynamic object
+ named by a DT_NEEDED entry. The FORCE parameter indicates whether
+ to skip the check for a conflicting version. */
+
+static boolean
+gld${EMULATION_NAME}_try_needed (name, force)
+ const char *name;
+ int force;
+{
+ bfd *abfd;
+
+ abfd = bfd_openr (name, bfd_get_target (output_bfd));
+ if (abfd == NULL)
+ return false;
+ if (! bfd_check_format (abfd, bfd_object))
+ {
+ (void) bfd_close (abfd);
+ return false;
+ }
+ if ((bfd_get_file_flags (abfd) & DYNAMIC) == 0)
+ {
+ (void) bfd_close (abfd);
+ return false;
+ }
+
+ /* Check whether this object would include any conflicting library
+ versions. If FORCE is set, then we skip this check; we use this
+ the second time around, if we couldn't find any compatible
+ instance of the shared library. */
+
+ if (! force)
+ {
+ struct bfd_link_needed_list *needed;
+
+ if (! bfd_elf_get_bfd_needed_list (abfd, &needed))
+ einfo ("%F%P:%B: bfd_elf_get_bfd_needed_list failed: %E\n", abfd);
+
+ if (needed != NULL)
+ {
+ global_vercheck_needed = needed;
+ global_vercheck_failed = false;
+ lang_for_each_input_file (gld${EMULATION_NAME}_vercheck);
+ if (global_vercheck_failed)
+ {
+ (void) bfd_close (abfd);
+ /* Return false to force the caller to move on to try
+ another file on the search path. */
+ return false;
+ }
+
+ /* But wait! It gets much worse. On Linux, if a shared
+ library does not use libc at all, we are supposed to skip
+ it the first time around in case we encounter a shared
+ library later on with the same name which does use the
+ version of libc that we want. This is much too horrible
+ to use on any system other than Linux. */
+
+EOF
+case ${target} in
+ *-*-linux-gnu*)
+ cat >>e${EMULATION_NAME}.c <<EOF
+ {
+ struct bfd_link_needed_list *l;
+
+ for (l = needed; l != NULL; l = l->next)
+ if (strncmp (l->name, "libc.so", 7) == 0)
+ break;
+ if (l == NULL)
+ {
+ (void) bfd_close (abfd);
+ return false;
+ }
+ }
+
+EOF
+ ;;
+esac
+cat >>e${EMULATION_NAME}.c <<EOF
+ }
+ }
+
+ /* We've found a dynamic object matching the DT_NEEDED entry. */
+
+ /* We have already checked that there is no other input file of the
+ same name. We must now check again that we are not including the
+ same file twice. We need to do this because on many systems
+ libc.so is a symlink to, e.g., libc.so.1. The SONAME entry will
+ reference libc.so.1. If we have already included libc.so, we
+ don't want to include libc.so.1 if they are the same file, and we
+ can only check that using stat. */
+
+ if (bfd_stat (abfd, &global_stat) != 0)
+ einfo ("%F%P:%B: bfd_stat failed: %E\n", abfd);
+ global_found = false;
+ lang_for_each_input_file (gld${EMULATION_NAME}_stat_needed);
+ if (global_found)
+ {
+ /* Return true to indicate that we found the file, even though
+ we aren't going to do anything with it. */
+ return true;
+ }
+
+ /* Tell the ELF backend that don't want the output file to have a
+ DT_NEEDED entry for this file. */
+ bfd_elf_set_dt_needed_name (abfd, "");
+
+ /* Add this file into the symbol table. */
+ if (! bfd_link_add_symbols (abfd, &link_info))
+ einfo ("%F%B: could not read symbols: %E\n", abfd);
+
+ return true;
+}
+
+/* See if an input file matches a DT_NEEDED entry by name. */
+
+static void
+gld${EMULATION_NAME}_check_needed (s)
+ lang_input_statement_type *s;
+{
+ if (global_found)
+ return;
+
+ if (s->filename != NULL
+ && strcmp (s->filename, global_needed->name) == 0)
+ {
+ global_found = true;
+ return;
+ }
+
+ if (s->the_bfd != NULL)
+ {
+ const char *soname;
+
+ soname = bfd_elf_get_dt_soname (s->the_bfd);
+ if (soname != NULL
+ && strcmp (soname, global_needed->name) == 0)
+ {
+ global_found = true;
+ return;
+ }
+ }
+
+ if (s->search_dirs_flag
+ && s->filename != NULL
+ && strchr (global_needed->name, '/') == NULL)
+ {
+ const char *f;
+
+ f = strrchr (s->filename, '/');
+ if (f != NULL
+ && strcmp (f + 1, global_needed->name) == 0)
+ {
+ global_found = true;
+ return;
+ }
+ }
+}
+
+/* See if an input file matches a DT_NEEDED entry by running stat on
+ the file. */
+
+static void
+gld${EMULATION_NAME}_stat_needed (s)
+ lang_input_statement_type *s;
+{
+ struct stat st;
+ const char *suffix;
+ const char *soname;
+ const char *f;
+
+ if (global_found)
+ return;
+ if (s->the_bfd == NULL)
+ return;
+
+ if (bfd_stat (s->the_bfd, &st) != 0)
+ {
+ einfo ("%P:%B: bfd_stat failed: %E\n", s->the_bfd);
+ return;
+ }
+
+ if (st.st_dev == global_stat.st_dev
+ && st.st_ino == global_stat.st_ino)
+ {
+ global_found = true;
+ return;
+ }
+
+ /* We issue a warning if it looks like we are including two
+ different versions of the same shared library. For example,
+ there may be a problem if -lc picks up libc.so.6 but some other
+ shared library has a DT_NEEDED entry of libc.so.5. This is a
+ hueristic test, and it will only work if the name looks like
+ NAME.so.VERSION. FIXME: Depending on file names is error-prone.
+ If we really want to issue warnings about mixing version numbers
+ of shared libraries, we need to find a better way. */
+
+ if (strchr (global_needed->name, '/') != NULL)
+ return;
+ suffix = strstr (global_needed->name, ".so.");
+ if (suffix == NULL)
+ return;
+ suffix += sizeof ".so." - 1;
+
+ soname = bfd_elf_get_dt_soname (s->the_bfd);
+ if (soname == NULL)
+ soname = s->filename;
+
+ f = strrchr (soname, '/');
+ if (f != NULL)
+ ++f;
+ else
+ f = soname;
+
+ if (strncmp (f, global_needed->name, suffix - global_needed->name) == 0)
+ einfo ("%P: warning: %s, needed by %B, may conflict with %s\n",
+ global_needed->name, global_needed->by, f);
+}
+
+/* On Linux, it's possible to have different versions of the same
+ shared library linked against different versions of libc. The
+ dynamic linker somehow tags which libc version to use in
+ /etc/ld.so.cache, and, based on the libc that it sees in the
+ executable, chooses which version of the shared library to use.
+
+ We try to do a similar check here by checking whether this shared
+ library needs any other shared libraries which may conflict with
+ libraries we have already included in the link. If it does, we
+ skip it, and try to find another shared library farther on down the
+ link path.
+
+ This is called via lang_for_each_input_file.
+ GLOBAL_VERCHECK_NEEDED is the list of objects needed by the object
+ which we ar checking. This sets GLOBAL_VERCHECK_FAILED if we find
+ a conflicting version. */
+
+static void
+gld${EMULATION_NAME}_vercheck (s)
+ lang_input_statement_type *s;
+{
+ const char *soname, *f;
+ struct bfd_link_needed_list *l;
+
+ if (global_vercheck_failed)
+ return;
+ if (s->the_bfd == NULL
+ || (bfd_get_file_flags (s->the_bfd) & DYNAMIC) == 0)
+ return;
+
+ soname = bfd_elf_get_dt_soname (s->the_bfd);
+ if (soname == NULL)
+ soname = bfd_get_filename (s->the_bfd);
+
+ f = strrchr (soname, '/');
+ if (f != NULL)
+ ++f;
+ else
+ f = soname;
+
+ for (l = global_vercheck_needed; l != NULL; l = l->next)
+ {
+ const char *suffix;
+
+ if (strcmp (f, l->name) == 0)
+ {
+ /* Probably can't happen, but it's an easy check. */
+ continue;
+ }
+
+ if (strchr (l->name, '/') != NULL)
+ continue;
+
+ suffix = strstr (l->name, ".so.");
+ if (suffix == NULL)
+ continue;
+
+ suffix += sizeof ".so." - 1;
+
+ if (strncmp (f, l->name, suffix - l->name) == 0)
+ {
+ /* Here we know that S is a dynamic object FOO.SO.VER1, and
+ the object we are considering needs a dynamic object
+ FOO.SO.VER2, and VER1 and VER2 are different. This
+ appears to be a version mismatch, so we tell the caller
+ to try a different version of this library. */
+ global_vercheck_failed = true;
+ return;
+ }
+ }
+}
+
+/* Place an orphan section. We use this to put random SHF_ALLOC
+ sections in the right segment. */
+
+static asection *hold_section;
+static lang_output_section_statement_type *hold_use;
+static lang_output_section_statement_type *hold_text;
+static lang_output_section_statement_type *hold_rodata;
+static lang_output_section_statement_type *hold_data;
+static lang_output_section_statement_type *hold_bss;
+static lang_output_section_statement_type *hold_rel;
+static lang_output_section_statement_type *hold_interp;
+
+/*ARGSUSED*/
+static boolean
+gld${EMULATION_NAME}_place_orphan (file, s)
+ lang_input_statement_type *file;
+ asection *s;
+{
+ lang_output_section_statement_type *place;
+ asection *snew, **pps;
+ lang_statement_list_type *old;
+ lang_statement_list_type add;
+ etree_type *address;
+ const char *secname, *ps;
+ const char *outsecname;
+ lang_output_section_statement_type *os;
+
+ if ((s->flags & SEC_ALLOC) == 0)
+ return false;
+
+ /* Look through the script to see where to place this section. */
+ hold_section = s;
+ hold_use = NULL;
+ lang_for_each_statement (gld${EMULATION_NAME}_place_section);
+
+ if (hold_use != NULL)
+ {
+ /* We have already placed a section with this name. */
+ wild_doit (&hold_use->children, s, hold_use, file);
+ return true;
+ }
+
+ secname = bfd_get_section_name (s->owner, s);
+
+ /* If this is a final link, then always put .gnu.warning.SYMBOL
+ sections into the .text section to get them out of the way. */
+ if (! link_info.shared
+ && ! link_info.relocateable
+ && strncmp (secname, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0
+ && hold_text != NULL)
+ {
+ wild_doit (&hold_text->children, s, hold_text, file);
+ return true;
+ }
+
+ /* Decide which segment the section should go in based on the
+ section name and section flags. We put loadable .note sections
+ right after the .interp section, so that the PT_NOTE segment is
+ stored right after the program headers where the OS can read it
+ in the first page. */
+ place = NULL;
+ if (s->flags & SEC_EXCLUDE)
+ return false;
+ else if ((s->flags & SEC_LOAD) != 0
+ && strncmp (secname, ".note", 4) == 0
+ && hold_interp != NULL)
+ place = hold_interp;
+ else if ((s->flags & SEC_HAS_CONTENTS) == 0
+ && hold_bss != NULL)
+ place = hold_bss;
+ else if ((s->flags & SEC_READONLY) == 0
+ && hold_data != NULL)
+ place = hold_data;
+ else if (strncmp (secname, ".rel", 4) == 0
+ && hold_rel != NULL)
+ place = hold_rel;
+ else if ((s->flags & SEC_CODE) == 0
+ && (s->flags & SEC_READONLY) != 0
+ && hold_rodata != NULL)
+ place = hold_rodata;
+ else if ((s->flags & SEC_READONLY) != 0
+ && hold_text != NULL)
+ place = hold_text;
+ if (place == NULL)
+ return false;
+
+ /* Choose a unique name for the section. This will be needed if the
+ same section name appears in the input file with different
+ loadable or allocateable characteristics. */
+ outsecname = secname;
+ if (bfd_get_section_by_name (output_bfd, outsecname) != NULL)
+ {
+ unsigned int len;
+ char *newname;
+ unsigned int i;
+
+ len = strlen (outsecname);
+ newname = xmalloc (len + 5);
+ strcpy (newname, outsecname);
+ i = 0;
+ do
+ {
+ sprintf (newname + len, "%d", i);
+ ++i;
+ }
+ while (bfd_get_section_by_name (output_bfd, newname) != NULL);
+
+ outsecname = newname;
+ }
+
+ /* Create the section in the output file, and put it in the right
+ place. This shuffling is to make the output file look neater. */
+ snew = bfd_make_section (output_bfd, outsecname);
+ if (snew == NULL)
+ einfo ("%P%F: output format %s cannot represent section called %s\n",
+ output_bfd->xvec->name, outsecname);
+ if (place->bfd_section != NULL)
+ {
+ for (pps = &output_bfd->sections; *pps != snew; pps = &(*pps)->next)
+ ;
+ *pps = snew->next;
+ snew->next = place->bfd_section->next;
+ place->bfd_section->next = snew;
+ }
+
+ /* Start building a list of statements for this section. */
+ old = stat_ptr;
+ stat_ptr = &add;
+ lang_list_init (stat_ptr);
+
+ /* If the name of the section is representable in C, then create
+ symbols to mark the start and the end of the section. */
+ for (ps = outsecname; *ps != '\0'; ps++)
+ if (! isalnum ((unsigned char) *ps) && *ps != '_')
+ break;
+ if (*ps == '\0' && config.build_constructors)
+ {
+ char *symname;
+
+ symname = (char *) xmalloc (ps - outsecname + sizeof "__start_");
+ sprintf (symname, "__start_%s", outsecname);
+ lang_add_assignment (exp_assop ('=', symname,
+ exp_unop (ALIGN_K,
+ exp_intop ((bfd_vma) 1
+ << s->alignment_power))));
+ }
+
+ if (! link_info.relocateable)
+ address = NULL;
+ else
+ address = exp_intop ((bfd_vma) 0);
+
+ lang_enter_output_section_statement (outsecname, address, 0,
+ (bfd_vma) 0,
+ (etree_type *) NULL,
+ (etree_type *) NULL,
+ (etree_type *) NULL);
+
+ os = lang_output_section_statement_lookup (outsecname);
+ wild_doit (&os->children, s, os, file);
+
+ lang_leave_output_section_statement
+ ((bfd_vma) 0, "*default*", (struct lang_output_section_phdr_list *) NULL);
+ stat_ptr = &add;
+
+ if (*ps == '\0' && config.build_constructors)
+ {
+ char *symname;
+
+ symname = (char *) xmalloc (ps - outsecname + sizeof "__stop_");
+ sprintf (symname, "__stop_%s", outsecname);
+ lang_add_assignment (exp_assop ('=', symname,
+ exp_nameop (NAME, ".")));
+ }
+
+ /* Now stick the new statement list right after PLACE. */
+ *add.tail = place->header.next;
+ place->header.next = add.head;
+
+ stat_ptr = old;
+
+ return true;
+}
+
+static void
+gld${EMULATION_NAME}_place_section (s)
+ lang_statement_union_type *s;
+{
+ lang_output_section_statement_type *os;
+
+ if (s->header.type != lang_output_section_statement_enum)
+ return;
+
+ os = &s->output_section_statement;
+
+ if (strcmp (os->name, hold_section->name) == 0
+ && os->bfd_section != NULL
+ && ((hold_section->flags & (SEC_LOAD | SEC_ALLOC))
+ == (os->bfd_section->flags & (SEC_LOAD | SEC_ALLOC))))
+ hold_use = os;
+
+ if (strcmp (os->name, ".text") == 0)
+ hold_text = os;
+ else if (strcmp (os->name, ".rodata") == 0)
+ hold_rodata = os;
+ else if (strcmp (os->name, ".data") == 0)
+ hold_data = os;
+ else if (strcmp (os->name, ".bss") == 0)
+ hold_bss = os;
+ else if (hold_rel == NULL
+ && os->bfd_section != NULL
+ && (os->bfd_section->flags & SEC_ALLOC) != 0
+ && strncmp (os->name, ".rel", 4) == 0)
+ hold_rel = os;
+ else if (strcmp (os->name, ".interp") == 0)
+ hold_interp = os;
+}
+
+/* Look through an expression for an assignment statement. */
+
+static void
+gld${EMULATION_NAME}_find_exp_assignment (exp)
+ etree_type *exp;
+{
+ struct bfd_link_hash_entry *h;
+
+ switch (exp->type.node_class)
+ {
+ case etree_provide:
+ h = bfd_link_hash_lookup (link_info.hash, exp->assign.dst,
+ false, false, false);
+ if (h == NULL)
+ break;
+
+ /* We call record_link_assignment even if the symbol is defined.
+ This is because if it is defined by a dynamic object, we
+ actually want to use the value defined by the linker script,
+ not the value from the dynamic object (because we are setting
+ symbols like etext). If the symbol is defined by a regular
+ object, then, as it happens, calling record_link_assignment
+ will do no harm. */
+
+ /* Fall through. */
+ case etree_assign:
+ if (strcmp (exp->assign.dst, ".") != 0)
+ {
+ if (! (bfd_elf${ELFSIZE}_record_link_assignment
+ (output_bfd, &link_info, exp->assign.dst,
+ exp->type.node_class == etree_provide ? true : false)))
+ einfo ("%P%F: failed to record assignment to %s: %E\n",
+ exp->assign.dst);
+ }
+ gld${EMULATION_NAME}_find_exp_assignment (exp->assign.src);
+ break;
+
+ case etree_binary:
+ gld${EMULATION_NAME}_find_exp_assignment (exp->binary.lhs);
+ gld${EMULATION_NAME}_find_exp_assignment (exp->binary.rhs);
+ break;
+
+ case etree_trinary:
+ gld${EMULATION_NAME}_find_exp_assignment (exp->trinary.cond);
+ gld${EMULATION_NAME}_find_exp_assignment (exp->trinary.lhs);
+ gld${EMULATION_NAME}_find_exp_assignment (exp->trinary.rhs);
+ break;
+
+ case etree_unary:
+ gld${EMULATION_NAME}_find_exp_assignment (exp->unary.child);
+ break;
+
+ default:
+ break;
+ }
+}
+
+/* This is called by the before_allocation routine via
+ lang_for_each_statement. It locates any assignment statements, and
+ tells the ELF backend about them, in case they are assignments to
+ symbols which are referred to by dynamic objects. */
+
+static void
+gld${EMULATION_NAME}_find_statement_assignment (s)
+ lang_statement_union_type *s;
+{
+ if (s->header.type == lang_assignment_statement_enum)
+ gld${EMULATION_NAME}_find_exp_assignment (s->assignment_statement.exp);
}
/* This is called after the sections have been attached to output
@@ -57,6 +1043,73 @@ gld${EMULATION_NAME}_before_parse ()
static void
gld${EMULATION_NAME}_before_allocation ()
{
+ const char *rpath;
+ asection *sinterp;
+
+ /* If we are going to make any variable assignments, we need to let
+ the ELF backend know about them in case the variables are
+ referred to by dynamic objects. */
+ lang_for_each_statement (gld${EMULATION_NAME}_find_statement_assignment);
+
+ /* Let the ELF backend work out the sizes of any sections required
+ by dynamic linking. */
+ rpath = command_line.rpath;
+ if (rpath == NULL)
+ rpath = (const char *) getenv ("LD_RUN_PATH");
+ if (! (bfd_elf${ELFSIZE}_size_dynamic_sections
+ (output_bfd, command_line.soname, rpath,
+ command_line.export_dynamic, command_line.filter_shlib,
+ (const char * const *) command_line.auxiliary_filters,
+ &link_info, &sinterp, lang_elf_version_info)))
+ einfo ("%P%F: failed to set dynamic section sizes: %E\n");
+
+ /* Let the user override the dynamic linker we are using. */
+ if (command_line.interpreter != NULL
+ && sinterp != NULL)
+ {
+ sinterp->contents = (bfd_byte *) command_line.interpreter;
+ sinterp->_raw_size = strlen (command_line.interpreter) + 1;
+ }
+
+ /* Look for any sections named .gnu.warning. As a GNU extensions,
+ we treat such sections as containing warning messages. We print
+ out the warning message, and then zero out the section size so
+ that it does not get copied into the output file. */
+
+ {
+ LANG_FOR_EACH_INPUT_STATEMENT (is)
+ {
+ asection *s;
+ bfd_size_type sz;
+ char *msg;
+ boolean ret;
+
+ if (is->just_syms_flag)
+ continue;
+
+ s = bfd_get_section_by_name (is->the_bfd, ".gnu.warning");
+ if (s == NULL)
+ continue;
+
+ sz = bfd_section_size (is->the_bfd, s);
+ msg = xmalloc ((size_t) sz + 1);
+ if (! bfd_get_section_contents (is->the_bfd, s, msg, (file_ptr) 0, sz))
+ einfo ("%F%B: Can't read contents of section .gnu.warning: %E\n",
+ is->the_bfd);
+ msg[sz] = '\0';
+ ret = link_info.callbacks->warning (&link_info, msg,
+ (const char *) NULL,
+ is->the_bfd, (asection *) NULL,
+ (bfd_vma) 0);
+ ASSERT (ret);
+ free (msg);
+
+ /* Clobber the section size, so that we don't waste copying the
+ warning into the output file. */
+ s->_raw_size = 0;
+ }
+ }
+
/* we should be able to set the size of the interworking stub section */
/* Here we rummage through the found bfds to collect glue information */
@@ -64,7 +1117,8 @@ gld${EMULATION_NAME}_before_allocation ()
{
LANG_FOR_EACH_INPUT_STATEMENT (is)
{
- if (!bfd_elf32_arm_process_before_allocation (is->the_bfd, &link_info))
+ if (!bfd_elf32_arm_process_before_allocation (is->the_bfd, & link_info,
+ no_pipeline_knowledge))
{
/* xgettext:c-format */
einfo (_("Errors encountered processing file %s"), is->filename);
@@ -76,18 +1130,6 @@ gld${EMULATION_NAME}_before_allocation ()
bfd_elf32_arm_allocate_interworking_sections (& link_info);
}
-static void
-gld${EMULATION_NAME}_after_open ()
-{
-
- LANG_FOR_EACH_INPUT_STATEMENT (is)
- {
- /* The interworking bfd must be the last one to be processed */
- if (!is->next)
- bfd_elf32_arm_get_bfd_for_interworking (is->the_bfd, & link_info);
- }
-}
-
static char *
gld${EMULATION_NAME}_get_script (isfile)
int *isfile;
@@ -158,11 +1200,12 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
"${OUTPUT_FORMAT}",
NULL, /* finish */
NULL, /* create output section statements */
- NULL, /* open dynamic archive */
- NULL, /* place orphan */
+ gld${EMULATION_NAME}_open_dynamic_archive,
+ gld${EMULATION_NAME}_place_orphan,
NULL, /* set_symbols */
- NULL,
+ gld${EMULATION_NAME}_parse_args,
NULL, /* unrecognised file */
- NULL
+ gld${EMULATION_NAME}_list_options,
+ NULL /* recognized file */
};
EOF
diff --git a/ld/emultempl/armelf_oabi.em b/ld/emultempl/armelf_oabi.em
index c0526e5d6f7..20a50dfe652 100644
--- a/ld/emultempl/armelf_oabi.em
+++ b/ld/emultempl/armelf_oabi.em
@@ -71,7 +71,7 @@ gld${EMULATION_NAME}_before_allocation ()
{
LANG_FOR_EACH_INPUT_STATEMENT (is)
{
- if (!bfd_elf32_arm_process_before_allocation (is->the_bfd, &link_info))
+ if (!bfd_elf32_arm_process_before_allocation (is->the_bfd, &link_info, 0))
{
/* xgettext:c-format */
einfo (_("Errors encountered processing file %s"), is->filename);
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index 46ebbe99865..91a1eecfb00 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -1,6 +1,7 @@
# This shell script emits a C file. -*- C -*-
# It does some substitutions.
-cat >e${EMULATION_NAME}.c <<EOF
+(echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
+cat >>e${EMULATION_NAME}.c <<EOF
/* This file is part of GLD, the Gnu Linker.
Copyright 1995, 96, 97, 1998 Free Software Foundation, Inc.
@@ -42,10 +43,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "ldfile.h"
#include "coff/internal.h"
#include "../bfd/libcoff.h"
+#include "../bfd/libbfd.h"
#include "deffile.h"
#define TARGET_IS_${EMULATION_NAME}
+#if defined(TARGET_IS_i386pe)
+#define DLL_SUPPORT
+#endif
+
+#define PE_DEF_SUBSYSTEM 3
+
static void gld_${EMULATION_NAME}_set_symbols PARAMS ((void));
static void gld_${EMULATION_NAME}_after_open PARAMS ((void));
static void gld_${EMULATION_NAME}_before_parse PARAMS ((void));
@@ -78,7 +86,7 @@ gld_${EMULATION_NAME}_before_parse()
{
output_filename = "a.exe";
ldfile_output_architecture = bfd_arch_${ARCH};
-#ifdef TARGET_IS_i386pe
+#ifdef DLL_SUPPORT
config.has_shared = 1;
#endif
}
@@ -128,7 +136,7 @@ static struct option longopts[] =
{"stack", required_argument, NULL, OPTION_STACK},
{"subsystem", required_argument, NULL, OPTION_SUBSYSTEM},
{"support-old-code", no_argument, NULL, OPTION_SUPPORT_OLD_CODE},
-#ifdef TARGET_IS_i386pe
+#ifdef DLL_SUPPORT
/* getopt allows abbreviations, so we do this to stop it from treating -o
as an abbreviation for this option */
{"output-def", required_argument, NULL, OPTION_OUT_DEF},
@@ -174,7 +182,7 @@ static definfo init[] =
D(MinorImageVersion,"__minor_image_version__", 0),
D(MajorSubsystemVersion,"__major_subsystem_version__", 4),
D(MinorSubsystemVersion,"__minor_subsystem_version__", 0),
- D(Subsystem,"__subsystem__", 3),
+ D(Subsystem,"__subsystem__", PE_DEF_SUBSYSTEM),
D(SizeOfStackReserve,"__size_of_stack_reserve__", 0x2000000),
D(SizeOfStackCommit,"__size_of_stack_commit__", 0x1000),
D(SizeOfHeapReserve,"__size_of_heap_reserve__", 0x100000),
@@ -202,7 +210,7 @@ gld_${EMULATION_NAME}_list_options (file)
fprintf (file, _(" --stack <size> Set size of the initial stack\n"));
fprintf (file, _(" --subsystem <name>[:<version>] Set required OS subsystem [& version]\n"));
fprintf (file, _(" --support-old-code Support interworking with old code\n"));
-#ifdef TARGET_IS_i386pe
+#ifdef DLL_SUPPORT
fprintf (file, _(" --add-stdcall-alias Export symbols with and without @nn\n"));
fprintf (file, _(" --disable-stdcall-fixup Don't link _sym to _sym@nn\n"));
fprintf (file, _(" --enable-stdcall-fixup Link _sym to _sym@nn without warnings\n"));
@@ -410,6 +418,7 @@ gld_${EMULATION_NAME}_parse_args(argc, argv)
case OPTION_SUPPORT_OLD_CODE:
support_old_code = 1;
break;
+#ifdef DLL_SUPPORT
case OPTION_OUT_DEF:
pe_out_def_filename = xstrdup (optarg);
break;
@@ -417,9 +426,7 @@ gld_${EMULATION_NAME}_parse_args(argc, argv)
pe_dll_export_everything = 1;
break;
case OPTION_EXCLUDE_SYMBOLS:
-#ifdef TARGET_IS_i386pe
pe_dll_add_excludes (optarg);
-#endif
break;
case OPTION_KILL_ATS:
pe_dll_kill_ats = 1;
@@ -436,6 +443,7 @@ gld_${EMULATION_NAME}_parse_args(argc, argv)
case OPTION_IMPLIB_FILENAME:
pe_implib_filename = xstrdup (optarg);
break;
+#endif
}
return 1;
}
@@ -617,7 +625,7 @@ gld_${EMULATION_NAME}_after_open ()
pe_data (output_bfd)->pe_opthdr = pe;
pe_data (output_bfd)->dll = init[DLLOFF].value;
-#ifdef TARGET_IS_i386pe
+#ifdef DLL_SUPPORT
if (pe_enable_stdcall_fixup) /* -1=warn or 1=disable */
pe_fixup_stdcalls ();
@@ -626,7 +634,7 @@ gld_${EMULATION_NAME}_after_open ()
pe_dll_build_sections (output_bfd, &link_info);
#endif
-#ifdef TARGET_IS_armpe
+#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe)
{
/* Find a BFD that can hold the interworking stubs. */
LANG_FOR_EACH_INPUT_STATEMENT (is)
@@ -636,6 +644,70 @@ gld_${EMULATION_NAME}_after_open ()
}
}
#endif
+
+ {
+ static int sequence = 0;
+ int is_ms_arch;
+ bfd *cur_arch = 0, *elt;
+ lang_input_statement_type *is2;
+ /* Careful - this is a shell script. Watch those dollar signs! */
+ /* Microsoft import libraries have every member named the same,
+ and not in the right order for us to link them correctly. We
+ must detect these and rename the members so that they'll link
+ correctly. There are three types of objects: the head, the
+ thunks, and the sentinel(s). The head is easy; it's the one
+ with idata2. We assume that the sentinels won't have relocs,
+ and the thunks will. It's easier than checking the symbol
+ table for external references. */
+ LANG_FOR_EACH_INPUT_STATEMENT (is)
+ {
+ if (is->the_bfd->my_archive)
+ {
+ bfd *arch = is->the_bfd->my_archive;
+ if (cur_arch != arch)
+ {
+ cur_arch = arch;
+ is_ms_arch = 1;
+ for (is2 = is;
+ is2 && is2->the_bfd->my_archive == arch;
+ is2 = (lang_input_statement_type *)is2->next)
+ {
+ if (strcmp (is->the_bfd->filename, is2->the_bfd->filename))
+ is_ms_arch = 0;
+ }
+ }
+
+ if (is_ms_arch)
+ {
+ int idata2 = 0, i, reloc_count=0;
+ asection *sec;
+ char *new_name, seq;
+ for (sec = is->the_bfd->sections; sec; sec = sec->next)
+ {
+ if (strcmp (sec->name, ".idata\$2") == 0)
+ idata2 = 1;
+ reloc_count += sec->reloc_count;
+ }
+
+ if (idata2) /* .idata2 is the TOC */
+ seq = 'a';
+ else if (reloc_count > 0) /* thunks */
+ seq = 'b';
+ else /* sentinel */
+ seq = 'c';
+
+ new_name = bfd_alloc (is->the_bfd,
+ strlen (is->the_bfd->filename)+2);
+ sprintf (new_name, "%s.%c", is->the_bfd->filename, seq);
+ is->the_bfd->filename = new_name;
+
+ new_name = bfd_alloc(is->the_bfd, strlen(is->filename)+2);
+ sprintf (new_name, "%s.%c", is->filename, seq);
+ is->filename = new_name;
+ }
+ }
+ }
+ }
}
static void
@@ -658,7 +730,7 @@ gld_${EMULATION_NAME}_before_allocation()
ppc_allocate_toc_section (&link_info);
#endif /* TARGET_IS_ppcpe */
-#ifdef TARGET_IS_armpe
+#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe)
/* FIXME: we should be able to set the size of the interworking stub
section.
@@ -701,7 +773,7 @@ static boolean
gld_${EMULATION_NAME}_unrecognized_file(entry)
lang_input_statement_type *entry;
{
-#ifdef TARGET_IS_i386pe
+#ifdef DLL_SUPPORT
const char *ext = entry->filename + strlen (entry->filename) - 4;
if (strcmp (ext, ".def") == 0 || strcmp (ext, ".DEF") == 0)
@@ -786,7 +858,10 @@ static boolean
gld_${EMULATION_NAME}_recognized_file(entry)
lang_input_statement_type *entry;
{
+#ifdef DLL_SUPPORT
#ifdef TARGET_IS_i386pe
+ pe_dll_id_target ("pei-i386");
+#endif
if (bfd_get_format (entry->the_bfd) == bfd_object)
{
const char *ext = entry->filename + strlen (entry->filename) - 4;
@@ -800,7 +875,7 @@ gld_${EMULATION_NAME}_recognized_file(entry)
static void
gld_${EMULATION_NAME}_finish ()
{
-#ifdef TARGET_IS_i386pe
+#ifdef DLL_SUPPORT
if (link_info.shared)
{
pe_dll_fill_sections (output_bfd, &link_info);
diff --git a/ld/ld.texinfo b/ld/ld.texinfo
index 027f196d599..43665761779 100644
--- a/ld/ld.texinfo
+++ b/ld/ld.texinfo
@@ -179,18 +179,21 @@ result of linking the file @code{/lib/crt0.o} with @code{hello.o} and
the library @code{libc.a}, which will come from the standard search
directories. (See the discussion of the @samp{-l} option below.)
-The command-line options to @code{ld} may be specified in any order, and
-may be repeated at will. Repeating most options with a different
-argument will either have no further effect, or override prior
+Some of the command-line options to @code{ld} may be specified at any
+point in the command line. However, options which refer to files, such
+as @samp{-l} or @samp{-T}, cause the file to be read at the point at
+which the option appears in the command line, relative to the object
+files and other file options. Repeating non-file options with a
+different argument will either have no further effect, or override prior
occurrences (those further to the left on the command line) of that
option. Options which may be meaningfully specified more than once are
noted in the descriptions below.
@cindex object files
-Non-option arguments are objects files which are to be linked together.
-They may follow, precede, or be mixed in with command-line options,
-except that an object file argument may not be placed between an option
-and its argument.
+Non-option arguments are object files or archives which are to be linked
+together. They may follow, precede, or be mixed in with command-line
+options, except that an object file argument may not be placed between
+an option and its argument.
Usually the linker is invoked with at least one object file, but you can
specify other forms of binary input files using @samp{-l}, @samp{-R},
diff --git a/ld/ldlang.c b/ld/ldlang.c
index aa5c68131dd..a2c533d7a81 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -77,16 +77,9 @@ static boolean wildcardp PARAMS ((const char *));
static lang_statement_union_type *wild_sort
PARAMS ((lang_wild_statement_type *, lang_input_statement_type *,
asection *));
-static void wild_section PARAMS ((lang_wild_statement_type *ptr,
- const char *section,
- lang_input_statement_type *file,
- lang_output_section_statement_type *output));
static lang_input_statement_type *lookup_name PARAMS ((const char *name));
static void load_symbols PARAMS ((lang_input_statement_type *entry,
lang_statement_list_type *));
-static void wild_file PARAMS ((lang_wild_statement_type *, const char *,
- lang_input_statement_type *,
- lang_output_section_statement_type *));
static void wild PARAMS ((lang_wild_statement_type *s,
const char *section, const char *file,
const char *target,
@@ -142,20 +135,23 @@ static int topower PARAMS ((int));
static void lang_set_startof PARAMS ((void));
static void reset_memory_regions PARAMS ((void));
static void lang_record_phdrs PARAMS ((void));
-static void lang_gc_wild_section
- PARAMS ((lang_wild_statement_type *, const char *,
- lang_input_statement_type *));
-static void lang_gc_wild_file
- PARAMS ((lang_wild_statement_type *, const char *,
- lang_input_statement_type *));
static void lang_gc_wild
PARAMS ((lang_wild_statement_type *, const char *, const char *));
static void lang_gc_sections_1 PARAMS ((lang_statement_union_type *));
static void lang_gc_sections PARAMS ((void));
static void lang_do_version_exports_section PARAMS ((void));
static void lang_check_section_addresses PARAMS ((void));
-
+typedef void (*callback_t) PARAMS ((lang_wild_statement_type *,
+ asection *, lang_input_statement_type *,
+ void *));
+static void walk_wild_section
+ PARAMS ((lang_wild_statement_type *, const char *,
+ lang_input_statement_type *, callback_t, void *));
+static void walk_wild_file
+ PARAMS ((lang_wild_statement_type *, const char *,
+ lang_input_statement_type *, callback_t, void *));
+
/* EXPORTS */
lang_output_section_statement_type *abs_output_section;
lang_statement_list_type *stat_ptr = &statement_list;
@@ -193,6 +189,142 @@ stat_alloc (size)
}
/*----------------------------------------------------------------------
+ Generic traversal routines for finding matching sections.
+*/
+
+static void
+walk_wild_section (ptr, section, file, callback, data)
+ lang_wild_statement_type *ptr;
+ const char *section;
+ lang_input_statement_type *file;
+ callback_t callback;
+ void *data;
+{
+ /* Don't process sections from files which were excluded. */
+ if (ptr->exclude_filename != NULL)
+ {
+ boolean match;
+
+ if (wildcardp (ptr->exclude_filename))
+ match = fnmatch (ptr->exclude_filename, file->filename, 0) == 0 ? true : false;
+ else
+ match = strcmp (ptr->exclude_filename, file->filename) == 0 ? true : false;
+
+ if (match)
+ return;
+ }
+
+ if (file->just_syms_flag == false)
+ {
+ register asection *s;
+ boolean wildcard;
+
+ if (section == NULL)
+ wildcard = false;
+ else
+ wildcard = wildcardp (section);
+
+ for (s = file->the_bfd->sections; s != NULL; s = s->next)
+ {
+ boolean match;
+
+ if (section == NULL)
+ match = true;
+ else
+ {
+ const char *name;
+
+ name = bfd_get_section_name (file->the_bfd, s);
+ if (wildcard)
+ match = fnmatch (section, name, 0) == 0 ? true : false;
+ else
+ match = strcmp (section, name) == 0 ? true : false;
+ }
+
+ if (match)
+ (*callback) (ptr, s, file, data);
+ }
+ }
+}
+
+/* Handle a wild statement for a single file F. */
+
+static void
+walk_wild_file (s, section, f, callback, data)
+ lang_wild_statement_type *s;
+ const char *section;
+ lang_input_statement_type *f;
+ callback_t callback;
+ void *data;
+{
+ if (f->the_bfd == NULL
+ || ! bfd_check_format (f->the_bfd, bfd_archive))
+ walk_wild_section (s, section, f, callback, data);
+ else
+ {
+ bfd *member;
+
+ /* This is an archive file. We must map each member of the
+ archive separately. */
+ member = bfd_openr_next_archived_file (f->the_bfd, (bfd *) NULL);
+ while (member != NULL)
+ {
+ /* When lookup_name is called, it will call the add_symbols
+ entry point for the archive. For each element of the
+ archive which is included, BFD will call ldlang_add_file,
+ which will set the usrdata field of the member to the
+ lang_input_statement. */
+ if (member->usrdata != NULL)
+ {
+ walk_wild_section (s, section,
+ (lang_input_statement_type *) member->usrdata,
+ callback, data);
+ }
+
+ member = bfd_openr_next_archived_file (f->the_bfd, member);
+ }
+ }
+}
+
+static void
+walk_wild (s, section, file, callback, data)
+ lang_wild_statement_type *s;
+ const char *section;
+ const char *file;
+ callback_t callback;
+ void *data;
+{
+ lang_input_statement_type *f;
+
+ if (file == (char *) NULL)
+ {
+ /* Perform the iteration over all files in the list. */
+ for (f = (lang_input_statement_type *) file_chain.head;
+ f != (lang_input_statement_type *) NULL;
+ f = (lang_input_statement_type *) f->next)
+ {
+ walk_wild_file (s, section, f, callback, data);
+ }
+ }
+ else if (wildcardp (file))
+ {
+ for (f = (lang_input_statement_type *) file_chain.head;
+ f != (lang_input_statement_type *) NULL;
+ f = (lang_input_statement_type *) f->next)
+ {
+ if (fnmatch (file, f->filename, FNM_FILE_NAME) == 0)
+ walk_wild_file (s, section, f, callback, data);
+ }
+ }
+ else
+ {
+ /* Perform the iteration over a single file. */
+ f = lookup_name (file);
+ walk_wild_file (s, section, f, callback, data);
+ }
+}
+
+/*----------------------------------------------------------------------
lang_for_each_statement walks the parse tree and calls the provided
function for each node
*/
@@ -1070,104 +1202,53 @@ wild_sort (wild, file, section)
NULL, in which case it is a wild card. */
static void
-wild_section (ptr, section, file, output)
+output_section_callback (ptr, section, file, output)
lang_wild_statement_type *ptr;
- const char *section;
+ asection *section;
lang_input_statement_type *file;
- lang_output_section_statement_type *output;
+ void *output;
{
-
- /* Don't process sections from files which were excluded. */
- if (ptr->exclude_filename != NULL)
- {
- boolean match;
-
- if (wildcardp (ptr->exclude_filename))
- match = fnmatch (ptr->exclude_filename, file->filename, 0) == 0 ? true : false;
- else
- match = strcmp (ptr->exclude_filename, file->filename) == 0 ? true : false;
-
- if (match)
- return;
- }
-
- if (file->just_syms_flag == false)
+ lang_statement_union_type *before;
+
+ /* If the wild pattern was marked KEEP, the member sections
+ should be as well. */
+ if (ptr->keep_sections)
+ section->flags |= SEC_KEEP;
+
+ before = wild_sort (ptr, file, section);
+
+ /* Here BEFORE points to the lang_input_section which
+ should follow the one we are about to add. If BEFORE
+ is NULL, then the section should just go at the end
+ of the current list. */
+
+ if (before == NULL)
+ wild_doit (&ptr->children, section,
+ (lang_output_section_statement_type *) output,
+ file);
+ else
{
- register asection *s;
- boolean wildcard;
-
- if (section == NULL)
- wildcard = false;
- else
- wildcard = wildcardp (section);
-
- for (s = file->the_bfd->sections; s != NULL; s = s->next)
+ lang_statement_list_type list;
+ lang_statement_union_type **pp;
+
+ lang_list_init (&list);
+ wild_doit (&list, section,
+ (lang_output_section_statement_type *) output,
+ file);
+
+ /* If we are discarding the section, LIST.HEAD will
+ be NULL. */
+ if (list.head != NULL)
{
- boolean match;
-
- /* Attach all sections named SECTION. If SECTION is NULL,
- then attach all sections.
-
- Previously, if SECTION was NULL, this code did not call
- wild_doit if the SEC_IS_COMMON flag was set for the
- section. I did not understand that, and I took it out.
- --ian@cygnus.com. */
-
- if (section == NULL)
- match = true;
- else
- {
- const char *name;
-
- name = bfd_get_section_name (file->the_bfd, s);
- if (wildcard)
- match = fnmatch (section, name, 0) == 0 ? true : false;
- else
- match = strcmp (section, name) == 0 ? true : false;
- }
-
- if (match)
- {
- lang_statement_union_type *before;
-
- /* If the wild pattern was marked KEEP, the member sections
- should be as well. */
- if (ptr->keep_sections)
- s->flags |= SEC_KEEP;
-
- before = wild_sort (ptr, file, s);
-
- /* Here BEFORE points to the lang_input_section which
- should follow the one we are about to add. If BEFORE
- is NULL, then the section should just go at the end
- of the current list. */
-
- if (before == NULL)
- wild_doit (&ptr->children, s, output, file);
- else
- {
- lang_statement_list_type list;
- lang_statement_union_type **pp;
-
- lang_list_init (&list);
- wild_doit (&list, s, output, file);
-
- /* If we are discarding the section, LIST.HEAD will
- be NULL. */
- if (list.head != NULL)
- {
- ASSERT (list.head->next == NULL);
-
- for (pp = &ptr->children.head;
- *pp != before;
- pp = &(*pp)->next)
- ASSERT (*pp != NULL);
-
- list.head->next = *pp;
- *pp = list.head;
- }
- }
- }
+ ASSERT (list.head->next == NULL);
+
+ for (pp = &ptr->children.head;
+ *pp != before;
+ pp = &(*pp)->next)
+ ASSERT (*pp != NULL);
+
+ list.head->next = *pp;
+ *pp = list.head;
}
}
}
@@ -1320,43 +1401,7 @@ load_symbols (entry, place)
entry->loaded = true;
}
-/* Handle a wild statement for a single file F. */
-
-static void
-wild_file (s, section, f, output)
- lang_wild_statement_type *s;
- const char *section;
- lang_input_statement_type *f;
- lang_output_section_statement_type *output;
-{
- if (f->the_bfd == NULL
- || ! bfd_check_format (f->the_bfd, bfd_archive))
- wild_section (s, section, f, output);
- else
- {
- bfd *member;
-
- /* This is an archive file. We must map each member of the
- archive separately. */
- member = bfd_openr_next_archived_file (f->the_bfd, (bfd *) NULL);
- while (member != NULL)
- {
- /* When lookup_name is called, it will call the add_symbols
- entry point for the archive. For each element of the
- archive which is included, BFD will call ldlang_add_file,
- which will set the usrdata field of the member to the
- lang_input_statement. */
- if (member->usrdata != NULL)
- {
- wild_section (s, section,
- (lang_input_statement_type *) member->usrdata,
- output);
- }
-
- member = bfd_openr_next_archived_file (f->the_bfd, member);
- }
- }
-}
+
/* Handle a wild statement. SECTION or FILE or both may be NULL,
indicating that it is a wildcard. Separate lang_input_section
@@ -1371,34 +1416,7 @@ wild (s, section, file, target, output)
const char *target;
lang_output_section_statement_type *output;
{
- lang_input_statement_type *f;
-
- if (file == (char *) NULL)
- {
- /* Perform the iteration over all files in the list */
- for (f = (lang_input_statement_type *) file_chain.head;
- f != (lang_input_statement_type *) NULL;
- f = (lang_input_statement_type *) f->next)
- {
- wild_file (s, section, f, output);
- }
- }
- else if (wildcardp (file))
- {
- for (f = (lang_input_statement_type *) file_chain.head;
- f != (lang_input_statement_type *) NULL;
- f = (lang_input_statement_type *) f->next)
- {
- if (fnmatch (file, f->filename, FNM_FILE_NAME) == 0)
- wild_file (s, section, f, output);
- }
- }
- else
- {
- /* Perform the iteration over a single file */
- f = lookup_name (file);
- wild_file (s, section, f, output);
- }
+ walk_wild (s, section, file, output_section_callback, (void *) output);
if (section != (char *) NULL
&& strcmp (section, "COMMON") == 0
@@ -3487,90 +3505,20 @@ reset_memory_regions ()
}
}
-/* ??? At some point this traversal for GC should share code with the
- traversal for manipulating the output file. */
-
/* Expand a wild statement for a particular FILE, marking its sections KEEP
as needed. SECTION may be NULL, in which case it is a wild card. */
static void
-lang_gc_wild_section (ptr, section, file)
+gc_section_callback (ptr, section, file, data)
lang_wild_statement_type *ptr;
- const char *section;
+ asection *section;
lang_input_statement_type *file;
+ void *data;
{
- if (file->just_syms_flag == false)
- {
- register asection *s;
- boolean wildcard;
-
- if (section == NULL)
- wildcard = false;
- else
- wildcard = wildcardp (section);
-
- for (s = file->the_bfd->sections; s != NULL; s = s->next)
- {
- boolean match;
-
- if (section == NULL)
- match = true;
- else
- {
- const char *name;
-
- name = bfd_get_section_name (file->the_bfd, s);
- if (wildcard)
- match = fnmatch (section, name, 0) == 0 ? true : false;
- else
- match = strcmp (section, name) == 0 ? true : false;
- }
-
- if (match)
- {
- /* If the wild pattern was marked KEEP, the member sections
- should be as well. */
- if (ptr->keep_sections)
- s->flags |= SEC_KEEP;
- }
- }
- }
-}
-
-/* Handle a wild statement for a single file F. */
-
-static void
-lang_gc_wild_file (s, section, f)
- lang_wild_statement_type *s;
- const char *section;
- lang_input_statement_type *f;
-{
- if (f->the_bfd == NULL
- || ! bfd_check_format (f->the_bfd, bfd_archive))
- lang_gc_wild_section (s, section, f);
- else
- {
- bfd *member;
-
- /* This is an archive file. We must map each member of the
- archive separately. */
- member = bfd_openr_next_archived_file (f->the_bfd, (bfd *) NULL);
- while (member != NULL)
- {
- /* When lookup_name is called, it will call the add_symbols
- entry point for the archive. For each element of the
- archive which is included, BFD will call ldlang_add_file,
- which will set the usrdata field of the member to the
- lang_input_statement. */
- if (member->usrdata != NULL)
- {
- lang_gc_wild_section (s, section,
- (lang_input_statement_type *) member->usrdata);
- }
-
- member = bfd_openr_next_archived_file (f->the_bfd, member);
- }
- }
+ /* If the wild pattern was marked KEEP, the member sections
+ should be as well. */
+ if (ptr->keep_sections)
+ section->flags |= SEC_KEEP;
}
/* Handle a wild statement, marking it against GC. SECTION or FILE or both
@@ -3582,34 +3530,7 @@ lang_gc_wild (s, section, file)
const char *section;
const char *file;
{
- lang_input_statement_type *f;
-
- if (file == (char *) NULL)
- {
- /* Perform the iteration over all files in the list */
- for (f = (lang_input_statement_type *) file_chain.head;
- f != (lang_input_statement_type *) NULL;
- f = (lang_input_statement_type *) f->next)
- {
- lang_gc_wild_file (s, section, f);
- }
- }
- else if (wildcardp (file))
- {
- for (f = (lang_input_statement_type *) file_chain.head;
- f != (lang_input_statement_type *) NULL;
- f = (lang_input_statement_type *) f->next)
- {
- if (fnmatch (file, f->filename, FNM_FILE_NAME) == 0)
- lang_gc_wild_file (s, section, f);
- }
- }
- else
- {
- /* Perform the iteration over a single file */
- f = lookup_name (file);
- lang_gc_wild_file (s, section, f);
- }
+ walk_wild (s, section, file, gc_section_callback, NULL);
}
/* Iterate over sections marking them against GC. */
diff --git a/ld/lexsup.c b/ld/lexsup.c
index 7ee5087f1ac..5557cceadaa 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -341,7 +341,7 @@ static const struct ld_option ld_options[] =
'\0', N_("FILE"), N_("Read version information script"), TWO_DASHES },
{ {"version-exports-section", required_argument, NULL,
OPTION_VERSION_EXPORTS_SECTION },
- '\0', N_("SYMBOL"), N_("Take export symbols list from .exports, using SYMBOL as the version."),
+ '\0', N_("SYMBOL"), N_("Take export symbols list from .exports, using\n\t\t\t\tSYMBOL as the version."),
TWO_DASHES },
{ {"warn-common", no_argument, NULL, OPTION_WARN_COMMON},
'\0', NULL, N_("Warn about duplicate common symbols"), TWO_DASHES },
@@ -360,7 +360,7 @@ static const struct ld_option ld_options[] =
{ {"wrap", required_argument, NULL, OPTION_WRAP},
'\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES },
{ {"mpc860c0", optional_argument, NULL, OPTION_MPC860C0},
- '\0', N_("[=WORDS]"), N_("Modify problematic branches in last WORDS (1-10, default 5) words of a page"), TWO_DASHES }
+ '\0', N_("[=WORDS]"), N_("Modify problematic branches in last WORDS (1-10,\n\t\t\t\tdefault 5) words of a page"), TWO_DASHES }
};
#define OPTION_COUNT ((int) (sizeof ld_options / sizeof ld_options[0]))
@@ -1119,7 +1119,7 @@ help ()
}
/* xgettext:c-format */
- printf (_("%s: supported targets:"), program_name);
+ printf (_("%s: supported targets:\n "), program_name);
targets = bfd_target_list ();
for (pp = targets; *pp != NULL; pp++)
printf (" %s", *pp);
@@ -1127,7 +1127,7 @@ help ()
printf ("\n");
/* xgettext:c-format */
- printf (_("%s: supported emulations: "), program_name);
+ printf (_("%s: supported emulations:\n "), program_name);
ldemul_list_emulations (stdout);
printf ("\n");
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index 6d7306c03c5..1752d6666f4 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -73,6 +73,48 @@ static struct sec *edata_s, *reloc_s;
static unsigned char *edata_d, *reloc_d;
static int edata_sz, reloc_sz;
+typedef struct {
+ char *target_name;
+ char *object_target;
+ int imagebase_reloc;
+ int pe_arch;
+ int bfd_arch;
+ int underscored;
+} pe_details_type;
+
+#define PE_ARCH_i386 1
+
+static pe_details_type pe_detail_list[] = {
+ {
+ "pei-i386",
+ "pe-i386",
+ 7 /* R_IMAGEBASE */,
+ PE_ARCH_i386,
+ bfd_arch_i386,
+ 1
+ },
+ { 0 }
+};
+
+static pe_details_type *pe_details;
+
+#define U(str) (pe_details->underscored ? "_" str : str)
+
+void
+pe_dll_id_target (target)
+ char *target;
+{
+ int i;
+ for (i=0; pe_detail_list[i].target_name; i++)
+ if (strcmp (pe_detail_list[i].target_name, target) == 0)
+ {
+ pe_details = pe_detail_list+i;
+ return;
+ }
+ einfo (_("%XUnsupported PEI architecture: %s\n"), target);
+ exit (1);
+}
+
/************************************************************************
Helper functions for qsort. Relocs must be sorted so that we can write
@@ -80,13 +122,19 @@ static int edata_sz, reloc_sz;
************************************************************************/
+typedef struct {
+ bfd_vma vma;
+ char type;
+ short extra;
+} reloc_data_type;
+
static int
reloc_sort (va, vb)
const void *va, *vb;
{
- bfd_vma a = *(bfd_vma *) va;
- bfd_vma b = *(bfd_vma *) vb;
- return (a > b) - (a < b);
+ bfd_vma a = ((reloc_data_type *) va)->vma;
+ bfd_vma b = ((reloc_data_type *) vb)->vma;
+ return (a > b) ? 1 : ((a < b) ? -1 : 0);
}
static int
@@ -323,8 +371,13 @@ process_def_file (abfd, info)
for (i = 0; i < NE; i++)
{
char *name = (char *) xmalloc (strlen (pe_def_file->exports[i].internal_name) + 2);
- *name = '_';
- strcpy (name + 1, pe_def_file->exports[i].internal_name);
+ if (pe_details->underscored)
+ {
+ *name = '_';
+ strcpy (name + 1, pe_def_file->exports[i].internal_name);
+ }
+ else
+ strcpy (name, pe_def_file->exports[i].internal_name);
blhe = bfd_link_hash_lookup (info->hash,
name,
@@ -376,7 +429,8 @@ process_def_file (abfd, info)
************************************************************************/
static void
-build_filler_bfd ()
+build_filler_bfd (include_edata)
+ int include_edata;
{
lang_input_statement_type *filler_file;
filler_file = lang_add_input_file ("dll stuff",
@@ -392,19 +446,22 @@ build_filler_bfd ()
return;
}
- edata_s = bfd_make_section_old_way (filler_bfd, ".edata");
- if (edata_s == NULL
- || !bfd_set_section_flags (filler_bfd, edata_s,
- (SEC_HAS_CONTENTS
- | SEC_ALLOC
- | SEC_LOAD
- | SEC_KEEP
- | SEC_IN_MEMORY)))
+ if (include_edata)
{
- einfo ("%X%P: can not create .edata section: %E\n");
- return;
+ edata_s = bfd_make_section_old_way (filler_bfd, ".edata");
+ if (edata_s == NULL
+ || !bfd_set_section_flags (filler_bfd, edata_s,
+ (SEC_HAS_CONTENTS
+ | SEC_ALLOC
+ | SEC_LOAD
+ | SEC_KEEP
+ | SEC_IN_MEMORY)))
+ {
+ einfo ("%X%P: can not create .edata section: %E\n");
+ return;
+ }
+ bfd_set_section_size (filler_bfd, edata_s, edata_sz);
}
- bfd_set_section_size (filler_bfd, edata_s, edata_sz);
reloc_s = bfd_make_section_old_way (filler_bfd, ".reloc");
if (reloc_s == NULL
@@ -598,7 +655,7 @@ generate_reloc (abfd, info)
{
/* for .reloc stuff */
- bfd_vma *reloc_addresses;
+ reloc_data_type *reloc_data;
int total_relocs = 0;
int i;
unsigned long sec_page = (unsigned long) (-1);
@@ -612,7 +669,7 @@ generate_reloc (abfd, info)
for (s = b->sections; s; s = s->next)
total_relocs += s->reloc_count;
- reloc_addresses = (bfd_vma *) xmalloc (total_relocs * sizeof (bfd_vma));
+ reloc_data = (reloc_data_type *) xmalloc (total_relocs * sizeof (reloc_data_type));
total_relocs = 0;
bi = 0;
@@ -656,12 +713,22 @@ generate_reloc (abfd, info)
for (i = 0; i < nrelocs; i++)
{
if (!relocs[i]->howto->pc_relative
- && relocs[i]->howto->type != R_IMAGEBASE)
+ && relocs[i]->howto->type != pe_details->imagebase_reloc)
{
- switch (relocs[i]->howto->bitsize)
+ bfd_vma sym_vma;
+ struct symbol_cache_entry *sym = *relocs[i]->sym_ptr_ptr;
+ sym_vma = (relocs[i]->addend
+ + sym->value
+ + sym->section->vma
+ + sym->section->output_offset
+ + sym->section->output_section->vma);
+ reloc_data[total_relocs].vma = sec_vma + relocs[i]->address;
+ switch (relocs[i]->howto->bitsize*1000
+ + relocs[i]->howto->rightshift)
{
- case 32:
- reloc_addresses[total_relocs++] = sec_vma + relocs[i]->address;
+ case 32000:
+ reloc_data[total_relocs].type = 3;
+ total_relocs++;
break;
default:
/* xgettext:c-format */
@@ -682,11 +749,11 @@ generate_reloc (abfd, info)
reloc_addresses, which are all suitable for the .reloc section.
We must now create the new sections. */
- qsort (reloc_addresses, total_relocs, sizeof (bfd_vma), reloc_sort);
+ qsort (reloc_data, total_relocs, sizeof (*reloc_data), reloc_sort);
for (i = 0; i < total_relocs; i++)
{
- unsigned long this_page = (reloc_addresses[i] >> 12);
+ unsigned long this_page = (reloc_data[i].vma >> 12);
if (this_page != sec_page)
{
reloc_sz = (reloc_sz + 3) & ~3; /* 4-byte align */
@@ -705,7 +772,7 @@ generate_reloc (abfd, info)
page_count = 0;
for (i = 0; i < total_relocs; i++)
{
- unsigned long rva = reloc_addresses[i] - image_base;
+ unsigned long rva = reloc_data[i].vma - image_base;
unsigned long this_page = (rva & ~0xfff);
if (this_page != sec_page)
{
@@ -719,8 +786,14 @@ generate_reloc (abfd, info)
sec_page = this_page;
page_count = 0;
}
- bfd_put_16 (abfd, (rva & 0xfff) + 0x3000, reloc_d + reloc_sz);
+ bfd_put_16 (abfd, (rva & 0xfff) + (reloc_data[i].type<<12),
+ reloc_d + reloc_sz);
reloc_sz += 2;
+ if (reloc_data[i].type == 4)
+ {
+ bfd_put_16 (abfd, reloc_data[i].extra, reloc_d + reloc_sz);
+ reloc_sz += 2;
+ }
page_count++;
}
while (reloc_sz & 3)
@@ -1049,19 +1122,25 @@ make_head (parent)
tmp_seq++;
abfd = bfd_create (oname, parent);
- bfd_find_target ("pe-i386", abfd);
+ bfd_find_target (pe_details->object_target, abfd);
bfd_make_writable (abfd);
bfd_set_format (abfd, bfd_object);
- bfd_set_arch_mach (abfd, bfd_arch_i386, 0);
+ bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
symptr = 0;
symtab = (asymbol **) xmalloc (6 * sizeof (asymbol *));
id2 = quick_section (abfd, ".idata$2", SEC_HAS_CONTENTS, 2);
id5 = quick_section (abfd, ".idata$5", SEC_HAS_CONTENTS, 2);
id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2);
- quick_symbol (abfd, "__head_", dll_symname, "", id2, BSF_GLOBAL, 0);
- quick_symbol (abfd, "_", dll_symname, "_iname", UNDSEC, BSF_GLOBAL, 0);
+ quick_symbol (abfd, U("_head_"), dll_symname, "", id2, BSF_GLOBAL, 0);
+ quick_symbol (abfd, U(""), dll_symname, "_iname", UNDSEC, BSF_GLOBAL, 0);
+
+ /* OK, pay attention here. I got confused myself looking back at
+ it. We create a four-byte section to mark the beginning of the
+ list, and we include an offset of 4 in the section, so that the
+ pointer to the list points to the *end* of this section, which is
+ the start of the list of sections from other objects. */
bfd_set_section_size (abfd, id2, 20);
d2 = (unsigned char *) xmalloc (20);
@@ -1119,18 +1198,18 @@ make_tail (parent)
tmp_seq++;
abfd = bfd_create (oname, parent);
- bfd_find_target ("pe-i386", abfd);
+ bfd_find_target (pe_details->object_target, abfd);
bfd_make_writable (abfd);
bfd_set_format (abfd, bfd_object);
- bfd_set_arch_mach (abfd, bfd_arch_i386, 0);
+ bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
symptr = 0;
symtab = (asymbol **) xmalloc (5 * sizeof (asymbol *));
id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2);
id5 = quick_section (abfd, ".idata$5", SEC_HAS_CONTENTS, 2);
id7 = quick_section (abfd, ".idata$7", SEC_HAS_CONTENTS, 2);
- quick_symbol (abfd, "_", dll_symname, "_iname", id7, BSF_GLOBAL, 0);
+ quick_symbol (abfd, U(""), dll_symname, "_iname", id7, BSF_GLOBAL, 0);
bfd_set_section_size (abfd, id4, 4);
d4 = (unsigned char *) xmalloc (4);
@@ -1198,17 +1277,27 @@ make_one (exp, parent)
int len;
char *oname;
bfd *abfd;
+ unsigned char *jmp_bytes;
+ int jmp_byte_count;
+
+ switch (pe_details->pe_arch)
+ {
+ case PE_ARCH_i386:
+ jmp_bytes = jmp_ix86_bytes;
+ jmp_byte_count = sizeof (jmp_ix86_bytes);
+ break;
+ }
oname = (char *) xmalloc (20);
sprintf (oname, "d%06d.o", tmp_seq);
tmp_seq++;
abfd = bfd_create (oname, parent);
- bfd_find_target ("pe-i386", abfd);
+ bfd_find_target (pe_details->object_target, abfd);
bfd_make_writable (abfd);
bfd_set_format (abfd, bfd_object);
- bfd_set_arch_mach (abfd, bfd_arch_i386, 0);
+ bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
symptr = 0;
symtab = (asymbol **) xmalloc (10 * sizeof (asymbol *));
@@ -1217,16 +1306,21 @@ make_one (exp, parent)
id5 = quick_section (abfd, ".idata$5", SEC_HAS_CONTENTS, 2);
id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2);
id6 = quick_section (abfd, ".idata$6", SEC_HAS_CONTENTS, 2);
- quick_symbol (abfd, "_", exp->internal_name, "", tx, BSF_GLOBAL, 0);
- quick_symbol (abfd, "__head_", dll_symname, "", UNDSEC, BSF_GLOBAL, 0);
- quick_symbol (abfd, "___imp_", exp->internal_name, "", id5, BSF_GLOBAL, 0);
- quick_symbol (abfd, "__imp__", exp->internal_name, "", id5, BSF_GLOBAL, 0);
+ quick_symbol (abfd, U(""), exp->internal_name, "", tx, BSF_GLOBAL, 0);
+ quick_symbol (abfd, U("_head_"), dll_symname, "", UNDSEC, BSF_GLOBAL, 0);
+ quick_symbol (abfd, U("__imp_"), exp->internal_name, "", id5, BSF_GLOBAL, 0);
+ quick_symbol (abfd, U("_imp__"), exp->internal_name, "", id5, BSF_GLOBAL, 0);
- bfd_set_section_size (abfd, tx, 8);
- td = (unsigned char *) xmalloc (8);
+ bfd_set_section_size (abfd, tx, jmp_byte_count);
+ td = (unsigned char *) xmalloc (jmp_byte_count);
tx->contents = td;
- memcpy (td, jmp_ix86_bytes, 8);
- quick_reloc (abfd, 2, BFD_RELOC_32, 2);
+ memcpy (td, jmp_bytes, jmp_byte_count);
+ switch (pe_details->pe_arch)
+ {
+ case PE_ARCH_i386:
+ quick_reloc (abfd, 2, BFD_RELOC_32, 2);
+ break;
+ }
save_relocs (tx);
bfd_set_section_size (abfd, id7, 4);
@@ -1289,7 +1383,7 @@ make_one (exp, parent)
bfd_set_symtab (abfd, symtab, symptr);
- bfd_set_section_contents (abfd, tx, td, 0, 4);
+ bfd_set_section_contents (abfd, tx, td, 0, jmp_byte_count);
bfd_set_section_contents (abfd, id7, d7, 0, 4);
bfd_set_section_contents (abfd, id5, d5, 0, 4);
bfd_set_section_contents (abfd, id4, d4, 0, 4);
@@ -1344,10 +1438,6 @@ pe_dll_generate_implib (def, impfilename)
/* Work out a reasonable size of things to put onto one line. */
ar_head = make_head (outarch);
- ar_tail = make_tail (outarch);
-
- if (ar_head == NULL || ar_tail == NULL)
- return;
for (i = 0; i<def->num_exports; i++)
{
@@ -1361,6 +1451,11 @@ pe_dll_generate_implib (def, impfilename)
def->exports[i].internal_name = internal;
}
+ ar_tail = make_tail (outarch);
+
+ if (ar_head == NULL || ar_tail == NULL)
+ return;
+
/* Now stick them all into the archive */
ar_head->next = head;
@@ -1403,6 +1498,7 @@ pe_process_import_defs (output_bfd, link_info)
struct bfd_link_info *link_info;
{
def_file_module *module;
+ pe_dll_id_target(bfd_get_target (output_bfd));
if (!pe_def_file)
return;
@@ -1427,7 +1523,7 @@ pe_process_import_defs (output_bfd, link_info)
/* see if we need this import */
char *name = (char *) xmalloc (strlen (pe_def_file->imports[i].internal_name) + 2);
- sprintf (name, "_%s", pe_def_file->imports[i].internal_name);
+ sprintf (name, "%s%s", U(""), pe_def_file->imports[i].internal_name);
blhe = bfd_link_hash_lookup (link_info->hash, name,
false, false, false);
free (name);
@@ -1527,7 +1623,7 @@ pe_implied_import_dll (filename)
/* No, I can't use bfd here. kernel32.dll puts its export table in
the middle of the .rdata section. */
- dll = bfd_openr (filename, "pei-i386");
+ dll = bfd_openr (filename, pe_details->target_name);
if (!dll)
{
einfo ("%Xopen %s: %s\n", filename, bfd_errmsg (bfd_get_error ()));
@@ -1611,10 +1707,20 @@ pe_dll_build_sections (abfd, info)
bfd *abfd;
struct bfd_link_info *info;
{
+ pe_dll_id_target (bfd_get_target (abfd));
process_def_file (abfd, info);
generate_edata (abfd, info);
- build_filler_bfd ();
+ build_filler_bfd (1);
+}
+
+void
+pe_exe_build_sections (abfd, info)
+ bfd *abfd;
+ struct bfd_link_info *info;
+{
+ pe_dll_id_target (bfd_get_target (abfd));
+ build_filler_bfd (0);
}
void
@@ -1622,6 +1728,7 @@ pe_dll_fill_sections (abfd, info)
bfd *abfd;
struct bfd_link_info *info;
{
+ pe_dll_id_target (bfd_get_target (abfd));
image_base = pe_data (abfd)->pe_opthdr.ImageBase;
generate_reloc (abfd, info);
@@ -1649,3 +1756,31 @@ pe_dll_fill_sections (abfd, info)
edata_s->contents = edata_d;
reloc_s->contents = reloc_d;
}
+
+void
+pe_exe_fill_sections (abfd, info)
+ bfd *abfd;
+ struct bfd_link_info *info;
+{
+ pe_dll_id_target (bfd_get_target (abfd));
+ image_base = pe_data (abfd)->pe_opthdr.ImageBase;
+
+ generate_reloc (abfd, info);
+ if (reloc_sz > 0)
+ {
+ 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, (bfd_vma) 0, false);
+
+ /* 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);
+ }
+ reloc_s->contents = reloc_d;
+}
diff --git a/ld/scripttempl/mcorepe.sc b/ld/scripttempl/mcorepe.sc
index 8111bf211ee..b9713388fa6 100644
--- a/ld/scripttempl/mcorepe.sc
+++ b/ld/scripttempl/mcorepe.sc
@@ -1,4 +1,4 @@
-# Linker script for PE.
+# Linker script for MCore PE.
if test -z "${RELOCATEABLE_OUTPUT_FORMAT}"; then
RELOCATEABLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
@@ -36,9 +36,8 @@ else
fi
cat <<EOF
-${RELOCATING+OUTPUT_FORMAT(${OUTPUT_FORMAT})}
-${RELOCATING-OUTPUT_FORMAT(${RELOCATEABLE_OUTPUT_FORMAT})}
-
+${RELOCATING+OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
+ "${LITTLE_OUTPUT_FORMAT}")}
${LIB_SEARCH_DIRS}
ENTRY(_mainCRTStartup)
diff --git a/ld/scripttempl/pe.sc b/ld/scripttempl/pe.sc
index 7926bfe8776..6212d424346 100644
--- a/ld/scripttempl/pe.sc
+++ b/ld/scripttempl/pe.sc
@@ -38,6 +38,7 @@ fi
cat <<EOF
${RELOCATING+OUTPUT_FORMAT(${OUTPUT_FORMAT})}
${RELOCATING-OUTPUT_FORMAT(${RELOCATEABLE_OUTPUT_FORMAT})}
+${OUTPUT_ARCH+OUTPUT_ARCH(${OUTPUT_ARCH})}
${LIB_SEARCH_DIRS}
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 6610cbfb3e6..dd891d43f03 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+1999-05-17 Nick Clifton <nickc@cygnus.com>
+
+ * ld-undefined/undefined.exp: Add xfail for mcore-elf.
+
+1999-05-11 DJ Delorie <dj@cygnus.com>
+
+ * ld-srec/srec.exp: Do not run tests for PE based ports.
+
1999-03-05 Nick Clifton <nickc@cygnus.com>
* ld-selective/selective.exp: Do not run tests for COFF or PE
diff --git a/ld/testsuite/ld-srec/srec.exp b/ld/testsuite/ld-srec/srec.exp
index 63a70ab7bcf..6551d36dd50 100644
--- a/ld/testsuite/ld-srec/srec.exp
+++ b/ld/testsuite/ld-srec/srec.exp
@@ -343,6 +343,11 @@ setup_xfail "v850*-*-elf"
setup_xfail "alpha*-*-elf*" "alpha*-*-linux-gnu*" "alpha*-*-gnu*"
setup_xfail "alpha*-*-netbsd*"
+# The S-record linker doesn't support the special PE headers - the PE
+# emulation tries to write pe-specific information to the PE headers
+# in the output bfd, but it's not a PE bfd (it's an srec bfd)
+setup_xfail "*-*-cygwin*" "*-*-mingw*" "*-*-pe*" "*-*-winnt*"
+
run_srec_test $test1 "tmpdir/sr1.o tmpdir/sr2.o"
# Now try linking a C++ program with global constructors and
@@ -370,5 +375,6 @@ setup_xfail "powerpc*-*-eabi*"
setup_xfail "v850*-*-elf"
setup_xfail "alpha*-*-elf*" "alpha*-*-linux-gnu*" "alpha*-*-gnu*"
setup_xfail "alpha*-*-netbsd*"
+setup_xfail "*-*-cygwin*" "*-*-mingw*" "*-*-pe*" "*-*-winnt*"
run_srec_test $test2 "tmpdir/sr3.o"
diff --git a/ld/testsuite/ld-undefined/undefined.exp b/ld/testsuite/ld-undefined/undefined.exp
index 29b3bddc41d..9025e026ee7 100644
--- a/ld/testsuite/ld-undefined/undefined.exp
+++ b/ld/testsuite/ld-undefined/undefined.exp
@@ -122,5 +122,6 @@ set ml "undefined.c:9: undefined reference to `this_function_is_not_defined'"
setup_xfail arm-*-elf
setup_xfail strongarm-*-elf
setup_xfail thumb-*-elf
+setup_xfail mcore-*-elf
checkund $ml $testline
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 7032febe630..16d32297220 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,16 @@
+1999-05-11 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * cplus-dem.c (main): Use table lookup to distinguish identifier
+ characters from non-identifier characters.
+ (standard_symbol_alphabet, hp_symbol_alphabet): New functions.
+
+Thu May 6 20:34:42 1999 Fred Fish <fnf@be.com>
+
+ * configure.in (sys/resource.h): Add to AC_CHECK_HEADERS list.
+ * getruntime.c: Only attempt to include sys/resource.h and
+ use getrusage if both HAVE_GETRUSAGE and HAVE_SYS_RESOURCE_H
+ are defined.
+
1999-04-20 Jim Blandy <jimb@zwingli.cygnus.com>
Fix from Dale Hawkins:
diff --git a/libiberty/configure b/libiberty/configure
index 98407e7946c..075551026a7 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -1055,7 +1055,7 @@ else
fi
echo "$ac_t""$CPP" 1>&6
-for ac_hdr in sys/file.h sys/param.h stdlib.h string.h unistd.h strings.h sys/time.h
+for ac_hdr in sys/file.h sys/param.h stdlib.h string.h unistd.h strings.h sys/time.h sys/resource.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
diff --git a/libiberty/configure.in b/libiberty/configure.in
index f02f03561e5..1c1cb0b9748 100644
--- a/libiberty/configure.in
+++ b/libiberty/configure.in
@@ -106,7 +106,7 @@ AC_SUBST_FILE(host_makefile_frag)
# It's OK to check for header files. Although the compiler may not be
# able to link anything, it had better be able to at least compile
# something.
-AC_CHECK_HEADERS(sys/file.h sys/param.h stdlib.h string.h unistd.h strings.h sys/time.h)
+AC_CHECK_HEADERS(sys/file.h sys/param.h stdlib.h string.h unistd.h strings.h sys/time.h sys/resource.h)
AC_HEADER_SYS_WAIT
# This is the list of functions which libiberty will provide if they
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index 4be587a3bca..14ef56a588d 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -4379,6 +4379,66 @@ fancy_abort ()
fatal ("Internal gcc abort.");
}
+
+/* Fill in TABLE so that TABLE[C] is true iff C (as an unsigned char)
+ is a valid symbol component, in the standard assembler symbol
+ syntax. */
+void
+standard_symbol_alphabet (char *table)
+{
+ int c;
+
+ for (c = 0; c < 256; c++)
+ table[c] = isalnum(c);
+
+ table['_'] = 1;
+ table['$'] = 1;
+ table['.'] = 1;
+}
+
+
+/* Fill in TABLE so that TABLE[C] is true iff C (as an unsigned char)
+ is a valid symbol name component in an HP object file.
+
+ Note that, since HP's compiler generates object code straight from
+ C++ source, without going through an assembler, its mangled
+ identifiers can use all sorts of characters that no assembler would
+ tolerate, so the alphabet this function creates is a little odd.
+ Here are some sample mangled identifiers offered by HP:
+
+ typeid*__XT24AddressIndExpClassMember_
+ [Vftptr]key:__dt__32OrdinaryCompareIndExpClassMemberFv
+ __ct__Q2_9Elf64_Dyn18{unnamed.union.#1}Fv
+
+ This still seems really weird to me, since nowhere else in this
+ file is there anything to recognize curly brackets, parens, etc.
+ I've talked with Srikanth <srikanth@cup.hp.com>, and he assures me
+ this is right, but I still strongly suspect that there's a
+ misunderstanding here.
+
+ If we decide it's better for c++filt to use HP's assembler syntax
+ to scrape identifiers out of its input, here's the definition of
+ the symbol name syntax from the HP assembler manual:
+
+ Symbols are composed of uppercase and lowercase letters, decimal
+ digits, dollar symbol, period (.), ampersand (&), pound sign(#) and
+ underscore (_). A symbol can begin with a letter, digit underscore or
+ dollar sign. If a symbol begins with a digit, it must contain a
+ non-digit character.
+
+ So have fun. */
+void
+hp_symbol_alphabet (char *table)
+{
+ char *c;
+
+ standard_symbol_alphabet (table);
+
+ for (c = "<>#,*&[]:(){}"; *c; c++)
+ table[(unsigned char) *c] = 1;
+}
+
+
int
main (argc, argv)
int argc;
@@ -4386,6 +4446,7 @@ main (argc, argv)
{
char *result;
int c;
+ char symbol_alphabet[256];
program_name = argv[0];
@@ -4452,16 +4513,30 @@ main (argc, argv)
}
else
{
+ switch (current_demangling_style)
+ {
+ case gnu_demangling:
+ case lucid_demangling:
+ case arm_demangling:
+ case edg_demangling:
+ standard_symbol_alphabet (symbol_alphabet);
+ break;
+ case hp_demangling:
+ hp_symbol_alphabet (symbol_alphabet);
+ break;
+ default:
+ /* Folks should explicitly indicate the appropriate alphabet for
+ each demangling. Providing a default would allow the
+ question to go unconsidered. */
+ abort ();
+ }
+
for (;;)
{
int i = 0;
c = getchar ();
/* Try to read a label. */
- while (c != EOF && (isalnum(c) || c == '_' || c == '$' || c == '.' ||
- c == '<' || c == '>' || c == '#' || c == ',' || c == '*' || c == '&' ||
- c == '[' || c == ']' || c == ':' || c == '(' || c == ')'))
- /* the ones in the 2nd & 3rd lines were added to handle
- HP aCC template specialization manglings */
+ while (c != EOF && symbol_alphabet[c])
{
if (i >= MBUF_SIZE-1)
break;
diff --git a/libiberty/getruntime.c b/libiberty/getruntime.c
index 6e70773bd94..b855ea6e82f 100644
--- a/libiberty/getruntime.c
+++ b/libiberty/getruntime.c
@@ -28,7 +28,7 @@ Boston, MA 02111-1307, USA. */
#include <time.h>
-#ifdef HAVE_GETRUSAGE
+#if defined (HAVE_GETRUSAGE) && defined (HAVE_SYS_RESOURCE_H)
#include <sys/time.h>
#include <sys/resource.h>
#endif
@@ -66,7 +66,7 @@ Boston, MA 02111-1307, USA. */
long
get_run_time ()
{
-#ifdef HAVE_GETRUSAGE
+#if defined (HAVE_GETRUSAGE) && defined (HAVE_SYS_RESOURCE_H)
struct rusage rusage;
getrusage (0, &rusage);
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 0e5ea1760cb..d4f808033e9 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,18 +1,112 @@
+1999-05-28 Linus Nordberg <linus.nordberg@canit.se>
+
+ * m68k-opc.c: Rename MACL/MSACL to MAC/MSAC. Add MACM/MSACM. Add
+ MOVE MACSR,CCR.
+
+ * m68k-dis.c (fetch_arg): Add places `n', `o'.
+
+ * m68k-opc.c: Add MSAC, MACL, MOVE to/from ACC, MACSR, MASK.
+ Add mcf5206e to appropriate instructions.
+ Add alias for MAC, MSAC.
+
+ * m68k-dis.c (print_insn_arg): Add formats `E', `G', `H' and place
+ `N'.
+
+ * m68k-opc.c (m68k_opcodes): Add divsw, divsl, divuw, divul, macl,
+ macw, remsl, remul for mcf5307. Change mcf5200 --> mcf.
+
+ * m68k-dis.c: Add format `u' and places `h', `m', `M'.
+
+1999-05-18 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * i386-dis.c (Ed): Define.
+ (dis386_twobyte_att, dis386_twobyte_intel): Use Ed for movd.
+ (Rw): Remove.
+ (OP_rm): Rename to OP_Rd.
+ (ONE): Remove.
+ (OP_ONE): Remove.
+ (putop): Add const to template and p.
+ (print_insn_x86): Delete.
+ (print_insn_i386): Merge old function print_insn_x86. Add const
+ to dp.
+ (struct dis386): Add const to name.
+ (dis386_att, dis386_intel): Add const.
+ (dis386_twobyte_att, dis386_twobyte_intel): Add const.
+ (names32, names16, names8, names_seg, index16): Add const.
+ (grps, prefix_user_table, float_reg): Add const.
+ (float_mem_att, float_mem_intel): Add const.
+ (oappend): Add const to s.
+ (OP_REG): Add const to s.
+ (ptr_reg): Add const to s.
+ (dofloat): Add const to dp.
+ (OP_C): Don't skip modrm, it's now done in OP_Rd.
+ (OP_D): Ditto.
+ (OP_T): Ditto.
+ (OP_Rd): Check for valid mod. Call Op_E to print.
+ (OP_E): Handle d_mode arg. Check for bad sfence,lea,lds etc.
+ (OP_MS): Check for valid mod. Call Op_EM to print.
+ (OP_3DNowSuffix): Set obufp and use oappend rather than
+ strcat. Call BadOp() for errors.
+ (OP_SIMD_Suffix): Likewise.
+ (BadOp): New function.
+
+1999-05-12 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * i386-dis.c (dis386_intel): Remove macro chars, except for
+ jEcxz. Change cWtR and cRtd to cW and cR.
+ (dis386_twobyte_intel): Remove macro chars here too.
+ (putop): Handle R and W macros for intel mode.
+
+ * i386-dis.c (SIMD_Fixup): New function.
+ (dis386_twobyte_att): Use it on movlps and movhps, and change
+ Ev to EX on these insns. Change movmskps Ev, XM to Gv, EX.
+ (dis386_twobyte_intel): Same here.
+
+ * i386-dis.c (Av): Remove.
+ (Ap): remove lptr.
+ (lptr): Remove.
+ (OPSIMD): Define.
+ (OP_SIMD_Suffix): New function.
+ (OP_DIR): Remove dead code.
+ (eAX_reg..eDI_reg): Renumber.
+ (onebyte_has_modrm): Table numbering comments.
+ (INTERNAL_DISASSEMBLER_ERROR): Move to before print_insn_x86.
+ (print_insn_x86): Move all prefix oappends to after uses_f3_prefix
+ checks. Print error on invalid dp->bytemode2. Remove simd_cmp,
+ and handle SIMD cmp insns in OP_SIMD_Suffix.
+ (info->bytes_per_line): Bump from 5 to 6.
+ (OP_None): Remove.
+ (OP_E): Use INTERNAL_DISASSEMBLER_ERROR. Handle sfence.
+ (OP_3DNowSuffix): Ensure mnemonic index unsigned.
+
+ PIII SIMD support from Doug Ledford <dledford@redhat.com>
+ * i386-dis.c (XM, EX, None): Define.
+ (OP_XMM, OP_EX, OP_None): New functions.
+ (USE_GROUPS, USE_PREFIX_USER_TABLE): Define.
+ (GRP14): Rename to GRPAMD.
+ (GRP*): Add USE_GROUPS flag.
+ (PREGRP*): Define.
+ (dis386_twobyte_att, dis386_twobyte_intel): Add SIMD insns.
+ (twobyte_has_modrm): Add SIMD entries.
+ (twobyte_uses_f3_prefix, simd_cmp_op, prefix_user_table): New.
+ (grps): Add SIMD insns.
+ (print_insn_x86): New vars uses_f3_prefix and simd_cmp. Don't
+ oappend repz if uses_f3_prefix. Add code to handle new groups for
+ SIMD insns.
+
+ From Maciej W. Rozycki <macro@ds2.pg.gda.pl>
+ * i386-dis.c (dis386_att, dis386_intel): Change 0xE8 call insn
+ operand from Av to Jv.
+
+1999-05-07 Nick Clifton <nickc@cygnus.com>
+
+ * mcore-dis.c (print_insn_mcore): Use .short to display
+ unidentified instructions, not .word.
+
1999-04-26 Tom Tromey <tromey@cygnus.com>
* aclocal.m4, configure: Updated for new version of libtool.
-1999-04-22 Nick Clifton <nickc@cygnus.com>
-
- * mcore-dis.c (print_insn_mcore): Display locaiton of address pool
- for LRW instructions.
-
-1999-04-18 Nick Clifton <nickc@cygnus.com>
-
- * mcore-dis.c (print_insn_mcore): Display location of address pool
- for JMP instructions.
- * mcore-opc.h (mcore_table): Add 'nop'.
-
1999-04-14 Doug Evans <devans@casey.cygnus.com>
* fr30-desc.c,fr30-desc.h,fr30-dis.c,fr30-ibld.c,fr30-opc.c: Rebuild.
@@ -28,16 +122,6 @@ Mon Apr 12 23:46:17 1999 Jeffrey A Law (law@cygnus.com)
* fr30-desc.c,fr30-desc.h,fr30-ibld.c: Rebuild.
* m32r-desc.c,m32r-desc.h,m32r-opinst.c: Rebuild.
-1999-04-08 Nick Clifton <nickc@cygnus.com>
-
- * mcore-dis.c: New file: Disassemble MCore opcodes.
- * mcore-opc.h: New file: Definitions of MCore opcodes.
- * Makefile.am: Add Mcore source files.
- * Makefile.in: Regenerate.
- * configure.in: Add support for MCore targets.
- * configure: Regenerate.
- * disassemble.c: Add support for MCore targets.
-
1999-04-06 Ian Lance Taylor <ian@zembu.com>
* opintl.h (LC_MESSAGES): Never define.
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 19144cb9fc5..7cda14e8d78 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -93,24 +93,21 @@ fetch_data (info, addr)
#define indirEb OP_indirE, b_mode
#define Gb OP_G, b_mode
#define Ev OP_E, v_mode
+#define Ed OP_E, d_mode
#define indirEv OP_indirE, v_mode
#define Ew OP_E, w_mode
#define Ma OP_E, v_mode
-#define M OP_E, 0
-#define Mp OP_E, 0 /* ? */
+#define M OP_E, 0 /* lea */
+#define Mp OP_E, 0 /* 32 or 48 bit memory operand for LDS, LES etc */
#define Gv OP_G, v_mode
#define Gw OP_G, w_mode
-#define Rw OP_rm, w_mode
-#define Rd OP_rm, d_mode
+#define Rd OP_Rd, d_mode
#define Ib OP_I, b_mode
#define sIb OP_sI, b_mode /* sign extened byte */
#define Iv OP_I, v_mode
#define Iw OP_I, w_mode
#define Jb OP_J, b_mode
#define Jv OP_J, v_mode
-#if 0
-#define ONE OP_ONE, 0
-#endif
#define Cd OP_C, d_mode
#define Dd OP_D, d_mode
#define Td OP_T, d_mode
@@ -136,8 +133,7 @@ fetch_data (info, addr)
#define indirDX OP_REG, indir_dx_reg
#define Sw OP_SEG, w_mode
-#define Ap OP_DIR, lptr
-#define Av OP_DIR, v_mode
+#define Ap OP_DIR, 0
#define Ob OP_OFF, b_mode
#define Ov OP_OFF, v_mode
#define Xb OP_DSreg, eSI_reg
@@ -154,9 +150,13 @@ fetch_data (info, addr)
#define gs OP_REG, gs_reg
#define MX OP_MMX, 0
+#define XM OP_XMM, 0
#define EM OP_EM, v_mode
-#define MS OP_MS, b_mode
+#define EX OP_EX, v_mode
+#define MS OP_MS, v_mode
+#define None OP_E, 0
#define OPSUF OP_3DNowSuffix, 0
+#define OPSIMD OP_SIMD_Suffix, 0
/* bits in sizeflag */
#if 0 /* leave undefined until someone adds the extra flag to objdump */
@@ -165,7 +165,7 @@ fetch_data (info, addr)
#define AFLAG 2
#define DFLAG 1
-typedef void (*op_rtn) PARAMS ((int bytemode, int sizeflag ));
+typedef void (*op_rtn) PARAMS ((int bytemode, int sizeflag));
static void OP_E PARAMS ((int, int));
static void OP_G PARAMS ((int, int));
@@ -182,25 +182,27 @@ static void OP_SEG PARAMS ((int, int));
static void OP_C PARAMS ((int, int));
static void OP_D PARAMS ((int, int));
static void OP_T PARAMS ((int, int));
-static void OP_rm PARAMS ((int, int));
+static void OP_Rd PARAMS ((int, int));
static void OP_ST PARAMS ((int, int));
static void OP_STi PARAMS ((int, int));
-#if 0
-static void OP_ONE PARAMS ((int, int));
-#endif
static void OP_MMX PARAMS ((int, int));
+static void OP_XMM PARAMS ((int, int));
static void OP_EM PARAMS ((int, int));
+static void OP_EX PARAMS ((int, int));
static void OP_MS PARAMS ((int, int));
static void OP_3DNowSuffix PARAMS ((int, int));
+static void OP_SIMD_Suffix PARAMS ((int, int));
+static void SIMD_Fixup PARAMS ((int, int));
static void append_seg PARAMS ((void));
static void set_op PARAMS ((unsigned int op));
-static void putop PARAMS ((char *template, int sizeflag));
+static void putop PARAMS ((const char *template, int sizeflag));
static void dofloat PARAMS ((int sizeflag));
static int get16 PARAMS ((void));
static int get32 PARAMS ((void));
static void ckprefix PARAMS ((void));
static void ptr_reg PARAMS ((int, int));
+static void BadOp PARAMS ((void));
#define b_mode 1
#define v_mode 2
@@ -214,16 +216,15 @@ static void ptr_reg PARAMS ((int, int));
#define ds_reg 103
#define fs_reg 104
#define gs_reg 105
-#define eAX_reg 107
-#define eCX_reg 108
-#define eDX_reg 109
-#define eBX_reg 110
-#define eSP_reg 111
-#define eBP_reg 112
-#define eSI_reg 113
-#define eDI_reg 114
-#define lptr 115
+#define eAX_reg 108
+#define eCX_reg 109
+#define eDX_reg 110
+#define eBX_reg 111
+#define eSP_reg 112
+#define eBP_reg 113
+#define eSI_reg 114
+#define eDI_reg 115
#define al_reg 116
#define cl_reg 117
@@ -245,34 +246,54 @@ static void ptr_reg PARAMS ((int, int));
#define indir_dx_reg 150
-#define GRP1b NULL, NULL, 0
-#define GRP1S NULL, NULL, 1
-#define GRP1Ss NULL, NULL, 2
-#define GRP2b NULL, NULL, 3
-#define GRP2S NULL, NULL, 4
-#define GRP2b_one NULL, NULL, 5
-#define GRP2S_one NULL, NULL, 6
-#define GRP2b_cl NULL, NULL, 7
-#define GRP2S_cl NULL, NULL, 8
-#define GRP3b NULL, NULL, 9
-#define GRP3S NULL, NULL, 10
-#define GRP4 NULL, NULL, 11
-#define GRP5 NULL, NULL, 12
-#define GRP6 NULL, NULL, 13
-#define GRP7 NULL, NULL, 14
-#define GRP8 NULL, NULL, 15
-#define GRP9 NULL, NULL, 16
-#define GRP10 NULL, NULL, 17
-#define GRP11 NULL, NULL, 18
-#define GRP12 NULL, NULL, 19
-#define GRP13 NULL, NULL, 20
-#define GRP14 NULL, NULL, 21
+#define USE_GROUPS 1
+#define USE_PREFIX_USER_TABLE 2
+
+#define GRP1b NULL, NULL, 0, NULL, USE_GROUPS
+#define GRP1S NULL, NULL, 1, NULL, USE_GROUPS
+#define GRP1Ss NULL, NULL, 2, NULL, USE_GROUPS
+#define GRP2b NULL, NULL, 3, NULL, USE_GROUPS
+#define GRP2S NULL, NULL, 4, NULL, USE_GROUPS
+#define GRP2b_one NULL, NULL, 5, NULL, USE_GROUPS
+#define GRP2S_one NULL, NULL, 6, NULL, USE_GROUPS
+#define GRP2b_cl NULL, NULL, 7, NULL, USE_GROUPS
+#define GRP2S_cl NULL, NULL, 8, NULL, USE_GROUPS
+#define GRP3b NULL, NULL, 9, NULL, USE_GROUPS
+#define GRP3S NULL, NULL, 10, NULL, USE_GROUPS
+#define GRP4 NULL, NULL, 11, NULL, USE_GROUPS
+#define GRP5 NULL, NULL, 12, NULL, USE_GROUPS
+#define GRP6 NULL, NULL, 13, NULL, USE_GROUPS
+#define GRP7 NULL, NULL, 14, NULL, USE_GROUPS
+#define GRP8 NULL, NULL, 15, NULL, USE_GROUPS
+#define GRP9 NULL, NULL, 16, NULL, USE_GROUPS
+#define GRP10 NULL, NULL, 17, NULL, USE_GROUPS
+#define GRP11 NULL, NULL, 18, NULL, USE_GROUPS
+#define GRP12 NULL, NULL, 19, NULL, USE_GROUPS
+#define GRP13 NULL, NULL, 20, NULL, USE_GROUPS
+#define GRP14 NULL, NULL, 21, NULL, USE_GROUPS
+#define GRPAMD NULL, NULL, 22, NULL, USE_GROUPS
+
+#define PREGRP0 NULL, NULL, 0, NULL, USE_PREFIX_USER_TABLE
+#define PREGRP1 NULL, NULL, 1, NULL, USE_PREFIX_USER_TABLE
+#define PREGRP2 NULL, NULL, 2, NULL, USE_PREFIX_USER_TABLE
+#define PREGRP3 NULL, NULL, 3, NULL, USE_PREFIX_USER_TABLE
+#define PREGRP4 NULL, NULL, 4, NULL, USE_PREFIX_USER_TABLE
+#define PREGRP5 NULL, NULL, 5, NULL, USE_PREFIX_USER_TABLE
+#define PREGRP6 NULL, NULL, 6, NULL, USE_PREFIX_USER_TABLE
+#define PREGRP7 NULL, NULL, 7, NULL, USE_PREFIX_USER_TABLE
+#define PREGRP8 NULL, NULL, 8, NULL, USE_PREFIX_USER_TABLE
+#define PREGRP9 NULL, NULL, 9, NULL, USE_PREFIX_USER_TABLE
+#define PREGRP10 NULL, NULL, 10, NULL, USE_PREFIX_USER_TABLE
+#define PREGRP11 NULL, NULL, 11, NULL, USE_PREFIX_USER_TABLE
+#define PREGRP12 NULL, NULL, 12, NULL, USE_PREFIX_USER_TABLE
+#define PREGRP13 NULL, NULL, 13, NULL, USE_PREFIX_USER_TABLE
+#define PREGRP14 NULL, NULL, 14, NULL, USE_PREFIX_USER_TABLE
#define FLOATCODE 50
#define FLOAT NULL, NULL, FLOATCODE
struct dis386 {
- char *name;
+ const char *name;
op_rtn op1;
int bytemode1;
op_rtn op2;
@@ -295,7 +316,7 @@ struct dis386 {
'W' => print 'b' or 'w'
*/
-static struct dis386 dis386_att[] = {
+static const struct dis386 dis386_att[] = {
/* 00 */
{ "addB", Eb, Gb },
{ "addS", Ev, Gv },
@@ -558,7 +579,7 @@ static struct dis386 dis386_att[] = {
{ "outB", Ib, AL },
{ "outS", Ib, eAX },
/* e8 */
- { "callP", Av },
+ { "callP", Jv },
{ "jmpP", Jv },
{ "ljmpP", Ap },
{ "jmp", Jb },
@@ -586,133 +607,133 @@ static struct dis386 dis386_att[] = {
{ GRP5 },
};
-static struct dis386 dis386_intel[] = {
+static const struct dis386 dis386_intel[] = {
/* 00 */
- { "addB", Eb, Gb },
- { "addS", Ev, Gv },
- { "addB", Gb, Eb },
- { "addS", Gv, Ev },
- { "addB", AL, Ib },
- { "addS", eAX, Iv },
- { "pushP", es },
- { "popP", es },
+ { "add", Eb, Gb },
+ { "add", Ev, Gv },
+ { "add", Gb, Eb },
+ { "add", Gv, Ev },
+ { "add", AL, Ib },
+ { "add", eAX, Iv },
+ { "push", es },
+ { "pop", es },
/* 08 */
- { "orB", Eb, Gb },
- { "orS", Ev, Gv },
- { "orB", Gb, Eb },
- { "orS", Gv, Ev },
- { "orB", AL, Ib },
- { "orS", eAX, Iv },
- { "pushP", cs },
+ { "or", Eb, Gb },
+ { "or", Ev, Gv },
+ { "or", Gb, Eb },
+ { "or", Gv, Ev },
+ { "or", AL, Ib },
+ { "or", eAX, Iv },
+ { "push", cs },
{ "(bad)" }, /* 0x0f extended opcode escape */
/* 10 */
- { "adcB", Eb, Gb },
- { "adcS", Ev, Gv },
- { "adcB", Gb, Eb },
- { "adcS", Gv, Ev },
- { "adcB", AL, Ib },
- { "adcS", eAX, Iv },
- { "pushP", ss },
- { "popP", ss },
+ { "adc", Eb, Gb },
+ { "adc", Ev, Gv },
+ { "adc", Gb, Eb },
+ { "adc", Gv, Ev },
+ { "adc", AL, Ib },
+ { "adc", eAX, Iv },
+ { "push", ss },
+ { "pop", ss },
/* 18 */
- { "sbbB", Eb, Gb },
- { "sbbS", Ev, Gv },
- { "sbbB", Gb, Eb },
- { "sbbS", Gv, Ev },
- { "sbbB", AL, Ib },
- { "sbbS", eAX, Iv },
- { "pushP", ds },
- { "popP", ds },
+ { "sbb", Eb, Gb },
+ { "sbb", Ev, Gv },
+ { "sbb", Gb, Eb },
+ { "sbb", Gv, Ev },
+ { "sbb", AL, Ib },
+ { "sbb", eAX, Iv },
+ { "push", ds },
+ { "pop", ds },
/* 20 */
- { "andB", Eb, Gb },
- { "andS", Ev, Gv },
- { "andB", Gb, Eb },
- { "andS", Gv, Ev },
- { "andB", AL, Ib },
- { "andS", eAX, Iv },
+ { "and", Eb, Gb },
+ { "and", Ev, Gv },
+ { "and", Gb, Eb },
+ { "and", Gv, Ev },
+ { "and", AL, Ib },
+ { "and", eAX, Iv },
{ "(bad)" }, /* SEG ES prefix */
{ "daa" },
/* 28 */
- { "subB", Eb, Gb },
- { "subS", Ev, Gv },
- { "subB", Gb, Eb },
- { "subS", Gv, Ev },
- { "subB", AL, Ib },
- { "subS", eAX, Iv },
+ { "sub", Eb, Gb },
+ { "sub", Ev, Gv },
+ { "sub", Gb, Eb },
+ { "sub", Gv, Ev },
+ { "sub", AL, Ib },
+ { "sub", eAX, Iv },
{ "(bad)" }, /* SEG CS prefix */
{ "das" },
/* 30 */
- { "xorB", Eb, Gb },
- { "xorS", Ev, Gv },
- { "xorB", Gb, Eb },
- { "xorS", Gv, Ev },
- { "xorB", AL, Ib },
- { "xorS", eAX, Iv },
+ { "xor", Eb, Gb },
+ { "xor", Ev, Gv },
+ { "xor", Gb, Eb },
+ { "xor", Gv, Ev },
+ { "xor", AL, Ib },
+ { "xor", eAX, Iv },
{ "(bad)" }, /* SEG SS prefix */
{ "aaa" },
/* 38 */
- { "cmpB", Eb, Gb },
- { "cmpS", Ev, Gv },
- { "cmpB", Gb, Eb },
- { "cmpS", Gv, Ev },
- { "cmpB", AL, Ib },
- { "cmpS", eAX, Iv },
+ { "cmp", Eb, Gb },
+ { "cmp", Ev, Gv },
+ { "cmp", Gb, Eb },
+ { "cmp", Gv, Ev },
+ { "cmp", AL, Ib },
+ { "cmp", eAX, Iv },
{ "(bad)" }, /* SEG DS prefix */
{ "aas" },
/* 40 */
- { "incS", eAX },
- { "incS", eCX },
- { "incS", eDX },
- { "incS", eBX },
- { "incS", eSP },
- { "incS", eBP },
- { "incS", eSI },
- { "incS", eDI },
+ { "inc", eAX },
+ { "inc", eCX },
+ { "inc", eDX },
+ { "inc", eBX },
+ { "inc", eSP },
+ { "inc", eBP },
+ { "inc", eSI },
+ { "inc", eDI },
/* 48 */
- { "decS", eAX },
- { "decS", eCX },
- { "decS", eDX },
- { "decS", eBX },
- { "decS", eSP },
- { "decS", eBP },
- { "decS", eSI },
- { "decS", eDI },
+ { "dec", eAX },
+ { "dec", eCX },
+ { "dec", eDX },
+ { "dec", eBX },
+ { "dec", eSP },
+ { "dec", eBP },
+ { "dec", eSI },
+ { "dec", eDI },
/* 50 */
- { "pushS", eAX },
- { "pushS", eCX },
- { "pushS", eDX },
- { "pushS", eBX },
- { "pushS", eSP },
- { "pushS", eBP },
- { "pushS", eSI },
- { "pushS", eDI },
+ { "push", eAX },
+ { "push", eCX },
+ { "push", eDX },
+ { "push", eBX },
+ { "push", eSP },
+ { "push", eBP },
+ { "push", eSI },
+ { "push", eDI },
/* 58 */
- { "popS", eAX },
- { "popS", eCX },
- { "popS", eDX },
- { "popS", eBX },
- { "popS", eSP },
- { "popS", eBP },
- { "popS", eSI },
- { "popS", eDI },
+ { "pop", eAX },
+ { "pop", eCX },
+ { "pop", eDX },
+ { "pop", eBX },
+ { "pop", eSP },
+ { "pop", eBP },
+ { "pop", eSI },
+ { "pop", eDI },
/* 60 */
- { "pushaP" },
- { "popaP" },
- { "boundS", Gv, Ma },
+ { "pusha" },
+ { "popa" },
+ { "bound", Gv, Ma },
{ "arpl", Ew, Gw },
{ "(bad)" }, /* seg fs */
{ "(bad)" }, /* seg gs */
{ "(bad)" }, /* op size prefix */
{ "(bad)" }, /* adr size prefix */
/* 68 */
- { "pushP", Iv }, /* 386 book wrong */
- { "imulS", Gv, Ev, Iv },
- { "pushP", sIb }, /* push of byte really pushes 2 or 4 bytes */
- { "imulS", Gv, Ev, sIb },
- { "insb", Yb, indirDX },
- { "insR", Yv, indirDX },
- { "outsb", indirDX, Xb },
- { "outsR", indirDX, Xv },
+ { "push", Iv }, /* 386 book wrong */
+ { "imul", Gv, Ev, Iv },
+ { "push", sIb }, /* push of byte really pushes 2 or 4 bytes */
+ { "imul", Gv, Ev, sIb },
+ { "ins", Yb, indirDX },
+ { "ins", Yv, indirDX },
+ { "outs", indirDX, Xb },
+ { "outs", indirDX, Xv },
/* 70 */
{ "jo", Jb },
{ "jno", Jb },
@@ -736,91 +757,91 @@ static struct dis386 dis386_intel[] = {
{ GRP1S },
{ "(bad)" },
{ GRP1Ss },
- { "testB", Eb, Gb },
- { "testS", Ev, Gv },
- { "xchgB", Eb, Gb },
- { "xchgS", Ev, Gv },
+ { "test", Eb, Gb },
+ { "test", Ev, Gv },
+ { "xchg", Eb, Gb },
+ { "xchg", Ev, Gv },
/* 88 */
- { "movB", Eb, Gb },
- { "movS", Ev, Gv },
- { "movB", Gb, Eb },
- { "movS", Gv, Ev },
- { "movQ", Ev, Sw },
- { "leaS", Gv, M },
- { "movQ", Sw, Ev },
- { "popQ", Ev },
+ { "mov", Eb, Gb },
+ { "mov", Ev, Gv },
+ { "mov", Gb, Eb },
+ { "mov", Gv, Ev },
+ { "mov", Ev, Sw },
+ { "lea", Gv, M },
+ { "mov", Sw, Ev },
+ { "pop", Ev },
/* 90 */
{ "nop" },
- { "xchgS", eCX, eAX },
- { "xchgS", eDX, eAX },
- { "xchgS", eBX, eAX },
- { "xchgS", eSP, eAX },
- { "xchgS", eBP, eAX },
- { "xchgS", eSI, eAX },
- { "xchgS", eDI, eAX },
+ { "xchg", eCX, eAX },
+ { "xchg", eDX, eAX },
+ { "xchg", eBX, eAX },
+ { "xchg", eSP, eAX },
+ { "xchg", eBP, eAX },
+ { "xchg", eSI, eAX },
+ { "xchg", eDI, eAX },
/* 98 */
- { "cWtR" },
- { "cRtd" },
- { "lcallP", Ap },
+ { "cW" }, /* cwde and cbw */
+ { "cR" }, /* cdq and cwd */
+ { "lcall", Ap },
{ "(bad)" }, /* fwait */
- { "pushfP" },
- { "popfP" },
+ { "pushf" },
+ { "popf" },
{ "sahf" },
{ "lahf" },
/* a0 */
- { "movB", AL, Ob },
- { "movS", eAX, Ov },
- { "movB", Ob, AL },
- { "movS", Ov, eAX },
- { "movsb", Yb, Xb },
- { "movsR", Yv, Xv },
- { "cmpsb", Xb, Yb },
- { "cmpsR", Xv, Yv },
+ { "mov", AL, Ob },
+ { "mov", eAX, Ov },
+ { "mov", Ob, AL },
+ { "mov", Ov, eAX },
+ { "movs", Yb, Xb },
+ { "movs", Yv, Xv },
+ { "cmps", Xb, Yb },
+ { "cmps", Xv, Yv },
/* a8 */
- { "testB", AL, Ib },
- { "testS", eAX, Iv },
- { "stosB", Yb, AL },
- { "stosS", Yv, eAX },
- { "lodsB", AL, Xb },
- { "lodsS", eAX, Xv },
- { "scasB", AL, Yb },
- { "scasS", eAX, Yv },
+ { "test", AL, Ib },
+ { "test", eAX, Iv },
+ { "stos", Yb, AL },
+ { "stos", Yv, eAX },
+ { "lods", AL, Xb },
+ { "lods", eAX, Xv },
+ { "scas", AL, Yb },
+ { "scas", eAX, Yv },
/* b0 */
- { "movB", AL, Ib },
- { "movB", CL, Ib },
- { "movB", DL, Ib },
- { "movB", BL, Ib },
- { "movB", AH, Ib },
- { "movB", CH, Ib },
- { "movB", DH, Ib },
- { "movB", BH, Ib },
+ { "mov", AL, Ib },
+ { "mov", CL, Ib },
+ { "mov", DL, Ib },
+ { "mov", BL, Ib },
+ { "mov", AH, Ib },
+ { "mov", CH, Ib },
+ { "mov", DH, Ib },
+ { "mov", BH, Ib },
/* b8 */
- { "movS", eAX, Iv },
- { "movS", eCX, Iv },
- { "movS", eDX, Iv },
- { "movS", eBX, Iv },
- { "movS", eSP, Iv },
- { "movS", eBP, Iv },
- { "movS", eSI, Iv },
- { "movS", eDI, Iv },
+ { "mov", eAX, Iv },
+ { "mov", eCX, Iv },
+ { "mov", eDX, Iv },
+ { "mov", eBX, Iv },
+ { "mov", eSP, Iv },
+ { "mov", eBP, Iv },
+ { "mov", eSI, Iv },
+ { "mov", eDI, Iv },
/* c0 */
{ GRP2b },
{ GRP2S },
- { "retP", Iw },
- { "retP" },
- { "lesS", Gv, Mp },
- { "ldsS", Gv, Mp },
- { "movA", Eb, Ib },
- { "movQ", Ev, Iv },
+ { "ret", Iw },
+ { "ret" },
+ { "les", Gv, Mp },
+ { "lds", Gv, Mp },
+ { "mov", Eb, Ib },
+ { "mov", Ev, Iv },
/* c8 */
- { "enterP", Iw, Ib },
- { "leaveP" },
- { "lretP", Iw },
- { "lretP" },
+ { "enter", Iw, Ib },
+ { "leave" },
+ { "lret", Iw },
+ { "lret" },
{ "int3" },
{ "int", Ib },
{ "into" },
- { "iretP" },
+ { "iret" },
/* d0 */
{ GRP2b_one },
{ GRP2S_one },
@@ -844,19 +865,19 @@ static struct dis386 dis386_intel[] = {
{ "loope", Jb },
{ "loop", Jb },
{ "jEcxz", Jb },
- { "inB", AL, Ib },
- { "inS", eAX, Ib },
- { "outB", Ib, AL },
- { "outS", Ib, eAX },
+ { "in", AL, Ib },
+ { "in", eAX, Ib },
+ { "out", Ib, AL },
+ { "out", Ib, eAX },
/* e8 */
- { "callP", Av },
- { "jmpP", Jv },
- { "ljmpP", Ap },
+ { "call", Jv },
+ { "jmp", Jv },
+ { "ljmp", Ap },
{ "jmp", Jb },
- { "inB", AL, indirDX },
- { "inS", eAX, indirDX },
- { "outB", indirDX, AL },
- { "outS", indirDX, eAX },
+ { "in", AL, indirDX },
+ { "in", eAX, indirDX },
+ { "out", indirDX, AL },
+ { "out", indirDX, eAX },
/* f0 */
{ "(bad)" }, /* lock prefix */
{ "(bad)" },
@@ -877,7 +898,7 @@ static struct dis386 dis386_intel[] = {
{ GRP5 },
};
-static struct dis386 dis386_twobyte_att[] = {
+static const struct dis386 dis386_twobyte_att[] = {
/* 00 */
{ GRP6 },
{ GRP7 },
@@ -893,14 +914,21 @@ static struct dis386 dis386_twobyte_att[] = {
{ "(bad)" },
{ "ud2a" },
{ "(bad)" },
- { GRP14 },
+ { GRPAMD },
{ "femms" },
{ "", MX, EM, OPSUF }, /* See OP_3DNowSuffix */
/* 10 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { PREGRP8 },
+ { PREGRP9 },
+ { "movlps", XM, EX, SIMD_Fixup, 'h' }, /* really only 2 operands */
+ { "movlps", EX, XM, SIMD_Fixup, 'h' },
+ { "unpcklps", XM, EX },
+ { "unpckhps", XM, EX },
+ { "movhps", XM, EX, SIMD_Fixup, 'l' },
+ { "movhps", EX, XM, SIMD_Fixup, 'l' },
/* 18 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { GRP14 },
+ { "(bad)" }, { "(bad)" }, { "(bad)" },
{ "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
/* 20 */
/* these are all backward in appendix A of the intel book */
@@ -913,8 +941,14 @@ static struct dis386 dis386_twobyte_att[] = {
{ "movL", Td, Rd },
{ "(bad)" },
/* 28 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "movaps", XM, EX },
+ { "movaps", EX, XM },
+ { PREGRP2 },
+ { "movntps", Ev, XM },
+ { PREGRP4 },
+ { PREGRP3 },
+ { "ucomiss", XM, EX },
+ { "comiss", XM, EX },
/* 30 */
{ "wrmsr" }, { "rdtsc" }, { "rdmsr" }, { "rdpmc" },
{ "sysenter" }, { "sysexit" }, { "(bad)" }, { "(bad)" },
@@ -928,11 +962,23 @@ static struct dis386 dis386_twobyte_att[] = {
{ "cmovs", Gv,Ev }, { "cmovns", Gv,Ev }, { "cmovp", Gv,Ev }, { "cmovnp", Gv,Ev },
{ "cmovl", Gv,Ev }, { "cmovge", Gv,Ev }, { "cmovle", Gv,Ev }, { "cmovg", Gv,Ev },
/* 50 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "movmskps", Gv, EX },
+ { PREGRP13 },
+ { PREGRP12 },
+ { PREGRP11 },
+ { "andps", XM, EX },
+ { "andnps", XM, EX },
+ { "orps", XM, EX },
+ { "xorps", XM, EX },
/* 58 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { PREGRP0 },
+ { PREGRP10 },
+ { "(bad)" },
+ { "(bad)" },
+ { PREGRP14 },
+ { PREGRP7 },
+ { PREGRP5 },
+ { PREGRP6 },
/* 60 */
{ "punpcklbw", MX, EM },
{ "punpcklwd", MX, EM },
@@ -948,10 +994,10 @@ static struct dis386 dis386_twobyte_att[] = {
{ "punpckhdq", MX, EM },
{ "packssdw", MX, EM },
{ "(bad)" }, { "(bad)" },
- { "movd", MX, Ev },
+ { "movd", MX, Ed },
{ "movq", MX, EM },
/* 70 */
- { "(bad)" },
+ { "pshufw", MX, EM, Ib },
{ GRP10 },
{ GRP11 },
{ GRP12 },
@@ -962,7 +1008,7 @@ static struct dis386 dis386_twobyte_att[] = {
/* 78 */
{ "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
{ "(bad)" }, { "(bad)" },
- { "movd", Ev, MX },
+ { "movd", Ed, MX },
{ "movq", EM, MX },
/* 80 */
{ "jo", Jv },
@@ -1021,10 +1067,10 @@ static struct dis386 dis386_twobyte_att[] = {
/* b0 */
{ "cmpxchgB", Eb, Gb },
{ "cmpxchgS", Ev, Gv },
- { "lssS", Gv, Mp }, /* 386 lists only Mp */
+ { "lssS", Gv, Mp },
{ "btrS", Ev, Gv },
- { "lfsS", Gv, Mp }, /* 386 lists only Mp */
- { "lgsS", Gv, Mp }, /* 386 lists only Mp */
+ { "lfsS", Gv, Mp },
+ { "lgsS", Gv, Mp },
{ "movzbR", Gv, Eb },
{ "movzwR", Gv, Ew }, /* yes, there really is movzww ! */
/* b8 */
@@ -1039,11 +1085,11 @@ static struct dis386 dis386_twobyte_att[] = {
/* c0 */
{ "xaddB", Eb, Gb },
{ "xaddS", Ev, Gv },
+ { PREGRP1 },
{ "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
+ { "pinsrw", MX, Ev, Ib },
+ { "pextrw", Ev, MX, Ib },
+ { "shufps", XM, EX, Ib },
{ GRP9 },
/* c8 */
{ "bswap", eAX }, /* bswap doesn't support 16 bit regs */
@@ -1061,32 +1107,34 @@ static struct dis386 dis386_twobyte_att[] = {
{ "psrlq", MX, EM },
{ "(bad)" },
{ "pmullw", MX, EM },
- { "(bad)" }, { "(bad)" },
+ { "(bad)" },
+ { "pmovmskb", Ev, MX },
/* d8 */
{ "psubusb", MX, EM },
{ "psubusw", MX, EM },
- { "(bad)" },
+ { "pminub", MX, EM },
{ "pand", MX, EM },
{ "paddusb", MX, EM },
{ "paddusw", MX, EM },
- { "(bad)" },
+ { "pmaxub", MX, EM },
{ "pandn", MX, EM },
/* e0 */
- { "(bad)" },
+ { "pavgb", MX, EM },
{ "psraw", MX, EM },
{ "psrad", MX, EM },
- { "(bad)" },
- { "(bad)" },
+ { "pavgw", MX, EM },
+ { "pmulhuw", MX, EM },
{ "pmulhw", MX, EM },
- { "(bad)" }, { "(bad)" },
+ { "(bad)" },
+ { "movntq", Ev, MX },
/* e8 */
{ "psubsb", MX, EM },
{ "psubsw", MX, EM },
- { "(bad)" },
+ { "pminsw", MX, EM },
{ "por", MX, EM },
{ "paddsb", MX, EM },
{ "paddsw", MX, EM },
- { "(bad)" },
+ { "pmaxsw", MX, EM },
{ "pxor", MX, EM },
/* f0 */
{ "(bad)" },
@@ -1095,7 +1143,8 @@ static struct dis386 dis386_twobyte_att[] = {
{ "psllq", MX, EM },
{ "(bad)" },
{ "pmaddwd", MX, EM },
- { "(bad)" }, { "(bad)" },
+ { "psadbw", MX, EM },
+ { "maskmovq", MX, EM },
/* f8 */
{ "psubb", MX, EM },
{ "psubw", MX, EM },
@@ -1107,12 +1156,12 @@ static struct dis386 dis386_twobyte_att[] = {
{ "(bad)" }
};
-static struct dis386 dis386_twobyte_intel[] = {
+static const struct dis386 dis386_twobyte_intel[] = {
/* 00 */
{ GRP6 },
{ GRP7 },
- { "larS", Gv, Ew },
- { "lslS", Gv, Ew },
+ { "lar", Gv, Ew },
+ { "lsl", Gv, Ew },
{ "(bad)" },
{ "(bad)" },
{ "clts" },
@@ -1123,28 +1172,41 @@ static struct dis386 dis386_twobyte_intel[] = {
{ "(bad)" },
{ "ud2a" },
{ "(bad)" },
- { GRP14 },
+ { GRPAMD },
{ "femms" },
{ "", MX, EM, OPSUF }, /* See OP_3DNowSuffix */
/* 10 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { PREGRP8 },
+ { PREGRP9 },
+ { "movlps", XM, EX, SIMD_Fixup, 'h' }, /* really only 2 operands */
+ { "movlps", EX, XM, SIMD_Fixup, 'h' },
+ { "unpcklps", XM, EX },
+ { "unpckhps", XM, EX },
+ { "movhps", XM, EX, SIMD_Fixup, 'l' },
+ { "movhps", EX, XM, SIMD_Fixup, 'l' },
/* 18 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { GRP14 },
+ { "(bad)" }, { "(bad)" }, { "(bad)" },
{ "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
/* 20 */
/* these are all backward in appendix A of the intel book */
- { "movL", Rd, Cd },
- { "movL", Rd, Dd },
- { "movL", Cd, Rd },
- { "movL", Dd, Rd },
- { "movL", Rd, Td },
+ { "mov", Rd, Cd },
+ { "mov", Rd, Dd },
+ { "mov", Cd, Rd },
+ { "mov", Dd, Rd },
+ { "mov", Rd, Td },
{ "(bad)" },
- { "movL", Td, Rd },
+ { "mov", Td, Rd },
{ "(bad)" },
/* 28 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "movaps", XM, EX },
+ { "movaps", EX, XM },
+ { PREGRP2 },
+ { "movntps", Ev, XM },
+ { PREGRP4 },
+ { PREGRP3 },
+ { "ucomiss", XM, EX },
+ { "comiss", XM, EX },
/* 30 */
{ "wrmsr" }, { "rdtsc" }, { "rdmsr" }, { "rdpmc" },
{ "sysenter" }, { "sysexit" }, { "(bad)" }, { "(bad)" },
@@ -1158,11 +1220,23 @@ static struct dis386 dis386_twobyte_intel[] = {
{ "cmovs", Gv,Ev }, { "cmovns", Gv,Ev }, { "cmovp", Gv,Ev }, { "cmovnp", Gv,Ev },
{ "cmovl", Gv,Ev }, { "cmovge", Gv,Ev }, { "cmovle", Gv,Ev }, { "cmovg", Gv,Ev },
/* 50 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "movmskps", Gv, EX },
+ { PREGRP13 },
+ { PREGRP12 },
+ { PREGRP11 },
+ { "andps", XM, EX },
+ { "andnps", XM, EX },
+ { "orps", XM, EX },
+ { "xorps", XM, EX },
/* 58 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { PREGRP0 },
+ { PREGRP10 },
+ { "(bad)" },
+ { "(bad)" },
+ { PREGRP14 },
+ { PREGRP7 },
+ { PREGRP5 },
+ { PREGRP6 },
/* 60 */
{ "punpcklbw", MX, EM },
{ "punpcklwd", MX, EM },
@@ -1178,10 +1252,10 @@ static struct dis386 dis386_twobyte_intel[] = {
{ "punpckhdq", MX, EM },
{ "packssdw", MX, EM },
{ "(bad)" }, { "(bad)" },
- { "movd", MX, Ev },
+ { "movd", MX, Ed },
{ "movq", MX, EM },
/* 70 */
- { "(bad)" },
+ { "pshufw", MX, EM, Ib },
{ GRP10 },
{ GRP11 },
{ GRP12 },
@@ -1192,7 +1266,7 @@ static struct dis386 dis386_twobyte_intel[] = {
/* 78 */
{ "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
{ "(bad)" }, { "(bad)" },
- { "movd", Ev, MX },
+ { "movd", Ed, MX },
{ "movq", EM, MX },
/* 80 */
{ "jo", Jv },
@@ -1231,49 +1305,49 @@ static struct dis386 dis386_twobyte_intel[] = {
{ "setle", Eb },
{ "setg", Eb },
/* a0 */
- { "pushP", fs },
- { "popP", fs },
+ { "push", fs },
+ { "pop", fs },
{ "cpuid" },
- { "btS", Ev, Gv },
- { "shldS", Ev, Gv, Ib },
- { "shldS", Ev, Gv, CL },
+ { "bt", Ev, Gv },
+ { "shld", Ev, Gv, Ib },
+ { "shld", Ev, Gv, CL },
{ "(bad)" },
{ "(bad)" },
/* a8 */
- { "pushP", gs },
- { "popP", gs },
+ { "push", gs },
+ { "pop", gs },
{ "rsm" },
- { "btsS", Ev, Gv },
- { "shrdS", Ev, Gv, Ib },
- { "shrdS", Ev, Gv, CL },
+ { "bts", Ev, Gv },
+ { "shrd", Ev, Gv, Ib },
+ { "shrd", Ev, Gv, CL },
{ GRP13 },
- { "imulS", Gv, Ev },
+ { "imul", Gv, Ev },
/* b0 */
- { "cmpxchgB", Eb, Gb },
- { "cmpxchgS", Ev, Gv },
- { "lssS", Gv, Mp }, /* 386 lists only Mp */
- { "btrS", Ev, Gv },
- { "lfsS", Gv, Mp }, /* 386 lists only Mp */
- { "lgsS", Gv, Mp }, /* 386 lists only Mp */
+ { "cmpxchg", Eb, Gb },
+ { "cmpxchg", Ev, Gv },
+ { "lss", Gv, Mp },
+ { "btr", Ev, Gv },
+ { "lfs", Gv, Mp },
+ { "lgs", Gv, Mp },
{ "movzx", Gv, Eb },
{ "movzx", Gv, Ew },
/* b8 */
{ "(bad)" },
{ "ud2b" },
{ GRP8 },
- { "btcS", Ev, Gv },
- { "bsfS", Gv, Ev },
- { "bsrS", Gv, Ev },
+ { "btc", Ev, Gv },
+ { "bsf", Gv, Ev },
+ { "bsr", Gv, Ev },
{ "movsx", Gv, Eb },
{ "movsx", Gv, Ew },
/* c0 */
- { "xaddB", Eb, Gb },
- { "xaddS", Ev, Gv },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
+ { "xadd", Eb, Gb },
+ { "xadd", Ev, Gv },
+ { PREGRP1 },
{ "(bad)" },
+ { "pinsrw", MX, Ev, Ib },
+ { "pextrw", Ev, MX, Ib },
+ { "shufps", XM, EX, Ib },
{ GRP9 },
/* c8 */
{ "bswap", eAX }, /* bswap doesn't support 16 bit regs */
@@ -1291,32 +1365,34 @@ static struct dis386 dis386_twobyte_intel[] = {
{ "psrlq", MX, EM },
{ "(bad)" },
{ "pmullw", MX, EM },
- { "(bad)" }, { "(bad)" },
+ { "(bad)" },
+ { "pmovmskb", Ev, MX },
/* d8 */
{ "psubusb", MX, EM },
{ "psubusw", MX, EM },
- { "(bad)" },
+ { "pminub", MX, EM },
{ "pand", MX, EM },
{ "paddusb", MX, EM },
{ "paddusw", MX, EM },
- { "(bad)" },
+ { "pmaxub", MX, EM },
{ "pandn", MX, EM },
/* e0 */
- { "(bad)" },
+ { "pavgb", MX, EM },
{ "psraw", MX, EM },
{ "psrad", MX, EM },
- { "(bad)" },
- { "(bad)" },
+ { "pavgw", MX, EM },
+ { "pmulhuw", MX, EM },
{ "pmulhw", MX, EM },
- { "(bad)" }, { "(bad)" },
+ { "(bad)" },
+ { "movntq", Ev, MX },
/* e8 */
{ "psubsb", MX, EM },
{ "psubsw", MX, EM },
- { "(bad)" },
+ { "pminsw", MX, EM },
{ "por", MX, EM },
{ "paddsb", MX, EM },
{ "paddsw", MX, EM },
- { "(bad)" },
+ { "pmaxsw", MX, EM },
{ "pxor", MX, EM },
/* f0 */
{ "(bad)" },
@@ -1325,7 +1401,8 @@ static struct dis386 dis386_twobyte_intel[] = {
{ "psllq", MX, EM },
{ "(bad)" },
{ "pmaddwd", MX, EM },
- { "(bad)" }, { "(bad)" },
+ { "psadbw", MX, EM },
+ { "maskmovq", MX, EM },
/* f8 */
{ "psubb", MX, EM },
{ "psubw", MX, EM },
@@ -1338,41 +1415,72 @@ static struct dis386 dis386_twobyte_intel[] = {
};
static const unsigned char onebyte_has_modrm[256] = {
- 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
- 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
- 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
- 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,
- 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1
+ /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
+ /* ------------------------------- */
+ /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */
+ /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */
+ /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */
+ /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */
+ /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */
+ /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */
+ /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */
+ /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */
+ /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */
+ /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */
+ /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */
+ /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */
+ /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */
+ /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */
+ /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */
+ /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */
+ /* ------------------------------- */
+ /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
};
static const unsigned char twobyte_has_modrm[256] = {
+ /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
+ /* ------------------------------- */
/* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
- /* 10 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 1f */
- /* 20 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* 2f */
+ /* 10 */ 1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0, /* 1f */
+ /* 20 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 2f */
/* 30 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 3f */
/* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
- /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 5f */
+ /* 50 */ 1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1, /* 5f */
/* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1, /* 6f */
- /* 70 */ 0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1, /* 7f */
+ /* 70 */ 1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1, /* 7f */
/* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
/* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */
/* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
/* b0 */ 1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1, /* bf */
/* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
- /* d0 */ 0,1,1,1,0,1,0,0,1,1,0,1,1,1,0,1, /* df */
- /* e0 */ 0,1,1,0,0,1,0,0,1,1,0,1,1,1,0,1, /* ef */
- /* f0 */ 0,1,1,1,0,1,0,0,1,1,1,0,1,1,1,0 /* ff */
+ /* d0 */ 0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1, /* df */
+ /* e0 */ 1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1, /* ef */
+ /* f0 */ 0,1,1,1,0,1,1,1,1,1,1,0,1,1,1,0 /* ff */
+ /* ------------------------------- */
+ /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
+};
+
+static const unsigned char twobyte_uses_f3_prefix[256] = {
+ /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
+ /* ------------------------------- */
+ /* 00 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0f */
+ /* 10 */ 1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 1f */
+ /* 20 */ 0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0, /* 2f */
+ /* 30 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 3f */
+ /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 4f */
+ /* 50 */ 0,1,1,1,0,0,0,0,1,1,0,0,1,1,1,1, /* 5f */
+ /* 60 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 6f */
+ /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 7f */
+ /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
+ /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 9f */
+ /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* af */
+ /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* bf */
+ /* c0 */ 0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0, /* cf */
+ /* d0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* df */
+ /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ef */
+ /* f0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* ff */
+ /* ------------------------------- */
+ /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
};
static char obuf[100];
@@ -1385,25 +1493,25 @@ static disassemble_info *the_info;
static int mod;
static int rm;
static int reg;
-static void oappend PARAMS ((char *s));
+static void oappend PARAMS ((const char *s));
-static char *names32[]={
+static const char *names32[]={
"%eax","%ecx","%edx","%ebx", "%esp","%ebp","%esi","%edi",
};
-static char *names16[] = {
+static const char *names16[] = {
"%ax","%cx","%dx","%bx","%sp","%bp","%si","%di",
};
-static char *names8[] = {
+static const char *names8[] = {
"%al","%cl","%dl","%bl","%ah","%ch","%dh","%bh",
};
-static char *names_seg[] = {
+static const char *names_seg[] = {
"%es","%cs","%ss","%ds","%fs","%gs","%?","%?",
};
-static char *index16[] = {
+static const char *index16[] = {
"%bx,%si","%bx,%di","%bp,%si","%bp,%di","%si","%di","%bp","%bx"
};
-static struct dis386 grps[][8] = {
+static const struct dis386 grps[][8] = {
/* GRP1b */
{
{ "addA", Eb, Ib },
@@ -1628,14 +1736,25 @@ static struct dis386 grps[][8] = {
{
{ "fxsave", Ev },
{ "fxrstor", Ev },
+ { "ldmxcsr", Ev },
+ { "stmxcsr", Ev },
+ { "(bad)" },
{ "(bad)" },
{ "(bad)" },
+ { "sfence", None },
+ },
+ /* GRP14 */
+ {
+ { "prefetchnta", Ev },
+ { "prefetcht0", Ev },
+ { "prefetcht1", Ev },
+ { "prefetcht2", Ev },
{ "(bad)" },
{ "(bad)" },
{ "(bad)" },
{ "(bad)" },
},
- /* GRP14 */
+ /* GRPAMD */
{
{ "prefetch", Eb },
{ "prefetchw", Eb },
@@ -1649,6 +1768,86 @@ static struct dis386 grps[][8] = {
};
+static const struct dis386 prefix_user_table[][2] = {
+ /* PREGRP0 */
+ {
+ { "addps", XM, EX },
+ { "addss", XM, EX },
+ },
+ /* PREGRP1 */
+ {
+ { "", XM, EX, OPSIMD }, /* See OP_SIMD_SUFFIX */
+ { "", XM, EX, OPSIMD },
+ },
+ /* PREGRP2 */
+ {
+ { "cvtpi2ps", XM, EM },
+ { "cvtsi2ss", XM, Ev },
+ },
+ /* PREGRP3 */
+ {
+ { "cvtps2pi", MX, EX },
+ { "cvtss2si", Gv, EX },
+ },
+ /* PREGRP4 */
+ {
+ { "cvttps2pi", MX, EX },
+ { "cvttss2si", Gv, EX },
+ },
+ /* PREGRP5 */
+ {
+ { "divps", XM, EX },
+ { "divss", XM, EX },
+ },
+ /* PREGRP6 */
+ {
+ { "maxps", XM, EX },
+ { "maxss", XM, EX },
+ },
+ /* PREGRP7 */
+ {
+ { "minps", XM, EX },
+ { "minss", XM, EX },
+ },
+ /* PREGRP8 */
+ {
+ { "movups", XM, EX },
+ { "movss", XM, EX },
+ },
+ /* PREGRP9 */
+ {
+ { "movups", EX, XM },
+ { "movss", EX, XM },
+ },
+ /* PREGRP10 */
+ {
+ { "mulps", XM, EX },
+ { "mulss", XM, EX },
+ },
+ /* PREGRP11 */
+ {
+ { "rcpps", XM, EX },
+ { "rcpss", XM, EX },
+ },
+ /* PREGRP12 */
+ {
+ { "rsqrtps", XM, EX },
+ { "rsqrtss", XM, EX },
+ },
+ /* PREGRP13 */
+ {
+ { "sqrtps", XM, EX },
+ { "sqrtss", XM, EX },
+ },
+ /* PREGRP14 */
+ {
+ { "subps", XM, EX },
+ { "subss", XM, EX },
+ }
+};
+
+#define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
+
#define PREFIX_REPZ 1
#define PREFIX_REPNZ 2
#define PREFIX_LOCK 4
@@ -1740,8 +1939,6 @@ static unsigned int start_pc;
* The function returns the length of this instruction in bytes.
*/
-static int print_insn_x86
- PARAMS ((bfd_vma pc, disassemble_info *info, int sizeflag));
static int print_insn_i386
PARAMS ((bfd_vma pc, disassemble_info *info));
@@ -1784,36 +1981,29 @@ print_insn_i386 (pc, info)
bfd_vma pc;
disassemble_info *info;
{
- int flags;
- if (info->mach == bfd_mach_i386_i386
- || info->mach == bfd_mach_i386_i386_intel_syntax)
- flags = AFLAG|DFLAG;
- else if (info->mach == bfd_mach_i386_i8086)
- flags = 0;
- else
- abort ();
- return print_insn_x86 (pc, info, flags);
-}
-
-static int
-print_insn_x86 (pc, info, sizeflag)
- bfd_vma pc;
- disassemble_info *info;
- int sizeflag;
-{
- struct dis386 *dp;
+ const struct dis386 *dp;
int i;
int two_source_ops;
char *first, *second, *third;
int needcomma;
unsigned char need_modrm;
+ unsigned char uses_f3_prefix;
+ int sizeflag;
struct dis_private priv;
bfd_byte *inbuf = priv.the_buffer;
- /* The output looks better if we put 5 bytes on a line, since that
- puts long word instructions on a single line. */
- info->bytes_per_line = 5;
+ if (info->mach == bfd_mach_i386_i386
+ || info->mach == bfd_mach_i386_i386_intel_syntax)
+ sizeflag = AFLAG|DFLAG;
+ else if (info->mach == bfd_mach_i386_i8086)
+ sizeflag = 0;
+ else
+ abort ();
+
+ /* The output looks better if we put 6 bytes on a line, since that
+ puts most long word instructions on a single line. */
+ info->bytes_per_line = 6;
info->private_data = (PTR) &priv;
priv.max_fetched = priv.the_buffer;
@@ -1852,25 +2042,6 @@ print_insn_x86 (pc, info, sizeflag)
return codep - inbuf;
}
- if (prefixes & PREFIX_REPZ)
- oappend ("repz ");
- if (prefixes & PREFIX_REPNZ)
- oappend ("repnz ");
- if (prefixes & PREFIX_LOCK)
- oappend ("lock ");
-
- if (prefixes & PREFIX_DATA)
- sizeflag ^= DFLAG;
-
- if (prefixes & PREFIX_ADDR)
- {
- sizeflag ^= AFLAG;
- if (sizeflag & AFLAG)
- oappend ("addr32 ");
- else
- oappend ("addr16 ");
- }
-
if (*codep == 0x0f)
{
FETCH_DATA (info, codep + 2);
@@ -1879,6 +2050,7 @@ print_insn_x86 (pc, info, sizeflag)
else
dp = &dis386_twobyte_att[*++codep];
need_modrm = twobyte_has_modrm[*codep];
+ uses_f3_prefix = twobyte_uses_f3_prefix[*codep];
}
else
{
@@ -1887,9 +2059,29 @@ print_insn_x86 (pc, info, sizeflag)
else
dp = &dis386_att[*codep];
need_modrm = onebyte_has_modrm[*codep];
+ uses_f3_prefix = 0;
}
codep++;
+ if (!uses_f3_prefix && (prefixes & PREFIX_REPZ))
+ oappend ("repz ");
+ if (prefixes & PREFIX_REPNZ)
+ oappend ("repnz ");
+ if (prefixes & PREFIX_LOCK)
+ oappend ("lock ");
+
+ if (prefixes & PREFIX_DATA)
+ sizeflag ^= DFLAG;
+
+ if (prefixes & PREFIX_ADDR)
+ {
+ sizeflag ^= AFLAG;
+ if (sizeflag & AFLAG)
+ oappend ("addr32 ");
+ else
+ oappend ("addr16 ");
+ }
+
if (need_modrm)
{
FETCH_DATA (info, codep + 1);
@@ -1905,7 +2097,20 @@ print_insn_x86 (pc, info, sizeflag)
else
{
if (dp->name == NULL)
- dp = &grps[dp->bytemode1][reg];
+ {
+ switch(dp->bytemode2)
+ {
+ case USE_GROUPS:
+ dp = &grps[dp->bytemode1][reg];
+ break;
+ case USE_PREFIX_USER_TABLE:
+ dp = &prefix_user_table[dp->bytemode1][prefixes & PREFIX_REPZ ? 1 : 0];
+ break;
+ default:
+ oappend (INTERNAL_DISASSEMBLER_ERROR);
+ break;
+ }
+ }
putop (dp->name, sizeflag);
@@ -1933,7 +2138,7 @@ print_insn_x86 (pc, info, sizeflag)
/* The enter and bound instructions are printed with operands in the same
order as the intel book; everything else is printed in reverse order. */
- if (intel_syntax || two_source_ops)
+ if (intel_syntax || two_source_ops)
{
first = op1out;
second = op2out;
@@ -1979,7 +2184,7 @@ print_insn_x86 (pc, info, sizeflag)
return codep - inbuf;
}
-static char *float_mem_att[] = {
+static const char *float_mem_att[] = {
/* d8 */
"fadds",
"fmuls",
@@ -2054,7 +2259,7 @@ static char *float_mem_att[] = {
"fistpll",
};
-static char *float_mem_intel[] = {
+static const char *float_mem_intel[] = {
/* d8 */
"fadd",
"fmul",
@@ -2142,7 +2347,7 @@ static char *float_mem_intel[] = {
#define FGRPde_3 NULL, NULL, 7
#define FGRPdf_4 NULL, NULL, 8
-static struct dis386 float_reg[][8] = {
+static const struct dis386 float_reg[][8] = {
/* d8 */
{
{ "fadd", ST, STi },
@@ -2300,7 +2505,7 @@ static void
dofloat (sizeflag)
int sizeflag;
{
- struct dis386 *dp;
+ const struct dis386 *dp;
unsigned char floatop;
floatop = codep[-1];
@@ -2316,7 +2521,7 @@ dofloat (sizeflag)
OP_E (x_mode, sizeflag);
else if (floatop == 0xdd)
OP_E (d_mode, sizeflag);
- else
+ else
OP_E (v_mode, sizeflag);
return;
}
@@ -2367,10 +2572,10 @@ OP_STi (ignore, sizeflag)
/* capital letters in template are macros */
static void
putop (template, sizeflag)
- char *template;
+ const char *template;
int sizeflag;
{
- char *p;
+ const char *p;
for (p = template; *p; p++)
{
@@ -2445,11 +2650,25 @@ putop (template, sizeflag)
break;
case 'R':
if (intel_syntax)
- break;
- if (sizeflag & DFLAG)
- *obufp++ = 'l';
+ {
+ if (sizeflag & DFLAG)
+ {
+ *obufp++ = 'd';
+ *obufp++ = 'q';
+ }
+ else
+ {
+ *obufp++ = 'w';
+ *obufp++ = 'd';
+ }
+ }
else
- *obufp++ = 'w';
+ {
+ if (sizeflag & DFLAG)
+ *obufp++ = 'l';
+ else
+ *obufp++ = 'w';
+ }
break;
case 'S':
if (intel_syntax)
@@ -2465,13 +2684,23 @@ putop (template, sizeflag)
#endif
break;
case 'W':
- if (intel_syntax)
- break;
/* operand size flag for cwtl, cbtw */
if (sizeflag & DFLAG)
*obufp++ = 'w';
else
*obufp++ = 'b';
+ if (intel_syntax)
+ {
+ if (sizeflag & DFLAG)
+ {
+ *obufp++ = 'd';
+ *obufp++ = 'e';
+ }
+ else
+ {
+ *obufp++ = 'w';
+ }
+ }
break;
}
}
@@ -2480,7 +2709,7 @@ putop (template, sizeflag)
static void
oappend (s)
- char *s;
+ const char *s;
{
strcpy (obufp, s);
obufp += strlen (s);
@@ -2533,14 +2762,21 @@ OP_E (bytemode, sizeflag)
case w_mode:
oappend (names16[rm]);
break;
+ case d_mode:
+ oappend (names32[rm]);
+ break;
case v_mode:
if (sizeflag & DFLAG)
oappend (names32[rm]);
else
oappend (names16[rm]);
break;
+ case 0:
+ if ( !(codep[-2] == 0xAE && codep[-1] == 0xF8 /* sfence */))
+ BadOp(); /* bad sfence,lea,lds,les,lfs,lgs,lss modrm */
+ break;
default:
- oappend ("<bad dis table>");
+ oappend (INTERNAL_DISASSEMBLER_ERROR);
break;
}
return;
@@ -2597,7 +2833,7 @@ OP_E (bytemode, sizeflag)
sprintf (scratchbuf, "0x%x", disp);
oappend (scratchbuf);
}
-
+
if (havebase || (havesib && (index != 4 || scale != 0)))
{
if (intel_syntax)
@@ -2645,7 +2881,7 @@ OP_E (bytemode, sizeflag)
oappend (scratchbuf);
}
if (!intel_syntax
- || (intel_syntax
+ || (intel_syntax
&& bytemode != b_mode
&& bytemode != w_mode
&& bytemode != v_mode))
@@ -2735,8 +2971,6 @@ OP_E (bytemode, sizeflag)
}
}
-#define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
-
static void
OP_G (bytemode, sizeflag)
int bytemode;
@@ -2802,7 +3036,7 @@ OP_REG (code, sizeflag)
int code;
int sizeflag;
{
- char *s;
+ const char *s;
switch (code)
{
@@ -2962,48 +3196,26 @@ OP_SEG (dummy, sizeflag)
oappend (sreg[reg]);
}
+/* ARGSUSED */
static void
-OP_DIR (size, sizeflag)
- int size;
+OP_DIR (dummy, sizeflag)
+ int dummy;
int sizeflag;
{
int seg, offset;
- switch (size)
+ if (sizeflag & DFLAG)
{
- case lptr:
- if (sizeflag & DFLAG)
- {
- offset = get32 ();
- seg = get16 ();
- }
- else
- {
- offset = get16 ();
- seg = get16 ();
- }
- sprintf (scratchbuf, "$0x%x,$0x%x", seg, offset);
- oappend (scratchbuf);
- break;
- case v_mode:
- if (sizeflag & DFLAG)
- offset = get32 ();
- else
- {
- offset = get16 ();
- if ((offset & 0x8000) != 0)
- offset -= 0x10000;
- }
-
- offset = start_pc + codep - start_codep + offset;
- set_op (offset);
- sprintf (scratchbuf, "0x%x", offset);
- oappend (scratchbuf);
- break;
- default:
- oappend (INTERNAL_DISASSEMBLER_ERROR);
- break;
+ offset = get32 ();
+ seg = get16 ();
+ }
+ else
+ {
+ offset = get16 ();
+ seg = get16 ();
}
+ sprintf (scratchbuf, "$0x%x,$0x%x", seg, offset);
+ oappend (scratchbuf);
}
/* ARGSUSED */
@@ -3039,7 +3251,7 @@ ptr_reg (code, sizeflag)
int code;
int sizeflag;
{
- char *s;
+ const char *s;
oappend ("(");
if (sizeflag & AFLAG)
s = names32[code - eAX_reg];
@@ -3075,27 +3287,12 @@ OP_DSreg (code, sizeflag)
ptr_reg (code, sizeflag);
}
-#if 0
-/* Not used. */
-
-/* ARGSUSED */
-static void
-OP_ONE (dummy, sizeflag)
- int dummy;
- int sizeflag;
-{
- oappend ("1");
-}
-
-#endif
-
/* ARGSUSED */
static void
OP_C (dummy, sizeflag)
int dummy;
int sizeflag;
{
- codep++; /* skip mod/rm */
sprintf (scratchbuf, "%%cr%d", reg);
oappend (scratchbuf);
}
@@ -3106,7 +3303,6 @@ OP_D (dummy, sizeflag)
int dummy;
int sizeflag;
{
- codep++; /* skip mod/rm */
sprintf (scratchbuf, "%%db%d", reg);
oappend (scratchbuf);
}
@@ -3117,25 +3313,19 @@ OP_T (dummy, sizeflag)
int dummy;
int sizeflag;
{
- codep++; /* skip mod/rm */
sprintf (scratchbuf, "%%tr%d", reg);
oappend (scratchbuf);
}
static void
-OP_rm (bytemode, sizeflag)
+OP_Rd (bytemode, sizeflag)
int bytemode;
int sizeflag;
{
- switch (bytemode)
- {
- case d_mode:
- oappend (names32[rm]);
- break;
- case w_mode:
- oappend (names16[rm]);
- break;
- }
+ if (mod == 3)
+ OP_E (bytemode, sizeflag);
+ else
+ BadOp();
}
static void
@@ -3148,6 +3338,15 @@ OP_MMX (ignore, sizeflag)
}
static void
+OP_XMM (bytemode, sizeflag)
+ int bytemode;
+ int sizeflag;
+{
+ sprintf (scratchbuf, "%%xmm%d", reg);
+ oappend (scratchbuf);
+}
+
+static void
OP_EM (bytemode, sizeflag)
int bytemode;
int sizeflag;
@@ -3164,15 +3363,32 @@ OP_EM (bytemode, sizeflag)
}
static void
-OP_MS (ignore, sizeflag)
- int ignore;
+OP_EX (bytemode, sizeflag)
+ int bytemode;
int sizeflag;
{
- ++codep;
- sprintf (scratchbuf, "%%mm%d", rm);
+ if (mod != 3)
+ {
+ OP_E (bytemode, sizeflag);
+ return;
+ }
+
+ codep++;
+ sprintf (scratchbuf, "%%xmm%d", rm);
oappend (scratchbuf);
}
+static void
+OP_MS (bytemode, sizeflag)
+ int bytemode;
+ int sizeflag;
+{
+ if (mod == 3)
+ OP_EM (bytemode, sizeflag);
+ else
+ BadOp();
+}
+
static const char *Suffix3DNow[] = {
/* 00 */ NULL, NULL, NULL, NULL,
/* 04 */ NULL, NULL, NULL, NULL,
@@ -3251,18 +3467,80 @@ OP_3DNowSuffix (bytemode, sizeflag)
/* AMD 3DNow! instructions are specified by an opcode suffix in the
place where an 8-bit immediate would normally go. ie. the last
byte of the instruction. */
- mnemonic = Suffix3DNow[*codep++];
+ obufp = obuf + strlen(obuf);
+ mnemonic = Suffix3DNow[*codep++ & 0xff];
if (mnemonic)
- strcat (obuf, mnemonic);
+ oappend (mnemonic);
else
{
/* Since a variable sized modrm/sib chunk is between the start
of the opcode (0x0f0f) and the opcode suffix, we need to do
all the modrm processing first, and don't know until now that
we have a bad opcode. This necessitates some cleaning up. */
- op1out[0] = 0;
- op2out[0] = 0;
- codep = insn_codep + 1;
- strcat (obuf, "(bad)");
+ op1out[0] = '\0';
+ op2out[0] = '\0';
+ BadOp();
}
}
+
+
+static const char *simd_cmp_op [] = {
+ "eq",
+ "lt",
+ "le",
+ "unord",
+ "neq",
+ "nlt",
+ "nle",
+ "ord"
+};
+
+static void
+OP_SIMD_Suffix (bytemode, sizeflag)
+ int bytemode;
+ int sizeflag;
+{
+ unsigned int cmp_type;
+
+ FETCH_DATA (the_info, codep + 1);
+ obufp = obuf + strlen(obuf);
+ cmp_type = *codep++ & 0xff;
+ if (cmp_type < 8)
+ {
+ sprintf (scratchbuf, "cmp%s%cs",
+ simd_cmp_op[cmp_type],
+ prefixes & PREFIX_REPZ ? 's' : 'p');
+ oappend (scratchbuf);
+ }
+ else
+ {
+ /* We have a bad extension byte. Clean up. */
+ op1out[0] = '\0';
+ op2out[0] = '\0';
+ BadOp();
+ }
+}
+
+static void
+SIMD_Fixup (extrachar, sizeflag)
+ int extrachar;
+ int sizeflag;
+{
+ /* Change movlps/movhps to movhlps/movlhps for 2 register operand
+ forms of these instructions. */
+ if (mod == 3)
+ {
+ char *p = obuf + strlen(obuf);
+ *(p+1) = '\0';
+ *p = *(p-1);
+ *(p-1) = *(p-2);
+ *(p-2) = *(p-3);
+ *(p-3) = extrachar;
+ }
+}
+
+static void BadOp (void)
+{
+ codep = insn_codep + 1; /* throw away prefixes and 1st. opcode byte */
+ oappend ("(bad)");
+}
diff --git a/opcodes/m68k-dis.c b/opcodes/m68k-dis.c
index a316c211a82..23d3a8217c4 100644
--- a/opcodes/m68k-dis.c
+++ b/opcodes/m68k-dis.c
@@ -1,5 +1,5 @@
/* Print Motorola 68k instructions.
- Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
This file is free software; you can redistribute it and/or modify
@@ -504,6 +504,18 @@ print_insn_arg (d, buffer, p0, addr, info)
(*info->fprintf_func) (info->stream, "%%usp");
break;
+ case 'E':
+ (*info->fprintf_func) (info->stream, "%%acc");
+ break;
+
+ case 'G':
+ (*info->fprintf_func) (info->stream, "%%macsr");
+ break;
+
+ case 'H':
+ (*info->fprintf_func) (info->stream, "%%mask");
+ break;
+
case 'J':
{
static const struct { char *name; int value; } names[]
@@ -539,10 +551,19 @@ print_insn_arg (d, buffer, p0, addr, info)
break;
case 'M':
- val = fetch_arg (buffer, place, 8, info);
- if (val & 0x80)
- val = val - 0x100;
- (*info->fprintf_func) (info->stream, "#%d", val);
+ if (place == 'h')
+ {
+ static char *const scalefactor_name[] = { "<<", ">>" };
+ val = fetch_arg (buffer, place, 1, info);
+ (*info->fprintf_func) (info->stream, scalefactor_name[val]);
+ }
+ else
+ {
+ val = fetch_arg (buffer, place, 8, info);
+ if (val & 0x80)
+ val = val - 0x100;
+ (*info->fprintf_func) (info->stream, "#%d", val);
+ }
break;
case 'T':
@@ -979,6 +1000,22 @@ print_insn_arg (d, buffer, p0, addr, info)
}
break;
+ case 'u':
+ {
+ short is_upper = 0;
+ int reg = fetch_arg (buffer, place, 5, info);
+
+ if (reg & 0x10)
+ {
+ is_upper = 1;
+ reg &= 0xf;
+ }
+ (*info->fprintf_func) (info->stream, "%s%s",
+ reg_names[reg],
+ is_upper ? "u" : "l");
+ }
+ break;
+
default:
return -2;
}
@@ -1082,12 +1119,40 @@ fetch_arg (buffer, code, bits, info)
val = (buffer[1] >> 6);
break;
+ case 'm':
+ val = (buffer[1] & 0x40 ? 0x8 : 0)
+ | ((buffer[0] >> 1) & 0x7)
+ | (buffer[3] & 0x80 ? 0x10 : 0);
+ break;
+
+ case 'n':
+ val = (buffer[1] & 0x40 ? 0x8 : 0) | ((buffer[0] >> 1) & 0x7);
+ break;
+
+ case 'o':
+ val = (buffer[2] >> 4) | (buffer[3] & 0x80 ? 0x10 : 0);
+ break;
+
+ case 'M':
+ val = buffer[1] | (buffer[3] & 0x40 ? 0x10 : 0);
+ break;
+
+ case 'N':
+ val = buffer[3] | (buffer[3] & 0x40 ? 0x10 : 0);
+ break;
+
+ case 'h':
+ val = buffer[2] >> 2;
+ break;
+
default:
abort ();
}
switch (bits)
{
+ case 1:
+ return val & 1;
case 2:
return val & 3;
case 3:
diff --git a/opcodes/m68k-opc.c b/opcodes/m68k-opc.c
index 15e1b8dd626..847ad7c7f8f 100644
--- a/opcodes/m68k-opc.c
+++ b/opcodes/m68k-opc.c
@@ -35,16 +35,16 @@ const struct m68k_opcode m68k_opcodes[] =
{"abcd", one(0140410), one(0170770), "-s-d", m68000up },
{"addaw", one(0150300), one(0170700), "*wAd", m68000up },
-{"addal", one(0150700), one(0170700), "*lAd", m68000up | mcf5200 },
+{"addal", one(0150700), one(0170700), "*lAd", m68000up | mcf },
{"addib", one(0003000), one(0177700), "#b$s", m68000up },
{"addiw", one(0003100), one(0177700), "#w$s", m68000up },
{"addil", one(0003200), one(0177700), "#l$s", m68000up },
-{"addil", one(0003200), one(0177700), "#lDs", mcf5200 },
+{"addil", one(0003200), one(0177700), "#lDs", mcf },
{"addqb", one(0050000), one(0170700), "Qd$b", m68000up },
{"addqw", one(0050100), one(0170700), "Qd%w", m68000up },
-{"addql", one(0050200), one(0170700), "Qd%l", m68000up | mcf5200 },
+{"addql", one(0050200), one(0170700), "Qd%l", m68000up | mcf },
/* The add opcode can generate the adda, addi, and addq instructions. */
{"addb", one(0050000), one(0170700), "Qd$b", m68000up },
@@ -56,18 +56,18 @@ const struct m68k_opcode m68k_opcodes[] =
{"addw", one(0003100), one(0177700), "#w$s", m68000up },
{"addw", one(0150100), one(0170700), "*wDd", m68000up },
{"addw", one(0150500), one(0170700), "Dd~w", m68000up },
-{"addl", one(0050200), one(0170700), "Qd%l", m68000up | mcf5200 },
+{"addl", one(0050200), one(0170700), "Qd%l", m68000up | mcf },
{"addl", one(0003200), one(0177700), "#l$s", m68000up },
-{"addl", one(0003200), one(0177700), "#lDs", mcf5200 },
-{"addl", one(0150700), one(0170700), "*lAd", m68000up | mcf5200 },
-{"addl", one(0150200), one(0170700), "*lDd", m68000up | mcf5200 },
-{"addl", one(0150600), one(0170700), "Dd~l", m68000up | mcf5200 },
+{"addl", one(0003200), one(0177700), "#lDs", mcf },
+{"addl", one(0150700), one(0170700), "*lAd", m68000up | mcf },
+{"addl", one(0150200), one(0170700), "*lDd", m68000up | mcf },
+{"addl", one(0150600), one(0170700), "Dd~l", m68000up | mcf },
{"addxb", one(0150400), one(0170770), "DsDd", m68000up },
{"addxb", one(0150410), one(0170770), "-s-d", m68000up },
{"addxw", one(0150500), one(0170770), "DsDd", m68000up },
{"addxw", one(0150510), one(0170770), "-s-d", m68000up },
-{"addxl", one(0150600), one(0170770), "DsDd", m68000up | mcf5200 },
+{"addxl", one(0150600), one(0170770), "DsDd", m68000up | mcf },
{"addxl", one(0150610), one(0170770), "-s-d", m68000up },
{"andib", one(0001000), one(0177700), "#b$s", m68000up },
@@ -75,7 +75,7 @@ const struct m68k_opcode m68k_opcodes[] =
{"andiw", one(0001100), one(0177700), "#w$s", m68000up },
{"andiw", one(0001174), one(0177777), "#wSs", m68000up },
{"andil", one(0001200), one(0177700), "#l$s", m68000up },
-{"andil", one(0001200), one(0177700), "#lDs", mcf5200 },
+{"andil", one(0001200), one(0177700), "#lDs", mcf },
{"andi", one(0001100), one(0177700), "#w$s", m68000up },
{"andi", one(0001074), one(0177777), "#bCs", m68000up },
{"andi", one(0001174), one(0177777), "#wSs", m68000up },
@@ -90,9 +90,9 @@ const struct m68k_opcode m68k_opcodes[] =
{"andw", one(0140100), one(0170700), ";wDd", m68000up },
{"andw", one(0140500), one(0170700), "Dd~w", m68000up },
{"andl", one(0001200), one(0177700), "#l$s", m68000up },
-{"andl", one(0001200), one(0177700), "#lDs", mcf5200 },
-{"andl", one(0140200), one(0170700), ";lDd", m68000up | mcf5200 },
-{"andl", one(0140600), one(0170700), "Dd~l", m68000up | mcf5200 },
+{"andl", one(0001200), one(0177700), "#lDs", mcf },
+{"andl", one(0140200), one(0170700), ";lDd", m68000up | mcf },
+{"andl", one(0140600), one(0170700), "Dd~l", m68000up | mcf },
{"and", one(0001100), one(0177700), "#w$w", m68000up },
{"and", one(0001074), one(0177777), "#bCs", m68000up },
{"and", one(0001174), one(0177777), "#wSs", m68000up },
@@ -104,31 +104,31 @@ const struct m68k_opcode m68k_opcodes[] =
{"aslw", one(0160500), one(0170770), "QdDs", m68000up },
{"aslw", one(0160540), one(0170770), "DdDs", m68000up },
{"aslw", one(0160700), one(0177700), "~s", m68000up },
-{"asll", one(0160600), one(0170770), "QdDs", m68000up | mcf5200 },
-{"asll", one(0160640), one(0170770), "DdDs", m68000up | mcf5200 },
+{"asll", one(0160600), one(0170770), "QdDs", m68000up | mcf },
+{"asll", one(0160640), one(0170770), "DdDs", m68000up | mcf },
{"asrb", one(0160000), one(0170770), "QdDs", m68000up },
{"asrb", one(0160040), one(0170770), "DdDs", m68000up },
{"asrw", one(0160100), one(0170770), "QdDs", m68000up },
{"asrw", one(0160140), one(0170770), "DdDs", m68000up },
{"asrw", one(0160300), one(0177700), "~s", m68000up },
-{"asrl", one(0160200), one(0170770), "QdDs", m68000up | mcf5200 },
-{"asrl", one(0160240), one(0170770), "DdDs", m68000up | mcf5200 },
-
-{"bhiw", one(0061000), one(0177777), "BW", m68000up | mcf5200 },
-{"blsw", one(0061400), one(0177777), "BW", m68000up | mcf5200 },
-{"bccw", one(0062000), one(0177777), "BW", m68000up | mcf5200 },
-{"bcsw", one(0062400), one(0177777), "BW", m68000up | mcf5200 },
-{"bnew", one(0063000), one(0177777), "BW", m68000up | mcf5200 },
-{"beqw", one(0063400), one(0177777), "BW", m68000up | mcf5200 },
-{"bvcw", one(0064000), one(0177777), "BW", m68000up | mcf5200 },
-{"bvsw", one(0064400), one(0177777), "BW", m68000up | mcf5200 },
-{"bplw", one(0065000), one(0177777), "BW", m68000up | mcf5200 },
-{"bmiw", one(0065400), one(0177777), "BW", m68000up | mcf5200 },
-{"bgew", one(0066000), one(0177777), "BW", m68000up | mcf5200 },
-{"bltw", one(0066400), one(0177777), "BW", m68000up | mcf5200 },
-{"bgtw", one(0067000), one(0177777), "BW", m68000up | mcf5200 },
-{"blew", one(0067400), one(0177777), "BW", m68000up | mcf5200 },
+{"asrl", one(0160200), one(0170770), "QdDs", m68000up | mcf },
+{"asrl", one(0160240), one(0170770), "DdDs", m68000up | mcf },
+
+{"bhiw", one(0061000), one(0177777), "BW", m68000up | mcf },
+{"blsw", one(0061400), one(0177777), "BW", m68000up | mcf },
+{"bccw", one(0062000), one(0177777), "BW", m68000up | mcf },
+{"bcsw", one(0062400), one(0177777), "BW", m68000up | mcf },
+{"bnew", one(0063000), one(0177777), "BW", m68000up | mcf },
+{"beqw", one(0063400), one(0177777), "BW", m68000up | mcf },
+{"bvcw", one(0064000), one(0177777), "BW", m68000up | mcf },
+{"bvsw", one(0064400), one(0177777), "BW", m68000up | mcf },
+{"bplw", one(0065000), one(0177777), "BW", m68000up | mcf },
+{"bmiw", one(0065400), one(0177777), "BW", m68000up | mcf },
+{"bgew", one(0066000), one(0177777), "BW", m68000up | mcf },
+{"bltw", one(0066400), one(0177777), "BW", m68000up | mcf },
+{"bgtw", one(0067000), one(0177777), "BW", m68000up | mcf },
+{"blew", one(0067400), one(0177777), "BW", m68000up | mcf },
{"bhil", one(0061377), one(0177777), "BL", m68020up | cpu32 },
{"blsl", one(0061777), one(0177777), "BL", m68020up | cpu32 },
@@ -145,44 +145,44 @@ const struct m68k_opcode m68k_opcodes[] =
{"bgtl", one(0067377), one(0177777), "BL", m68020up | cpu32 },
{"blel", one(0067777), one(0177777), "BL", m68020up | cpu32 },
-{"bhis", one(0061000), one(0177400), "BB", m68000up | mcf5200 },
-{"blss", one(0061400), one(0177400), "BB", m68000up | mcf5200 },
-{"bccs", one(0062000), one(0177400), "BB", m68000up | mcf5200 },
-{"bcss", one(0062400), one(0177400), "BB", m68000up | mcf5200 },
-{"bnes", one(0063000), one(0177400), "BB", m68000up | mcf5200 },
-{"beqs", one(0063400), one(0177400), "BB", m68000up | mcf5200 },
-{"bvcs", one(0064000), one(0177400), "BB", m68000up | mcf5200 },
-{"bvss", one(0064400), one(0177400), "BB", m68000up | mcf5200 },
-{"bpls", one(0065000), one(0177400), "BB", m68000up | mcf5200 },
-{"bmis", one(0065400), one(0177400), "BB", m68000up | mcf5200 },
-{"bges", one(0066000), one(0177400), "BB", m68000up | mcf5200 },
-{"blts", one(0066400), one(0177400), "BB", m68000up | mcf5200 },
-{"bgts", one(0067000), one(0177400), "BB", m68000up | mcf5200 },
-{"bles", one(0067400), one(0177400), "BB", m68000up | mcf5200 },
-
-{"jhi", one(0061000), one(0177400), "Bg", m68000up | mcf5200 },
-{"jls", one(0061400), one(0177400), "Bg", m68000up | mcf5200 },
-{"jcc", one(0062000), one(0177400), "Bg", m68000up | mcf5200 },
-{"jcs", one(0062400), one(0177400), "Bg", m68000up | mcf5200 },
-{"jne", one(0063000), one(0177400), "Bg", m68000up | mcf5200 },
-{"jeq", one(0063400), one(0177400), "Bg", m68000up | mcf5200 },
-{"jvc", one(0064000), one(0177400), "Bg", m68000up | mcf5200 },
-{"jvs", one(0064400), one(0177400), "Bg", m68000up | mcf5200 },
-{"jpl", one(0065000), one(0177400), "Bg", m68000up | mcf5200 },
-{"jmi", one(0065400), one(0177400), "Bg", m68000up | mcf5200 },
-{"jge", one(0066000), one(0177400), "Bg", m68000up | mcf5200 },
-{"jlt", one(0066400), one(0177400), "Bg", m68000up | mcf5200 },
-{"jgt", one(0067000), one(0177400), "Bg", m68000up | mcf5200 },
-{"jle", one(0067400), one(0177400), "Bg", m68000up | mcf5200 },
-
-{"bchg", one(0000500), one(0170700), "Dd$s", m68000up | mcf5200 },
+{"bhis", one(0061000), one(0177400), "BB", m68000up | mcf },
+{"blss", one(0061400), one(0177400), "BB", m68000up | mcf },
+{"bccs", one(0062000), one(0177400), "BB", m68000up | mcf },
+{"bcss", one(0062400), one(0177400), "BB", m68000up | mcf },
+{"bnes", one(0063000), one(0177400), "BB", m68000up | mcf },
+{"beqs", one(0063400), one(0177400), "BB", m68000up | mcf },
+{"bvcs", one(0064000), one(0177400), "BB", m68000up | mcf },
+{"bvss", one(0064400), one(0177400), "BB", m68000up | mcf },
+{"bpls", one(0065000), one(0177400), "BB", m68000up | mcf },
+{"bmis", one(0065400), one(0177400), "BB", m68000up | mcf },
+{"bges", one(0066000), one(0177400), "BB", m68000up | mcf },
+{"blts", one(0066400), one(0177400), "BB", m68000up | mcf },
+{"bgts", one(0067000), one(0177400), "BB", m68000up | mcf },
+{"bles", one(0067400), one(0177400), "BB", m68000up | mcf },
+
+{"jhi", one(0061000), one(0177400), "Bg", m68000up | mcf },
+{"jls", one(0061400), one(0177400), "Bg", m68000up | mcf },
+{"jcc", one(0062000), one(0177400), "Bg", m68000up | mcf },
+{"jcs", one(0062400), one(0177400), "Bg", m68000up | mcf },
+{"jne", one(0063000), one(0177400), "Bg", m68000up | mcf },
+{"jeq", one(0063400), one(0177400), "Bg", m68000up | mcf },
+{"jvc", one(0064000), one(0177400), "Bg", m68000up | mcf },
+{"jvs", one(0064400), one(0177400), "Bg", m68000up | mcf },
+{"jpl", one(0065000), one(0177400), "Bg", m68000up | mcf },
+{"jmi", one(0065400), one(0177400), "Bg", m68000up | mcf },
+{"jge", one(0066000), one(0177400), "Bg", m68000up | mcf },
+{"jlt", one(0066400), one(0177400), "Bg", m68000up | mcf },
+{"jgt", one(0067000), one(0177400), "Bg", m68000up | mcf },
+{"jle", one(0067400), one(0177400), "Bg", m68000up | mcf },
+
+{"bchg", one(0000500), one(0170700), "Dd$s", m68000up | mcf },
{"bchg", one(0004100), one(0177700), "#b$s", m68000up },
-{"bchg", one(0004100), one(0177700), "#bqs", mcf5200 },
+{"bchg", one(0004100), one(0177700), "#bqs", mcf },
{"bclr", one(0000600), one(0170700), "Dd$s", m68000up },
-{"bclr", one(0000600), one(0170700), "Ddvs", mcf5200 },
+{"bclr", one(0000600), one(0170700), "Ddvs", mcf },
{"bclr", one(0004200), one(0177700), "#b$s", m68000up },
-{"bclr", one(0004200), one(0177700), "#bqs", mcf5200 },
+{"bclr", one(0004200), one(0177700), "#bqs", mcf },
{"bfchg", two(0165300, 0), two(0177700, 0170000), "?sO2O3", m68020up },
{"bfclr", two(0166300, 0), two(0177700, 0170000), "?sO2O3", m68020up },
@@ -197,22 +197,22 @@ const struct m68k_opcode m68k_opcodes[] =
{"bkpt", one(0044110), one(0177770), "ts", m68010up },
-{"braw", one(0060000), one(0177777), "BW", m68000up | mcf5200 },
+{"braw", one(0060000), one(0177777), "BW", m68000up | mcf },
{"bral", one(0060377), one(0177777), "BL", m68020up | cpu32 },
-{"bras", one(0060000), one(0177400), "BB", m68000up | mcf5200 },
+{"bras", one(0060000), one(0177400), "BB", m68000up | mcf },
{"bset", one(0000700), one(0170700), "Dd$s", m68000up },
-{"bset", one(0000700), one(0170700), "Ddvs", mcf5200 },
+{"bset", one(0000700), one(0170700), "Ddvs", mcf },
{"bset", one(0004300), one(0177700), "#b$s", m68000up },
-{"bset", one(0004300), one(0177700), "#bqs", mcf5200 },
+{"bset", one(0004300), one(0177700), "#bqs", mcf },
-{"bsrw", one(0060400), one(0177777), "BW", m68000up | mcf5200 },
+{"bsrw", one(0060400), one(0177777), "BW", m68000up | mcf },
{"bsrl", one(0060777), one(0177777), "BL", m68020up | cpu32 },
-{"bsrs", one(0060400), one(0177400), "BB", m68000up | mcf5200 },
+{"bsrs", one(0060400), one(0177400), "BB", m68000up | mcf },
-{"btst", one(0000400), one(0170700), "Dd;b", m68000up | mcf5200 },
+{"btst", one(0000400), one(0170700), "Dd;b", m68000up | mcf },
{"btst", one(0004000), one(0177700), "#b@s", m68000up },
-{"btst", one(0004000), one(0177700), "#bqs", mcf5200 },
+{"btst", one(0004000), one(0177700), "#bqs", mcf },
{"callm", one(0003300), one(0177700), "#b!s", m68020 },
@@ -242,28 +242,28 @@ const struct m68k_opcode m68k_opcodes[] =
{"cpusha", one(0xf420|SCOPE_ALL), one(0xff38), "ce", m68040up },
{"cpushl", one(0xf420|SCOPE_LINE), one(0xff38), "ceas", m68040up },
-{"cpushl", one(0x04e8), one(0xfff8), "as", mcf5200 },
+{"cpushl", one(0x04e8), one(0xfff8), "as", mcf },
{"cpushp", one(0xf420|SCOPE_PAGE), one(0xff38), "ceas", m68040up },
#undef SCOPE_LINE
#undef SCOPE_PAGE
#undef SCOPE_ALL
-{"clrb", one(0041000), one(0177700), "$s", m68000up | mcf5200 },
-{"clrw", one(0041100), one(0177700), "$s", m68000up | mcf5200 },
-{"clrl", one(0041200), one(0177700), "$s", m68000up | mcf5200 },
+{"clrb", one(0041000), one(0177700), "$s", m68000up | mcf },
+{"clrw", one(0041100), one(0177700), "$s", m68000up | mcf },
+{"clrl", one(0041200), one(0177700), "$s", m68000up | mcf },
{"cmp2b", two(0000300,0), two(0177700,07777), "!sR1", m68020up | cpu32 },
{"cmp2w", two(0001300,0), two(0177700,07777), "!sR1", m68020up | cpu32 },
{"cmp2l", two(0002300,0), two(0177700,07777), "!sR1", m68020up | cpu32 },
{"cmpaw", one(0130300), one(0170700), "*wAd", m68000up },
-{"cmpal", one(0130700), one(0170700), "*lAd", m68000up | mcf5200 },
+{"cmpal", one(0130700), one(0170700), "*lAd", m68000up | mcf },
{"cmpib", one(0006000), one(0177700), "#b@s", m68000up },
{"cmpiw", one(0006100), one(0177700), "#w@s", m68000up },
{"cmpil", one(0006200), one(0177700), "#l@s", m68000up },
-{"cmpil", one(0006200), one(0177700), "#lDs", mcf5200 },
+{"cmpil", one(0006200), one(0177700), "#lDs", mcf },
{"cmpmb", one(0130410), one(0170770), "+s+d", m68000up },
{"cmpmw", one(0130510), one(0170770), "+s+d", m68000up },
@@ -277,11 +277,11 @@ const struct m68k_opcode m68k_opcodes[] =
{"cmpw", one(0006100), one(0177700), "#w@s", m68000up },
{"cmpw", one(0130510), one(0170770), "+s+d", m68000up },
{"cmpw", one(0130100), one(0170700), "*wDd", m68000up },
-{"cmpl", one(0130700), one(0170700), "*lAd", m68000up | mcf5200 },
+{"cmpl", one(0130700), one(0170700), "*lAd", m68000up | mcf },
{"cmpl", one(0006200), one(0177700), "#l@s", m68000up },
-{"cmpl", one(0006200), one(0177700), "#lDs", mcf5200 },
+{"cmpl", one(0006200), one(0177700), "#lDs", mcf },
{"cmpl", one(0130610), one(0170770), "+s+d", m68000up },
-{"cmpl", one(0130200), one(0170700), "*lDd", m68000up | mcf5200 },
+{"cmpl", one(0130200), one(0170700), "*lDd", m68000up | mcf },
{"dbcc", one(0052310), one(0177770), "DsBw", m68000up },
{"dbcs", one(0052710), one(0177770), "DsBw", m68000up },
@@ -301,17 +301,21 @@ const struct m68k_opcode m68k_opcodes[] =
{"dbvs", one(0054710), one(0177770), "DsBw", m68000up },
{"divsw", one(0100700), one(0170700), ";wDd", m68000up },
+{"divsw", one(0100700), one(0170700), "vsDd", mcf5307 | mcf5206e },
{"divsl", two(0046100,0006000),two(0177700,0107770),";lD3D1", m68020up|cpu32 },
{"divsl", two(0046100,0004000),two(0177700,0107770),";lDD", m68020up|cpu32 },
+{"divsl", two(0046100,0004000),two(0177700,0107770),"vsDD", mcf5307 | mcf5206e },
{"divsll", two(0046100,0004000),two(0177700,0107770),";lD3D1",m68020up|cpu32 },
{"divsll", two(0046100,0004000),two(0177700,0107770),";lDD", m68020up|cpu32 },
{"divuw", one(0100300), one(0170700), ";wDd", m68000up },
+{"divuw", one(0100300), one(0170700), "vsDd", mcf5307 | mcf5206e },
{"divul", two(0046100,0002000),two(0177700,0107770),";lD3D1", m68020up|cpu32 },
{"divul", two(0046100,0000000),two(0177700,0107770),";lDD", m68020up|cpu32 },
+{"divul", two(0046100,0000000),two(0177700,0107770),"vsDD", mcf5307 | mcf5206e },
{"divull", two(0046100,0000000),two(0177700,0107770),";lD3D1",m68020up|cpu32 },
{"divull", two(0046100,0000000),two(0177700,0107770),";lDD", m68020up|cpu32 },
@@ -321,7 +325,7 @@ const struct m68k_opcode m68k_opcodes[] =
{"eoriw", one(0005100), one(0177700), "#w$s", m68000up },
{"eoriw", one(0005174), one(0177777), "#wSs", m68000up },
{"eoril", one(0005200), one(0177700), "#l$s", m68000up },
-{"eoril", one(0005200), one(0177700), "#lDs", mcf5200 },
+{"eoril", one(0005200), one(0177700), "#lDs", mcf },
{"eori", one(0005074), one(0177777), "#bCs", m68000up },
{"eori", one(0005174), one(0177777), "#wSs", m68000up },
{"eori", one(0005100), one(0177700), "#w$s", m68000up },
@@ -334,8 +338,8 @@ const struct m68k_opcode m68k_opcodes[] =
{"eorw", one(0005174), one(0177777), "#wSs", m68000up },
{"eorw", one(0130500), one(0170700), "Dd$s", m68000up },
{"eorl", one(0005200), one(0177700), "#l$s", m68000up },
-{"eorl", one(0005200), one(0177700), "#lDs", mcf5200 },
-{"eorl", one(0130600), one(0170700), "Dd$s", m68000up | mcf5200 },
+{"eorl", one(0005200), one(0177700), "#lDs", mcf },
+{"eorl", one(0130600), one(0170700), "Dd$s", m68000up | mcf },
{"eor", one(0005074), one(0177777), "#bCs", m68000up },
{"eor", one(0005174), one(0177777), "#wSs", m68000up },
{"eor", one(0005100), one(0177700), "#w$s", m68000up },
@@ -346,9 +350,9 @@ const struct m68k_opcode m68k_opcodes[] =
{"exg", one(0140610), one(0170770), "DdAs", m68000up },
{"exg", one(0140610), one(0170770), "AsDd", m68000up },
-{"extw", one(0044200), one(0177770), "Ds", m68000up|mcf5200 },
-{"extl", one(0044300), one(0177770), "Ds", m68000up|mcf5200 },
-{"extbl", one(0044700), one(0177770), "Ds", m68020up|cpu32|mcf5200 },
+{"extw", one(0044200), one(0177770), "Ds", m68000up|mcf },
+{"extl", one(0044300), one(0177770), "Ds", m68000up|mcf },
+{"extbl", one(0044700), one(0177770), "Ds", m68020up|cpu32|mcf },
/* float stuff starts here */
@@ -1198,27 +1202,27 @@ const struct m68k_opcode m68k_opcodes[] =
{"ftwotoxx", two(0xF000, 0x4811), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
{"ftwotoxx", two(0xF000, 0x0011), two(0xF1C0, 0xE07F), "IiFt", mfloat },
-{"halt", one(0045310), one(0177777), "", m68060 | mcf5200 },
+{"halt", one(0045310), one(0177777), "", m68060 | mcf },
{"illegal", one(0045374), one(0177777), "", m68000up },
-{"jmp", one(0047300), one(0177700), "!s", m68000up | mcf5200 },
+{"jmp", one(0047300), one(0177700), "!s", m68000up | mcf },
-{"jra", one(0060000), one(0177400), "Bg", m68000up | mcf5200 },
-{"jra", one(0047300), one(0177700), "!s", m68000up | mcf5200 },
+{"jra", one(0060000), one(0177400), "Bg", m68000up | mcf },
+{"jra", one(0047300), one(0177700), "!s", m68000up | mcf },
-{"jsr", one(0047200), one(0177700), "!s", m68000up | mcf5200 },
+{"jsr", one(0047200), one(0177700), "!s", m68000up | mcf },
-{"jbsr", one(0060400), one(0177400), "Bg", m68000up | mcf5200 },
-{"jbsr", one(0047200), one(0177700), "!s", m68000up | mcf5200 },
+{"jbsr", one(0060400), one(0177400), "Bg", m68000up | mcf },
+{"jbsr", one(0047200), one(0177700), "!s", m68000up | mcf },
-{"lea", one(0040700), one(0170700), "!sAd", m68000up | mcf5200 },
+{"lea", one(0040700), one(0170700), "!sAd", m68000up | mcf },
{"lpstop", two(0174000,0000700),two(0177777,0177777),"#w", cpu32|m68060 },
-{"linkw", one(0047120), one(0177770), "As#w", m68000up | mcf5200 },
+{"linkw", one(0047120), one(0177770), "As#w", m68000up | mcf },
{"linkl", one(0044010), one(0177770), "As#l", m68020up | cpu32 },
-{"link", one(0047120), one(0177770), "As#W", m68000up | mcf5200 },
+{"link", one(0047120), one(0177770), "As#W", m68000up | mcf },
{"link", one(0044010), one(0177770), "As#l", m68020up | cpu32 },
{"lslb", one(0160410), one(0170770), "QdDs", m68000up },
@@ -1226,16 +1230,55 @@ const struct m68k_opcode m68k_opcodes[] =
{"lslw", one(0160510), one(0170770), "QdDs", m68000up },
{"lslw", one(0160550), one(0170770), "DdDs", m68000up },
{"lslw", one(0161700), one(0177700), "~s", m68000up },
-{"lsll", one(0160610), one(0170770), "QdDs", m68000up | mcf5200 },
-{"lsll", one(0160650), one(0170770), "DdDs", m68000up | mcf5200 },
+{"lsll", one(0160610), one(0170770), "QdDs", m68000up | mcf },
+{"lsll", one(0160650), one(0170770), "DdDs", m68000up | mcf },
{"lsrb", one(0160010), one(0170770), "QdDs", m68000up },
{"lsrb", one(0160050), one(0170770), "DdDs", m68000up },
{"lsrw", one(0160110), one(0170770), "QdDs", m68000up },
{"lsrw", one(0160150), one(0170770), "DdDs", m68000up },
{"lsrw", one(0161300), one(0177700), "~s", m68000up },
-{"lsrl", one(0160210), one(0170770), "QdDs", m68000up | mcf5200 },
-{"lsrl", one(0160250), one(0170770), "DdDs", m68000up | mcf5200 },
+{"lsrl", one(0160210), one(0170770), "QdDs", m68000up | mcf },
+{"lsrl", one(0160250), one(0170770), "DdDs", m68000up | mcf },
+
+ /* FIXME: add MAM mode (`&' after <ea> operand) / remove MACM */
+{"macw", two(0120000, 0000000), two(0170660, 0005400), "uMum", mcf5307 | mcf5206e },
+{"macw", two(0120000, 0001000), two(0170660, 0005400), "uMumMh", mcf5307 | mcf5206e },
+{"macw", two(0120220, 0000000), two(0170670, 0005460), "uNuoasRn", mcf5307 | mcf5206e },
+{"macw", two(0120230, 0000000), two(0170670, 0005460), "uNuo+sRn", mcf5307 | mcf5206e },
+{"macw", two(0120240, 0000000), two(0170670, 0005460), "uNuo-sRn", mcf5307 | mcf5206e },
+{"macw", two(0120250, 0000000), two(0170670, 0005460), "uNuodsRn", mcf5307 | mcf5206e },
+{"macw", two(0120220, 0001000), two(0170670, 0005460), "uNuoMhasRn", mcf5307 | mcf5206e },
+{"macw", two(0120230, 0001000), two(0170670, 0005460), "uNuoMh+sRn", mcf5307 | mcf5206e },
+{"macw", two(0120240, 0001000), two(0170670, 0005460), "uNuoMh-sRn", mcf5307 | mcf5206e },
+{"macw", two(0120250, 0001000), two(0170670, 0005460), "uNuoMhdsRn", mcf5307 | mcf5206e },
+{"macmw", two(0120220, 0000040), two(0170670, 0005460), "uNuoasRn", mcf5307 | mcf5206e },
+{"macmw", two(0120230, 0000040), two(0170670, 0005460), "uNuo+sRn", mcf5307 | mcf5206e },
+{"macmw", two(0120240, 0000040), two(0170670, 0005460), "uNuo-sRn", mcf5307 | mcf5206e },
+{"macmw", two(0120250, 0000040), two(0170670, 0005460), "uNuodsRn", mcf5307 | mcf5206e },
+{"macmw", two(0120220, 0001040), two(0170670, 0005460), "uNuoMhasRn", mcf5307 | mcf5206e },
+{"macmw", two(0120230, 0001040), two(0170670, 0005460), "uNuoMh+sRn", mcf5307 | mcf5206e },
+{"macmw", two(0120240, 0001040), two(0170670, 0005460), "uNuoMh-sRn", mcf5307 | mcf5206e },
+{"macmw", two(0120250, 0001040), two(0170670, 0005460), "uNuoMhdsRn", mcf5307 | mcf5206e },
+
+{"macl", two(0120000, 0004000), two(0170660, 0005400), "RsRm", mcf5307 | mcf5206e },
+{"macl", two(0120000, 0005000), two(0170660, 0005400), "RsRmMh", mcf5307 | mcf5206e },
+{"macl", two(0120220, 0004000), two(0170670, 0005460), "R3R1asRn", mcf5307 | mcf5206e },
+{"macl", two(0120230, 0004000), two(0170670, 0005460), "R3R1+sRn", mcf5307 | mcf5206e },
+{"macl", two(0120240, 0004000), two(0170670, 0005460), "R3R1-sRn", mcf5307 | mcf5206e },
+{"macl", two(0120250, 0004000), two(0170670, 0005460), "R3R1dsRn", mcf5307 | mcf5206e },
+{"macl", two(0120220, 0005000), two(0170670, 0005460), "R3R1MhasRn", mcf5307 | mcf5206e },
+{"macl", two(0120230, 0005000), two(0170670, 0005460), "R3R1Mh+sRn", mcf5307 | mcf5206e },
+{"macl", two(0120240, 0005000), two(0170670, 0005460), "R3R1Mh-sRn", mcf5307 | mcf5206e },
+{"macl", two(0120250, 0005000), two(0170670, 0005460), "R3R1MhdsRn", mcf5307 | mcf5206e },
+{"macml", two(0120220, 0004040), two(0170670, 0005460), "R3R1asRn", mcf5307 | mcf5206e },
+{"macml", two(0120230, 0004040), two(0170670, 0005460), "R3R1+sRn", mcf5307 | mcf5206e },
+{"macml", two(0120240, 0004040), two(0170670, 0005460), "R3R1-sRn", mcf5307 | mcf5206e },
+{"macml", two(0120250, 0004040), two(0170670, 0005460), "R3R1dsRn", mcf5307 | mcf5206e },
+{"macml", two(0120220, 0005040), two(0170670, 0005460), "R3R1MhasRn", mcf5307 | mcf5206e },
+{"macml", two(0120230, 0005040), two(0170670, 0005460), "R3R1Mh+sRn", mcf5307 | mcf5206e },
+{"macml", two(0120240, 0005040), two(0170670, 0005460), "R3R1Mh-sRn", mcf5307 | mcf5206e },
+{"macml", two(0120250, 0005040), two(0170670, 0005460), "R3R1MhdsRn", mcf5307 | mcf5206e },
/* NOTE: The mcf5200 family programmer's reference manual does not
indicate the byte form of the movea instruction is invalid (as it
@@ -1254,11 +1297,11 @@ const struct m68k_opcode m68k_opcodes[] =
jtc@cygnus.com - 97/01/24
*/
-{"moveal", one(0020100), one(0170700), "*lAd", m68000up | mcf5200 },
-{"moveaw", one(0030100), one(0170700), "*wAd", m68000up | mcf5200 },
+{"moveal", one(0020100), one(0170700), "*lAd", m68000up | mcf },
+{"moveaw", one(0030100), one(0170700), "*wAd", m68000up | mcf },
-{"movec", one(0047173), one(0177777), "R1Jj", m68010up | mcf5200 },
-{"movec", one(0047173), one(0177777), "R1#j", m68010up | mcf5200 },
+{"movec", one(0047173), one(0177777), "R1Jj", m68010up | mcf },
+{"movec", one(0047173), one(0177777), "R1#j", m68010up | mcf },
{"movec", one(0047172), one(0177777), "JjR1", m68010up },
{"movec", one(0047172), one(0177777), "#jR1", m68010up },
@@ -1273,66 +1316,76 @@ const struct m68k_opcode m68k_opcodes[] =
{"moveml", one(0046300), one(0177700), "<sLw", m68000up },
{"moveml", one(0046300), one(0177700), "<s#w", m68000up },
/* FIXME: need specifier for mode 2 and 5 to simplify below insn patterns */
-{"moveml", one(0044320), one(0177770), "Lwas", mcf5200 },
-{"moveml", one(0044320), one(0177770), "#was", mcf5200 },
-{"moveml", one(0044350), one(0177770), "Lwds", mcf5200 },
-{"moveml", one(0044350), one(0177770), "#wds", mcf5200 },
-{"moveml", one(0046320), one(0177770), "asLw", mcf5200 },
-{"moveml", one(0046320), one(0177770), "as#w", mcf5200 },
-{"moveml", one(0046350), one(0177770), "dsLw", mcf5200 },
-{"moveml", one(0046350), one(0177770), "ds#w", mcf5200 },
+{"moveml", one(0044320), one(0177770), "Lwas", mcf },
+{"moveml", one(0044320), one(0177770), "#was", mcf },
+{"moveml", one(0044350), one(0177770), "Lwds", mcf },
+{"moveml", one(0044350), one(0177770), "#wds", mcf },
+{"moveml", one(0046320), one(0177770), "asLw", mcf },
+{"moveml", one(0046320), one(0177770), "as#w", mcf },
+{"moveml", one(0046350), one(0177770), "dsLw", mcf },
+{"moveml", one(0046350), one(0177770), "ds#w", mcf },
{"movepw", one(0000410), one(0170770), "dsDd", m68000up },
{"movepw", one(0000610), one(0170770), "Ddds", m68000up },
{"movepl", one(0000510), one(0170770), "dsDd", m68000up },
{"movepl", one(0000710), one(0170770), "Ddds", m68000up },
-{"moveq", one(0070000), one(0170400), "MsDd", m68000up | mcf5200 },
-{"moveq", one(0070000), one(0170400), "#BDd", m68000up | mcf5200 },
+{"moveq", one(0070000), one(0170400), "MsDd", m68000up | mcf },
+{"moveq", one(0070000), one(0170400), "#BDd", m68000up | mcf },
/* The move opcode can generate the movea and moveq instructions. */
{"moveb", one(0010000), one(0170000), ";b$d", m68000up },
-{"moveb", one(0010000), one(0170000), "ms%d", mcf5200 },
-{"moveb", one(0010000), one(0170000), "nspd", mcf5200 },
-{"moveb", one(0010000), one(0170000), "obmd", mcf5200 },
+{"moveb", one(0010000), one(0170000), "ms%d", mcf },
+{"moveb", one(0010000), one(0170000), "nspd", mcf },
+{"moveb", one(0010000), one(0170000), "obmd", mcf },
{"movew", one(0030000), one(0170000), "*w%d", m68000up },
-{"movew", one(0030000), one(0170000), "ms%d", mcf5200 },
-{"movew", one(0030000), one(0170000), "nspd", mcf5200 },
-{"movew", one(0030000), one(0170000), "owmd", mcf5200 },
+{"movew", one(0030000), one(0170000), "ms%d", mcf },
+{"movew", one(0030000), one(0170000), "nspd", mcf },
+{"movew", one(0030000), one(0170000), "owmd", mcf },
{"movew", one(0040300), one(0177700), "Ss$s", m68000up },
-{"movew", one(0040300), one(0177770), "SsDs", mcf5200 },
+{"movew", one(0040300), one(0177770), "SsDs", mcf },
{"movew", one(0041300), one(0177700), "Cs$s", m68010up },
-{"movew", one(0041300), one(0177770), "CsDs", mcf5200 },
+{"movew", one(0041300), one(0177770), "CsDs", mcf },
{"movew", one(0042300), one(0177700), ";wCd", m68000up },
-{"movew", one(0042300), one(0177700), "DsCd", mcf5200 },
-{"movew", one(0042374), one(0177777), "#wCd", mcf5200 },
+{"movew", one(0042300), one(0177700), "DsCd", mcf },
+{"movew", one(0042374), one(0177777), "#wCd", mcf },
{"movew", one(0043300), one(0177700), ";wSd", m68000up },
-{"movew", one(0043300), one(0177700), "DsSd", mcf5200 },
-{"movew", one(0043374), one(0177777), "#wSd", mcf5200 },
+{"movew", one(0043300), one(0177700), "DsSd", mcf },
+{"movew", one(0043374), one(0177777), "#wSd", mcf },
-{"movel", one(0070000), one(0170400), "MsDd", m68000up | mcf5200 },
+{"movel", one(0070000), one(0170400), "MsDd", m68000up | mcf },
{"movel", one(0020000), one(0170000), "*l%d", m68000up },
-{"movel", one(0020000), one(0170000), "ms%d", mcf5200 },
-{"movel", one(0020000), one(0170000), "nspd", mcf5200 },
-{"movel", one(0020000), one(0170000), "olmd", mcf5200 },
+{"movel", one(0020000), one(0170000), "ms%d", mcf },
+{"movel", one(0020000), one(0170000), "nspd", mcf },
+{"movel", one(0020000), one(0170000), "olmd", mcf },
{"movel", one(0047140), one(0177770), "AsUd", m68000up },
{"movel", one(0047150), one(0177770), "UdAs", m68000up },
+{"movel", one(0120600), one(0177760), "EsRs", mcf5307 | mcf5206e },
+{"movel", one(0120400), one(0177760), "RsEs", mcf5307 | mcf5206e },
+{"movel", one(0120474), one(0177777), "#lEs", mcf5307 | mcf5206e },
+{"movel", one(0124600), one(0177760), "GsRs", mcf5307 | mcf5206e },
+{"movel", one(0124400), one(0177760), "RsGs", mcf5307 | mcf5206e },
+{"movel", one(0124474), one(0177777), "#lGs", mcf5307 | mcf5206e },
+{"movel", one(0126600), one(0177760), "HsRs", mcf5307 | mcf5206e },
+{"movel", one(0126400), one(0177760), "RsHs", mcf5307 | mcf5206e },
+{"movel", one(0126474), one(0177777), "#lHs", mcf5307 | mcf5206e },
+{"movel", one(0124700), one(0177777), "GsCs", mcf5307 | mcf5206e },
{"move", one(0030000), one(0170000), "*w%d", m68000up },
-{"move", one(0030000), one(0170000), "ms%d", mcf5200 },
-{"move", one(0030000), one(0170000), "nspd", mcf5200 },
-{"move", one(0030000), one(0170000), "owmd", mcf5200 },
+{"move", one(0030000), one(0170000), "ms%d", mcf },
+{"move", one(0030000), one(0170000), "nspd", mcf },
+{"move", one(0030000), one(0170000), "owmd", mcf },
{"move", one(0040300), one(0177700), "Ss$s", m68000up },
-{"move", one(0040300), one(0177770), "SsDs", mcf5200 },
+{"move", one(0040300), one(0177770), "SsDs", mcf },
{"move", one(0041300), one(0177700), "Cs$s", m68010up },
-{"move", one(0041300), one(0177770), "CsDs", mcf5200 },
+{"move", one(0041300), one(0177770), "CsDs", mcf },
{"move", one(0042300), one(0177700), ";wCd", m68000up },
-{"move", one(0042300), one(0177700), "DsCd", mcf5200 },
-{"move", one(0042374), one(0177777), "#wCd", mcf5200 },
+{"move", one(0042300), one(0177700), "DsCd", mcf },
+{"move", one(0042374), one(0177777), "#wCd", mcf },
{"move", one(0043300), one(0177700), ";wSd", m68000up },
-{"move", one(0043300), one(0177700), "DsSd", mcf5200 },
-{"move", one(0043374), one(0177777), "#wSd", mcf5200 },
+{"move", one(0043300), one(0177700), "DsSd", mcf },
+{"move", one(0043374), one(0177777), "#wSd", mcf },
{"move", one(0047140), one(0177770), "AsUd", m68000up },
{"move", one(0047150), one(0177770), "UdAs", m68000up },
@@ -1350,14 +1403,53 @@ const struct m68k_opcode m68k_opcodes[] =
{"move16", one(0xf610), one(0xfff8), "as_L", m68040up },
{"move16", one(0xf618), one(0xfff8), "_Las", m68040up },
-{"mulsw", one(0140700), one(0170700), ";wDd", m68000up|mcf5200 },
+ /* FIXME: add MAM mode (`&' after <ea> operand) / remove MSACM */
+{"msacw", two(0120000, 0000400), two(0170660, 0005400), "uMum", mcf5307 | mcf5206e },
+{"msacw", two(0120000, 0001400), two(0170660, 0005400), "uMumMh", mcf5307 | mcf5206e },
+{"msacw", two(0120220, 0000400), two(0170670, 0005460), "uNuoasRn", mcf5307 | mcf5206e },
+{"msacw", two(0120230, 0000400), two(0170670, 0005460), "uNuo+sRn", mcf5307 | mcf5206e },
+{"msacw", two(0120240, 0000400), two(0170670, 0005460), "uNuo-sRn", mcf5307 | mcf5206e },
+{"msacw", two(0120250, 0000400), two(0170670, 0005460), "uNuodsRn", mcf5307 | mcf5206e },
+{"msacw", two(0120220, 0001400), two(0170670, 0005460), "uNuoMhasRn", mcf5307 | mcf5206e },
+{"msacw", two(0120230, 0001400), two(0170670, 0005460), "uNuoMh+sRn", mcf5307 | mcf5206e },
+{"msacw", two(0120240, 0001400), two(0170670, 0005460), "uNuoMh-sRn", mcf5307 | mcf5206e },
+{"msacw", two(0120250, 0001400), two(0170670, 0005460), "uNuoMhdsRn", mcf5307 | mcf5206e },
+{"msacmw", two(0120220, 0000440), two(0170670, 0005460), "uNuoasRn", mcf5307 | mcf5206e },
+{"msacmw", two(0120230, 0000440), two(0170670, 0005460), "uNuo+sRn", mcf5307 | mcf5206e },
+{"msacmw", two(0120240, 0000440), two(0170670, 0005460), "uNuo-sRn", mcf5307 | mcf5206e },
+{"msacmw", two(0120250, 0000440), two(0170670, 0005460), "uNuodsRn", mcf5307 | mcf5206e },
+{"msacmw", two(0120220, 0001440), two(0170670, 0005460), "uNuoMhasRn", mcf5307 | mcf5206e },
+{"msacmw", two(0120230, 0001440), two(0170670, 0005460), "uNuoMh+sRn", mcf5307 | mcf5206e },
+{"msacmw", two(0120240, 0001440), two(0170670, 0005460), "uNuoMh-sRn", mcf5307 | mcf5206e },
+{"msacmw", two(0120250, 0001440), two(0170670, 0005460), "uNuoMhdsRn", mcf5307 | mcf5206e },
+
+{"msacl", two(0120000, 0004400), two(0170660, 0005400), "RsRm", mcf5307 | mcf5206e },
+{"msacl", two(0120000, 0005400), two(0170660, 0005400), "RsRmMh", mcf5307 | mcf5206e },
+{"msacl", two(0120220, 0004400), two(0170670, 0005460), "R3R1asRn", mcf5307 | mcf5206e },
+{"msacl", two(0120230, 0004400), two(0170670, 0005460), "R3R1+sRn", mcf5307 | mcf5206e },
+{"msacl", two(0120240, 0004400), two(0170670, 0005460), "R3R1-sRn", mcf5307 | mcf5206e },
+{"msacl", two(0120250, 0004400), two(0170670, 0005460), "R3R1dsRn", mcf5307 | mcf5206e },
+{"msacl", two(0120220, 0005400), two(0170670, 0005460), "R3R1MhasRn", mcf5307 | mcf5206e },
+{"msacl", two(0120230, 0005400), two(0170670, 0005460), "R3R1Mh+sRn", mcf5307 | mcf5206e },
+{"msacl", two(0120240, 0005400), two(0170670, 0005460), "R3R1Mh-sRn", mcf5307 | mcf5206e },
+{"msacl", two(0120250, 0005400), two(0170670, 0005460), "R3R1MhdsRn", mcf5307 | mcf5206e },
+{"msacml", two(0120220, 0004440), two(0170670, 0005460), "R3R1asRn", mcf5307 | mcf5206e },
+{"msacml", two(0120230, 0004440), two(0170670, 0005460), "R3R1+sRn", mcf5307 | mcf5206e },
+{"msacml", two(0120240, 0004440), two(0170670, 0005460), "R3R1-sRn", mcf5307 | mcf5206e },
+{"msacml", two(0120250, 0004440), two(0170670, 0005460), "R3R1dsRn", mcf5307 | mcf5206e },
+{"msacml", two(0120220, 0005440), two(0170670, 0005460), "R3R1MhasRn", mcf5307 | mcf5206e },
+{"msacml", two(0120230, 0005440), two(0170670, 0005460), "R3R1Mh+sRn", mcf5307 | mcf5206e },
+{"msacml", two(0120240, 0005440), two(0170670, 0005460), "R3R1Mh-sRn", mcf5307 | mcf5206e },
+{"msacml", two(0120250, 0005440), two(0170670, 0005460), "R3R1MhdsRn", mcf5307 | mcf5206e },
+
+{"mulsw", one(0140700), one(0170700), ";wDd", m68000up|mcf },
{"mulsl", two(0046000,004000), two(0177700,0107770), ";lD1", m68020up|cpu32 },
-{"mulsl", two(0046000,004000), two(0177700,0107770), "qsD1", mcf5200 },
+{"mulsl", two(0046000,004000), two(0177700,0107770), "qsD1", mcf },
{"mulsl", two(0046000,006000), two(0177700,0107770), ";lD3D1",m68020up|cpu32 },
-{"muluw", one(0140300), one(0170700), ";wDd", m68000up|mcf5200 },
+{"muluw", one(0140300), one(0170700), ";wDd", m68000up|mcf },
{"mulul", two(0046000,000000), two(0177700,0107770), ";lD1", m68020up|cpu32 },
-{"mulul", two(0046000,000000), two(0177700,0107770), "qsD1", mcf5200 },
+{"mulul", two(0046000,000000), two(0177700,0107770), "qsD1", mcf },
{"mulul", two(0046000,002000), two(0177700,0107770), ";lD3D1",m68020up|cpu32 },
{"nbcd", one(0044000), one(0177700), "$s", m68000up },
@@ -1365,26 +1457,26 @@ const struct m68k_opcode m68k_opcodes[] =
{"negb", one(0042000), one(0177700), "$s", m68000up },
{"negw", one(0042100), one(0177700), "$s", m68000up },
{"negl", one(0042200), one(0177700), "$s", m68000up },
-{"negl", one(0042200), one(0177700), "Ds", mcf5200},
+{"negl", one(0042200), one(0177700), "Ds", mcf},
{"negxb", one(0040000), one(0177700), "$s", m68000up },
{"negxw", one(0040100), one(0177700), "$s", m68000up },
{"negxl", one(0040200), one(0177700), "$s", m68000up },
-{"negxl", one(0040200), one(0177700), "Ds", mcf5200},
+{"negxl", one(0040200), one(0177700), "Ds", mcf},
-{"nop", one(0047161), one(0177777), "", m68000up | mcf5200},
+{"nop", one(0047161), one(0177777), "", m68000up | mcf},
{"notb", one(0043000), one(0177700), "$s", m68000up },
{"notw", one(0043100), one(0177700), "$s", m68000up },
{"notl", one(0043200), one(0177700), "$s", m68000up },
-{"notl", one(0043200), one(0177700), "Ds", mcf5200},
+{"notl", one(0043200), one(0177700), "Ds", mcf},
{"orib", one(0000000), one(0177700), "#b$s", m68000up },
{"orib", one(0000074), one(0177777), "#bCs", m68000up },
{"oriw", one(0000100), one(0177700), "#w$s", m68000up },
{"oriw", one(0000174), one(0177777), "#wSs", m68000up },
{"oril", one(0000200), one(0177700), "#l$s", m68000up },
-{"oril", one(0000200), one(0177700), "#lDs", mcf5200 },
+{"oril", one(0000200), one(0177700), "#lDs", mcf },
{"ori", one(0000074), one(0177777), "#bCs", m68000up },
{"ori", one(0000100), one(0177700), "#w$s", m68000up },
{"ori", one(0000174), one(0177777), "#wSs", m68000up },
@@ -1399,9 +1491,9 @@ const struct m68k_opcode m68k_opcodes[] =
{"orw", one(0100100), one(0170700), ";wDd", m68000up },
{"orw", one(0100500), one(0170700), "Dd~s", m68000up },
{"orl", one(0000200), one(0177700), "#l$s", m68000up },
-{"orl", one(0000200), one(0177700), "#lDs", mcf5200 },
-{"orl", one(0100200), one(0170700), ";lDd", m68000up | mcf5200 },
-{"orl", one(0100600), one(0170700), "Dd~s", m68000up | mcf5200 },
+{"orl", one(0000200), one(0177700), "#lDs", mcf },
+{"orl", one(0100200), one(0170700), ";lDd", m68000up | mcf },
+{"orl", one(0100600), one(0170700), "Dd~s", m68000up | mcf },
{"or", one(0000074), one(0177777), "#bCs", m68000up },
{"or", one(0000100), one(0177700), "#w$s", m68000up },
{"or", one(0000174), one(0177777), "#wSs", m68000up },
@@ -1461,7 +1553,7 @@ const struct m68k_opcode m68k_opcodes[] =
{"pdbwc", two(0xf048, 0x0009), two(0xfff8, 0xffff), "DsBw", m68851 },
{"pdbws", two(0xf048, 0x0008), two(0xfff8, 0xffff), "DsBw", m68851 },
-{"pea", one(0044100), one(0177700), "!s", m68000up|mcf5200 },
+{"pea", one(0044100), one(0177700), "!s", m68000up|mcf },
{"pflusha", one(0xf518), one(0xfff8), "", m68040up },
{"pflusha", two(0xf000,0x2400), two(0xffff,0xffff), "", m68030 | m68851 },
@@ -1619,11 +1711,14 @@ const struct m68k_opcode m68k_opcodes[] =
{"ptrapwsl", two(0xf07b, 0x0008), two(0xffff, 0xffff), "#l", m68851 },
{"ptrapws", two(0xf07c, 0x0008), two(0xffff, 0xffff), "", m68851 },
-{"pulse", one(0045314), one(0177777), "", m68060 | mcf5200 },
+{"pulse", one(0045314), one(0177777), "", m68060 | mcf },
{"pvalid", two(0xf000, 0x2800), two(0xffc0, 0xffff), "Vs&s", m68851 },
{"pvalid", two(0xf000, 0x2c00), two(0xffc0, 0xfff8), "A3&s", m68851 },
+ /* FIXME: don't allow Dw==Dx. */
+{"remsl", two(0x4c40, 0x0800), two(0xffc0, 0x8ff8), "vsD3D1", mcf5307 | mcf5206e },
+{"remul", two(0x4c40, 0x0000), two(0xffc0, 0x8ff8), "vsD3D1", mcf5307 | mcf5206e },
{"reset", one(0047160), one(0177777), "", m68000up },
@@ -1661,64 +1756,64 @@ const struct m68k_opcode m68k_opcodes[] =
{"rtd", one(0047164), one(0177777), "#w", m68010up },
-{"rte", one(0047163), one(0177777), "", m68000up|mcf5200 },
+{"rte", one(0047163), one(0177777), "", m68000up|mcf },
{"rtm", one(0003300), one(0177760), "Rs", m68020 },
{"rtr", one(0047167), one(0177777), "", m68000up },
-{"rts", one(0047165), one(0177777), "", m68000up|mcf5200 },
+{"rts", one(0047165), one(0177777), "", m68000up|mcf },
{"sbcd", one(0100400), one(0170770), "DsDd", m68000up },
{"sbcd", one(0100410), one(0170770), "-s-d", m68000up },
{"scc", one(0052300), one(0177700), "$s", m68000up },
-{"scc", one(0052300), one(0177700), "Ds", mcf5200 },
+{"scc", one(0052300), one(0177700), "Ds", mcf },
{"scs", one(0052700), one(0177700), "$s", m68000up },
-{"scs", one(0052700), one(0177700), "Ds", mcf5200 },
+{"scs", one(0052700), one(0177700), "Ds", mcf },
{"seq", one(0053700), one(0177700), "$s", m68000up },
-{"seq", one(0053700), one(0177700), "Ds", mcf5200 },
+{"seq", one(0053700), one(0177700), "Ds", mcf },
{"sf", one(0050700), one(0177700), "$s", m68000up },
-{"sf", one(0050700), one(0177700), "Ds", mcf5200 },
+{"sf", one(0050700), one(0177700), "Ds", mcf },
{"sge", one(0056300), one(0177700), "$s", m68000up },
-{"sge", one(0056300), one(0177700), "Ds", mcf5200 },
+{"sge", one(0056300), one(0177700), "Ds", mcf },
{"sgt", one(0057300), one(0177700), "$s", m68000up },
-{"sgt", one(0057300), one(0177700), "Ds", mcf5200 },
+{"sgt", one(0057300), one(0177700), "Ds", mcf },
{"shi", one(0051300), one(0177700), "$s", m68000up },
-{"shi", one(0051300), one(0177700), "Ds", mcf5200 },
+{"shi", one(0051300), one(0177700), "Ds", mcf },
{"sle", one(0057700), one(0177700), "$s", m68000up },
-{"sle", one(0057700), one(0177700), "Ds", mcf5200 },
+{"sle", one(0057700), one(0177700), "Ds", mcf },
{"sls", one(0051700), one(0177700), "$s", m68000up },
-{"sls", one(0051700), one(0177700), "Ds", mcf5200 },
+{"sls", one(0051700), one(0177700), "Ds", mcf },
{"slt", one(0056700), one(0177700), "$s", m68000up },
-{"slt", one(0056700), one(0177700), "Ds", mcf5200 },
+{"slt", one(0056700), one(0177700), "Ds", mcf },
{"smi", one(0055700), one(0177700), "$s", m68000up },
-{"smi", one(0055700), one(0177700), "Ds", mcf5200 },
+{"smi", one(0055700), one(0177700), "Ds", mcf },
{"sne", one(0053300), one(0177700), "$s", m68000up },
-{"sne", one(0053300), one(0177700), "Ds", mcf5200 },
+{"sne", one(0053300), one(0177700), "Ds", mcf },
{"spl", one(0055300), one(0177700), "$s", m68000up },
-{"spl", one(0055300), one(0177700), "Ds", mcf5200 },
+{"spl", one(0055300), one(0177700), "Ds", mcf },
{"st", one(0050300), one(0177700), "$s", m68000up },
-{"st", one(0050300), one(0177700), "Ds", mcf5200 },
+{"st", one(0050300), one(0177700), "Ds", mcf },
{"svc", one(0054300), one(0177700), "$s", m68000up },
-{"svc", one(0054300), one(0177700), "Ds", mcf5200 },
+{"svc", one(0054300), one(0177700), "Ds", mcf },
{"svs", one(0054700), one(0177700), "$s", m68000up },
-{"svs", one(0054700), one(0177700), "Ds", mcf5200 },
+{"svs", one(0054700), one(0177700), "Ds", mcf },
-{"stop", one(0047162), one(0177777), "#w", m68000up | mcf5200 },
+{"stop", one(0047162), one(0177777), "#w", m68000up | mcf },
-{"subal", one(0110700), one(0170700), "*lAd", m68000up | mcf5200 },
+{"subal", one(0110700), one(0170700), "*lAd", m68000up | mcf },
{"subaw", one(0110300), one(0170700), "*wAd", m68000up },
{"subib", one(0002000), one(0177700), "#b$s", m68000up },
{"subiw", one(0002100), one(0177700), "#w$s", m68000up },
{"subil", one(0002200), one(0177700), "#l$s", m68000up },
-{"subil", one(0002200), one(0177700), "#lDs", mcf5200 },
+{"subil", one(0002200), one(0177700), "#lDs", mcf },
{"subqb", one(0050400), one(0170700), "Qd%s", m68000up },
{"subqw", one(0050500), one(0170700), "Qd%s", m68000up },
-{"subql", one(0050600), one(0170700), "Qd%s", m68000up | mcf5200 },
+{"subql", one(0050600), one(0170700), "Qd%s", m68000up | mcf },
/* The sub opcode can generate the suba, subi, and subq instructions. */
{"subb", one(0050400), one(0170700), "Qd%s", m68000up },
@@ -1730,21 +1825,21 @@ const struct m68k_opcode m68k_opcodes[] =
{"subw", one(0110300), one(0170700), "*wAd", m68000up },
{"subw", one(0110100), one(0170700), "*wDd", m68000up },
{"subw", one(0110500), one(0170700), "Dd~s", m68000up },
-{"subl", one(0050600), one(0170700), "Qd%s", m68000up | mcf5200 },
+{"subl", one(0050600), one(0170700), "Qd%s", m68000up | mcf },
{"subl", one(0002200), one(0177700), "#l$s", m68000up },
-{"subl", one(0002200), one(0177700), "#lDs", mcf5200 },
-{"subl", one(0110700), one(0170700), "*lAd", m68000up | mcf5200 },
-{"subl", one(0110200), one(0170700), "*lDd", m68000up | mcf5200 },
-{"subl", one(0110600), one(0170700), "Dd~s", m68000up | mcf5200 },
+{"subl", one(0002200), one(0177700), "#lDs", mcf },
+{"subl", one(0110700), one(0170700), "*lAd", m68000up | mcf },
+{"subl", one(0110200), one(0170700), "*lDd", m68000up | mcf },
+{"subl", one(0110600), one(0170700), "Dd~s", m68000up | mcf },
{"subxb", one(0110400), one(0170770), "DsDd", m68000up },
{"subxb", one(0110410), one(0170770), "-s-d", m68000up },
{"subxw", one(0110500), one(0170770), "DsDd", m68000up },
{"subxw", one(0110510), one(0170770), "-s-d", m68000up },
-{"subxl", one(0110600), one(0170770), "DsDd", m68000up | mcf5200 },
+{"subxl", one(0110600), one(0170770), "DsDd", m68000up | mcf },
{"subxl", one(0110610), one(0170770), "-s-d", m68000up },
-{"swap", one(0044100), one(0177770), "Ds", m68000up | mcf5200 },
+{"swap", one(0044100), one(0177770), "Ds", m68000up | mcf },
/* swbeg and swbegl are magic constants used on sysV68. The compiler
generates them before a switch table. They tell the debugger and
@@ -1752,8 +1847,8 @@ const struct m68k_opcode m68k_opcodes[] =
number of elements in the table. swbeg means that the entries in
the table are word (2 byte) sized, and swbegl means that the
entries in the table are longword (4 byte) sized. */
-{"swbeg", one(0045374), one(0177777), "#w", m68000up | mcf5200 },
-{"swbegl", one(0045375), one(0177777), "#l", m68000up | mcf5200 },
+{"swbeg", one(0045374), one(0177777), "#w", m68000up | mcf },
+{"swbegl", one(0045375), one(0177777), "#l", m68000up | mcf },
{"tas", one(0045300), one(0177700), "$s", m68000up },
@@ -1769,12 +1864,12 @@ TBL("tblsnb", "tblsnw", "tblsnl", 1, 0),
TBL("tblub", "tbluw", "tblul", 0, 1),
TBL("tblunb", "tblunw", "tblunl", 0, 0),
-{"trap", one(0047100), one(0177760), "Ts", m68000up | mcf5200 },
+{"trap", one(0047100), one(0177760), "Ts", m68000up | mcf },
{"trapcc", one(0052374), one(0177777), "", m68020up | cpu32 },
{"trapcs", one(0052774), one(0177777), "", m68020up | cpu32 },
{"trapeq", one(0053774), one(0177777), "", m68020up | cpu32 },
-{"trapf", one(0050774), one(0177777), "", m68020up | cpu32 | mcf5200 },
+{"trapf", one(0050774), one(0177777), "", m68020up | cpu32 | mcf },
{"trapge", one(0056374), one(0177777), "", m68020up | cpu32 },
{"trapgt", one(0057374), one(0177777), "", m68020up | cpu32 },
{"traphi", one(0051374), one(0177777), "", m68020up | cpu32 },
@@ -1791,7 +1886,7 @@ TBL("tblunb", "tblunw", "tblunl", 0, 0),
{"trapccw", one(0052372), one(0177777), "#w", m68020up|cpu32 },
{"trapcsw", one(0052772), one(0177777), "#w", m68020up|cpu32 },
{"trapeqw", one(0053772), one(0177777), "#w", m68020up|cpu32 },
-{"trapfw", one(0050772), one(0177777), "#w", m68020up|cpu32|mcf5200},
+{"trapfw", one(0050772), one(0177777), "#w", m68020up|cpu32|mcf},
{"trapgew", one(0056372), one(0177777), "#w", m68020up|cpu32 },
{"trapgtw", one(0057372), one(0177777), "#w", m68020up|cpu32 },
{"traphiw", one(0051372), one(0177777), "#w", m68020up|cpu32 },
@@ -1808,7 +1903,7 @@ TBL("tblunb", "tblunw", "tblunl", 0, 0),
{"trapccl", one(0052373), one(0177777), "#l", m68020up|cpu32 },
{"trapcsl", one(0052773), one(0177777), "#l", m68020up|cpu32 },
{"trapeql", one(0053773), one(0177777), "#l", m68020up|cpu32 },
-{"trapfl", one(0050773), one(0177777), "#l", m68020up|cpu32|mcf5200},
+{"trapfl", one(0050773), one(0177777), "#l", m68020up|cpu32|mcf},
{"trapgel", one(0056373), one(0177777), "#l", m68020up|cpu32 },
{"trapgtl", one(0057373), one(0177777), "#l", m68020up|cpu32 },
{"traphil", one(0051373), one(0177777), "#l", m68020up|cpu32 },
@@ -1824,21 +1919,21 @@ TBL("tblunb", "tblunw", "tblunl", 0, 0),
{"trapv", one(0047166), one(0177777), "", m68000up },
-{"tstb", one(0045000), one(0177700), ";b", m68020up|cpu32|mcf5200 },
+{"tstb", one(0045000), one(0177700), ";b", m68020up|cpu32|mcf },
{"tstb", one(0045000), one(0177700), "$b", m68000up },
-{"tstw", one(0045100), one(0177700), "*w", m68020up|cpu32|mcf5200 },
+{"tstw", one(0045100), one(0177700), "*w", m68020up|cpu32|mcf },
{"tstw", one(0045100), one(0177700), "$w", m68000up },
-{"tstl", one(0045200), one(0177700), "*l", m68020up|cpu32|mcf5200 },
+{"tstl", one(0045200), one(0177700), "*l", m68020up|cpu32|mcf },
{"tstl", one(0045200), one(0177700), "$l", m68000up },
-{"unlk", one(0047130), one(0177770), "As", m68000up | mcf5200 },
+{"unlk", one(0047130), one(0177770), "As", m68000up | mcf },
{"unpk", one(0100600), one(0170770), "DsDd#w", m68020up },
{"unpk", one(0100610), one(0170770), "-s-d#w", m68020up },
-{"wddatab", one(0172000), one(0177700), "~s", mcf5200 },
-{"wddataw", one(0172100), one(0177700), "~s", mcf5200 },
-{"wddatal", one(0172200), one(0177700), "~s", mcf5200 },
+{"wddatab", one(0172000), one(0177700), "~s", mcf },
+{"wddataw", one(0172100), one(0177700), "~s", mcf },
+{"wddatal", one(0172200), one(0177700), "~s", mcf },
};
@@ -1973,6 +2068,7 @@ const struct m68k_opcode_alias m68k_opcode_aliases[] =
{ "leal", "lea", },
{ "lsl", "lslw", },
{ "lsr", "lsrw", },
+ { "mac", "macw" },
{ "movea", "moveaw", },
{ "movem", "movemw", },
{ "movml", "moveml", },
@@ -1983,6 +2079,7 @@ const struct m68k_opcode_alias m68k_opcode_aliases[] =
{ "moves", "movesw" },
{ "muls", "mulsw", },
{ "mulu", "muluw", },
+ { "msac", "msacw" },
{ "nbcdb", "nbcd" },
{ "neg", "negw", },
{ "negx", "negxw", },
diff --git a/opcodes/mcore-dis.c b/opcodes/mcore-dis.c
index 42c1793b6d7..36612a2e6f7 100644
--- a/opcodes/mcore-dis.c
+++ b/opcodes/mcore-dis.c
@@ -57,6 +57,9 @@ static const unsigned short imsk[] =
/* OMc */ 0xFF00,
/* SIa */ 0xFE00,
+/* start-sanitize-m340 */
+ /* MULSH */ 0xFF00,
+/* end-sanitize-m340 */
/* JC */ 0, /* JC,JU,JL don't appear in object */
/* JU */ 0,
@@ -96,6 +99,8 @@ print_insn_mcore (memaddr, info)
mcore_opcode_info * op;
int status;
+ info->bytes_per_chunk = 2;
+
status = info->read_memory_func (memaddr, ibytes, 2, info);
if (status != 0)
@@ -104,17 +109,24 @@ print_insn_mcore (memaddr, info)
return -1;
}
- inst = (ibytes[0] << 8) | ibytes[1];
+/* start-sanitize-m340 */
+ if (info->endian == BFD_ENDIAN_BIG)
+/* end-sanitize-m340 */
+ inst = (ibytes[0] << 8) | ibytes[1];
+/* start-sanitize-m340 */
+ else if (info->endian == BFD_ENDIAN_LITTLE)
+ inst = (ibytes[1] << 8) | ibytes[0];
+ else
+ abort ();
+/* end-sanitize-m340 */
/* Just a linear search of the table. */
for (op = mcore_table; op->name != 0; op ++)
- {
- if (op->inst == (inst & imsk[op->opclass]))
- break;
- }
+ if (op->inst == (inst & imsk[op->opclass]))
+ break;
if (op->name == 0)
- fprintf (stream, ".word 0x%04x", inst);
+ fprintf (stream, ".short 0x%04x", inst);
else
{
const char * name = grname[inst & 0x0F];
@@ -130,6 +142,9 @@ print_insn_mcore (memaddr, info)
case JSR: fprintf (stream, "\t%s", name); break;
case OC: fprintf (stream, "\t%s, %s", name, crname[(inst >> 4) & 0x1F]); break;
case O1R1: fprintf (stream, "\t%s, r1", name); break;
+/* start-sanitize-m340 */
+ case MULSH:
+/* end-sanitize-m340 */
case O2: fprintf (stream, "\t%s, %s", name, grname[(inst >> 4) & 0xF]); break;
case X1: fprintf (stream, "\tr1, %s", name); break;
case OI: fprintf (stream, "\t%s, %d", name, ((inst >> 4) & 0x1F) + 1); break;
@@ -191,11 +206,17 @@ print_insn_mcore (memaddr, info)
if (status != 0)
{
info->memory_error_func (status, memaddr, info);
- return -1;
+ break;
}
- val = (ibytes[0] << 24) | (ibytes[1] << 16)
- | (ibytes[2] << 8) | (ibytes[3]);
+/* start-sanitize-m340 */
+ if (info->endian == BFD_ENDIAN_LITTLE)
+ val = (ibytes[3] << 24) | (ibytes[2] << 16)
+ | (ibytes[1] << 8) | (ibytes[0]);
+ else
+/* end-sanitize-m340 */
+ val = (ibytes[0] << 24) | (ibytes[1] << 16)
+ | (ibytes[2] << 8) | (ibytes[3]);
/* Removed [] around literal value to match ABI syntax 12/95. */
fprintf (stream, "\t%s, 0x%X", grname[(inst >> 8) & 0xF], val);
@@ -216,11 +237,17 @@ print_insn_mcore (memaddr, info)
if (status != 0)
{
info->memory_error_func (status, memaddr, info);
- return -1;
+ break;
}
-
- val = (ibytes[0] << 24) | (ibytes[1] << 16)
- | (ibytes[2] << 8) | (ibytes[3]);
+
+/* start-sanitize-m340 */
+ if (info->endian == BFD_ENDIAN_LITTLE)
+ val = (ibytes[3] << 24) | (ibytes[2] << 16)
+ | (ibytes[1] << 8) | (ibytes[0]);
+ else
+/* end-sanitize-m340 */
+ val = (ibytes[0] << 24) | (ibytes[1] << 16)
+ | (ibytes[2] << 8) | (ibytes[3]);
/* Removed [] around literal value to match ABI syntax 12/95. */
fprintf (stream, "\t0x%X", val);
diff --git a/opcodes/mcore-opc.h b/opcodes/mcore-opc.h
index 606ba846efd..856f78b617c 100644
--- a/opcodes/mcore-opc.h
+++ b/opcodes/mcore-opc.h
@@ -24,6 +24,9 @@ typedef enum
OMa, SI, I7, LS, BR, BL, LR, LJ,
RM, RQ, JSR, JMP, OBRa, OBRb, OBRc, OBR2,
O1R1, OMb, OMc, SIa,
+ /* start-sanitize-m340 */
+ MULSH,
+ /* end-sanitize-m340 */
JC, JU, JL, RSI, DO21, OB2
}
mcore_opclass;
@@ -48,6 +51,9 @@ mcore_opcode_info mcore_table[] =
{ "stop", O0, 0, 0x0004 },
{ "wait", O0, 0, 0x0005 },
{ "doze", O0, 0, 0x0006 },
+ /* start-sanitize-m340 */
+ { "idly4", O0, 0, 0x0007 },
+ /* end-sanitize-m340 */
{ "trap", OT, 0, 0x0008 },
/* SPACE: 0x000C - 0x000F */
/* SPACE: 0x0010 - 0x001F */
@@ -146,6 +152,10 @@ mcore_opcode_info mcore_table[] =
{ "movi", I7, 0, 0x6000 },
#define MCORE_INST_BMASKI_ALT 0x6000
#define MCORE_INST_BGENI_ALT 0x6000
+/* start-sanitize-m340 */
+ { "mulsh", MULSH, 0, 0x6800 },
+ { "muls.h", MULSH, 0, 0x6800 },
+/* end-sanitize-m340 */
/* SPACE: 0x6900 - 0x6FFF */
{ "jmpi", LJ, 1, 0x7000 },
{ "jsri", LJ, 0, 0x7F00 },