diff options
author | Nick Clifton <nickc@redhat.com> | 2001-10-30 15:20:14 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2001-10-30 15:20:14 +0000 |
commit | 3c3bdf30e42268e6193693acd1dc66d2d1792536 (patch) | |
tree | 8f6b2752d885c3e71d0bef5717e981faac396928 /bfd | |
parent | f5ffc9190a633d0f8eb1632a64a28eda75206b55 (diff) | |
download | gdb-3c3bdf30e42268e6193693acd1dc66d2d1792536.zip gdb-3c3bdf30e42268e6193693acd1dc66d2d1792536.tar.gz gdb-3c3bdf30e42268e6193693acd1dc66d2d1792536.tar.bz2 |
Add MMIX support
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 24 | ||||
-rw-r--r-- | bfd/Makefile.am | 13 | ||||
-rw-r--r-- | bfd/Makefile.in | 21 | ||||
-rw-r--r-- | bfd/archures.c | 3 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 53 | ||||
-rw-r--r-- | bfd/bfd.c | 1 | ||||
-rw-r--r-- | bfd/config.bfd | 6 | ||||
-rwxr-xr-x | bfd/configure | 332 | ||||
-rw-r--r-- | bfd/configure.in | 2 | ||||
-rw-r--r-- | bfd/cpu-mmix.c | 41 | ||||
-rw-r--r-- | bfd/doc/ChangeLog | 9 | ||||
-rw-r--r-- | bfd/doc/Makefile.am | 12 | ||||
-rw-r--r-- | bfd/doc/Makefile.in | 20 | ||||
-rw-r--r-- | bfd/doc/bfd.texinfo | 6 | ||||
-rw-r--r-- | bfd/doc/bfdint.texi | 2 | ||||
-rw-r--r-- | bfd/elf64-mmix.c | 1739 | ||||
-rw-r--r-- | bfd/elfxx-target.h | 3 | ||||
-rw-r--r-- | bfd/libbfd.h | 23 | ||||
-rw-r--r-- | bfd/mmo.c | 3274 | ||||
-rw-r--r-- | bfd/po/SRC-POTFILES.in | 60 | ||||
-rw-r--r-- | bfd/po/bfd.pot | 1131 | ||||
-rw-r--r-- | bfd/reloc.c | 72 | ||||
-rw-r--r-- | bfd/targets.c | 9 |
23 files changed, 6100 insertions, 756 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 2e4a5d1..3511fd9 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,27 @@ +2001-10-30 Hans-Peter Nilsson <hp@bitrange.com> + + * Makefile.am (ALL_MACHINES): Add cpu-mmix.lo. + (BFD64_BACKENDS): Add elf64-mmix.lo and mmo.lo. + (BFD64_BACKENDS_CFILES): Add elf64-mmix.c and mmo.c. + Regenerate dependencies. + * configure.in (bfd_elf64_mmix_vec, bfd_mmo_vec): New vectors. + * config.bfd: [BFD64] (mmix-*-*): New case. + * cpu-mmix.c, mmo.c, elf64-mmix.c: New files. + * archures.c (enum bfd_architecture): Add bfd_arch_mmix. + (bfd_mmix_arch): Declare. + (bfd_archures_list): Add bfd_mmix_arch. + * targets.c (enum bfd_flavour): Add bfd_target_mmo_flavour. + (bfd_elf64_mmix_vec, bfd_mmo_vec): Declare. + (bfd_target_vect) [BFD64]: Add bfd_elf64_mmix_vec and + bfd_mmo_mmix_vec. + * reloc.c: Add MMIX relocations. + * bfd.c (struct _bfd, tdata): Add mmo_data. + * Makefile.in: Regenerate. + * configure: Regenerate. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * configure: Rebuild. + 2001-10-30 Richard Earnshaw (rearnsha@arm.com) * elf.c (_bfd_elf_make_section_from_shdr): Set the LMA based on the diff --git a/bfd/Makefile.am b/bfd/Makefile.am index 83e96d7..a1f737f 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -68,6 +68,7 @@ ALL_MACHINES = \ cpu-m10300.lo \ cpu-mcore.lo \ cpu-mips.lo \ + cpu-mmix.lo \ cpu-ns32k.lo \ cpu-openrisc.lo \ cpu-pdp11.lo \ @@ -113,6 +114,7 @@ ALL_MACHINES_CFILES = \ cpu-m10300.c \ cpu-mcore.c \ cpu-mips.c \ + cpu-mmix.c \ cpu-ns32k.c \ cpu-openrisc.c \ cpu-pdp11.c \ @@ -428,10 +430,12 @@ BFD64_BACKENDS = \ elf64-ia64.lo \ elf64-gen.lo \ elf64-mips.lo \ + elf64-mmix.lo \ elf64-ppc.lo \ elf64-s390.lo \ elf64-sparc.lo \ elf64.lo \ + mmo.lo \ nlm32-alpha.lo \ nlm64.lo \ pepigen.lo @@ -447,10 +451,12 @@ BFD64_BACKENDS_CFILES = \ elf64-hppa.c \ elf64-gen.c \ elf64-mips.c \ + elf64-mmix.c \ elf64-ppc.c \ elf64-s390.c \ elf64-sparc.c \ elf64.c \ + mmo.c \ nlm32-alpha.c \ nlm64.c @@ -824,6 +830,7 @@ cpu-m10200.lo: cpu-m10200.c $(INCDIR)/filenames.h cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h +cpu-mmix.lo: cpu-mmix.c $(INCDIR)/filenames.h cpu-ns32k.lo: cpu-ns32k.c $(INCDIR)/filenames.h ns32k.h cpu-openrisc.lo: cpu-openrisc.c $(INCDIR)/filenames.h cpu-pdp11.lo: cpu-pdp11.c $(INCDIR)/filenames.h @@ -1346,6 +1353,10 @@ elf64-mips.lo: elf64-mips.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h \ ecoffswap.h elf64-target.h +elf64-mmix.lo: elf64-mmix.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/mmix.h elf64-target.h elf64-ppc.lo: elf64-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ @@ -1363,6 +1374,8 @@ elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \ elflink.h +mmo.lo: mmo.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/mmix.h nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \ $(INCDIR)/nlm/alpha-ext.h libnlm.h $(INCDIR)/nlm/common.h \ $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h nlmswap.h \ diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 51dc17f..efaae62 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -1,6 +1,6 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am +# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am -# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -193,6 +193,7 @@ ALL_MACHINES = \ cpu-m10300.lo \ cpu-mcore.lo \ cpu-mips.lo \ + cpu-mmix.lo \ cpu-ns32k.lo \ cpu-openrisc.lo \ cpu-pdp11.lo \ @@ -239,6 +240,7 @@ ALL_MACHINES_CFILES = \ cpu-m10300.c \ cpu-mcore.c \ cpu-mips.c \ + cpu-mmix.c \ cpu-ns32k.c \ cpu-openrisc.c \ cpu-pdp11.c \ @@ -557,10 +559,12 @@ BFD64_BACKENDS = \ elf64-ia64.lo \ elf64-gen.lo \ elf64-mips.lo \ + elf64-mmix.lo \ elf64-ppc.lo \ elf64-s390.lo \ elf64-sparc.lo \ elf64.lo \ + mmo.lo \ nlm32-alpha.lo \ nlm64.lo \ pepigen.lo @@ -577,10 +581,12 @@ BFD64_BACKENDS_CFILES = \ elf64-hppa.c \ elf64-gen.c \ elf64-mips.c \ + elf64-mmix.c \ elf64-ppc.c \ elf64-s390.c \ elf64-sparc.c \ elf64.c \ + mmo.c \ nlm32-alpha.c \ nlm64.c @@ -716,7 +722,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) @@ -883,7 +889,7 @@ maintainer-clean-recursive: dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev="$$subdir $$rev"; \ - test "$$subdir" = "." && dot_seen=yes; \ + test "$$subdir" != "." || dot_seen=yes; \ done; \ test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ @@ -1367,6 +1373,7 @@ cpu-m10200.lo: cpu-m10200.c $(INCDIR)/filenames.h cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h +cpu-mmix.lo: cpu-mmix.c $(INCDIR)/filenames.h cpu-ns32k.lo: cpu-ns32k.c $(INCDIR)/filenames.h ns32k.h cpu-openrisc.lo: cpu-openrisc.c $(INCDIR)/filenames.h cpu-pdp11.lo: cpu-pdp11.c $(INCDIR)/filenames.h @@ -1889,6 +1896,10 @@ elf64-mips.lo: elf64-mips.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h \ ecoffswap.h elf64-target.h +elf64-mmix.lo: elf64-mmix.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/mmix.h elf64-target.h elf64-ppc.lo: elf64-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ @@ -1906,6 +1917,8 @@ elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \ elflink.h +mmo.lo: mmo.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/mmix.h nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \ $(INCDIR)/nlm/alpha-ext.h libnlm.h $(INCDIR)/nlm/common.h \ $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h nlmswap.h \ diff --git a/bfd/archures.c b/bfd/archures.c index 18925e3..74d4424 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -258,6 +258,7 @@ DESCRIPTION .#define bfd_mach_s390_esa 0 .#define bfd_mach_s390_esame 1 . bfd_arch_openrisc, {* OpenRISC *} +. bfd_arch_mmix, {* Donald Knuth's educational processor *} . bfd_arch_last . }; */ @@ -336,6 +337,7 @@ extern const bfd_arch_info_type bfd_avr_arch; extern const bfd_arch_info_type bfd_ia64_arch; extern const bfd_arch_info_type bfd_s390_arch; extern const bfd_arch_info_type bfd_openrisc_arch; +extern const bfd_arch_info_type bfd_mmix_arch; static const bfd_arch_info_type * const bfd_archures_list[] = { #ifdef SELECT_ARCHITECTURES @@ -383,6 +385,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = { &bfd_ia64_arch, &bfd_s390_arch, &bfd_openrisc_arch, + &bfd_mmix_arch, #endif 0 }; diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 854dd0e..1f3704b 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1601,6 +1601,7 @@ enum bfd_architecture #define bfd_mach_s390_esa 0 #define bfd_mach_s390_esame 1 bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_mmix, /* Donald Knuth's educational processor */ bfd_arch_last }; @@ -2566,6 +2567,54 @@ short offset into 11 bits. */ BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2, BFD_RELOC_MCORE_RVA, +/* These are relocations for the GETA instruction. */ + BFD_RELOC_MMIX_GETA, + BFD_RELOC_MMIX_GETA_1, + BFD_RELOC_MMIX_GETA_2, + BFD_RELOC_MMIX_GETA_3, + +/* These are relocations for a conditional branch instruction. */ + BFD_RELOC_MMIX_CBRANCH, + BFD_RELOC_MMIX_CBRANCH_J, + BFD_RELOC_MMIX_CBRANCH_1, + BFD_RELOC_MMIX_CBRANCH_2, + BFD_RELOC_MMIX_CBRANCH_3, + +/* These are relocations for the PUSHJ instruction. */ + BFD_RELOC_MMIX_PUSHJ, + BFD_RELOC_MMIX_PUSHJ_1, + BFD_RELOC_MMIX_PUSHJ_2, + BFD_RELOC_MMIX_PUSHJ_3, + +/* These are relocations for the JMP instruction. */ + BFD_RELOC_MMIX_JMP, + BFD_RELOC_MMIX_JMP_1, + BFD_RELOC_MMIX_JMP_2, + BFD_RELOC_MMIX_JMP_3, + +/* This is a relocation for a relative address as in a GETA instruction or +a branch. */ + BFD_RELOC_MMIX_ADDR19, + +/* This is a relocation for a relative address as in a JMP instruction. */ + BFD_RELOC_MMIX_ADDR27, + +/* This is a relocation for an instruction field that may be a general +register or a value 0..255. */ + BFD_RELOC_MMIX_REG_OR_BYTE, + +/* This is a relocation for an instruction field that may be a general +register. */ + BFD_RELOC_MMIX_REG, + +/* This is a relocation for two instruction fields holding a register and +an offset, the equivalent of the relocation. */ + BFD_RELOC_MMIX_BASE_PLUS_OFFSET, + +/* This relocation is an assertion that the expression is not allocated as +a global register. It does not modify contents. */ + BFD_RELOC_MMIX_LOCAL, + /* This is a 16 bit reloc for the AVR that stores 8 bit pc relative short offset into 7 bits. */ BFD_RELOC_AVR_7_PCREL, @@ -3166,6 +3215,7 @@ struct _bfd struct elf_obj_tdata *elf_obj_data; struct nlm_obj_tdata *nlm_obj_data; struct bout_data_struct *bout_data; + struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; struct trad_core_struct *trad_core_data; @@ -3425,7 +3475,8 @@ enum bfd_flavour { bfd_target_versados_flavour, bfd_target_msdos_flavour, bfd_target_ovax_flavour, - bfd_target_evax_flavour + bfd_target_evax_flavour, + bfd_target_mmo_flavour }; enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN }; @@ -167,6 +167,7 @@ CODE_FRAGMENT . struct elf_obj_tdata *elf_obj_data; . struct nlm_obj_tdata *nlm_obj_data; . struct bout_data_struct *bout_data; +. struct mmo_data_struct *mmo_data; . struct sun_core_struct *sun_core_data; . struct sco5_core_struct *sco5_core_data; . struct trad_core_struct *trad_core_data; diff --git a/bfd/config.bfd b/bfd/config.bfd index e5c9495..094fba4 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -710,6 +710,12 @@ case "${targ}" in targ_defvec=bfd_elf32_tradbigmips_vec targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" ;; +#ifdef BFD64 + mmix-*-*) + targ_defvec=bfd_elf64_mmix_vec + targ_selvecs=bfd_mmo_vec + ;; +#endif mn10200-*-*) targ_defvec=bfd_elf32_mn10200_vec ;; diff --git a/bfd/configure b/bfd/configure index 2bda57b..b55b0dc 100755 --- a/bfd/configure +++ b/bfd/configure @@ -3229,7 +3229,7 @@ EOF fi -for ac_hdr in unistd.h +for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -3361,11 +3361,24 @@ else #include <fcntl.h> #include <sys/mman.h> +#if HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif + +#if HAVE_STDLIB_H +# include <stdlib.h> +#endif + +#if HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif + +#if HAVE_UNISTD_H +# include <unistd.h> +#endif + /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include <unistd.h> -# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -3473,7 +3486,7 @@ main() } EOF -if { (eval echo configure:3477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3490: \"$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 @@ -3501,17 +3514,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:3505: checking for $ac_hdr" >&5 +echo "configure:3518: 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 3510 "configure" +#line 3523 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3515: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3528: \"$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* @@ -3541,12 +3554,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3545: checking for $ac_func" >&5 +echo "configure:3558: 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 3550 "configure" +#line 3563 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3569,7 +3582,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3586: \"$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 @@ -3598,12 +3611,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3602: checking for $ac_func" >&5 +echo "configure:3615: 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 3607 "configure" +#line 3620 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3626,7 +3639,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3643: \"$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 @@ -3660,19 +3673,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3664: checking for LC_MESSAGES" >&5 +echo "configure:3677: 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 3669 "configure" +#line 3682 "configure" #include "confdefs.h" #include <locale.h> int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:3676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3689: \"$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 @@ -3693,7 +3706,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3697: checking whether NLS is requested" >&5 +echo "configure:3710: 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" @@ -3713,7 +3726,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3717: checking whether included gettext is requested" >&5 +echo "configure:3730: 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" @@ -3732,17 +3745,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3736: checking for libintl.h" >&5 +echo "configure:3749: 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 3741 "configure" +#line 3754 "configure" #include "confdefs.h" #include <libintl.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3759: \"$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* @@ -3759,19 +3772,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:3763: checking for gettext in libc" >&5 +echo "configure:3776: 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 3768 "configure" +#line 3781 "configure" #include "confdefs.h" #include <libintl.h> int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3788: \"$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 @@ -3787,7 +3800,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:3791: checking for bindtextdomain in -lintl" >&5 +echo "configure:3804: 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 @@ -3795,7 +3808,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <<EOF -#line 3799 "configure" +#line 3812 "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 @@ -3806,7 +3819,7 @@ int main() { bindtextdomain() ; return 0; } EOF -if { (eval echo configure:3810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3823: \"$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 @@ -3822,19 +3835,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:3826: checking for gettext in libintl" >&5 +echo "configure:3839: 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 3831 "configure" +#line 3844 "configure" #include "confdefs.h" int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3851: \"$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 @@ -3862,7 +3875,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:3866: checking for $ac_word" >&5 +echo "configure:3879: 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 @@ -3896,12 +3909,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3900: checking for $ac_func" >&5 +echo "configure:3913: 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 3905 "configure" +#line 3918 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3924,7 +3937,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3941: \"$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 @@ -3951,7 +3964,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:3955: checking for $ac_word" >&5 +echo "configure:3968: 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 @@ -3987,7 +4000,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:3991: checking for $ac_word" >&5 +echo "configure:4004: 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 @@ -4019,7 +4032,7 @@ else fi cat > conftest.$ac_ext <<EOF -#line 4023 "configure" +#line 4036 "configure" #include "confdefs.h" int main() { @@ -4027,7 +4040,7 @@ extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } EOF -if { (eval echo configure:4031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -4059,7 +4072,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:4063: checking for $ac_word" >&5 +echo "configure:4076: 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 @@ -4093,7 +4106,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:4097: checking for $ac_word" >&5 +echo "configure:4110: 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 @@ -4129,7 +4142,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:4133: checking for $ac_word" >&5 +echo "configure:4146: 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 @@ -4219,7 +4232,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:4223: checking for catalogs to be installed" >&5 +echo "configure:4236: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -4247,17 +4260,17 @@ echo "configure:4223: 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:4251: checking for linux/version.h" >&5 +echo "configure:4264: 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 4256 "configure" +#line 4269 "configure" #include "confdefs.h" #include <linux/version.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4261: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4274: \"$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* @@ -4302,7 +4315,7 @@ fi l= - if test -d $srcdir/po; then + if test -f $srcdir/po/POTFILES.in; then test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then @@ -4335,7 +4348,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:4339: checking for a BSD compatible install" >&5 +echo "configure:4352: 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 @@ -4418,7 +4431,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:4422: checking for build system executable suffix" >&5 +echo "configure:4435: 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 @@ -4446,17 +4459,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:4450: checking for $ac_hdr" >&5 +echo "configure:4463: 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 4455 "configure" +#line 4468 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4460: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4473: \"$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* @@ -4486,17 +4499,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:4490: checking for $ac_hdr" >&5 +echo "configure:4503: 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 4495 "configure" +#line 4508 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4513: \"$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* @@ -4523,12 +4536,12 @@ fi done echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:4527: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:4540: 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 4532 "configure" +#line 4545 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/time.h> @@ -4537,7 +4550,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:4541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4554: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -4562,12 +4575,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:4566: checking for $ac_hdr that defines DIR" >&5 +echo "configure:4579: 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 4571 "configure" +#line 4584 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_hdr> @@ -4575,7 +4588,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:4579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4592: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -4600,7 +4613,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:4604: checking for opendir in -ldir" >&5 +echo "configure:4617: 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 @@ -4608,7 +4621,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <<EOF -#line 4612 "configure" +#line 4625 "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 @@ -4619,7 +4632,7 @@ int main() { opendir() ; return 0; } EOF -if { (eval echo configure:4623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4636: \"$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 @@ -4641,7 +4654,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:4645: checking for opendir in -lx" >&5 +echo "configure:4658: 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 @@ -4649,7 +4662,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <<EOF -#line 4653 "configure" +#line 4666 "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 @@ -4660,7 +4673,7 @@ int main() { opendir() ; return 0; } EOF -if { (eval echo configure:4664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4677: \"$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 @@ -4685,12 +4698,12 @@ fi for ac_func in fcntl getpagesize setitimer sysconf fdopen getuid getgid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4689: checking for $ac_func" >&5 +echo "configure:4702: 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 4694 "configure" +#line 4707 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4713,7 +4726,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4730: \"$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 @@ -4748,12 +4761,12 @@ EOF esac echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4752: checking whether strstr must be declared" >&5 +echo "configure:4765: 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 4757 "configure" +#line 4770 "configure" #include "confdefs.h" #include <stdio.h> @@ -4774,7 +4787,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4795,12 +4808,12 @@ EOF fi echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:4799: checking whether malloc must be declared" >&5 +echo "configure:4812: 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 4804 "configure" +#line 4817 "configure" #include "confdefs.h" #include <stdio.h> @@ -4821,7 +4834,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:4825: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -4842,12 +4855,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:4846: checking whether realloc must be declared" >&5 +echo "configure:4859: 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 4851 "configure" +#line 4864 "configure" #include "confdefs.h" #include <stdio.h> @@ -4868,7 +4881,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:4872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4885: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -4889,12 +4902,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:4893: checking whether free must be declared" >&5 +echo "configure:4906: 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 4898 "configure" +#line 4911 "configure" #include "confdefs.h" #include <stdio.h> @@ -4915,7 +4928,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:4919: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4932: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -4936,12 +4949,12 @@ EOF fi echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:4940: checking whether getenv must be declared" >&5 +echo "configure:4953: 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 4945 "configure" +#line 4958 "configure" #include "confdefs.h" #include <stdio.h> @@ -4962,7 +4975,7 @@ int main() { char *(*pfn) = (char *(*)) getenv ; return 0; } EOF -if { (eval echo configure:4966: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4979: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_getenv=no else @@ -5185,17 +5198,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:5189: checking for $ac_hdr" >&5 +echo "configure:5202: 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 5194 "configure" +#line 5207 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5199: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5212: \"$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* @@ -5223,12 +5236,12 @@ 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:5227: checking for prstatus_t in sys/procfs.h" >&5 +echo "configure:5240: 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 5232 "configure" +#line 5245 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5237,7 +5250,7 @@ int main() { prstatus_t avar ; return 0; } EOF -if { (eval echo configure:5241: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prstatus_t=yes else @@ -5259,12 +5272,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus_t" 1>&6 echo $ac_n "checking for prstatus32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5263: checking for prstatus32_t in sys/procfs.h" >&5 +echo "configure:5276: checking for prstatus32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5268 "configure" +#line 5281 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5273,7 +5286,7 @@ int main() { prstatus32_t avar ; return 0; } EOF -if { (eval echo configure:5277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prstatus32_t=yes else @@ -5295,12 +5308,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus32_t" 1>&6 echo $ac_n "checking for prstatus_t.pr_who in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5299: checking for prstatus_t.pr_who in sys/procfs.h" >&5 +echo "configure:5312: 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 5304 "configure" +#line 5317 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5309,7 +5322,7 @@ int main() { prstatus_t avar; void* aref = (void*) &avar.pr_who ; return 0; } EOF -if { (eval echo configure:5313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5326: \"$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 @@ -5331,12 +5344,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" 1>&6 echo $ac_n "checking for prstatus32_t.pr_who in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5335: checking for prstatus32_t.pr_who in sys/procfs.h" >&5 +echo "configure:5348: checking for prstatus32_t.pr_who in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5340 "configure" +#line 5353 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5345,7 +5358,7 @@ int main() { prstatus32_t avar; void* aref = (void*) &avar.pr_who ; return 0; } EOF -if { (eval echo configure:5349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5362: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who=yes else @@ -5367,12 +5380,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who" 1>&6 echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5371: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:5384: 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 5376 "configure" +#line 5389 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5381,7 +5394,7 @@ int main() { pstatus_t avar ; return 0; } EOF -if { (eval echo configure:5385: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5398: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -5403,12 +5416,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6 echo $ac_n "checking for pxstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5407: checking for pxstatus_t in sys/procfs.h" >&5 +echo "configure:5420: checking for pxstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pxstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5412 "configure" +#line 5425 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5417,7 +5430,7 @@ int main() { pxstatus_t avar ; return 0; } EOF -if { (eval echo configure:5421: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5434: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pxstatus_t=yes else @@ -5439,12 +5452,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pxstatus_t" 1>&6 echo $ac_n "checking for pstatus32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5443: checking for pstatus32_t in sys/procfs.h" >&5 +echo "configure:5456: checking for pstatus32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5448 "configure" +#line 5461 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5453,7 +5466,7 @@ int main() { pstatus32_t avar ; return 0; } EOF -if { (eval echo configure:5457: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus32_t=yes else @@ -5475,12 +5488,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus32_t" 1>&6 echo $ac_n "checking for prpsinfo_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5479: checking for prpsinfo_t in sys/procfs.h" >&5 +echo "configure:5492: 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 5484 "configure" +#line 5497 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5489,7 +5502,7 @@ int main() { prpsinfo_t avar ; return 0; } EOF -if { (eval echo configure:5493: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5506: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prpsinfo_t=yes else @@ -5511,12 +5524,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo_t" 1>&6 echo $ac_n "checking for prpsinfo32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5515: checking for prpsinfo32_t in sys/procfs.h" >&5 +echo "configure:5528: checking for prpsinfo32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5520 "configure" +#line 5533 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5525,7 +5538,7 @@ int main() { prpsinfo32_t avar ; return 0; } EOF -if { (eval echo configure:5529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prpsinfo32_t=yes else @@ -5547,12 +5560,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo32_t" 1>&6 echo $ac_n "checking for psinfo_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5551: checking for psinfo_t in sys/procfs.h" >&5 +echo "configure:5564: 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 5556 "configure" +#line 5569 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5561,7 +5574,7 @@ int main() { psinfo_t avar ; return 0; } EOF -if { (eval echo configure:5565: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psinfo_t=yes else @@ -5583,12 +5596,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo_t" 1>&6 echo $ac_n "checking for psinfo32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5587: checking for psinfo32_t in sys/procfs.h" >&5 +echo "configure:5600: checking for psinfo32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5592 "configure" +#line 5605 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5597,7 +5610,7 @@ int main() { psinfo32_t avar ; return 0; } EOF -if { (eval echo configure:5601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psinfo32_t=yes else @@ -5619,12 +5632,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo32_t" 1>&6 echo $ac_n "checking for lwpstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5623: checking for lwpstatus_t in sys/procfs.h" >&5 +echo "configure:5636: 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 5628 "configure" +#line 5641 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5633,7 +5646,7 @@ int main() { lwpstatus_t avar ; return 0; } EOF -if { (eval echo configure:5637: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5650: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpstatus_t=yes else @@ -5655,12 +5668,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpstatus_t" 1>&6 echo $ac_n "checking for lwpxstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5659: checking for lwpxstatus_t in sys/procfs.h" >&5 +echo "configure:5672: checking for lwpxstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpxstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5664 "configure" +#line 5677 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5669,7 +5682,7 @@ int main() { lwpxstatus_t avar ; return 0; } EOF -if { (eval echo configure:5673: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpxstatus_t=yes else @@ -5691,12 +5704,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpxstatus_t" 1>&6 echo $ac_n "checking for lwpstatus_t.pr_context in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5695: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 +echo "configure:5708: 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 5700 "configure" +#line 5713 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5705,7 +5718,7 @@ int main() { lwpstatus_t avar; void* aref = (void*) &avar.pr_context ; return 0; } EOF -if { (eval echo configure:5709: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5722: \"$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 @@ -5727,12 +5740,12 @@ 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:5731: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 +echo "configure:5744: 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 5736 "configure" +#line 5749 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5741,7 +5754,7 @@ int main() { lwpstatus_t avar; void* aref = (void*) &avar.pr_reg ; return 0; } EOF -if { (eval echo configure:5745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5758: \"$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 @@ -5763,12 +5776,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg" 1>&6 echo $ac_n "checking for win32_pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5767: checking for win32_pstatus_t in sys/procfs.h" >&5 +echo "configure:5780: checking for win32_pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_win32_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5772 "configure" +#line 5785 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5777,7 +5790,7 @@ int main() { win32_pstatus_t avar ; return 0; } EOF -if { (eval echo configure:5781: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5794: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_win32_pstatus_t=yes else @@ -6001,6 +6014,7 @@ do bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf64_mmix_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;; bfd_elf64_powerpc_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_powerpcle_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;; bfd_elf64_s390_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;; @@ -6008,6 +6022,7 @@ do bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;; + bfd_mmo_vec) tb="$tb mmo.lo" target_size=64 ;; bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; @@ -6191,21 +6206,21 @@ test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selar test -n "${havevecs}" && tdefaults="${tdefaults} ${havevecs}" -for ac_hdr in unistd.h +for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6199: checking for $ac_hdr" >&5 +echo "configure:6214: 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 6204 "configure" +#line 6219 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6209: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6224: \"$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* @@ -6234,12 +6249,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6238: checking for $ac_func" >&5 +echo "configure:6253: 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 6243 "configure" +#line 6258 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6262,7 +6277,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6281: \"$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 @@ -6287,7 +6302,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:6291: checking for working mmap" >&5 +echo "configure:6306: 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 @@ -6295,7 +6310,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 6299 "configure" +#line 6314 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -6323,11 +6338,24 @@ else #include <fcntl.h> #include <sys/mman.h> +#if HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif + +#if HAVE_STDLIB_H +# include <stdlib.h> +#endif + +#if HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif + +#if HAVE_UNISTD_H +# include <unistd.h> +#endif + /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include <unistd.h> -# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -6435,7 +6463,7 @@ main() } EOF -if { (eval echo configure:6439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6467: \"$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 @@ -6460,12 +6488,12 @@ fi for ac_func in madvise mprotect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6464: checking for $ac_func" >&5 +echo "configure:6492: 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 6469 "configure" +#line 6497 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6488,7 +6516,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6520: \"$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 diff --git a/bfd/configure.in b/bfd/configure.in index b660268..86a82e5 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -594,6 +594,7 @@ do bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf64_mmix_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;; bfd_elf64_powerpc_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_powerpcle_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;; bfd_elf64_s390_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;; @@ -601,6 +602,7 @@ do bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;; + bfd_mmo_vec) tb="$tb mmo.lo" target_size=64 ;; bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; diff --git a/bfd/cpu-mmix.c b/bfd/cpu-mmix.c new file mode 100644 index 0000000..a21473c --- /dev/null +++ b/bfd/cpu-mmix.c @@ -0,0 +1,41 @@ +/* BFD library support routines for MMIX. + Copyright (C) 2001 Free Software Foundation, Inc. + Contributed by Hans-Peter Nilsson (hp@bitrange.com) + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" + +const bfd_arch_info_type +bfd_mmix_arch = + { + 64, /* 64 bits in a word. */ + 64, /* 64 bits in an address. */ + 8, /* 8 bits in a byte. */ + bfd_arch_mmix, /* Architecture. */ + 0, /* Machine number - 0 for now. */ + /* Sorry, these are by custom and creeping assumption lower-case. */ + "mmix", /* Architecture name. */ + "mmix", /* Printable name. */ + 3, /* Section align power. */ + true, /* This is the default architecture. */ + bfd_default_compatible, /* Architecture comparison function. */ + bfd_default_scan, /* String to architecture conversion. */ + NULL /* Next in list. */ +}; diff --git a/bfd/doc/ChangeLog b/bfd/doc/ChangeLog index 4d3d588..2f3db6f 100644 --- a/bfd/doc/ChangeLog +++ b/bfd/doc/ChangeLog @@ -1,3 +1,12 @@ +2001-10-30 Hans-Peter Nilsson <hp@bitrange.com> + + * doc/bfdint.texi (BFD target vector miscellaneous): Add + bfd_target_mmo_flavour. + * doc/bfd.texinfo (BFD back ends): Add entry for mmo. + * doc/Makefile.am (DOCFILES): Add mmo.texi. + (SRCDOC): Add mmo.c. + (s-mmo, mmo.texi): New rules. + 2001-10-29 Kazu Hirata <kazu@hxi.com> * bfdsumm.texi: Fix a typo. diff --git a/bfd/doc/Makefile.am b/bfd/doc/Makefile.am index 91e2d02..075c9f3 100644 --- a/bfd/doc/Makefile.am +++ b/bfd/doc/Makefile.am @@ -6,7 +6,8 @@ DOCFILES = aoutx.texi archive.texi archures.texi \ bfdt.texi cache.texi coffcode.texi \ core.texi elf.texi elfcode.texi format.texi libbfd.texi \ opncls.texi reloc.texi section.texi \ - syms.texi targets.texi init.texi hash.texi linker.texi + syms.texi targets.texi init.texi hash.texi linker.texi \ + mmo.texi PROTOS = archive.p archures.p bfd.p \ core.p format.p \ @@ -27,7 +28,8 @@ SRCDOC = $(srcdir)/../aoutx.h $(srcdir)/../archive.c \ $(srcdir)/../libbfd.c $(srcdir)/../opncls.c \ $(srcdir)/../reloc.c $(srcdir)/../section.c \ $(srcdir)/../syms.c $(srcdir)/../targets.c \ - $(srcdir)/../hash.c $(srcdir)/../linker.c + $(srcdir)/../hash.c $(srcdir)/../linker.c \ + $(srcdir)/../mmo.c SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c \ $(srcdir)/../bfd.c $(srcdir)/../coffcode.h $(srcdir)/../corefile.c \ @@ -123,6 +125,12 @@ s-elfcode: $(MKDOC) $(srcdir)/../elfcode.h $(srcdir)/doc.str touch s-elfcode elfcode.texi: s-elfcode +s-mmo: $(MKDOC) $(srcdir)/../mmo.c $(srcdir)/doc.str + ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../mmo.c >mmo.tmp + $(srcdir)/../../move-if-change mmo.tmp mmo.texi + touch s-mmo +mmo.texi: s-mmo + s-format: $(MKDOC) $(srcdir)/../format.c $(srcdir)/doc.str ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../format.c >format.tmp $(srcdir)/../../move-if-change format.tmp format.texi diff --git a/bfd/doc/Makefile.in b/bfd/doc/Makefile.in index 80b46b3..10e9893 100644 --- a/bfd/doc/Makefile.in +++ b/bfd/doc/Makefile.in @@ -1,6 +1,6 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am +# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am -# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -130,7 +130,8 @@ DOCFILES = aoutx.texi archive.texi archures.texi \ bfdt.texi cache.texi coffcode.texi \ core.texi elf.texi elfcode.texi format.texi libbfd.texi \ opncls.texi reloc.texi section.texi \ - syms.texi targets.texi init.texi hash.texi linker.texi + syms.texi targets.texi init.texi hash.texi linker.texi \ + mmo.texi PROTOS = archive.p archures.p bfd.p \ @@ -153,7 +154,8 @@ SRCDOC = $(srcdir)/../aoutx.h $(srcdir)/../archive.c \ $(srcdir)/../libbfd.c $(srcdir)/../opncls.c \ $(srcdir)/../reloc.c $(srcdir)/../section.c \ $(srcdir)/../syms.c $(srcdir)/../targets.c \ - $(srcdir)/../hash.c $(srcdir)/../linker.c + $(srcdir)/../hash.c $(srcdir)/../linker.c \ + $(srcdir)/../mmo.c SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c \ @@ -239,7 +241,7 @@ DIST_COMMON = ChangeLog Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = tar +TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: @@ -325,7 +327,7 @@ uninstall-info: else ii=; fi; \ list='$(INFO_DEPS)'; \ for file in $$list; do \ - test -z "$ii" \ + test -z "$$ii" \ || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ done @$(NORMAL_UNINSTALL) @@ -529,6 +531,12 @@ s-elfcode: $(MKDOC) $(srcdir)/../elfcode.h $(srcdir)/doc.str touch s-elfcode elfcode.texi: s-elfcode +s-mmo: $(MKDOC) $(srcdir)/../mmo.c $(srcdir)/doc.str + ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../mmo.c >mmo.tmp + $(srcdir)/../../move-if-change mmo.tmp mmo.texi + touch s-mmo +mmo.texi: s-mmo + s-format: $(MKDOC) $(srcdir)/../format.c $(srcdir)/doc.str ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../format.c >format.tmp $(srcdir)/../../move-if-change format.tmp format.texi diff --git a/bfd/doc/bfd.texinfo b/bfd/doc/bfd.texinfo index 0534f46..d429117 100644 --- a/bfd/doc/bfd.texinfo +++ b/bfd/doc/bfd.texinfo @@ -298,6 +298,7 @@ structures. * aout :: a.out backends * coff :: coff backends * elf :: elf backends +* mmo :: mmo backend @ignore * oasys :: oasys backends * ieee :: ieee backend @@ -313,11 +314,14 @@ All of BFD lives in one directory. @node coff, elf, aout, BFD back ends @include coffcode.texi -@node elf, , coff, BFD back ends +@node elf, mmo, coff, BFD back ends @include elf.texi @c Leave this out until the file has some actual contents... @c @include elfcode.texi +@node mmo, , elf, BFD back ends +@include mmo.texi + @node GNU Free Documentation License, Index, BFD back ends, Top @chapter GNU Free Documentation License @cindex GNU Free Documentation License diff --git a/bfd/doc/bfdint.texi b/bfd/doc/bfdint.texi index 0c4afbe..76fd832 100644 --- a/bfd/doc/bfdint.texi +++ b/bfd/doc/bfdint.texi @@ -335,6 +335,8 @@ VERSAdos. MS-DOS. @item bfd_target_evax_flavour openVMS. +@item bfd_target_mmo_flavour +Donald Knuth's MMIXware object format. @end table @item byteorder diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c new file mode 100644 index 0000000..0aa627f --- /dev/null +++ b/bfd/elf64-mmix.c @@ -0,0 +1,1739 @@ +/* MMIX-specific support for 64-bit ELF. + Copyright (C) 2001 Free Software Foundation, Inc. + Contributed by Hans-Peter Nilsson <hp@bitrange.com> + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* No specific ABI or "processor-specific supplement" defined. */ + +/* TODO: + - Linker relaxation. + - On-demand register allocation (from R_MMIX_BASE_PLUS_OFFSET). */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "elf-bfd.h" +#include "elf/mmix.h" +#include "opcode/mmix.h" + +#define MINUS_ONE (((bfd_vma) 0) - 1) + +/* Put these everywhere in new code. */ +#define FATAL_DEBUG \ + _bfd_abort (__FILE__, __LINE__, \ + "Internal: Non-debugged code (test-case missing)") + +#define BAD_CASE(x) \ + _bfd_abort (__FILE__, __LINE__, \ + "bad case for " #x) + +static boolean mmix_elf_link_output_symbol_hook + PARAMS ((bfd *, struct bfd_link_info *, const char *, + Elf_Internal_Sym *, asection *)); + +static bfd_reloc_status_type mmix_elf_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + +static reloc_howto_type *bfd_elf64_bfd_reloc_type_lookup + PARAMS ((bfd *, bfd_reloc_code_real_type)); + +static void mmix_info_to_howto_rela + PARAMS ((bfd *, arelent *, Elf64_Internal_Rela *)); + +static int mmix_elf_sort_relocs PARAMS ((const PTR, const PTR)); + +static boolean mmix_elf_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); + +static boolean mmix_elf_relocate_section + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); + +static asection * mmix_elf_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); + +static bfd_reloc_status_type mmix_final_link_relocate + PARAMS ((reloc_howto_type *, asection *, bfd_byte *, + bfd_vma, bfd_signed_vma, bfd_vma, const char *, asection *)); + +static bfd_reloc_status_type mmix_elf_perform_relocation + PARAMS ((asection *, reloc_howto_type *, PTR, bfd_vma, bfd_vma)); + +static boolean mmix_elf_section_from_bfd_section + PARAMS ((bfd *, Elf64_Internal_Shdr *, asection *, int *)); + +static boolean mmix_elf_add_symbol_hook + PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, + const char **, flagword *, asection **, bfd_vma *)); + +static boolean mmix_elf_is_local_label_name + PARAMS ((bfd *, const char *)); + +extern boolean mmix_elf_final_link PARAMS ((bfd *, struct bfd_link_info *)); + +extern void mmix_elf_symbol_processing PARAMS ((bfd *, asymbol *)); + +/* Watch out: this currently needs to have elements with the same index as + their R_MMIX_ number. */ +static reloc_howto_type elf_mmix_howto_table[] = + { + /* This reloc does nothing. */ + HOWTO (R_MMIX_NONE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_MMIX_NONE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* An 8 bit absolute relocation. */ + HOWTO (R_MMIX_8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_MMIX_8", /* name */ + false, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + false), /* pcrel_offset */ + + /* An 16 bit absolute relocation. */ + HOWTO (R_MMIX_16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_MMIX_16", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* An 24 bit absolute relocation. */ + HOWTO (R_MMIX_24, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_MMIX_24", /* name */ + false, /* partial_inplace */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 32 bit absolute relocation. */ + HOWTO (R_MMIX_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_MMIX_32", /* name */ + false, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 64 bit relocation. */ + HOWTO (R_MMIX_64, /* 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_MMIX_64", /* name */ + false, /* partial_inplace */ + MINUS_ONE, /* src_mask */ + MINUS_ONE, /* dst_mask */ + false), /* pcrel_offset */ + + /* An 8 bit PC-relative relocation. */ + HOWTO (R_MMIX_PC_8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_MMIX_PC_8", /* name */ + false, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + true), /* pcrel_offset */ + + /* An 16 bit PC-relative relocation. */ + HOWTO (R_MMIX_PC_16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_MMIX_PC_16", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* An 24 bit PC-relative relocation. */ + HOWTO (R_MMIX_PC_24, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_MMIX_PC_24", /* name */ + false, /* partial_inplace */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* A 32 bit absolute PC-relative relocation. */ + HOWTO (R_MMIX_PC_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_MMIX_PC_32", /* name */ + false, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 64 bit PC-relative relocation. */ + HOWTO (R_MMIX_PC_64, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_MMIX_PC_64", /* name */ + false, /* partial_inplace */ + MINUS_ONE, /* src_mask */ + MINUS_ONE, /* dst_mask */ + true), /* pcrel_offset */ + + /* GNU extension to record C++ vtable hierarchy. */ + HOWTO (R_MMIX_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_MMIX_GNU_VTINHERIT", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + true), /* pcrel_offset */ + + /* GNU extension to record C++ vtable member usage. */ + HOWTO (R_MMIX_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_elf_rel_vtable_reloc_fn, /* special_function */ + "R_MMIX_GNU_VTENTRY", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* The GETA relocation is supposed to get any address that could + possibly be reached by the GETA instruction. It can silently expand + to get a 64-bit operand, but will complain if any of the two least + significant bits are set. The howto members reflect a simple GETA. */ + HOWTO (R_MMIX_GETA, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_GETA", /* name */ + false, /* partial_inplace */ + 0x0100ffff, /* src_mask */ + 0x0100ffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_MMIX_GETA_1, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_GETA_1", /* name */ + false, /* partial_inplace */ + 0x0100ffff, /* src_mask */ + 0x0100ffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_MMIX_GETA_2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_GETA_2", /* name */ + false, /* partial_inplace */ + 0x0100ffff, /* src_mask */ + 0x0100ffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_MMIX_GETA_3, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_GETA_3", /* name */ + false, /* partial_inplace */ + 0x0100ffff, /* src_mask */ + 0x0100ffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* The conditional branches are supposed to reach any (code) address. + It can silently expand to a 64-bit operand, but will emit an error if + any of the two least significant bits are set. The howto members + reflect a simple branch. */ + HOWTO (R_MMIX_CBRANCH, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_CBRANCH", /* name */ + false, /* partial_inplace */ + 0x0100ffff, /* src_mask */ + 0x0100ffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_MMIX_CBRANCH_J, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_CBRANCH_J", /* name */ + false, /* partial_inplace */ + 0x0100ffff, /* src_mask */ + 0x0100ffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_MMIX_CBRANCH_1, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_CBRANCH_1", /* name */ + false, /* partial_inplace */ + 0x0100ffff, /* src_mask */ + 0x0100ffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_MMIX_CBRANCH_2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_CBRANCH_2", /* name */ + false, /* partial_inplace */ + 0x0100ffff, /* src_mask */ + 0x0100ffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_MMIX_CBRANCH_3, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_CBRANCH_3", /* name */ + false, /* partial_inplace */ + 0x0100ffff, /* src_mask */ + 0x0100ffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* The PUSHJ instruction can reach any (code) address, as long as it's + the beginning of a function (no usable restriction). It can silently + expand to a 64-bit operand, but will emit an error if any of the two + least significant bits are set. The howto members reflect a simple + PUSHJ. */ + HOWTO (R_MMIX_PUSHJ, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_PUSHJ", /* name */ + false, /* partial_inplace */ + 0x0100ffff, /* src_mask */ + 0x0100ffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_MMIX_PUSHJ_1, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_PUSHJ_1", /* name */ + false, /* partial_inplace */ + 0x0100ffff, /* src_mask */ + 0x0100ffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_MMIX_PUSHJ_2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_PUSHJ_2", /* name */ + false, /* partial_inplace */ + 0x0100ffff, /* src_mask */ + 0x0100ffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_MMIX_PUSHJ_3, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_PUSHJ_3", /* name */ + false, /* partial_inplace */ + 0x0100ffff, /* src_mask */ + 0x0100ffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* A JMP is supposed to reach any (code) address. By itself, it can + reach +-64M; the expansion can reach all 64 bits. Note that the 64M + limit is soon reached if you link the program in wildly different + memory segments. The howto members reflect a trivial JMP. */ + HOWTO (R_MMIX_JMP, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 27, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_JMP", /* name */ + false, /* partial_inplace */ + 0x1ffffff, /* src_mask */ + 0x1ffffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_MMIX_JMP_1, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 27, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_JMP_1", /* name */ + false, /* partial_inplace */ + 0x1ffffff, /* src_mask */ + 0x1ffffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_MMIX_JMP_2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 27, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_JMP_2", /* name */ + false, /* partial_inplace */ + 0x1ffffff, /* src_mask */ + 0x1ffffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_MMIX_JMP_3, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 27, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_JMP_3", /* name */ + false, /* partial_inplace */ + 0x1ffffff, /* src_mask */ + 0x1ffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* When we don't emit link-time-relaxable code from the assembler, or + when relaxation has done all it can do, these relocs are used. For + GETA/PUSHJ/branches. */ + HOWTO (R_MMIX_ADDR19, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_ADDR19", /* name */ + false, /* partial_inplace */ + 0x0100ffff, /* src_mask */ + 0x0100ffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* For JMP. */ + HOWTO (R_MMIX_ADDR27, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 27, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_ADDR27", /* name */ + false, /* partial_inplace */ + 0x1ffffff, /* src_mask */ + 0x1ffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* A general register or the value 0..255. If a value, then the + instruction (offset -3) needs adjusting. */ + HOWTO (R_MMIX_REG_OR_BYTE, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_REG_OR_BYTE", /* name */ + false, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A general register. */ + HOWTO (R_MMIX_REG, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_REG", /* name */ + false, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A register plus an index, corresponding to the relocation expression. + The sizes must correspond to the valid range of the expression, while + the bitmasks correspond to what we store in the image. */ + HOWTO (R_MMIX_BASE_PLUS_OFFSET, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_BASE_PLUS_OFFSET", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A "magic" relocation for a LOCAL expression, asserting that the + expression is less than the number of global registers. No actual + modification of the contents is done. Implementing this as a + relocation was less intrusive than e.g. putting such expressions in a + section to discard *after* relocation. */ + HOWTO (R_MMIX_LOCAL, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mmix_elf_reloc, /* special_function */ + "R_MMIX_LOCAL", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + }; + + +/* Map BFD reloc types to MMIX ELF reloc types. */ + +struct mmix_reloc_map + { + bfd_reloc_code_real_type bfd_reloc_val; + enum elf_mmix_reloc_type elf_reloc_val; + }; + + +static const struct mmix_reloc_map mmix_reloc_map[] = + { + {BFD_RELOC_NONE, R_MMIX_NONE}, + {BFD_RELOC_8, R_MMIX_8}, + {BFD_RELOC_16, R_MMIX_16}, + {BFD_RELOC_24, R_MMIX_24}, + {BFD_RELOC_32, R_MMIX_32}, + {BFD_RELOC_64, R_MMIX_64}, + {BFD_RELOC_8_PCREL, R_MMIX_PC_8}, + {BFD_RELOC_16_PCREL, R_MMIX_PC_16}, + {BFD_RELOC_24_PCREL, R_MMIX_PC_24}, + {BFD_RELOC_32_PCREL, R_MMIX_PC_32}, + {BFD_RELOC_64_PCREL, R_MMIX_PC_64}, + {BFD_RELOC_VTABLE_INHERIT, R_MMIX_GNU_VTINHERIT}, + {BFD_RELOC_VTABLE_ENTRY, R_MMIX_GNU_VTENTRY}, + {BFD_RELOC_MMIX_GETA, R_MMIX_GETA}, + {BFD_RELOC_MMIX_CBRANCH, R_MMIX_CBRANCH}, + {BFD_RELOC_MMIX_PUSHJ, R_MMIX_PUSHJ}, + {BFD_RELOC_MMIX_JMP, R_MMIX_JMP}, + {BFD_RELOC_MMIX_ADDR19, R_MMIX_ADDR19}, + {BFD_RELOC_MMIX_ADDR27, R_MMIX_ADDR27}, + {BFD_RELOC_MMIX_REG_OR_BYTE, R_MMIX_REG_OR_BYTE}, + {BFD_RELOC_MMIX_REG, R_MMIX_REG}, + {BFD_RELOC_MMIX_BASE_PLUS_OFFSET, R_MMIX_BASE_PLUS_OFFSET}, + {BFD_RELOC_MMIX_LOCAL, R_MMIX_LOCAL} + }; + +static reloc_howto_type * +bfd_elf64_bfd_reloc_type_lookup (abfd, code) + bfd *abfd ATTRIBUTE_UNUSED; + bfd_reloc_code_real_type code; +{ + unsigned int i; + + for (i = 0; + i < sizeof (mmix_reloc_map) / sizeof (mmix_reloc_map[0]); + i++) + { + if (mmix_reloc_map[i].bfd_reloc_val == code) + return &elf_mmix_howto_table[mmix_reloc_map[i].elf_reloc_val]; + } + + return NULL; +} + + +/* This function performs the actual bitfiddling and sanity check for a + final relocation. Each relocation gets its *worst*-case expansion + in size when it arrives here; any reduction in size should have been + caught in linker relaxation earlier. When we get here, the relocation + looks like the smallest instruction with SWYM:s (nop:s) appended to the + max size. We fill in those nop:s. + + R_MMIX_GETA: (FIXME: Relaxation should break this up in 1, 2, 3 tetra) + GETA $N,foo + -> + SETL $N,foo & 0xffff + INCML $N,(foo >> 16) & 0xffff + INCMH $N,(foo >> 32) & 0xffff + INCH $N,(foo >> 48) & 0xffff + + R_MMIX_CBRANCH: (FIXME: Relaxation should break this up, but + condbranches needing relaxation might be rare enough to not be + worthwhile.) + [P]Bcc $N,foo + -> + [~P]B~cc $N,.+20 + SETL $255,foo & ... + INCML ... + INCMH ... + INCH ... + GO $255,$255,0 + + R_MMIX_PUSHJ: (FIXME: Relaxation...) + PUSHJ $N,foo + -> + SETL $255,foo & ... + INCML ... + INCMH ... + INCH ... + PUSHGO $N,$255,0 + + R_MMIX_JMP: (FIXME: Relaxation...) + JMP foo + -> + SETL $255,foo & ... + INCML ... + INCMH ... + INCH ... + GO $255,$255,0 + + R_MMIX_ADDR19 and R_MMIX_ADDR27 are just filled in. */ + +static bfd_reloc_status_type +mmix_elf_perform_relocation (isec, howto, datap, addr, value) + asection *isec; + reloc_howto_type *howto; + PTR datap; + bfd_vma addr ATTRIBUTE_UNUSED; + bfd_vma value; +{ + bfd *abfd = isec->owner; + bfd_reloc_status_type flag = bfd_reloc_ok; + bfd_reloc_status_type r; + int offs = 0; + int reg = 255; + + /* The worst case bits are all similar SETL/INCML/INCMH/INCH sequences. + We handle the differences here and the common sequence later. */ + switch (howto->type) + { + case R_MMIX_GETA: + offs = 0; + reg = bfd_get_8 (abfd, (bfd_byte *) datap + 1); + + /* We change to an absolute value. */ + value += addr; + break; + + case R_MMIX_CBRANCH: + { + int in1 = bfd_get_16 (abfd, (bfd_byte *) datap) << 16; + + /* Invert the condition and prediction bit, and set the offset + to five instructions ahead. + + We *can* do better if we want to. If the branch is found to be + within limits, we could leave the branch as is; there'll just + be a bunch of NOP:s after it. But we shouldn't see this + sequence often enough that it's worth doing it. */ + + bfd_put_32 (abfd, + (((in1 ^ ((PRED_INV_BIT | COND_INV_BIT) << 24)) & ~0xffff) + | (24/4)), + (bfd_byte *) datap); + + /* Put a "GO $255,$255,0" after the common sequence. */ + bfd_put_32 (abfd, + ((GO_INSN_BYTE | IMM_OFFSET_BIT) << 24) | 0xffff00, + (bfd_byte *) datap + 20); + + /* Common sequence starts at offset 4. */ + offs = 4; + + /* We change to an absolute value. */ + value += addr; + } + break; + + case R_MMIX_PUSHJ: + { + int inreg = bfd_get_8 (abfd, (bfd_byte *) datap + 1); + + /* Put a "PUSHGO $N,$255,0" after the common sequence. */ + bfd_put_32 (abfd, + ((PUSHGO_INSN_BYTE | IMM_OFFSET_BIT) << 24) + | (inreg << 16) + | 0xff00, + (bfd_byte *) datap + 16); + + /* We change to an absolute value. */ + value += addr; + } + break; + + case R_MMIX_JMP: + /* This one is a little special. If we get here on a non-relaxing + link, and the destination is actually in range, we don't need to + execute the nops. + If so, we fall through to the bit-fiddling relocs. + + FIXME: bfd_check_overflow seems broken; the relocation is + rightshifted before testing, so supply a zero rightshift. */ + + if (! ((value & 3) == 0 + && (r = bfd_check_overflow (complain_overflow_signed, + howto->bitsize, + 0, + bfd_arch_bits_per_address (abfd), + value)) == bfd_reloc_ok)) + { + /* If the relocation doesn't fit in a JMP, we let the NOP:s be + modified below, and put a "GO $255,$255,0" after the + address-loading sequence. */ + bfd_put_32 (abfd, + ((GO_INSN_BYTE | IMM_OFFSET_BIT) << 24) + | 0xffff00, + (bfd_byte *) datap + 16); + + /* We change to an absolute value. */ + value += addr; + break; + } + /* FALLTHROUGH. */ + case R_MMIX_ADDR19: + case R_MMIX_ADDR27: + /* These must be in range, or else we emit an error. */ + if ((value & 3) == 0 + /* Note rightshift 0; see above. */ + && (r = bfd_check_overflow (complain_overflow_signed, + howto->bitsize, + 0, + bfd_arch_bits_per_address (abfd), + value)) == bfd_reloc_ok) + { + bfd_vma in1 + = bfd_get_32 (abfd, (bfd_byte *) datap); + bfd_vma highbit; + + if ((bfd_signed_vma) value < 0) + { + highbit = (1 << 24); + value += (1 << (howto->bitsize - 1)); + } + else + highbit = 0; + + value >>= 2; + + bfd_put_32 (abfd, + (in1 & ~howto->src_mask) + | highbit + | (value & howto->dst_mask), + (bfd_byte *) datap); + + return bfd_reloc_ok; + } + else + return bfd_reloc_overflow; + + case R_MMIX_REG_OR_BYTE: + case R_MMIX_REG: + if (value > 255) + return bfd_reloc_overflow; + bfd_put_8 (abfd, value, datap); + return bfd_reloc_ok; + + default: + BAD_CASE (howto->type); + } + + /* This code adds the common SETL/INCML/INCMH/INCH worst-case + sequence. */ + + /* Lowest two bits must be 0. We return bfd_reloc_overflow for + everything that looks strange. */ + if (value & 3) + flag = bfd_reloc_overflow; + + bfd_put_32 (abfd, + (SETL_INSN_BYTE << 24) | (value & 0xffff) | (reg << 16), + (bfd_byte *) datap + offs); + bfd_put_32 (abfd, + (INCML_INSN_BYTE << 24) | ((value >> 16) & 0xffff) | (reg << 16), + (bfd_byte *) datap + offs + 4); + bfd_put_32 (abfd, + (INCMH_INSN_BYTE << 24) | ((value >> 32) & 0xffff) | (reg << 16), + (bfd_byte *) datap + offs + 8); + bfd_put_32 (abfd, + (INCH_INSN_BYTE << 24) | ((value >> 48) & 0xffff) | (reg << 16), + (bfd_byte *) datap + offs + 12); + + return flag; +} + +/* Set the howto pointer for an MMIX ELF reloc (type RELA). */ + +static void +mmix_info_to_howto_rela (abfd, cache_ptr, dst) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *cache_ptr; + Elf64_Internal_Rela *dst; +{ + unsigned int r_type; + + r_type = ELF64_R_TYPE (dst->r_info); + BFD_ASSERT (r_type < (unsigned int) R_MMIX_max); + cache_ptr->howto = &elf_mmix_howto_table[r_type]; +} + +/* Any MMIX-specific relocation gets here at assembly time or when linking + to other formats (such as mmo); this is the relocation function from + the reloc_table. We don't get here for final pure ELF linking. */ + +static bfd_reloc_status_type +mmix_elf_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd; + arelent *reloc_entry; + asymbol *symbol; + PTR data; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + bfd_vma relocation; + bfd_reloc_status_type r; + asection *reloc_target_output_section; + bfd_reloc_status_type flag = bfd_reloc_ok; + bfd_vma output_base = 0; + bfd_vma addr; + + r = bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message); + + /* If that was all that was needed (i.e. this isn't a final link, only + some segment adjustments), we're done. */ + if (r != bfd_reloc_continue) + return r; + + if (bfd_is_und_section (symbol->section) + && (symbol->flags & BSF_WEAK) == 0 + && output_bfd == (bfd *) NULL) + return bfd_reloc_undefined; + + /* Is the address of the relocation really within the section? */ + if (reloc_entry->address > input_section->_cooked_size) + return bfd_reloc_outofrange; + + /* Work out which section the relocation is targetted at and the + initial relocation command value. */ + + /* Get symbol value. (Common symbols are special.) */ + if (bfd_is_com_section (symbol->section)) + relocation = 0; + else + relocation = symbol->value; + + reloc_target_output_section = bfd_get_output_section (symbol); + + /* Here the variable relocation holds the final address of the symbol we + are relocating against, plus any addend. */ + if (output_bfd) + output_base = 0; + else + output_base = reloc_target_output_section->vma; + + relocation += output_base + symbol->section->output_offset; + + /* Get position of relocation. */ + addr = (reloc_entry->address + input_section->output_section->vma + + input_section->output_offset); + if (output_bfd != (bfd *) NULL) + { + /* Add in supplied addend. */ + relocation += reloc_entry->addend; + + /* This is a partial relocation, and we want to apply the + relocation to the reloc entry rather than the raw data. + Modify the reloc inplace to reflect what we now know. */ + reloc_entry->addend = relocation; + reloc_entry->address += input_section->output_offset; + return flag; + } + + return mmix_final_link_relocate (reloc_entry->howto, input_section, + data, reloc_entry->address, + reloc_entry->addend, relocation, + bfd_asymbol_name (symbol), + reloc_target_output_section); +} + +/* Relocate an MMIX ELF section. Modified from elf32-fr30.c; look to it + for guidance if you're thinking of copying this. */ + +static boolean +mmix_elf_relocate_section (output_bfd, info, input_bfd, input_section, + contents, relocs, local_syms, local_sections) + bfd *output_bfd ATTRIBUTE_UNUSED; + struct bfd_link_info *info; + bfd *input_bfd; + asection *input_section; + bfd_byte *contents; + Elf_Internal_Rela *relocs; + Elf_Internal_Sym *local_syms; + asection **local_sections; +{ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + Elf_Internal_Rela *rel; + Elf_Internal_Rela *relend; + + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (input_bfd); + relend = relocs + input_section->reloc_count; + + for (rel = relocs; rel < relend; rel ++) + { + reloc_howto_type *howto; + unsigned long r_symndx; + Elf_Internal_Sym *sym; + asection *sec; + struct elf_link_hash_entry *h; + bfd_vma relocation; + bfd_reloc_status_type r; + const char *name = NULL; + int r_type; + boolean undefined_signalled = false; + + r_type = ELF64_R_TYPE (rel->r_info); + + if (r_type == R_MMIX_GNU_VTINHERIT + || r_type == R_MMIX_GNU_VTENTRY) + continue; + + r_symndx = ELF64_R_SYM (rel->r_info); + + if (info->relocateable) + { + /* This is a relocateable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + + if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + sec = local_sections [r_symndx]; + rel->r_addend += sec->output_offset + sym->st_value; + } + } + + continue; + } + + /* This is a final link. */ + howto = elf_mmix_howto_table + ELF64_R_TYPE (rel->r_info); + h = NULL; + sym = NULL; + sec = NULL; + + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + sec = local_sections [r_symndx]; + relocation = (sec->output_section->vma + + sec->output_offset + + sym->st_value); + + name = bfd_elf_string_from_elf_section + (input_bfd, symtab_hdr->sh_link, sym->st_name); + name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name; + } + else + { + h = sym_hashes [r_symndx - symtab_hdr->sh_info]; + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + name = h->root.root.string; + + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + sec = h->root.u.def.section; + relocation = (h->root.u.def.value + + sec->output_section->vma + + sec->output_offset); + } + else if (h->root.type == bfd_link_hash_undefweak) + relocation = 0; + else if (info->shared + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) + relocation = 0; + else + { + /* The test on undefined_signalled is redundant at the + moment, but kept for symmetry. */ + if (! undefined_signalled + && ! ((*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, + input_section, rel->r_offset, true))) + return false; + undefined_signalled = true; + relocation = 0; + } + } + + r = mmix_final_link_relocate (howto, input_section, + contents, rel->r_offset, + rel->r_addend, relocation, name, sec); + + if (r != bfd_reloc_ok) + { + boolean check_ok = true; + const char * msg = (const char *) NULL; + + switch (r) + { + case bfd_reloc_overflow: + check_ok = info->callbacks->reloc_overflow + (info, name, howto->name, (bfd_vma) 0, + input_bfd, input_section, rel->r_offset); + break; + + case bfd_reloc_undefined: + /* We may have sent this message above. */ + if (! undefined_signalled) + check_ok = info->callbacks->undefined_symbol + (info, name, input_bfd, input_section, rel->r_offset, + true); + undefined_signalled = true; + break; + + case bfd_reloc_outofrange: + msg = _("internal error: out of range error"); + break; + + case bfd_reloc_notsupported: + msg = _("internal error: unsupported relocation error"); + break; + + case bfd_reloc_dangerous: + msg = _("internal error: dangerous relocation"); + break; + + default: + msg = _("internal error: unknown error"); + break; + } + + if (msg) + check_ok = info->callbacks->warning + (info, msg, name, input_bfd, input_section, rel->r_offset); + + if (! check_ok) + return false; + } + } + + return true; +} + +/* Perform a single relocation. By default we use the standard BFD + routines. A few relocs we have to do ourselves. */ + +static bfd_reloc_status_type +mmix_final_link_relocate (howto, input_section, contents, + r_offset, r_addend, relocation, symname, symsec) + reloc_howto_type *howto; + asection *input_section; + bfd_byte *contents; + bfd_vma r_offset; + bfd_signed_vma r_addend; + bfd_vma relocation; + const char *symname; + asection *symsec; +{ + bfd_reloc_status_type r = bfd_reloc_ok; + bfd_vma addr + = (input_section->output_section->vma + + input_section->output_offset + + r_offset); + bfd_signed_vma srel + = (bfd_signed_vma) relocation + r_addend; + + switch (howto->type) + { + /* All these are PC-relative. */ + case R_MMIX_PUSHJ: + case R_MMIX_CBRANCH: + case R_MMIX_ADDR19: + case R_MMIX_GETA: + case R_MMIX_ADDR27: + case R_MMIX_JMP: + contents += r_offset; + + srel -= (input_section->output_section->vma + + input_section->output_offset + + r_offset); + + r = mmix_elf_perform_relocation (input_section, howto, contents, + addr, srel); + break; + + case R_MMIX_REG_OR_BYTE: + case R_MMIX_REG: + /* For now, we handle these alike. They must refer to an register + symbol, which is either relative to the register section and in + the range 0..255, or is in the register contents section with vma + regno * 8. */ + + /* FIXME: A better way to check for reg contents section? + FIXME: Postpone section->scaling to mmix_elf_perform_relocation? */ + if (symsec == NULL) + return bfd_reloc_undefined; + + if (strcmp (bfd_get_section_name (symsec->owner, symsec), + MMIX_REG_CONTENTS_SECTION_NAME) == 0) + { + if ((srel & 7) != 0 || srel < 32*8 || srel > 255*8) + { + /* The bfd_reloc_outofrange return value, though intuitively + a better value, will not get us an error. */ + return bfd_reloc_overflow; + } + srel /= 8; + } + else if (strcmp (bfd_get_section_name (symsec->owner, symsec), + MMIX_REG_SECTION_NAME) == 0) + { + if (srel < 0 || srel > 255) + /* The bfd_reloc_outofrange return value, though intuitively a + better value, will not get us an error. */ + return bfd_reloc_overflow; + } + else + { + (*_bfd_error_handler) + (_("%s: register relocation against non-register symbol: %s in %s"), + bfd_get_filename (input_section->owner), + symname == NULL || *symname == 0 ? _("(unknown)") : symname, + bfd_get_section_name (symsec->owner, symsec)); + + /* The bfd_reloc_outofrange return value, though intuitively a + better value, will not get us an error. */ + return bfd_reloc_overflow; + } + contents += r_offset; + r = mmix_elf_perform_relocation (input_section, howto, contents, + addr, srel); + break; + + case R_MMIX_LOCAL: + /* This isn't a real relocation, it's just an assertion that the + final relocation value corresponds to a local register. We + ignore the actual relocation; nothing is changed. */ + { + asection *regsec + = bfd_get_section_by_name (input_section->output_section->owner, + MMIX_REG_CONTENTS_SECTION_NAME); + bfd_vma first_global; + + /* Check that this is an absolute value, or a reference to the + register contents section or the register (symbol) section. + Absolute numbers can get here as undefined section. Undefined + symbols are signalled elsewhere, so there's no conflict in us + accidentally handling it. */ + if (!bfd_is_abs_section (symsec) + && !bfd_is_und_section (symsec) + && strcmp (bfd_get_section_name (symsec->owner, symsec), + MMIX_REG_CONTENTS_SECTION_NAME) != 0 + && strcmp (bfd_get_section_name (symsec->owner, symsec), + MMIX_REG_SECTION_NAME) != 0) + { + (*_bfd_error_handler) + (_("%s: directive LOCAL valid only with a register or absolute value"), + bfd_get_filename (input_section->owner)); + + return bfd_reloc_overflow; + } + + /* If we don't have a register contents section, then $255 is the + first global register. */ + if (regsec == NULL) + first_global = 255; + else + { + first_global = bfd_get_section_vma (abfd, regsec) / 8; + if (strcmp (bfd_get_section_name (symsec->owner, symsec), + MMIX_REG_CONTENTS_SECTION_NAME) == 0) + { + if ((srel & 7) != 0 || srel < 32*8 || srel > 255*8) + /* The bfd_reloc_outofrange return value, though + intuitively a better value, will not get us an error. */ + return bfd_reloc_overflow; + srel /= 8; + } + } + + if ((bfd_vma) srel >= first_global) + { + /* FIXME: Better error message. */ + (*_bfd_error_handler) + (_("%s: LOCAL directive: Register $%ld is not a local register. First global register is $%ld."), + bfd_get_filename (input_section->owner), (long) srel, (long) first_global); + + return bfd_reloc_overflow; + } + } + r = bfd_reloc_ok; + break; + + default: + r = _bfd_final_link_relocate (howto, input_section->owner, input_section, + contents, r_offset, + relocation, r_addend); + } + + return r; +} + +/* Return the section that should be marked against GC for a given + relocation. */ + +static asection * +mmix_elf_gc_mark_hook (abfd, info, rel, h, sym) + bfd *abfd; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + Elf_Internal_Rela *rel; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; +{ + if (h != NULL) + { + switch (ELF64_R_TYPE (rel->r_info)) + { + case R_MMIX_GNU_VTINHERIT: + case R_MMIX_GNU_VTENTRY: + break; + + default: + switch (h->root.type) + { + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + return h->root.u.def.section; + + case bfd_link_hash_common: + return h->root.u.c.p->section; + + default: + break; + } + } + } + else + { + if (!(elf_bad_symtab (abfd) + && ELF_ST_BIND (sym->st_info) != STB_LOCAL) + && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE) + && sym->st_shndx != SHN_COMMON)) + { + return bfd_section_from_elf_index (abfd, sym->st_shndx); + } + } + + return NULL; +} + +/* Sort register relocs to come before expanding relocs. */ + +static int +mmix_elf_sort_relocs (p1, p2) + const PTR p1; + const PTR p2; +{ + const Elf_Internal_Rela *r1 = (const Elf_Internal_Rela *) p1; + const Elf_Internal_Rela *r2 = (const Elf_Internal_Rela *) p2; + int r1_is_reg, r2_is_reg; + + /* Sort primarily on r_offset & ~3, so relocs are done to consecutive + insns. */ + if ((r1->r_offset & ~(bfd_vma) 3) > (r2->r_offset & ~(bfd_vma) 3)) + return 1; + else if ((r1->r_offset & ~(bfd_vma) 3) < (r2->r_offset & ~(bfd_vma) 3)) + return -1; + + r1_is_reg + = (ELF64_R_TYPE (r1->r_info) == R_MMIX_REG_OR_BYTE + || ELF64_R_TYPE (r1->r_info) == R_MMIX_REG); + r2_is_reg + = (ELF64_R_TYPE (r2->r_info) == R_MMIX_REG_OR_BYTE + || ELF64_R_TYPE (r2->r_info) == R_MMIX_REG); + if (r1_is_reg != r2_is_reg) + return r2_is_reg - r1_is_reg; + + /* Neither or both are register relocs. Then sort on full offset. */ + if (r1->r_offset > r2->r_offset) + return 1; + else if (r1->r_offset < r2->r_offset) + return -1; + return 0; +} + +/* Look through the relocs for a section during the first phase. */ + +static boolean +mmix_elf_check_relocs (abfd, info, sec, relocs) + bfd *abfd; + struct bfd_link_info *info; + asection *sec; + const Elf_Internal_Rela *relocs; +{ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes, **sym_hashes_end; + const Elf_Internal_Rela *rel; + const Elf_Internal_Rela *rel_end; + + if (info->relocateable) + return true; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf64_External_Sym); + if (!elf_bad_symtab (abfd)) + sym_hashes_end -= symtab_hdr->sh_info; + + /* First we sort the relocs so that any register relocs come before + expansion-relocs to the same insn. FIXME: Not done for mmo. */ + qsort ((PTR) relocs, sec->reloc_count, sizeof (Elf_Internal_Rela), + mmix_elf_sort_relocs); + + rel_end = relocs + sec->reloc_count; + for (rel = relocs; rel < rel_end; rel++) + { + struct elf_link_hash_entry *h; + unsigned long r_symndx; + + r_symndx = ELF64_R_SYM (rel->r_info); + if (r_symndx < symtab_hdr->sh_info) + h = NULL; + else + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + + switch (ELF64_R_TYPE (rel->r_info)) + { + /* This relocation describes the C++ object vtable hierarchy. + Reconstruct it for later use during GC. */ + case R_MMIX_GNU_VTINHERIT: + if (!_bfd_elf64_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) + return false; + break; + + /* This relocation describes which C++ vtable entries are actually + used. Record for later use during GC. */ + case R_MMIX_GNU_VTENTRY: + if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend)) + return false; + break; + } + } + + return true; +} + +/* Change symbols relative to the reg contents section to instead be to + the register section, and scale them down to correspond to the register + number. */ + +static boolean +mmix_elf_link_output_symbol_hook (abfd, info, name, sym, input_sec) + bfd *abfd ATTRIBUTE_UNUSED; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + const char *name ATTRIBUTE_UNUSED; + Elf_Internal_Sym *sym; + asection *input_sec; +{ + if (input_sec != NULL + && input_sec->name != NULL + && ELF_ST_TYPE (sym->st_info) != STT_SECTION + && strcmp (input_sec->name, MMIX_REG_CONTENTS_SECTION_NAME) == 0) + { + sym->st_value /= 8; + sym->st_shndx = SHN_REGISTER; + } + + return true; +} + +/* We fake a register section that holds values that are register numbers. + Having a SHN_REGISTER and register section translates better to other + formats (e.g. mmo) than for example a STT_REGISTER attribute. + This section faking is based on a construct in elf32-mips.c. */ +static asection mmix_elf_reg_section; +static asymbol mmix_elf_reg_section_symbol; +static asymbol *mmix_elf_reg_section_symbol_ptr; + +/* Handle the special MIPS section numbers that a symbol may use. + This is used for both the 32-bit and the 64-bit ABI. */ + +void +mmix_elf_symbol_processing (abfd, asym) + bfd *abfd ATTRIBUTE_UNUSED; + asymbol *asym; +{ + elf_symbol_type *elfsym; + + elfsym = (elf_symbol_type *) asym; + switch (elfsym->internal_elf_sym.st_shndx) + { + case SHN_REGISTER: + if (mmix_elf_reg_section.name == NULL) + { + /* Initialize the register section. */ + mmix_elf_reg_section.name = MMIX_REG_SECTION_NAME; + mmix_elf_reg_section.flags = SEC_NO_FLAGS; + mmix_elf_reg_section.output_section = &mmix_elf_reg_section; + mmix_elf_reg_section.symbol = &mmix_elf_reg_section_symbol; + mmix_elf_reg_section.symbol_ptr_ptr = &mmix_elf_reg_section_symbol_ptr; + mmix_elf_reg_section_symbol.name = MMIX_REG_SECTION_NAME; + mmix_elf_reg_section_symbol.flags = BSF_SECTION_SYM; + mmix_elf_reg_section_symbol.section = &mmix_elf_reg_section; + mmix_elf_reg_section_symbol_ptr = &mmix_elf_reg_section_symbol; + } + asym->section = &mmix_elf_reg_section; + break; + + default: + break; + } +} + +/* Given a BFD section, try to locate the corresponding ELF section + index. */ + +static boolean +mmix_elf_section_from_bfd_section (abfd, hdr, sec, retval) + bfd * abfd ATTRIBUTE_UNUSED; + Elf64_Internal_Shdr * hdr ATTRIBUTE_UNUSED; + asection * sec; + int * retval; +{ + if (strcmp (bfd_get_section_name (abfd, sec), MMIX_REG_SECTION_NAME) == 0) + *retval = SHN_REGISTER; + else + return false; + + return true; +} + +/* Hook called by the linker routine which adds symbols from an object + file. We must handle the special SHN_REGISTER section number here. + + We also check that we only have *one* each of the section-start + symbols, since otherwise having two with the same value would cause + them to be "merged", but with the contents serialized. */ + +boolean +mmix_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) + bfd *abfd; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + const Elf_Internal_Sym *sym; + const char **namep ATTRIBUTE_UNUSED; + flagword *flagsp ATTRIBUTE_UNUSED; + asection **secp; + bfd_vma *valp ATTRIBUTE_UNUSED; +{ + if (sym->st_shndx == SHN_REGISTER) + *secp = bfd_make_section_old_way (abfd, MMIX_REG_SECTION_NAME); + else if ((*namep)[0] == '_' && (*namep)[1] == '_' && (*namep)[2] == '.' + && strncmp (*namep, MMIX_LOC_SECTION_START_SYMBOL_PREFIX, + strlen (MMIX_LOC_SECTION_START_SYMBOL_PREFIX)) == 0) + { + /* See if we have another one. */ + struct elf_link_hash_entry *h + = (struct elf_link_hash_entry *) bfd_link_hash_lookup (info->hash, + *namep, + false, + false, false); + + if (h != NULL && h->root.type != bfd_link_hash_undefined) + { + /* How do we get the asymbol (or really: the filename) from h? + h->root.u.def.section->owner is NULL. */ + ((*_bfd_error_handler) + (_("%s: Error: multiple definition of `%s'; start of %s is set in a earlier linked file\n"), + bfd_get_filename (abfd), *namep, + *namep + strlen (MMIX_LOC_SECTION_START_SYMBOL_PREFIX))); + bfd_set_error (bfd_error_bad_value); + return false; + } + } + + return true; +} + +/* We consider symbols matching "L.*:[0-9]+" to be local symbols. */ + +boolean +mmix_elf_is_local_label_name (abfd, name) + bfd *abfd; + const char *name; +{ + const char *colpos; + int digits; + + /* Also include the default local-label definition. */ + if (_bfd_elf_is_local_label_name (abfd, name)) + return true; + + if (*name != 'L') + return false; + + /* If there's no ":", or more than one, it's not a local symbol. */ + colpos = strchr (name, ':'); + if (colpos == NULL || strchr (colpos + 1, ':') != NULL) + return false; + + /* Check that there are remaining characters and that they are digits. */ + if (colpos[1] == 0) + return false; + + digits = strspn (colpos + 1, "0123456789"); + return digits != 0 && colpos[1 + digits] == 0; +} + +/* We get rid of the register section here. */ + +boolean +mmix_elf_final_link (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + /* We never output a register section, though we create one for + temporary measures. Check that nobody entered contents into it. */ + asection *reg_section; + asection **secpp; + + reg_section = bfd_get_section_by_name (abfd, MMIX_REG_SECTION_NAME); + + if (reg_section != NULL) + { + /* FIXME: Pass error state gracefully. */ + if (bfd_get_section_flags (abfd, reg_section) & SEC_HAS_CONTENTS) + _bfd_abort (__FILE__, __LINE__, _("Register section has contents\n")); + + /* FIXME: This does not seem like the proper way to kill a section, + but it's the way it's done elsewhere, like elf64-alpha.c. */ + /* Really remove the section. */ + for (secpp = &abfd->sections; + *secpp != reg_section; + secpp = &(*secpp)->next) + ; + *secpp = (*secpp)->next; + --abfd->section_count; + } + + if (! bfd_elf64_bfd_final_link (abfd, info)) + return false; + + return true; +} + +#define ELF_ARCH bfd_arch_mmix +#define ELF_MACHINE_CODE EM_MMIX + +/* According to mmix-doc page 36 (paragraph 45), this should be (1LL << 48LL). + However, that's too much for something somewhere in the linker part of + BFD; perhaps the start-address has to be a non-zero multiple of this + number, or larger than this number. The symptom is that the linker + complains: "warning: allocated section `.text' not in segment". We + settle for 64k; the page-size used in examples is 8k. + #define ELF_MAXPAGESIZE 0x10000 + + Unfortunately, this causes excessive padding in the supposedly small + for-education programs that are the expected usage (where people would + inspect output). We stick to 256 bytes just to have *some* default + alignment. */ +#define ELF_MAXPAGESIZE 0x100 + +#define TARGET_BIG_SYM bfd_elf64_mmix_vec +#define TARGET_BIG_NAME "elf64-mmix" + +#define elf_info_to_howto_rel NULL +#define elf_info_to_howto mmix_info_to_howto_rela +#define elf_backend_relocate_section mmix_elf_relocate_section +#define elf_backend_gc_mark_hook mmix_elf_gc_mark_hook +#define elf_backend_link_output_symbol_hook \ + mmix_elf_link_output_symbol_hook +#define elf_backend_add_symbol_hook mmix_elf_add_symbol_hook + +#define elf_backend_check_relocs mmix_elf_check_relocs +#define elf_backend_symbol_processing mmix_elf_symbol_processing + +#define bfd_elf64_bfd_is_local_label_name \ + mmix_elf_is_local_label_name + +#define elf_backend_may_use_rel_p 0 +#define elf_backend_may_use_rela_p 1 +#define elf_backend_default_use_rela_p 1 + +#define elf_backend_can_gc_sections 1 +#define elf_backend_section_from_bfd_section \ + mmix_elf_section_from_bfd_section + +#define bfd_elf64_bfd_final_link mmix_elf_final_link + +#include "elf64-target.h" diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h index 758deb4..f07dc9f 100644 --- a/bfd/elfxx-target.h +++ b/bfd/elfxx-target.h @@ -66,6 +66,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef elf_backend_got_symbol_offset #define elf_backend_got_symbol_offset (bfd_vma) 0 #endif +#ifndef elf_backend_can_refcount +#define elf_backend_can_refcount 0 +#endif #ifndef elf_backend_want_got_plt #define elf_backend_want_got_plt 0 #endif diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 8c9a29e..408cc10 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -954,6 +954,29 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_MCORE_PCREL_32", "BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2", "BFD_RELOC_MCORE_RVA", + "BFD_RELOC_MMIX_GETA", + "BFD_RELOC_MMIX_GETA_1", + "BFD_RELOC_MMIX_GETA_2", + "BFD_RELOC_MMIX_GETA_3", + "BFD_RELOC_MMIX_CBRANCH", + "BFD_RELOC_MMIX_CBRANCH_J", + "BFD_RELOC_MMIX_CBRANCH_1", + "BFD_RELOC_MMIX_CBRANCH_2", + "BFD_RELOC_MMIX_CBRANCH_3", + "BFD_RELOC_MMIX_PUSHJ", + "BFD_RELOC_MMIX_PUSHJ_1", + "BFD_RELOC_MMIX_PUSHJ_2", + "BFD_RELOC_MMIX_PUSHJ_3", + "BFD_RELOC_MMIX_JMP", + "BFD_RELOC_MMIX_JMP_1", + "BFD_RELOC_MMIX_JMP_2", + "BFD_RELOC_MMIX_JMP_3", + "BFD_RELOC_MMIX_ADDR19", + "BFD_RELOC_MMIX_ADDR27", + "BFD_RELOC_MMIX_REG_OR_BYTE", + "BFD_RELOC_MMIX_REG", + "BFD_RELOC_MMIX_BASE_PLUS_OFFSET", + "BFD_RELOC_MMIX_LOCAL", "BFD_RELOC_AVR_7_PCREL", "BFD_RELOC_AVR_13_PCREL", "BFD_RELOC_AVR_16_PM", diff --git a/bfd/mmo.c b/bfd/mmo.c new file mode 100644 index 0000000..8bb5095 --- /dev/null +++ b/bfd/mmo.c @@ -0,0 +1,3274 @@ +/* BFD back-end for mmo objects (MMIX-specific object-format). + Copyright 2001 + Free Software Foundation, Inc. + Written by Hans-Peter Nilsson (hp@bitrange.com). + Infrastructure and other bits originally copied from srec.c and + binary.c. + +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. */ + +/* +SECTION + mmo backend + + The mmo object format is used exclusively together with Professor + Donald E.@: Knuth's educational 64-bit processor MMIX. The simulator + @emph{mmix} which is available at + @emph{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz} + understands this format. That package also includes a combined + assembler and linker called @emph{mmixal}. The mmo format has + no advantages feature-wise compared to e.g. ELF. It is a simple + non-relocatable object format with no support for archives or + debugging information, except for symbol value information and + line numbers (which is not yet implemented in BFD). See + @emph{http://www-cs-faculty.stanford.edu/~knuth/mmix.html} for more + information about MMIX. The ELF format is used for intermediate + object files in the BFD implementation. + +@c We want to xref the symbol table node. A feature in "chew" +@c requires that "commands" do not contain spaces in the +@c arguments. Hence the hyphen in "Symbol-table". +@menu +@* File layout:: +@* Symbol-table:: +@* mmo section mapping:: +@end menu + +INODE +File layout, Symbol-table, mmo, mmo +SUBSECTION + File layout + + The mmo file contents is not partitioned into named sections as + with e.g.@: ELF. Memory areas is formed by specifying the + location of the data that follows. Only the memory area + @samp{0x0000@dots{}00} to @samp{0x01ff@dots{}ff} is executable, so + it is used for code (and constants) and the area + @samp{0x2000@dots{}00} to @samp{0x20ff@dots{}ff} is used for + writable data. @xref{mmo section mapping}. + + Contents is entered as 32-bit words, xor:ed over previous + contents, always zero-initialized. A word that starts with the + byte @samp{0x98} forms a command called a @samp{lopcode}, where + the next byte distinguished between the thirteen lopcodes. The + two remaining bytes, called the @samp{Y} and @samp{Z} fields, or + the @samp{YZ} field (a 16-bit big-endian number), are used for + various purposes different for each lopcode. As documented in + @emph{http://www-cs-faculty.stanford.edu/~knuth/mmixal-intro.ps.gz}, + the lopcodes are: + + There is provision for specifying ``special data'' of 65536 + different types. We use type 80 (decimal), arbitrarily chosen the + same as the ELF <<e_machine>> number for MMIX, filling it with + section information normally found in ELF objects. @xref{mmo + section mapping}. + + @table @code + @item lop_quote + 0x98000001. The next word is contents, regardless of whether it + starts with 0x98 or not. + + @item lop_loc + 0x9801YYZZ, where @samp{Z} is 1 or 2. This is a location + directive, setting the location for the next data to the next + 32-bit word (for @math{Z = 1}) or 64-bit word (for @math{Z = 2}), + plus @math{Y * 2^56}. Normally @samp{Y} is 0 for the text segment + and 2 for the data segment. + + @item lop_skip + 0x9802YYZZ. Increase the current location by @samp{YZ} bytes. + + @item lop_fixo + 0x9803YYZZ, where @samp{Z} is 1 or 2. Store the current location + as 64 bits into the location pointed to by the next 32-bit + (@math{Z = 1}) or 64-bit (@math{Z = 2}) word, plus @math{Y * + 2^56}. + + @item lop_fixr + 0x9804YYZZ. @samp{YZ} is stored into the current location plus + @math{2 - 4 * YZ}. + + @item lop_fixrx + 0x980500ZZ. @samp{Z} is 16 or 24. A value @samp{L} derived from + the following 32-bit word are used in a manner similar to + @samp{YZ} in lop_fixr: it is xor:ed into the current location + minus @math{4 * L}. The first byte of the word is 0 or 1. If it + is 1, then @math{L = (@var{lowest 24 bits of word}) - 2^Z}, if 0, + then @math{L = (@var{lowest 24 bits of word})}. + + @item lop_file + 0x9806YYZZ. @samp{Y} is the file number, @samp{Z} is count of + 32-bit words. Set the file number to @samp{Y} and the line + counter to 0. The next @math{Z * 4} bytes contain the file name, + padded with zeros if the count is not a multiple of four. The + same @samp{Y} may occur multiple times, but @samp{Z} must be 0 for + all but the first occurrence. + + @item lop_line + 0x9807YYZZ. @samp{YZ} is the line number. Together with + lop_file, it forms the source location for the next 32-bit word. + Note that for each non-lopcode 32-bit word, line numbers are + assumed incremented by one. + + @item lop_spec + 0x9808YYZZ. @samp{YZ} is the type number. Data until the next + lopcode other than lop_quote forms special data of type @samp{YZ}. + @xref{mmo section mapping}. + + Other types than 80, (or type 80 with a content that does not + parse) is stored in sections named <<.MMIX.spec_data.@var{n}>> + where @var{n} is the @samp{YZ}-type. The flags for such a + sections say not to allocate or load the data. The vma is 0. + Contents of multiple occurrences of special data @var{n} is + concatenated to the data of the previous lop_spec @var{n}s. The + location in data or code at which the lop_spec occurred is lost. + + @item lop_pre + 0x980901ZZ. The first lopcode in a file. The @samp{Z} field forms the + length of header information in 32-bit words, where the first word + tells the time in seconds since @samp{00:00:00 GMT Jan 1 1970}. + + @item lop_post + 0x980a00ZZ. @math{Z > 32}. This lopcode follows after all + content-generating lopcodes in a program. The @samp{Z} field + denotes the value of @samp{rG} at the beginning of the program. + The following @math{256 - Z} big-endian 64-bit words are loaded + into global registers @samp{$G} @dots{} @samp{$255}. + + @item lop_stab + 0x980b0000. The next-to-last lopcode in a program. Must follow + immediately after the lop_post lopcode and its data. After this + lopcode follows all symbols in a compressed format + (@pxref{Symbol-table}). + + @item lop_end + 0x980cYYZZ. The last lopcode in a program. It must follow the + lop_stab lopcode and its data. The @samp{YZ} field contains the + number of 32-bit words of symbol table information after the + preceding lop_stab lopcode. + @end table + + Note that the lopcode "fixups"; <<lop_fixr>>, <<lop_fixrx>> and + <<lop_fixo>> are not generated by BFD, but are handled. They are + generated by <<mmixal>>. + +EXAMPLE + This trivial one-label, one-instruction file: + +| :Main TRAP 1,2,3 + + can be represented this way in mmo: + +| 0x98090101 - lop_pre, one 32-bit word with timestamp. +| <timestamp> +| 0x98010002 - lop_loc, text segment, using a 64-bit address. +| Note that mmixal does not emit this for the file above. +| 0x00000000 - Address, high 32 bits. +| 0x00000000 - Address, low 32 bits. +| 0x98060002 - lop_file, 2 32-bit words for file-name. +| 0x74657374 - "test" +| 0x2e730000 - ".s\0\0" +| 0x98070001 - lop_line, line 1. +| 0x00010203 - TRAP 1,2,3 +| 0x980a00ff - lop_post, setting $255 to 0. +| 0x00000000 +| 0x00000000 +| 0x980b0000 - lop_stab for ":Main" = 0, serial 1. +| 0x203a4040 @xref{Symbol-table}. +| 0x10404020 +| 0x4d206120 +| 0x69016e00 +| 0x81000000 +| 0x980c0005 - lop_end; symbol table contained five 32-bit words. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "libiberty.h" +#include "elf/mmix.h" +#include "opcode/mmix.h" +#include <ctype.h> + +#define LOP 0x98 +#define LOP_QUOTE 0 +#define LOP_LOC 1 +#define LOP_SKIP 2 +#define LOP_FIXO 3 +#define LOP_FIXR 4 +#define LOP_FIXRX 5 +#define LOP_FILE 6 +#define LOP_LINE 7 +#define LOP_SPEC 8 +#define LOP_PRE 9 +#define LOP_POST 10 +#define LOP_STAB 11 +#define LOP_END 12 + +#define LOP_QUOTE_NEXT ((LOP << 24) | (LOP_QUOTE << 16) | 1) +#define SPEC_DATA_SECTION 80 +#define LOP_SPEC_SECTION \ + ((LOP << 24) | (LOP_SPEC << 16) | SPEC_DATA_SECTION) + +/* Must be a power of two. If you change this to be >= 64k, you need a + new test-case; the ld test b-loc64k.d touches chunk-size problem areas. */ +#define MMO_SEC_CONTENTS_CHUNK_SIZE (1 << 15) + +/* An arbitrary number for the maximum length section name size. */ +#define MAX_SECTION_NAME_SIZE (1024 * 1024) + +/* A quite arbitrary number for the maximum length section size. */ +#define MAX_ARTIFICIAL_SECTION_SIZE (1024 * 1024 * 1024) + +#define MMO3_WCHAR 0x80 +#define MMO3_LEFT 0x40 +#define MMO3_MIDDLE 0x20 +#define MMO3_RIGHT 0x10 +#define MMO3_TYPEBITS 0xf +#define MMO3_REGQUAL_BITS 0xf +#define MMO3_UNDEF 2 +#define MMO3_DATA 8 +#define MMO3_SYMBITS 0x2f + +/* Put these everywhere in new code. */ +#define FATAL_DEBUG \ + _bfd_abort (__FILE__, __LINE__, \ + "Internal: Non-debugged code (test-case missing)") + +#define BAD_CASE(x) \ + _bfd_abort (__FILE__, __LINE__, \ + "bad case for " #x) + +enum mmo_sym_type { mmo_reg_sym, mmo_undef_sym, mmo_data_sym, mmo_abs_sym}; + +/* When scanning the mmo file, a linked list of mmo_symbol + structures is built to represent the symbol table (if there is + one). */ + +struct mmo_symbol + { + struct mmo_symbol *next; + CONST char *name; + bfd_vma value; + enum mmo_sym_type sym_type; + unsigned int serno; + }; + +struct mmo_data_list_struct + { + struct mmo_data_list_struct *next; + bfd_vma where; + bfd_size_type size; + bfd_size_type allocated_size; + bfd_byte data[1]; + }; + +typedef struct mmo_data_list_struct mmo_data_list_type; + +struct mmo_symbol_trie + { + struct mmo_symbol_trie *left; + struct mmo_symbol_trie *right; + struct mmo_symbol_trie *middle; + + bfd_byte symchar; + + /* A zero name means there's nothing here. */ + struct mmo_symbol sym; + }; + +/* The mmo tdata information. */ + +struct mmo_data_struct + { + struct mmo_symbol *symbols; + struct mmo_symbol *symtail; + asymbol *csymbols; + + /* File representation of time (NULL) when this file was created. */ + bfd_byte created[4]; + + /* When we're reading bytes recursively, check this occasionally. + Also holds write errors. */ + boolean have_error; + + /* Max symbol length that may appear in the lop_stab table. Note that + this table might just hold a subset of symbols for not-really large + programs, as it can only be 65536 * 4 bytes large. */ + int max_symbol_length; + + /* Here's the symbol we build in lop_stab. */ + char *lop_stab_symbol; + + /* Index into lop_stab_symbol for the next character when parsing the + symbol information. */ + int symbol_position; + + /* When creating arbitrary sections, we need to count section numbers. */ + int sec_no; + + /* When writing or reading byte-wise, we need to count the bytes + within a 32-bit word. */ + int byte_no; + + /* We also need a buffer to hold the bytes we count reading or writing. */ + bfd_byte buf[4]; + }; + +typedef struct mmo_data_struct tdata_type; + +struct mmo_section_data_struct + { + mmo_data_list_type *head; + mmo_data_list_type *tail; + }; + +/* These structures are used in bfd_map_over_sections constructs. */ + +/* Used when writing out sections; all but the register contents section + which is stored in reg_section. */ +struct mmo_write_sec_info + { + asection *reg_section; + boolean retval; + }; + +/* Used when trying to find a section corresponding to addr. */ +struct mmo_find_sec_info + { + asection *sec; + bfd_vma addr; + }; + +static boolean mmo_bfd_copy_private_bfd_data PARAMS ((bfd *, bfd *)); +static void mmo_write_section_unless_reg_contents + PARAMS ((bfd *, asection *, PTR)); +static void mmo_find_sec_w_addr PARAMS ((bfd *, asection *, PTR)); +static void mmo_find_sec_w_addr_grow PARAMS ((bfd *, asection *, PTR)); +static asection *mmo_make_section PARAMS ((bfd *, CONST char *)); +static void mmo_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); +static void mmo_print_symbol + PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type)); +static void mmo_init PARAMS ((void)); +static boolean mmo_mkobject PARAMS ((bfd *)); +static boolean mmo_scan PARAMS ((bfd *)); +static asection *mmo_decide_section PARAMS ((bfd *, bfd_vma)); +static asection *mmo_get_generic_spec_data_section PARAMS ((bfd *, int)); +static asection *mmo_get_spec_section PARAMS ((bfd *, int)); +static INLINE bfd_byte *mmo_get_loc PARAMS ((asection *, bfd_vma, int)); +static void mmo_xore_64 PARAMS ((asection *, bfd_vma vma, bfd_vma value)); +static void mmo_xore_32 PARAMS ((asection *, bfd_vma vma, unsigned int)); +static void mmo_xore_16 PARAMS ((asection *, bfd_vma vma, unsigned int)); +static CONST bfd_target *mmo_object_p PARAMS ((bfd *)); +static void mmo_map_set_sizes PARAMS ((bfd *, asection *, PTR)); +static boolean mmo_get_symbols PARAMS ((bfd *)); +static boolean mmo_create_symbol PARAMS ((bfd *, CONST char *, bfd_vma, + enum mmo_sym_type, unsigned int)); +static boolean mmo_get_section_contents + PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); +static long mmo_get_symtab_upper_bound PARAMS ((bfd *)); +static long mmo_get_symtab PARAMS ((bfd *, asymbol **)); +static asymbol *mmo_make_empty_symbol PARAMS ((bfd *)); +static void mmo_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); +static void mmo_print_symbol PARAMS ((bfd *, PTR, asymbol *, + bfd_print_symbol_type)); +static boolean mmo_set_section_contents + PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); +static int mmo_sizeof_headers PARAMS ((bfd *, boolean)); +static long mmo_get_reloc_upper_bound PARAMS ((bfd *, asection *)); + +static boolean mmo_internal_write_header PARAMS ((bfd *)); +static boolean mmo_internal_write_post PARAMS ((bfd *, int, asection *)); +static boolean mmo_internal_add_3_sym + PARAMS ((bfd *, struct mmo_symbol_trie *, CONST struct mmo_symbol *)); +static unsigned int mmo_internal_3_length + PARAMS ((bfd *, struct mmo_symbol_trie *)); +static void mmo_internal_3_dump + PARAMS ((bfd *, struct mmo_symbol_trie *)); +static void mmo_beb128_out PARAMS ((bfd *, int, int)); +static boolean mmo_internal_write_section + PARAMS ((bfd *, asection *)); +static void mmo_write_tetra PARAMS ((bfd *, unsigned int)); +static void mmo_write_tetra_raw PARAMS ((bfd *, unsigned int)); +static void mmo_write_octa PARAMS ((bfd *, bfd_vma)); +static void mmo_write_octa_raw PARAMS ((bfd *, bfd_vma)); +static boolean mmo_write_chunk + PARAMS ((bfd *, CONST bfd_byte *, unsigned int)); +static boolean mmo_write_loc_chunk + PARAMS ((bfd *, bfd_vma, CONST bfd_byte *, unsigned int)); +static boolean mmo_write_chunk_list PARAMS ((bfd *, mmo_data_list_type *)); +static boolean mmo_write_loc_chunk_list + PARAMS ((bfd *, mmo_data_list_type *)); +static boolean mmo_write_symbols_and_terminator PARAMS ((bfd *)); +static flagword mmo_sec_flags_from_bfd_flags PARAMS ((flagword)); +static flagword bfd_sec_flags_from_mmo_flags PARAMS ((flagword)); +static bfd_byte mmo_get_byte PARAMS ((bfd *)); +static void mmo_write_byte PARAMS ((bfd *, bfd_byte)); +static boolean mmo_new_section_hook PARAMS ((bfd *, asection *)); +static int mmo_sort_mmo_symbols PARAMS ((CONST PTR, CONST PTR)); +static boolean mmo_write_object_contents PARAMS ((bfd *)); +static long mmo_canonicalize_reloc + PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); + +/* Global "const" variables initialized once. Must not depend on + particular input or caller; put such things into the bfd or elsewhere. + Look ma, no static per-invocation data! */ + +static unsigned +char valid_mmo_symbol_character_set[/* A-Z a-z (we assume consecutive + codes; sorry EBCDIC:ers!). */ + + 'Z' - 'A' + 1 + 'z' - 'a' + 1 + /* Digits. */ + + 10 + /* ':' and '_'. */ + + 1 + 1 + /* Codes higher than 126. */ + + 256 - 126 + /* Ending zero. */ + + 1]; + + +/* Get section SECNAME or create one if it doesn't exist. When creating + one, new memory for the name is allocated. */ + +static asection * +mmo_make_section (abfd, secname) + bfd *abfd; + CONST char *secname; +{ + asection *sec = bfd_get_section_by_name (abfd, secname); + + if (sec == NULL) + { + char *newsecname = strdup (secname); + + if (newsecname == NULL) + { + (*_bfd_error_handler) + (_("%s: No core to allocate section name %s\n"), + bfd_get_filename (abfd), secname); + bfd_set_error (bfd_error_system_call); + return NULL; + } + sec = bfd_make_section (abfd, newsecname); + } + + return sec; +} + +/* Nothing to do, but keep as a placeholder if we need it. + Note that state that might differ between bfd:s must not be initialized + here, nor must it be static. Add it to tdata information instead. */ + +static void +mmo_init () +{ + static boolean inited = false; + int i = 0; + int j = 0; + static const char letters[] + = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789:_"; + + if (inited == false) + { + inited = true; + } + + /* Fill in the set of valid symbol characters. */ + strcpy (valid_mmo_symbol_character_set, letters); + i = strlen (letters); + + for (j = 126; j < 256; j++) + valid_mmo_symbol_character_set[i++] = j; +} + +/* Check whether an existing file is an mmo file. */ + +static CONST bfd_target * +mmo_object_p (abfd) + bfd *abfd; +{ + struct stat statbuf; + bfd_byte b[4]; + + mmo_init (); + + if (bfd_stat (abfd, &statbuf) < 0 + || bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 + || bfd_bread (b, 4, abfd) != 4) + goto bad_final; + + /* All mmo files are a multiple of four bytes long. + Only recognize version one. */ + if ((statbuf.st_size % 4) != 0 + || b[0] != LOP || b[1] != LOP_PRE || b[2] != 1) + goto bad_format; + + /* Get the last 32-bit word. */ + if (bfd_seek (abfd, (file_ptr) statbuf.st_size - 4, SEEK_SET) != 0 + || bfd_bread (b, 4, abfd) != 4) + goto bad_final; + + /* Check if the file ends in a lop_end lopcode. */ + if (b[0] != LOP || b[1] != LOP_END || ! mmo_mkobject (abfd)) + goto bad_format; + + /* Compute an upper bound on the max symbol length. Not really + important as all of the symbol information can only be 256k. */ + abfd->tdata.mmo_data->max_symbol_length = (b[2] * 256 + b[3]) * 4; + abfd->tdata.mmo_data->lop_stab_symbol + = bfd_malloc (abfd->tdata.mmo_data->max_symbol_length + 1); + + if (abfd->tdata.mmo_data->lop_stab_symbol == NULL) + { + (*_bfd_error_handler) + (_("%s: No core to allocate a symbol %d bytes long\n"), + bfd_get_filename (abfd), abfd->tdata.mmo_data->max_symbol_length); + goto bad_final; + } + + /* Read in everything. */ + if (! mmo_scan (abfd)) + goto bad_format_free; + + if (abfd->symcount > 0) + abfd->flags |= HAS_SYMS; + + /* You'll have to tweak this if you want to use this format for other + arches (not recommended due to its small-size limitations). Look at + the ELF format for how to make it target-generic. */ + if (! bfd_default_set_arch_mach (abfd, bfd_arch_mmix, 0)) + goto bad_format_free; + + return abfd->xvec; + + bad_format_free: + free (abfd->tdata.mmo_data->lop_stab_symbol); + bad_format: + bfd_set_error (bfd_error_wrong_format); + bad_final: + return NULL; +} + +/* Set up the mmo tdata information. */ + +static boolean +mmo_mkobject (abfd) + bfd *abfd; +{ + mmo_init (); + + if (abfd->tdata.mmo_data == NULL) + { + time_t created; + + /* All fields are zero-initialized, so we don't have to explicitly + initialize most. */ + tdata_type *tdata = (tdata_type *) bfd_zmalloc (sizeof (tdata_type)); + if (tdata == NULL) + return false; + + created = time (NULL); + bfd_put_32 (abfd, created, tdata->created); + + abfd->tdata.mmo_data = tdata; + } + + return true; +} + +static boolean +mmo_bfd_copy_private_bfd_data (ibfd, obfd) + bfd *ibfd; + bfd *obfd; +{ + if (bfd_get_flavour (ibfd) != bfd_target_mmo_flavour + || bfd_get_flavour (obfd) != bfd_target_mmo_flavour) + return true; + + /* Copy the time the copied-from file was created. If people want the + time the file was last *modified*, they have that in the normal file + information. */ + memcpy (obfd->tdata.mmo_data->created, ibfd->tdata.mmo_data->created, + sizeof (obfd->tdata.mmo_data->created)); + return true; +} + +/* Helper functions for mmo_decide_section, used through + bfd_map_over_sections. */ + +static void +mmo_find_sec_w_addr (abfd, sec, p) + bfd *abfd ATTRIBUTE_UNUSED; + asection *sec; + PTR p; +{ + struct mmo_find_sec_info *infop = (struct mmo_find_sec_info *) p; + bfd_vma vma = bfd_get_section_vma (abfd, sec); + + /* Ignore sections that aren't loaded. */ + if ((bfd_get_section_flags (abfd, sec) & (SEC_LOAD | SEC_ALLOC)) + != (SEC_LOAD | SEC_ALLOC)) + return; + + if (infop->addr >= vma && infop->addr < vma + sec->_raw_size) + infop->sec = sec; +} + +static void +mmo_find_sec_w_addr_grow (abfd, sec, p) + bfd *abfd ATTRIBUTE_UNUSED; + asection *sec; + PTR p; +{ + struct mmo_find_sec_info *infop = (struct mmo_find_sec_info *) p; + bfd_vma vma = bfd_get_section_vma (abfd, sec); + + /* Ignore sections that aren't loaded. */ + if ((bfd_get_section_flags (abfd, sec) & (SEC_LOAD | SEC_ALLOC)) + != (SEC_LOAD | SEC_ALLOC)) + return; + + if (infop->addr >= vma && infop->addr < vma + MAX_ARTIFICIAL_SECTION_SIZE) + infop->sec = sec; +} + +/* Find a section that corresponds to a VMA. Automatically create .text + or .data and set current section to it, depending on what vma. If we + can't deduce a section, make one up as ".MMIX.sec.N", where N is an + increasing number. */ + +static asection * +mmo_decide_section (abfd, vma) + bfd *abfd; + bfd_vma vma; +{ + asection *sec = NULL; + char sec_name[sizeof (".MMIX.sec.") + 20]; + struct mmo_find_sec_info info; + + info.addr = vma; + info.sec = NULL; + + /* First see if there's a section that would match exactly. */ + bfd_map_over_sections (abfd, mmo_find_sec_w_addr, &info); + + if (info.sec != NULL) + return info.sec; + + /* If there's no such section, try and expand one of the existing ones, + up to a limit. Make sure we have .text and .data before we try that; + create them corresponding to expected addresses and set flags to make + them match the "loaded and with contents" expectation. */ + if ((vma >> 56) == 0) + { + sec = bfd_make_section_old_way (abfd, MMO_TEXT_SECTION_NAME); + + if (sec == NULL) + return NULL; + + if (! sec->user_set_vma) + bfd_set_section_vma (abfd, sec, vma); + if (! bfd_set_section_flags (abfd, sec, + bfd_get_section_flags (abfd, sec) + | SEC_CODE | SEC_LOAD | SEC_ALLOC)) + return NULL; + } + else if ((vma >> 56) == 0x20) + { + sec = bfd_make_section_old_way (abfd, MMO_DATA_SECTION_NAME); + + if (sec == NULL) + return NULL; + + if (! sec->user_set_vma) + bfd_set_section_vma (abfd, sec, vma); + if (! bfd_set_section_flags (abfd, sec, + bfd_get_section_flags (abfd, sec) + | SEC_LOAD | SEC_ALLOC)) + return NULL; + } + + bfd_map_over_sections (abfd, mmo_find_sec_w_addr_grow, &info); + + if (info.sec != NULL) + return info.sec; + + /* If there's still no suitable section, make a new one. */ + sprintf (sec_name, ".MMIX.sec.%d", abfd->tdata.mmo_data->sec_no++); + sec = mmo_make_section (abfd, sec_name); + if (! sec->user_set_vma) + bfd_set_section_vma (abfd, sec, vma); + + if (! bfd_set_section_flags (abfd, sec, + bfd_get_section_flags (abfd, sec) + | SEC_LOAD | SEC_ALLOC)) + return NULL; + return sec; +} + +/* Xor in a 64-bit value VALUE at VMA. */ + +static INLINE void +mmo_xore_64 (sec, vma, value) + asection *sec; + bfd_vma vma; + bfd_vma value; +{ + bfd_byte *loc = mmo_get_loc (sec, vma, 8); + bfd_vma prev = bfd_get_64 (sec->owner, loc); + + value ^= prev; + bfd_put_64 (sec->owner, value, loc); +} + +/* Xor in a 32-bit value VALUE at VMA. */ + +static INLINE void +mmo_xore_32 (sec, vma, value) + asection *sec; + bfd_vma vma; + unsigned int value; +{ + bfd_byte *loc = mmo_get_loc (sec, vma, 4); + unsigned int prev = bfd_get_32 (sec->owner, loc); + + value ^= prev; + bfd_put_32 (sec->owner, value, loc); +} + +/* Xor in a 16-bit value VALUE at VMA. */ + +static INLINE void +mmo_xore_16 (sec, vma, value) + asection *sec; + bfd_vma vma; + unsigned int value; +{ + bfd_byte *loc = mmo_get_loc (sec, vma, 2); + unsigned int prev = bfd_get_16 (sec->owner, loc); + + value ^= prev; + bfd_put_16 (sec->owner, value, loc); +} + +/* Write a 32-bit word to output file, no lop_quote generated. */ + +static INLINE void +mmo_write_tetra_raw (abfd, value) + bfd *abfd; + unsigned int value; +{ + bfd_byte buf[4]; + + bfd_put_32 (abfd, value, buf); + + if (bfd_bwrite ((PTR) buf, 4, abfd) != 4) + abfd->tdata.mmo_data->have_error = true; +} + +/* Write a 32-bit word to output file; lop_quote if necessary. */ + +static INLINE void +mmo_write_tetra (abfd, value) + bfd *abfd; + unsigned int value; +{ + if (((value >> 24) & 0xff) == LOP) + mmo_write_tetra_raw (abfd, LOP_QUOTE_NEXT); + + mmo_write_tetra_raw (abfd, value); +} + +/* Write a 64-bit word to output file, perhaps with lop_quoting. */ + +static INLINE void +mmo_write_octa (abfd, value) + bfd *abfd; + bfd_vma value; +{ + mmo_write_tetra (abfd, (unsigned int) (value >> 32)); + mmo_write_tetra (abfd, (unsigned int) value); +} + +/* Write a 64-bit word to output file, without lop_quoting. */ + +static INLINE void +mmo_write_octa_raw (abfd, value) + bfd *abfd; + bfd_vma value; +{ + mmo_write_tetra_raw (abfd, (unsigned int) (value >> 32)); + mmo_write_tetra_raw (abfd, (unsigned int) value); +} + +/* Write quoted contents, zero filled. */ + +static INLINE boolean +mmo_write_chunk (abfd, loc, len) + bfd *abfd; + CONST bfd_byte *loc; + unsigned int len; +{ + boolean retval = true; + bfd_byte buf[4] = {0, 0, 0, 0}; + + while (len >= 4) + { + if (loc[0] == LOP) + mmo_write_tetra_raw (abfd, LOP_QUOTE_NEXT); + + retval + = (retval == true + && abfd->tdata.mmo_data->have_error == false + && 4 == bfd_bwrite ((PTR) loc, 4, abfd)); + + loc += 4; + len -= 4; + } + + if (len) + { + memcpy (buf, loc, len); + if (buf[0] == LOP) + mmo_write_tetra_raw (abfd, LOP_QUOTE_NEXT); + + retval + = (retval == true + && abfd->tdata.mmo_data->have_error == false + && 4 == bfd_bwrite ((PTR) buf, 4, abfd)); + } + + return retval; +} + +/* Same, but from a list. */ + +static INLINE boolean +mmo_write_chunk_list (abfd, datap) + bfd *abfd; + mmo_data_list_type *datap; +{ + for (; datap != NULL; datap = datap->next) + if (! mmo_write_chunk (abfd, datap->data, datap->size)) + return false; + + return true; +} + +/* Write a lop_loc and some contents. */ + +static boolean +mmo_write_loc_chunk (abfd, vma, loc, len) + bfd *abfd; + bfd_vma vma; + CONST bfd_byte *loc; + unsigned int len; +{ + /* We always write the location as 64 bits; no use saving bytes here. */ + mmo_write_tetra_raw (abfd, (LOP << 24) | (LOP_LOC << 16) | 2); + + /* Find an initial and trailing section of zero tetras; we don't need to + write out zeros. FIXME: When we do this, we should emit section size + and address specifiers, else objcopy can't perform a unity + translation. */ + while (len >= 4 && bfd_get_32 (abfd, loc) == 0) + { + vma += 4; + len -= 4; + loc += 4; + } + + while (len >= 4 && bfd_get_32 (abfd, loc + len - 4) == 0) + len -= 4; + + mmo_write_octa_raw (abfd, vma); + return + abfd->tdata.mmo_data->have_error == false + && mmo_write_chunk (abfd, loc, len); +} + +/* Same, but from a list. */ + +static INLINE boolean +mmo_write_loc_chunk_list (abfd, datap) + bfd *abfd; + mmo_data_list_type *datap; +{ + for (; datap != NULL; datap = datap->next) + if (! mmo_write_loc_chunk (abfd, datap->where, datap->data, datap->size)) + return false; + + return true; +} + +/* Make a .MMIX.spec_data.N section. */ + +static asection * +mmo_get_generic_spec_data_section (abfd, spec_data_number) + bfd *abfd; + int spec_data_number; +{ + asection *sec; + char secname[sizeof (MMIX_OTHER_SPEC_SECTION_PREFIX) + 20] + = MMIX_OTHER_SPEC_SECTION_PREFIX; + + sprintf (secname + strlen (MMIX_OTHER_SPEC_SECTION_PREFIX), + "%d", spec_data_number); + + sec = mmo_make_section (abfd, secname); + + return sec; +} + +/* Make a special section for SPEC_DATA_NUMBER. If it is the one we use + ourselves, parse some of its data to get at the section name. */ + +static asection * +mmo_get_spec_section (abfd, spec_data_number) + bfd *abfd; + int spec_data_number; +{ + bfd_byte *secname; + asection *sec; + bfd_byte buf[4]; + unsigned int secname_length; + unsigned int i; + bfd_vma section_length; + bfd_vma section_vma; + mmo_data_list_type *loc; + flagword flags; + long orig_pos; + + /* If this isn't the "special" special data, then make a placeholder + section. */ + if (spec_data_number != SPEC_DATA_SECTION) + return mmo_get_generic_spec_data_section (abfd, spec_data_number); + + /* Seek back to this position if there was a format error. */ + orig_pos = bfd_tell (abfd); + + /* Read the length (in 32-bit words). */ + if (bfd_bread (buf, 4, abfd) != 4) + goto format_error; + + if (buf[0] == LOP) + { + if (buf[1] != LOP_QUOTE) + goto format_error; + + if (bfd_bread (buf, 4, abfd) != 4) + goto format_error; + } + + /* We don't care to keep the name length accurate. It's + zero-terminated. */ + secname_length = bfd_get_32 (abfd, buf) * 4; + + /* Check section name length for sanity. */ + if (secname_length > MAX_SECTION_NAME_SIZE) + goto format_error; + + /* This should be free'd regardless if a section is created. */ + secname = bfd_malloc (secname_length + 1); + secname[secname_length] = 0; + + for (i = 0; i < secname_length / 4; i++) + { + if (bfd_bread (secname + i * 4, 4, abfd) != 4) + goto format_error_free; + + if (secname[i * 4] == LOP) + { + /* A bit of overkill, but we handle char 0x98 in a section name, + and recognize misparsing. */ + if (secname[i * 4 + 1] != LOP_QUOTE + || bfd_bread (secname + i * 4, 4, abfd) != 4) + /* Whoops. We thought this was a name, and now we found a + non-lop_quote lopcode before we parsed the whole length of + the name. Signal end-of-file in the same manner. */ + goto format_error_free; + } + } + + /* Get the section flags. */ + if (bfd_bread (buf, 4, abfd) != 4 + || (buf[0] == LOP + && (buf[1] != LOP_QUOTE || bfd_bread (buf, 4, abfd) != 4))) + goto format_error_free; + + flags = bfd_get_32 (abfd, buf); + + /* Get the section length. */ + if (bfd_bread (buf, 4, abfd) != 4 + || (buf[0] == LOP + && (buf[1] != LOP_QUOTE || bfd_bread (buf, 4, abfd) != 4))) + goto format_error_free; + + section_length = (bfd_vma) bfd_get_32 (abfd, buf) << 32; + + /* That's the first, high-part. Now get the low part. */ + + if (bfd_bread (buf, 4, abfd) != 4 + || (buf[0] == LOP + && (buf[1] != LOP_QUOTE || bfd_bread (buf, 4, abfd) != 4))) + goto format_error_free; + + section_length |= (bfd_vma) bfd_get_32 (abfd, buf); + + /* Check the section length for sanity. */ + if (section_length > MAX_ARTIFICIAL_SECTION_SIZE) + goto format_error_free; + + /* Get the section VMA. */ + if (bfd_bread (buf, 4, abfd) != 4 + || (buf[0] == LOP + && (buf[1] != LOP_QUOTE || bfd_bread (buf, 4, abfd) != 4))) + goto format_error_free; + + section_vma = (bfd_vma) bfd_get_32 (abfd, buf) << 32; + + /* That's the first, high-part. Now get the low part. */ + if (bfd_bread (buf, 4, abfd) != 4 + || (buf[0] == LOP + && (buf[1] != LOP_QUOTE || bfd_bread (buf, 4, abfd) != 4))) + goto format_error_free; + + section_vma |= (bfd_vma) bfd_get_32 (abfd, buf); + + sec = mmo_make_section (abfd, secname); + free (secname); + if (sec == NULL) + goto format_error; + + /* We allocate a buffer here for the advertised size, with head room for + tetrabyte alignment. */ + loc = bfd_zmalloc (section_length + 3 + + sizeof (struct mmo_data_list_struct)); + if (loc == NULL) + goto format_error; + + /* Use a TETRA-rounded size for the allocated buffer; we set the + "visible" section size below. */ + loc->size = (section_length + 3) & ~3; + + /* Add in the section flags we found to those bfd entered during this + process and set the contents. */ + if (! bfd_set_section_flags (abfd, sec, + bfd_sec_flags_from_mmo_flags (flags) + | bfd_get_section_flags (abfd, sec) + | (section_length != 0 ? SEC_HAS_CONTENTS : 0)) + || ! bfd_set_section_size (abfd, sec, + sec->_cooked_size + section_length) + /* Set VMA only for the first occurrence. */ + || (! sec->user_set_vma + && ! bfd_set_section_vma (abfd, sec, section_vma))) + { + /* If we get an error for any of the calls above, signal more than + just a format error for the spec section. */ + return NULL; + } + + loc->next = NULL; + if (((struct mmo_section_data_struct *) (sec->used_by_bfd))->tail != NULL) + ((struct mmo_section_data_struct *) (sec->used_by_bfd))->tail->next + = loc; + else + ((struct mmo_section_data_struct *) (sec->used_by_bfd))->head = loc; + ((struct mmo_section_data_struct *) (sec->used_by_bfd))->tail = loc; + loc->where = section_vma; + + return sec; + + format_error_free: + free (secname); + format_error: + if (bfd_seek (abfd, orig_pos, SEEK_SET) != 0) + return NULL; + + return mmo_get_generic_spec_data_section (abfd, spec_data_number); +} + +/* Read a byte, but read from file in multiples of 32-bit words. */ + +static bfd_byte +mmo_get_byte (abfd) + bfd *abfd; +{ + bfd_byte retval; + + if (abfd->tdata.mmo_data->byte_no == 0) + { + if (abfd->tdata.mmo_data->have_error == false + && bfd_bread (abfd->tdata.mmo_data->buf, 4, abfd) != 4) + { + abfd->tdata.mmo_data->have_error = true; + + /* A value somewhat safe against tripping on some inconsistency + when mopping up after this error. */ + return 128; + } + } + + retval = abfd->tdata.mmo_data->buf[abfd->tdata.mmo_data->byte_no]; + abfd->tdata.mmo_data->byte_no = (abfd->tdata.mmo_data->byte_no + 1) % 4; + + return retval; +} + +/* Write a byte, in multiples of 32-bit words. */ + +static void +mmo_write_byte (abfd, value) + bfd *abfd; + bfd_byte value; +{ + abfd->tdata.mmo_data->buf[(abfd->tdata.mmo_data->byte_no++ % 4)] = value; + if ((abfd->tdata.mmo_data->byte_no % 4) == 0) + { + if (abfd->tdata.mmo_data->have_error == false + && bfd_bwrite (abfd->tdata.mmo_data->buf, 4, abfd) != 4) + abfd->tdata.mmo_data->have_error = true; + } +} + +/* Create a symbol. */ + +static boolean +mmo_create_symbol (abfd, symname, addr, sym_type, serno) + bfd *abfd; + CONST char *symname; + bfd_vma addr; + enum mmo_sym_type sym_type; + unsigned int serno; +{ + struct mmo_symbol *n; + + n = (struct mmo_symbol *) bfd_alloc (abfd, sizeof (struct mmo_symbol)); + if (n == NULL) + return false; + + n->name = bfd_alloc (abfd, strlen (symname) + 1); + if (n->name == NULL) + return false; + + strcpy ((PTR) n->name, symname); + + n->value = addr; + n->sym_type = sym_type; + n->serno = serno; + + if (abfd->tdata.mmo_data->symbols == NULL) + abfd->tdata.mmo_data->symbols = n; + else + abfd->tdata.mmo_data->symtail->next = n; + abfd->tdata.mmo_data->symtail = n; + n->next = NULL; + + ++abfd->symcount; + + /* Check that :Main equals the last octa of the .MMIX.reg_contents + section, as it's the one place we're sure to pass when reading a mmo + object. For written objects, we do it while setting the symbol + table. */ + if (strcmp (symname, MMIX_START_SYMBOL_NAME) == 0 + && bfd_get_start_address (abfd) != addr) + { + (*_bfd_error_handler) + (_("%s: invalid mmo file: initialization value for $255 is not `Main'\n"), + bfd_get_filename (abfd)); + bfd_set_error (bfd_error_bad_value); + return false; + } + + return true; +} + +/* Read in symbols. */ + +static boolean +mmo_get_symbols (abfd) + bfd *abfd; +{ +/* +INODE +Symbol-table, mmo section mapping, File layout, mmo +SUBSECTION + Symbol table format + + From mmixal.w (or really, the generated mmixal.tex) in + @emph{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz}): + ``Symbols are stored and retrieved by means of a @samp{ternary + search trie}, following ideas of Bentley and Sedgewick. (See + ACM--SIAM Symp.@: on Discrete Algorithms @samp{8} (1997), 360--369; + R.@:Sedgewick, @samp{Algorithms in C} (Reading, Mass.@: + Addison--Wesley, 1998), @samp{15.4}.) Each trie node stores a + character, and there are branches to subtries for the cases where + a given character is less than, equal to, or greater than the + character in the trie. There also is a pointer to a symbol table + entry if a symbol ends at the current node.'' + + So it's a tree encoded as a stream of bytes. The stream of bytes + acts on a single virtual global symbol, adding and removing + characters and signalling complete symbol points. Here, we read + the stream and create symbols at the completion points. + + First, there's a control byte <<m>>. If any of the listed bits + in <<m>> is nonzero, we execute what stands at the right, in + the listed order: + +| (MMO3_LEFT) +| 0x40 - Traverse left trie. +| (Read a new command byte and recurse.) +| +| (MMO3_SYMBITS) +| 0x2f - Read the next byte as a character and store it in the +| current character position; increment character position. +| Test the bits of <<m>>: +| +| (MMO3_WCHAR) +| 0x80 - The character is 16-bit (so read another byte, +| merge into current character. +| +| (MMO3_TYPEBITS) +| 0xf - We have a complete symbol; parse the type, value +| and serial number and do what should be done +| with a symbol. The type and length information +| is in j = (m & 0xf). +| +| (MMO3_REGQUAL_BITS) +| j == 0xf: A register variable. The following +| byte tells which register. +| j <= 8: An absolute symbol. Read j bytes as the +| big-endian number the symbol equals. +| A j = 2 with two zero bytes denotes an +| unknown symbol. +| j > 8: As with j <= 8, but add (0x20 << 56) +| to the value in the following j - 8 +| bytes. +| +| Then comes the serial number, as a variant of +| uleb128, but better named ubeb128: +| Read bytes and shift the previous value left 7 +| (multiply by 128). Add in the new byte, repeat +| until a byte has bit 7 set. The serial number +| is the computed value minus 128. +| +| (MMO3_MIDDLE) +| 0x20 - Traverse middle trie. (Read a new command byte +| and recurse.) Decrement character position. +| +| (MMO3_RIGHT) +| 0x10 - Traverse right trie. (Read a new command byte and +| recurse.) + + Let's look again at the <<lop_stab>> for the trivial file + (@pxref{File layout}). + +| 0x980b0000 - lop_stab for ":Main" = 0, serial 1. +| 0x203a4040 +| 0x10404020 +| 0x4d206120 +| 0x69016e00 +| 0x81000000 + + This forms the trivial trie (note that the path between ``:'' and + ``M'' is redundant): + +| 203a ":" +| 40 / +| 40 / +| 10 \ +| 40 / +| 40 / +| 204d "M" +| 2061 "a" +| 2069 "i" +| 016e "n" is the last character in a full symbol, and +| with a value represented in one byte. +| 00 The value is 0. +| 81 The serial number is 1. */ + + bfd_byte m = mmo_get_byte (abfd); + + /* Check first if we have a bad hair day. */ + if (abfd->tdata.mmo_data->have_error == true) + return false; + + if (m & MMO3_LEFT) + /* Traverse left trie. */ + mmo_get_symbols (abfd); + + if (m & MMO3_SYMBITS) + { + bfd_byte c = mmo_get_byte (abfd); + bfd_byte j = m & MMO3_TYPEBITS; + bfd_vma addr = 0; + enum mmo_sym_type sym_type; + unsigned int serno = 0; + bfd_byte k; + + if (m & MMO3_WCHAR) + { + bfd_byte c2 = mmo_get_byte (abfd); + + /* A two-byte character. We can't grok this, but neither can + mmotype, for other cases than the second byte being zero. */ + + if (c != 0) + { + abfd->tdata.mmo_data->lop_stab_symbol + [abfd->tdata.mmo_data->symbol_position] = 0; + + (*_bfd_error_handler) + (_("%s: unsupported wide character sequence\ + 0x%02X 0x%02X after symbol name starting with `%s'\n"), + bfd_get_filename (abfd), c, c2, + abfd->tdata.mmo_data->lop_stab_symbol); + bfd_set_error (bfd_error_bad_value); + abfd->tdata.mmo_data->have_error = true; + return false; + } + else + c = c2; + } + + abfd->tdata.mmo_data->lop_stab_symbol[abfd->tdata.mmo_data->symbol_position++] = c; + abfd->tdata.mmo_data->lop_stab_symbol[abfd->tdata.mmo_data->symbol_position] = 0; + + if (j & MMO3_REGQUAL_BITS) + { + if (j == MMO3_REGQUAL_BITS) + { + sym_type = mmo_reg_sym; + addr = mmo_get_byte (abfd); + } + else if (j <= 8) + { + unsigned int i; + + for (i = 0; i < j; i++) + addr = (addr << 8) + mmo_get_byte (abfd); + + if (addr == 0 && j == MMO3_UNDEF) + sym_type = mmo_undef_sym; + else + sym_type = mmo_abs_sym; + } + else + { + unsigned int i; + + for (i = MMO3_DATA; i < j; i++) + addr = (addr << 8) + mmo_get_byte (abfd); + + addr += (bfd_vma) 0x20 << 56; + sym_type = mmo_data_sym; + } + + /* Get the serial number. */ + do + { + k = mmo_get_byte (abfd); + serno = (serno << 7) + k; + } + while (k < 128); + serno -= 128; + + /* Got it. Now enter it. Skip a leading ":". */ + if (abfd->tdata.mmo_data->have_error == false + && ! mmo_create_symbol (abfd, + abfd->tdata.mmo_data->lop_stab_symbol + + 1, + addr, sym_type, serno)) + abfd->tdata.mmo_data->have_error = true; + } + + if (m & MMO3_MIDDLE) + /* Traverse middle trie. */ + mmo_get_symbols (abfd); + + abfd->tdata.mmo_data->symbol_position--; + } + + if (m & MMO3_RIGHT) + /* Traverse right trie. */ + mmo_get_symbols (abfd); + + return abfd->tdata.mmo_data->have_error == false; +} + +/* Get the location of memory area [VMA..VMA + SIZE - 1], which we think + is in section SEC. Adjust and reallocate zero-initialized contents. + If there's new contents, allocate to the next multiple of + MMO_SEC_CONTENTS_CHUNK_SIZE. */ + +static INLINE bfd_byte * +mmo_get_loc (sec, vma, size) + asection *sec; + bfd_vma vma; + int size; +{ + bfd_size_type allocated_size; + struct mmo_section_data_struct *sdatap + = (struct mmo_section_data_struct *) sec->used_by_bfd; + struct mmo_data_list_struct *datap = sdatap->head; + struct mmo_data_list_struct *entry; + + for (; datap != NULL; datap = datap->next) + { + if (datap->where <= vma + && datap->where + datap->size >= vma + size) + return datap->data + vma - datap->where; + else if (datap->where <= vma + && datap->where + datap->allocated_size >= vma + size + /* Only munch on the "allocated size" if it does not + overlap the next chunk. */ + && (datap->next == NULL || datap->next->where >= vma + size)) + { + /* There was room allocated, but the size wasn't set to include + it. Do that now. */ + datap->size += (vma + size) - (datap->where + datap->size); + + /* Update the section size. */ + if (vma + size > sec->vma + sec->_raw_size) + sec->_raw_size += (vma + size) - (sec->vma + sec->_raw_size); + + return datap->data + vma - datap->where; + } + } + + /* Not found; allocate a new block. First check in case we get a + request for a size split up over several blocks; we'll have to return + NULL for those cases, requesting the caller to split up the request. + Requests with an address aligned on MMO_SEC_CONTENTS_CHUNK_SIZE bytes and + for no more than MMO_SEC_CONTENTS_CHUNK_SIZE will always get resolved. */ + + for (datap = sdatap->head; datap != NULL; datap = datap->next) + if ((datap->where <= vma && datap->where + datap->size > vma) + || (datap->where < vma + size + && datap->where + datap->size >= vma + size)) + return NULL; + + allocated_size + = (size + MMO_SEC_CONTENTS_CHUNK_SIZE - 1) & ~(MMO_SEC_CONTENTS_CHUNK_SIZE - 1); + entry = (mmo_data_list_type *) + bfd_zalloc (sec->owner, sizeof (mmo_data_list_type) + allocated_size); + if (entry == NULL) + return false; + entry->where = vma; + entry->size = size; + entry->allocated_size = allocated_size; + + datap = sdatap->head; + + /* Sort the records by address. Optimize for the common case of adding + a record to the end of the list. */ + if (sdatap->tail != NULL && entry->where >= sdatap->tail->where) + { + sdatap->tail->next = entry; + entry->next = NULL; + sdatap->tail = entry; + } + else + { + mmo_data_list_type **look; + for (look = &sdatap->head; + *look != NULL && (*look)->where < entry->where; + look = &(*look)->next) + ; + entry->next = *look; + *look = entry; + if (entry->next == NULL) + { + sdatap->tail = entry; + + /* We get here for the first time (at other times too) for this + section. Say we have contents. */ + if (! bfd_set_section_flags (sec->owner, sec, + bfd_get_section_flags (sec->owner, sec) + | SEC_HAS_CONTENTS)) + return NULL; + } + } + + /* Update the section size. */ + if (vma + size > sec->vma + sec->_raw_size) + sec->_raw_size += (vma + size) - (sec->vma + sec->_raw_size); + return entry->data; +} + +/* Set sizes once we've read in all sections. */ + +static void +mmo_map_set_sizes (abfd, sec, ignored) + bfd *abfd ATTRIBUTE_UNUSED; + asection *sec; + PTR ignored ATTRIBUTE_UNUSED; +{ + sec->_cooked_size = sec->_raw_size; + sec->lma = sec->vma; +} + +/* Read the mmo file and turn it into sections. */ + +static boolean +mmo_scan (abfd) + bfd *abfd; +{ + unsigned int i; + unsigned int lineno = 1; + boolean error = false; + bfd_vma vma = 0; + asection *sec = bfd_make_section_old_way (abfd, MMO_TEXT_SECTION_NAME); + asection *non_spec_sec = NULL; + bfd_vma non_spec_vma = 0; + char *current_filename = NULL; + bfd_size_type nbytes_read = 0; + /* Buffer with room to read a 64-bit value. */ + bfd_byte buf[8]; + long stab_loc = -1; + char *file_names[256]; + + memset (file_names, 0, sizeof (file_names)); + + if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) + goto error_return; + + while ((nbytes_read = bfd_bread (buf, 4, abfd)) == 4) + { + if (buf[0] == LOP) + { + unsigned int y = bfd_get_8 (abfd, buf + 2); + unsigned int z = bfd_get_8 (abfd, buf + 3); + + /* Change back to the original section for lopcodes other + than LOP_QUOTE that comes after a LOP_SPEC. */ + if ((buf[1] != LOP_QUOTE || y != 0 || z != 1) + && non_spec_sec != NULL) + { + sec = non_spec_sec; + vma = non_spec_vma; + non_spec_sec = NULL; + } + + switch (buf[1]) + { + default: + (*_bfd_error_handler) + (_("%s: invalid mmo file: unsupported lopcode `%d'\n"), + bfd_get_filename (abfd), buf[1]); + bfd_set_error (bfd_error_bad_value); + goto error_return; + + case LOP_QUOTE: + /* Quote the next 32-bit word. */ + if (y != 0 || z != 1) + { + (*_bfd_error_handler) + (_("%s: invalid mmo file: expected YZ = 1 got YZ = %d for lop_quote\n"), + bfd_get_filename (abfd), y*256+z); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + if (bfd_bread (buf, 4, abfd) != 4) + goto error_return; + + mmo_xore_32 (sec, vma, bfd_get_32 (abfd, buf)); + vma += 4; + vma &= ~3; + lineno++; + break; + + case LOP_LOC: + /* Set vma (and section). */ + vma = (bfd_vma) y << 56; + if (z == 1) + { + /* Get a 32-bit value. */ + if (bfd_bread (buf, 4, abfd) != 4) + goto error_return; + + vma += bfd_get_32 (abfd, buf); + } + else if (z == 2) + { + /* Get a 64-bit value. */ + if (bfd_bread (buf, 8, abfd) != 8) + goto error_return; + + vma += bfd_get_64 (abfd, buf); + } + else + { + (*_bfd_error_handler) + (_("%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_loc\n"), + bfd_get_filename (abfd), z); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + + sec = mmo_decide_section (abfd, vma); + if (sec == NULL) + goto error_return; + break; + + case LOP_SKIP: + /* Move forward within the same section. */ + vma += y * 256 + z; + + sec = mmo_decide_section (abfd, vma); + if (sec == NULL) + goto error_return; + break; + + case LOP_FIXO: + /* A fixup: Store the current vma somewhere. Position using + same format as LOP_LOC. */ + { + bfd_vma p = (bfd_vma) y << 56; + asection *fixosec; + + if (z == 1) + { + /* Get a 32-bit value. */ + if (bfd_bread (buf, 4, abfd) != 4) + goto error_return; + + p += bfd_get_32 (abfd, buf); + } + else if (z == 2) + { + /* Get a 64-bit value. */ + if (bfd_bread (buf, 8, abfd) != 8) + goto error_return; + + p += bfd_get_64 (abfd, buf); + } + else + { + (*_bfd_error_handler) + (_("%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_fixo\n"), + bfd_get_filename (abfd), z); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + + /* The section where we store this address might be a + different one than the current section. */ + fixosec = mmo_decide_section (abfd, p); + if (fixosec == NULL) + goto error_return; + mmo_xore_64 (fixosec, p, vma); + } + break; + + case LOP_FIXR: + /* A fixup: Store YZ of this lopcode into YZ at vma - 4 * yz. */ + { + unsigned int yz = (y * 256 + z); + bfd_vma p = vma + 2 - 4 * yz; + asection *fixrsec = mmo_decide_section (abfd, p); + if (fixrsec == NULL) + goto error_return; + mmo_xore_16 (fixrsec, p, yz); + } + break; + + case LOP_FIXRX: + /* A fixup, similar to lop_fixr, but taking larger numbers + and can change branches into the opposite direction + (gasp!). */ + { + bfd_vma delta; + bfd_vma p; + asection *fixrsec; + + if (y != 0) + { + (*_bfd_error_handler) + (_("%s: invalid mmo file: expected y = 0, got y = %d for lop_fixrx\n"), + bfd_get_filename (abfd), y); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + + if (z != 16 && z != 24) + { + (*_bfd_error_handler) + (_("%s: invalid mmo file: expected z = 16 or z = 24, got z = %d for lop_fixrx\n"), + bfd_get_filename (abfd), z); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + + /* Get the next 32-bit value. */ + if (bfd_bread (buf, 4, abfd) != 4) + goto error_return; + + delta = bfd_get_32 (abfd, buf); + + /* Do an, ehm, involved calculation for the location of + the fixup. See mmixal documentation for a verbose + explanation. We follow it verbosely here for the + readers delight. */ + if (buf[0] == 0) + p = vma - 4 * delta; + else if (buf[0] == 1) + p = vma - 4 * ((delta & 0xffffff) - (1 << z)); + else + { + (*_bfd_error_handler) + (_("%s: invalid mmo file: leading byte of operand word must be 0 or 1, got %d for lop_fixrx\n"), + bfd_get_filename (abfd), buf[0]); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + + fixrsec = mmo_decide_section (abfd, vma); + if (fixrsec == NULL) + goto error_return; + mmo_xore_32 (fixrsec, p, delta); + } + break; + + case LOP_FILE: + /* Set current file and perhaps the file name. Reset line + number. */ + if (z != 0) + { + char *fname = bfd_malloc (z * 4 + 1); + + if (fname == NULL) + { + (*_bfd_error_handler) + (_("%s: cannot allocate file name for file number %d, %d bytes\n"), + bfd_get_filename (abfd), y, z * 4 + 1); + bfd_set_error (bfd_error_system_call); + goto error_return; + } + + fname[z * 4] = 0; + + for (i = 0; i < z; i++) + { + if (bfd_bread (fname + i * 4, 4, abfd) != 4) + { + free (fname); + goto error_return; + } + } + + if (file_names[y] != NULL) + { + (*_bfd_error_handler) + (_("%s: invalid mmo file: file number %d `%s',\ + was already entered as `%s'\n"), + bfd_get_filename (abfd), y, fname, file_names[y]); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + + file_names[y] = fname; + } + + if (file_names[y] == NULL) + { + (*_bfd_error_handler) + (_("%s: invalid mmo file: file name for number %d\ + was not specified before use\n"), + bfd_get_filename (abfd), y); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + + current_filename = file_names[y]; + lineno = 0; + break; + + case LOP_LINE: + /* Set line number. */ + lineno = y * 256 + z; + /* FIXME: Create a sequence of mmo-specific line number + entries for each section, then translate into canonical + format. */ + break; + + case LOP_SPEC: + /* Special data follows until the next non-lop_quote + lopcode. */ + non_spec_sec = sec; + non_spec_vma = vma; + sec = mmo_get_spec_section (abfd, y * 256 + z); + if (sec == NULL) + goto error_return; + + vma = sec->vma; + break; + + case LOP_PRE: + { + /* We ignore header information, except we read in the + creation time from the first 32-bit word with the time + in seconds since era. */ + if (z >= 1 + && bfd_bread (abfd->tdata.mmo_data->created, 4, + abfd) != 4) + goto error_return; + + for (i = 1; i < z; i++) + if (bfd_bread (buf, 4, abfd) != 4) + goto error_return; + } + break; + + case LOP_POST: + /* This tells of the contents of registers $Z..$255 at + startup. We make a section out of it, with VMA = Z * 8, + but only if Z != 255 or the contents is non-zero. */ + { + asection *rsec; + bfd_byte *loc; + bfd_vma first_octa; + bfd_vma startaddr_octa; + + /* Read first octaword outside loop to simplify logic when + excluding the Z == 255, octa == 0 case. */ + if (bfd_bread (buf, 8, abfd) != 8) + goto error_return; + + first_octa = bfd_get_64 (abfd, buf); + + /* Don't emit contents for the trivial case which is + always present; $255 pointing to Main. */ + if (z != 255) + { + rsec + = bfd_make_section_old_way (abfd, + MMIX_REG_CONTENTS_SECTION_NAME); + rsec->vma = z * 8; + loc = mmo_get_loc (rsec, z * 8, (255 - z) * 8); + bfd_put_64 (abfd, first_octa, loc); + + for (i = z + 1; i < 255; i++) + { + if (bfd_bread (loc + (i - z) * 8, 8, abfd) != 8) + goto error_return; + } + + /* Read out the last octabyte, and use it to set the + start address. */ + if (bfd_bread (buf, 8, abfd) != 8) + goto error_return; + + startaddr_octa = bfd_get_64 (abfd, buf); + } + else + startaddr_octa = first_octa; + + if (! bfd_set_start_address (abfd, startaddr_octa)) + { + /* Currently this can't fail, but this should handle + future failures. */ + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + } + break; + + case LOP_STAB: + /* We read in the symbols now, not later. */ + if (y != 0 || z != 0) + { + (*_bfd_error_handler) + (_("%s: invalid mmo file: fields y and z of lop_stab\ + non-zero, y: %d, z: %d\n"), + bfd_get_filename (abfd), y, z); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + + /* Save the location, so we can check that YZ in the LOP_END + is correct. */ + stab_loc = bfd_tell (abfd); + + /* It's not said that an MMO can be without symbols (though + mmixal will refuse to assemble files without Main), but + it seems it would still be a valid mmo-file, so allow it. + We detect the absence of a symbol area in that the upper + limit is computed (from the lop_end YZ field) as 0. + Don't call mmo_get_symbols; it can only detect the end of + a valid symbol trie, not the absence of one. */ + if (abfd->tdata.mmo_data->max_symbol_length != 0 + && ! mmo_get_symbols (abfd)) + goto error_return; + break; + + case LOP_END: + { + /* This must be the last 32-bit word in an mmo file. + Let's find out. */ + struct stat statbuf; + long curpos = bfd_tell (abfd); + + if (bfd_stat (abfd, &statbuf) < 0) + goto error_return; + + if (statbuf.st_size != curpos) + { + (*_bfd_error_handler) + (_("%s: invalid mmo file: lop_end not last item in\ + file\n"), + bfd_get_filename (abfd)); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + + /* Check that the YZ field is right. Subtract the size of + this LOP_END in the calculation; YZ does not include + it. */ + if ((long) (y * 256 + z) * 4 != (curpos - stab_loc) - 4) + { + (*_bfd_error_handler) + (_("%s: invalid mmo file: YZ of lop_end (%ld)\ + not equal to the number of tetras to the preceding lop_stab (%ld)\n"), + bfd_get_filename (abfd), (long) (y * 256 + z), + (curpos - stab_loc - 4)/4); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + + bfd_map_over_sections (abfd, mmo_map_set_sizes, NULL); + goto done; + } + } + } + else + { + /* This wasn't a lopcode, so store it in the current section. */ + mmo_xore_32 (sec, vma & ~3, bfd_get_32 (abfd, buf)); + vma += 4; + vma &= ~3; + lineno++; + } + } + + /* We know this file is a multiple of four bytes (checked in + mmo_object_p), so if we got something other than 0, this was a bad + file (although it's more likely we'll get 0 in that case too). + If we got end-of-file, then there was no lop_stab, so the file has + invalid format. */ + + if (nbytes_read != 0) + bfd_set_error (bfd_error_system_call); + else + bfd_set_error (bfd_error_bad_value); + + error_return: + error = true; + done: + /* Mark the .text and .data section with their normal attribute if they + contain anything. This is not redundant wrt. mmo_decide_section, + since that code might never execute, and conversely the alloc+code + section flags must be set then. */ + sec = bfd_get_section_by_name (abfd, MMO_TEXT_SECTION_NAME); + if (sec != NULL + && (bfd_get_section_flags (abfd, sec) & SEC_HAS_CONTENTS) + && ! bfd_set_section_flags (abfd, sec, + bfd_get_section_flags (abfd, sec) + | SEC_ALLOC | SEC_LOAD | SEC_CODE)) + error = true; + + sec = bfd_get_section_by_name (abfd, MMO_DATA_SECTION_NAME); + if (sec != NULL + && (bfd_get_section_flags (abfd, sec) & SEC_HAS_CONTENTS) + && ! bfd_set_section_flags (abfd, sec, + bfd_get_section_flags (abfd, sec) + | SEC_ALLOC | SEC_LOAD)) + error = true; + + /* Free whatever resources we took. */ + for (i = 0; i < sizeof (file_names) / sizeof (file_names[0]); i++) + if (file_names[i]) + free (file_names[i]); + return error ? false : true; +} + +/* A hook to set up object file dependent section information. For mmo, + we point out the shape of allocated section contents. */ + +static boolean +mmo_new_section_hook (abfd, newsect) + bfd *abfd ATTRIBUTE_UNUSED; + asection *newsect; +{ + /* We zero-fill all fields and assume NULL is represented by an all + zero-bit pattern. */ + newsect->used_by_bfd = + (PTR) bfd_zalloc (abfd, sizeof (struct mmo_section_data_struct)); + + if (!newsect->used_by_bfd) + return false; + + /* Always align to at least 32-bit words. */ + newsect->alignment_power = 2; + return true; +} + +/* We already have section contents loaded for sections that have + contents. */ + +static boolean +mmo_get_section_contents (abfd, sec, location, offset, bytes_to_do) + bfd *abfd ATTRIBUTE_UNUSED; + asection *sec ATTRIBUTE_UNUSED; + PTR location ATTRIBUTE_UNUSED; + file_ptr offset ATTRIBUTE_UNUSED; + bfd_size_type bytes_to_do ATTRIBUTE_UNUSED; +{ + /* Iterate over diminishing chunk sizes, copying contents, like + mmo_set_section_contents. */ + while (bytes_to_do) + { + /* A minor song-and-dance to make sure we're not bitten by the + distant possibility of the cast from bfd_vma to int making the + chunk zero-sized. */ + int chunk_size + = (int) bytes_to_do != 0 ? bytes_to_do : MMO_SEC_CONTENTS_CHUNK_SIZE; + bfd_byte *loc; + + do + loc = mmo_get_loc (sec, sec->vma + offset, chunk_size); + while (loc == NULL && (chunk_size /= 2) != 0); + + if (chunk_size == 0) + return false; + + memcpy (location, loc, chunk_size); + + location += chunk_size; + bytes_to_do -= chunk_size; + offset += chunk_size; + } + return true; +} + +/* Return the amount of memory needed to read the symbol table. */ + +static long +mmo_get_symtab_upper_bound (abfd) + bfd *abfd ATTRIBUTE_UNUSED; +{ + return (abfd->symcount + 1) * sizeof (asymbol *); +} + +/* Sort mmo symbols by serial number. */ + +static int +mmo_sort_mmo_symbols (arg1, arg2) + CONST PTR arg1; + CONST PTR arg2; +{ + CONST struct mmo_symbol *sym1 = *(CONST struct mmo_symbol **) arg1; + CONST struct mmo_symbol *sym2 = *(CONST struct mmo_symbol **) arg2; + + /* Sort by serial number first. */ + if (sym1->serno < sym2->serno) + return -1; + else if (sym1->serno > sym2->serno) + return 1; + + /* Then sort by address of the table entries. */ + return ((CONST char *) arg1 - (CONST char *) arg2); +} + +/* Translate the symbol table. */ + +static long +mmo_get_symtab (abfd, alocation) + bfd *abfd; + asymbol **alocation; +{ + unsigned int symcount = bfd_get_symcount (abfd); + asymbol *csymbols; + unsigned int i; + + csymbols = abfd->tdata.mmo_data->csymbols; + if (csymbols == NULL) + { + asymbol *c; + struct mmo_symbol *s; + struct mmo_symbol **msp; + + /* First we store the symbols into the table we'll return, then we + qsort it on the serial number, with secondary on the address of + the symbol, to preserve order if there would be non-unique serial + numbers. */ + for (s = abfd->tdata.mmo_data->symbols, + msp = (struct mmo_symbol **) alocation; + s != NULL; + s = s->next, ++msp) + *msp = s; + + *msp = NULL; + + qsort (alocation, symcount, sizeof (struct mmo_symbol *), + mmo_sort_mmo_symbols); + + csymbols = (asymbol *) bfd_alloc (abfd, symcount * sizeof (asymbol)); + if (csymbols == NULL && symcount != 0) + return false; + abfd->tdata.mmo_data->csymbols = csymbols; + + for (msp = (struct mmo_symbol **) alocation, c = csymbols; + *msp != NULL; + msp++, ++c) + { + s = *msp; + c->the_bfd = abfd; + c->name = s->name; + c->value = s->value; + c->flags = BSF_GLOBAL; + + if (s->sym_type == mmo_data_sym) + { + c->section + = bfd_get_section_by_name (abfd, MMO_DATA_SECTION_NAME); + + if (c->section == NULL) + c->section = bfd_abs_section_ptr; + else + c->value -= c->section->vma; + } + else if (s->sym_type == mmo_undef_sym) + c->section = bfd_und_section_ptr; + else if (s->sym_type == mmo_reg_sym) + { + c->section + = bfd_make_section_old_way (abfd, MMIX_REG_SECTION_NAME); + } + else + { + asection *textsec + = bfd_get_section_by_name (abfd, MMO_TEXT_SECTION_NAME); + + if (textsec != NULL + && c->value >= textsec->vma + && c->value <= textsec->vma + textsec->_cooked_size) + { + c->section = textsec; + c->value -= c->section->vma; + } + else + c->section = bfd_abs_section_ptr; + } + + c->udata.p = NULL; + } + } + + /* Last, overwrite the incoming table with the right-type entries. */ + for (i = 0; i < symcount; i++) + *alocation++ = csymbols++; + *alocation = NULL; + + return symcount; +} + +/* Make an empty symbol. */ + +static asymbol * +mmo_make_empty_symbol (abfd) + bfd *abfd; +{ + asymbol *new = (asymbol *) bfd_zalloc (abfd, sizeof (asymbol)); + + if (new) + new->the_bfd = abfd; + return new; +} + +/* Get information about a symbol. */ + +static void +mmo_get_symbol_info (ignore_abfd, symbol, ret) + bfd *ignore_abfd ATTRIBUTE_UNUSED; + asymbol *symbol; + symbol_info *ret; +{ + bfd_symbol_info (symbol, ret); +} + +static void +mmo_print_symbol (abfd, afile, symbol, how) + bfd *abfd; + PTR afile; + asymbol *symbol; + bfd_print_symbol_type how; +{ + FILE *file = (FILE *) afile; + + switch (how) + { + case bfd_print_symbol_name: + fprintf (file, "%s", symbol->name); + break; + default: + bfd_print_symbol_vandf (abfd, (PTR) file, symbol); + + fprintf (file, " %-5s %s", + symbol->section->name, + symbol->name); + } +} + +/* We can't map a file directly into executable code, so the + size of header information is irrelevant. */ + +static int +mmo_sizeof_headers (abfd, exec) + bfd *abfd ATTRIBUTE_UNUSED; + boolean exec ATTRIBUTE_UNUSED; +{ + return 0; +} + +/* Write the (section-neutral) file preamble. */ + +static boolean +mmo_internal_write_header (abfd) + bfd *abfd; +{ + CONST char lop_pre_bfd[] = { LOP, LOP_PRE, 1, 1}; + + if (bfd_bwrite (lop_pre_bfd, 4, abfd) != 4) + return false; + + /* Copy creation time of original file. */ + if (bfd_bwrite (abfd->tdata.mmo_data->created, 4, abfd) != 4) + return false; + + return true; +} + +/* Write the LOP_POST record, with global register initializations. + Z is the Z field of the LOP_POST, corresponding to 255 - number of + registers at DATA. The Z = 255 field is filled in with the + start-address. */ + +static boolean +mmo_internal_write_post (abfd, z, sec) + bfd *abfd; + int z; + asection *sec; +{ + int i; + bfd_byte buf[8]; + mmo_write_tetra_raw (abfd, (LOP << 24) | (LOP_POST << 16) | z); + + for (i = z; i < 255; i++) + { + bfd_byte *data = mmo_get_loc (sec, i * 8, 8); + + if (bfd_bwrite (data, 8, abfd) != 8) + return false; + } + + /* For Z == $255, we always emit the start location; supposedly Main, + but we have it handy at bfd_get_start_address. If we're called with + Z == 255, don't assume DATA is valid. */ + bfd_put_64 (abfd, bfd_get_start_address (abfd), buf); + + return + abfd->tdata.mmo_data->have_error == false + && bfd_bwrite (buf, 8, abfd) == 8; +} + +/* Translate to and from BFD flags. This is to make sure that we don't + get bitten by BFD flag number changes. */ + +static flagword +mmo_sec_flags_from_bfd_flags (flags) + flagword flags; +{ + flagword oflags = 0; + + if (flags & SEC_ALLOC) + oflags |= MMO_SEC_ALLOC; + if (flags & SEC_LOAD) + oflags |= MMO_SEC_LOAD; + if (flags & SEC_RELOC) + oflags |= MMO_SEC_RELOC; + if (flags & SEC_READONLY) + oflags |= MMO_SEC_READONLY; + if (flags & SEC_CODE) + oflags |= MMO_SEC_CODE; + if (flags & SEC_DATA) + oflags |= MMO_SEC_DATA; + if (flags & SEC_NEVER_LOAD) + oflags |= MMO_SEC_NEVER_LOAD; + if (flags & SEC_IS_COMMON) + oflags |= MMO_SEC_IS_COMMON; + if (flags & SEC_DEBUGGING) + oflags |= MMO_SEC_DEBUGGING; + + return oflags; +} + +static flagword +bfd_sec_flags_from_mmo_flags (flags) + flagword flags; +{ + flagword oflags = 0; + + if (flags & MMO_SEC_ALLOC) + oflags |= SEC_ALLOC; + if (flags & MMO_SEC_LOAD) + oflags |= SEC_LOAD; + if (flags & MMO_SEC_RELOC) + oflags |= SEC_RELOC; + if (flags & MMO_SEC_READONLY) + oflags |= SEC_READONLY; + if (flags & MMO_SEC_CODE) + oflags |= SEC_CODE; + if (flags & MMO_SEC_DATA) + oflags |= SEC_DATA; + if (flags & MMO_SEC_NEVER_LOAD) + oflags |= SEC_NEVER_LOAD; + if (flags & MMO_SEC_IS_COMMON) + oflags |= SEC_IS_COMMON; + if (flags & MMO_SEC_DEBUGGING) + oflags |= SEC_DEBUGGING; + + return oflags; +} + +/* Write a section. */ + +static boolean +mmo_internal_write_section (abfd, sec) + bfd *abfd; + asection *sec; +{ + /* We do it differently depending on what section this is: + + ".text": Output, prepended by information about the first source file + (not yet implemented.) + + ".data": Output. + + (".MMIX.reg_contents": Not handled here.) + + Anything else: Output inside a lop_spec 80, in the format described + above. */ + + if (strcmp (sec->name, MMO_TEXT_SECTION_NAME) == 0) + /* FIXME: Output source file name and line number. */ + return + mmo_write_loc_chunk_list (abfd, + ((struct mmo_section_data_struct *) + (sec->used_by_bfd))->head); + else if (strcmp (sec->name, MMO_DATA_SECTION_NAME) == 0) + return + mmo_write_loc_chunk_list (abfd, + ((struct mmo_section_data_struct *) + (sec->used_by_bfd))->head); + else if (strcmp (sec->name, MMIX_REG_CONTENTS_SECTION_NAME) == 0) + /* Not handled here. */ + { + /* This would normally be an abort call since this can't happen, but + we don't do that. */ + bfd_set_error (bfd_error_bad_value); + return false; + } + else if (strncmp (sec->name, MMIX_OTHER_SPEC_SECTION_PREFIX, + strlen (MMIX_OTHER_SPEC_SECTION_PREFIX)) == 0) + { + int n = atoi (sec->name + strlen (MMIX_OTHER_SPEC_SECTION_PREFIX)); + mmo_write_tetra_raw (abfd, (LOP << 24) | (LOP_SPEC << 16) | n); + return + abfd->tdata.mmo_data->have_error == false + && mmo_write_chunk_list (abfd, + ((struct mmo_section_data_struct *) + (sec->used_by_bfd))->head); + } + /* Ignore sections that are just allocated or empty; we write out + _contents_ here. */ + else if ((bfd_get_section_flags (abfd, sec) & SEC_HAS_CONTENTS) != 0 + && sec->_raw_size != 0) + { + /* Keep the document-comment formatted the way it is. */ +/* +INODE +mmo section mapping, , Symbol-table, mmo +SUBSECTION + mmo section mapping + + The implementation in BFD uses special data type 80 (decimal) to + encapsulate and describe named sections, containing e.g.@: debug + information. If needed, any datum in the encapsulation will be + quoted using lop_quote. First comes a 32-bit word holding the + number of 32-bit words containing the zero-terminated zero-padded + segment name. After the name there's a 32-bit word holding flags + describing the section type. Then comes a 64-bit big-endian word + with the section length (in bytes), then another with the section + start address. Depending on the type of section, the contents + might follow, zero-padded to 32-bit boundary. For a loadable + section (such as data or code), the contents might follow at some + later point, not necessarily immediately, as a lop_loc with the + same start address as in the section description, followed by the + contents. This in effect forms a descriptor that must be emitted + before the actual contents. Sections described this way must not + overlap. + + For areas that don't have such descriptors, synthetic sections are + formed by BFD. Consecutive contents in the two memory areas + @samp{0x0000@dots{}00} to @samp{0x01ff@dots{}ff} and + @samp{0x2000@dots{}00} to @samp{0x20ff@dots{}ff} are entered in + sections named <<.text>> and <<.data>> respectively. If an area + is not otherwise described, but would together with a neighboring + lower area be less than @samp{0x40000000} bytes long, it is joined + with the lower area and the gap is zero-filled. For other cases, + a new section is formed, named <<.MMIX.sec.@var{n}>>. Here, + @var{n} is a number, a running count through the mmo file, + starting at 0. + +EXAMPLE + A loadable section specified as: + +| .section secname,"ax" +| TETRA 1,2,3,4,-1,-2009 +| BYTE 80 + + and linked to address @samp{0x4}, is represented by the sequence: + +| 0x98080050 - lop_spec 80 +| 0x00000002 - two 32-bit words for the section name +| 0x7365636e - "secn" +| 0x616d6500 - "ame\0" +| 0x00000033 - flags CODE, READONLY, LOAD, ALLOC +| 0x00000000 - high 32 bits of section length +| 0x0000001c - section length is 28 bytes; 6 * 4 + 1 + alignment to 32 bits +| 0x00000000 - high 32 bits of section address +| 0x00000004 - section address is 4 +| 0x98010002 - 64 bits with address of following data +| 0x00000000 - high 64 bits of address +| 0x00000004 - data starts at address 4 +| 0x00000001 - 1 +| 0x00000002 - 2 +| 0x00000003 - 3 +| 0x00000004 - 4 +| 0xffffffff - -1 +| 0xfffff827 - -2009 +| 0x50000000 - 80 as a byte, padded with zeros. + + Note that the lop_spec wrapping does not include the section + contents. Compare this to a non-loaded section specified as: + +| .section thirdsec +| TETRA 200001,100002 +| BYTE 38,40 + + This, when linked to address @samp{0x200000000000001c}, is + represented by: + +| 0x98080050 - lop_spec 80 +| 0x00000002 - two 32-bit words for the section name +| 0x7365636e - "thir" +| 0x616d6500 - "dsec" +| 0x00000010 - flag READONLY +| 0x00000000 - high 32 bits of section length +| 0x0000000c - section length is 12 bytes; 2 * 4 + 2 + alignment to 32 bits +| 0x20000000 - high 64 bits of address +| 0x0000001c - low 64 bits of address 0x200000000000001c +| 0x00030d41 - 200001 +| 0x000186a2 - 100002 +| 0x26280000 - 38, 40 as bytes, padded with zeros + + For the latter example, the section contents must not to appear + loaded in memory, and is therefore specified as part of the + special data. The address is usually unimportant but might + provide information for e.g.@: the DWARF 2 debugging format. */ + + mmo_write_tetra_raw (abfd, LOP_SPEC_SECTION); + mmo_write_tetra (abfd, (strlen (sec->name) + 3) / 4); + mmo_write_chunk (abfd, sec->name, strlen (sec->name)); + /* FIXME: We can get debug sections (.debug_line & Co.) with a + section flag still having SEC_RELOC set. Investigate. This + might be true for all alien sections; perhaps mmo.em should clear + that flag. Might be related to weak references. */ + mmo_write_tetra (abfd, + mmo_sec_flags_from_bfd_flags + (bfd_get_section_flags (abfd, sec))); + mmo_write_octa (abfd, sec->_raw_size); + mmo_write_octa (abfd, bfd_get_section_vma (abfd, sec)); + + /* Writing a LOP_LOC ends the LOP_SPEC data, and makes data actually + loaded. */ + if (bfd_get_section_flags (abfd, sec) & SEC_LOAD) + return + abfd->tdata.mmo_data->have_error == false + && mmo_write_loc_chunk_list (abfd, + ((struct mmo_section_data_struct *) + (sec->used_by_bfd))->head); + return + abfd->tdata.mmo_data->have_error == false + && mmo_write_chunk_list (abfd, + ((struct mmo_section_data_struct *) + (sec->used_by_bfd))->head); + } + return true; +} + +/* We save up all data before output. */ + +static boolean +mmo_set_section_contents (abfd, sec, location, offset, bytes_to_do) + bfd *abfd ATTRIBUTE_UNUSED; + sec_ptr sec; + PTR location; + file_ptr offset; + bfd_size_type bytes_to_do; +{ + /* Iterate over diminishing chunk sizes, copying contents. */ + while (bytes_to_do) + { + /* A minor song-and-dance to make sure we're not bitten by the + distant possibility of the cast from bfd_vma to int making the + chunk zero-sized. */ + int chunk_size + = (int) bytes_to_do != 0 ? bytes_to_do : MMO_SEC_CONTENTS_CHUNK_SIZE; + bfd_byte *loc; + + do + loc = mmo_get_loc (sec, sec->vma + offset, chunk_size); + while (loc == NULL && (chunk_size /= 2) != 0); + + if (chunk_size == 0) + return false; + + memcpy (loc, location, chunk_size); + + location += chunk_size; + bytes_to_do -= chunk_size; + offset += chunk_size; + } + return true; +} + +/* Add a symbol to a trie-tree. */ + +static boolean +mmo_internal_add_3_sym (abfd, rootp, symp) + bfd *abfd; + struct mmo_symbol_trie *rootp; + CONST struct mmo_symbol *symp; +{ + CONST char *name = symp->name; + struct mmo_symbol_trie *trie = rootp; + struct mmo_symbol_trie **triep = NULL; + + while (*name && trie != NULL) + { + if (*name < trie->symchar) + { + triep = &trie->left; + trie = trie->left; + } + else if (*name > trie->symchar) + { + triep = &trie->right; + trie = trie->right; + } + else if (*name == trie->symchar) + { + triep = &trie->middle; + name++; + + /* Make sure "trie" points to where we should fill in the + current symbol whenever we've iterated through "name". We + would lose the right position if we encounter "foobar" then + "foo". */ + if (*name) + trie = trie->middle; + } + } + + while (*name != 0) + { + /* Create middle branches for the rest of the characters. */ + trie = bfd_zalloc (abfd, sizeof (struct mmo_symbol_trie)); + *triep = trie; + trie->symchar = *name++; + triep = &trie->middle; + } + + /* We discover a duplicate symbol rather late in the process, but still; + we discover it and bail out. */ + if (trie->sym.name != NULL) + { + (*_bfd_error_handler) + (_("%s: invalid symbol table: duplicate symbol `%s'\n"), + bfd_get_filename (abfd), trie->sym.name); + bfd_set_error (bfd_error_bad_value); + return false; + } + + memcpy (&trie->sym, symp, sizeof *symp); + return true; +} + +/* Find out the length of the serialized version of a trie in bytes. */ + +static unsigned int +mmo_internal_3_length (abfd, trie) + bfd *abfd; + struct mmo_symbol_trie *trie; +{ + /* First, one for the control byte. */ + unsigned int length = 1; + + if (trie == NULL) + return 0; + + /* Add in the recursion to the left. */ + length += mmo_internal_3_length (abfd, trie->left); + + /* Add in the middle trie and the character. */ + length += 1 + mmo_internal_3_length (abfd, trie->middle); + + /* Add in the recursion to the right. */ + length += mmo_internal_3_length (abfd, trie->right); + + /* Add in bytes for the symbol (if this is an endnode). */ + if (trie->sym.name != NULL) + { + unsigned int serno = trie->sym.serno; + + /* First what it takes to encode the value. */ + if (trie->sym.sym_type == mmo_reg_sym) + length++; + else if (trie->sym.sym_type == mmo_undef_sym) + length += 2; + else + { + bfd_vma value = trie->sym.value; + + /* Coded in one to eight following bytes. */ + if (trie->sym.sym_type == mmo_data_sym) + value -= (bfd_vma) 0x20 << 56; + + do + { + value >>= 8; + length++; + } + while (value != 0); + } + + /* Find out what it takes to encode the serial number. */ + do + { + serno >>= 7; + length++; + } + while (serno != 0); + } + + return length; +} + +/* Helper function for outputting the serial number of a symbol, output as + a variant of leb128 (see dwarf2 documentation) which could be called + beb128. Using a helper function and recursion simplifies debugging. */ + +static void +mmo_beb128_out (abfd, serno, marker) + bfd *abfd; + int serno; + int marker; +{ + if (serno & ~0x7f) + mmo_beb128_out (abfd, serno >> 7, 0); + mmo_write_byte (abfd, marker | (serno & 0x7f)); +} + +/* Serialize a trie. */ + +static void +mmo_internal_3_dump (abfd, trie) + bfd *abfd; + struct mmo_symbol_trie *trie; +{ + bfd_byte control = 0; + + if (trie == NULL) + return; + + if (trie->left) + control |= MMO3_LEFT; + + if (trie->middle) + control |= MMO3_MIDDLE; + + if (trie->right) + control |= MMO3_RIGHT; + + if (trie->sym.name != NULL) + { + /* Encode the symbol type and length of value bytes. */ + if (trie->sym.sym_type == mmo_reg_sym) + control |= MMO3_REGQUAL_BITS; + else if (trie->sym.sym_type == mmo_undef_sym) + control |= MMO3_UNDEF; + else + { + bfd_vma value = trie->sym.value; + + /* Coded in 1..8 following bytes. */ + if (trie->sym.sym_type == mmo_data_sym) + { + control |= MMO3_DATA; + value -= (bfd_vma) 0x20 << 56; + } + + do + { + value >>= 8; + control++; + } + while (value != 0); + } + } + + /* The control byte is output before recursing. */ + mmo_write_byte (abfd, control); + + mmo_internal_3_dump (abfd, trie->left); + + if (control & MMO3_SYMBITS) + { + mmo_write_byte (abfd, trie->symchar); + + if (trie->sym.name != NULL) + { + if (trie->sym.sym_type == mmo_reg_sym) + mmo_write_byte (abfd, trie->sym.value); + else if (trie->sym.sym_type == mmo_undef_sym) + { + mmo_write_byte (abfd, 0); + mmo_write_byte (abfd, 0); + } + else + { + bfd_vma value = trie->sym.value; + + bfd_byte byte_n = control & 15; + + /* Coded in 1..8 following bytes. Note that the value is + shifted out big-endian. */ + if (trie->sym.sym_type == mmo_data_sym) + { + value -= (bfd_vma) 0x20 << 56; + byte_n -= 8; + } + + do + { + mmo_write_byte (abfd, (value >> ((byte_n - 1) * 8)) & 0xff); + byte_n--; + } + while (byte_n != 0); + } + + mmo_beb128_out (abfd, trie->sym.serno, 128); + } + mmo_internal_3_dump (abfd, trie->middle); + } + mmo_internal_3_dump (abfd, trie->right); +} + +/* Write symbols, either in mmo format or hidden in a lop_spec 80 section. + Write the lop_end terminator also. */ + +static boolean +mmo_write_symbols_and_terminator (abfd) + bfd *abfd; +{ + int count = bfd_get_symcount (abfd); + asymbol *fakemain[2]; + asymbol **table; + int serno = 2; + struct mmo_symbol_trie root; + int trie_len; + int i; + bfd_byte buf[4]; + + /* Create a symbol for "Main". */ + asymbol *mainsym = bfd_make_empty_symbol (abfd); + + mainsym->flags = BSF_GLOBAL; + mainsym->value = bfd_get_start_address (abfd); + mainsym->name = MMIX_START_SYMBOL_NAME; + mainsym->section = bfd_abs_section_ptr; + fakemain[0] = mainsym; + fakemain[1] = NULL; + + memset (&root, 0, sizeof (root)); + + /* Make all symbols take a left turn. */ + root.symchar = 0xff; + + /* There must always be a ":Main", so we'll add one + if there are no symbols. */ + if (count == 0) + { + table = fakemain; + count = 1; + } + else + table = bfd_get_outsymbols (abfd); + + for (i = 0; i < count && table[i] != NULL; i++) + { + asymbol *s = table[i]; + + /* It's not enough to consult bfd_is_local_label, since it does not + mean "local" in the sense of linkable-and-observable-after-link. + Let's just check the BSF_GLOBAL flag. + + Also, don't export symbols with characters not in the allowed set. */ + if ((s->flags & (BSF_DEBUGGING|BSF_GLOBAL)) == BSF_GLOBAL + && strspn (s->name, + valid_mmo_symbol_character_set) == strlen (s->name)) + { + struct mmo_symbol sym; + memset (&sym, 0, sizeof (sym)); + + sym.name = s->name; + sym.value = + s->value + + s->section->output_section->vma + + s->section->output_offset; + + if (bfd_is_und_section (s->section)) + sym.sym_type = mmo_undef_sym; + else if (strcmp (s->section->name, MMO_DATA_SECTION_NAME) == 0 + /* The encoding of data symbols require that the "rest" + of the value fits in 6 bytes, so the upper two bytes + must be 0x2000. All other symbols get to be the + absolute type. */ + && (sym.value >> 48) == 0x2000) + sym.sym_type = mmo_data_sym; + else if (strcmp (s->section->name, MMIX_REG_SECTION_NAME) == 0) + sym.sym_type = mmo_reg_sym; + else if (strcmp (s->section->name, + MMIX_REG_CONTENTS_SECTION_NAME) == 0) + { + sym.sym_type = mmo_reg_sym; + sym.value /= 8; + } + else + sym.sym_type = mmo_abs_sym; + + /* FIXME: We assume the order of the received symbols is an + ordered mapping of the serial numbers. This is not + necessarily true if we e.g. objcopy a mmo file to another and + there are gaps in the numbering. Note sure if this can + happen. Not sure what to do. */ + /* Make sure Main has serial number 1; others start at 2. */ + if (strcmp (s->name, MMIX_START_SYMBOL_NAME) == 0) + { + sym.serno = 1; + + /* Check that the value assigned to :Main is the same as the + entry address. The default linker script asserts this. + This is as good a place as any to check this consistency. */ + if (sym.value != bfd_get_start_address (abfd)) + { + /* Arbitrary buffer to hold the printable representation + of a vma. */ + char vmas_main[40]; + char vmas_start[40]; + bfd_vma vma_start = bfd_get_start_address (abfd); + + sprintf_vma (vmas_main, s->value); + sprintf_vma (vmas_start, vma_start); + + (*_bfd_error_handler) + (_("%s: Bad symbol definition: `Main' set to %s rather\ + than the start address %s\n"), + bfd_get_filename (abfd), vmas_main, vmas_start); + bfd_set_error (bfd_error_bad_value); + return false; + } + } + else + sym.serno = serno++; + + if (! mmo_internal_add_3_sym (abfd, &root, &sym)) + return false; + } + } + + /* Change the root node to be a ":"-prefix. */ + root.symchar = ':'; + root.middle = root.left; + root.right = NULL; + root.left = NULL; + + /* We have to find out if we can fit the whole symbol table in the mmo + symtab. It would be bad to assume we can always fit it in 262144 + bytes. If we can't, just leave the Main symbol. */ + trie_len = (mmo_internal_3_length (abfd, &root) + 3)/4; + + if (trie_len > 0xffff) + { + /* Test this code by using a lower limit in the test above and check + that the single "Main" symbol is emitted and handled properly. + There's no specific test-case. */ + struct mmo_symbol sym; + + (*_bfd_error_handler) + (_("%s: warning: symbol table too large for mmo, larger than 65535\ + 32-bit words: %d. Only `Main' will be emitted.\n"), + bfd_get_filename (abfd), trie_len); + + memset (&sym, 0, sizeof (sym)); + sym.sym_type = mmo_abs_sym; + sym.name = MMIX_START_SYMBOL_NAME; + sym.serno = 1; + sym.value = bfd_get_start_address (abfd); + + /* Then patch up a symbol table to be just the ":Main" symbol. */ + memset (&root, 0, sizeof (root)); + root.left = root.middle; + root.symchar = 0xff; + root.middle = NULL; + root.right = NULL; + + if (! mmo_internal_add_3_sym (abfd, &root, &sym)) + return false; + + root.symchar = ':'; + root.middle = root.left; + root.right = NULL; + root.left = NULL; + + trie_len = (mmo_internal_3_length (abfd, &root) + 3)/4; + } + + /* Reset the written-bytes counter. */ + abfd->tdata.mmo_data->byte_no = 0; + + /* Put out the lop_stab mark. */ + bfd_put_32 (abfd, (LOP << 24) | (LOP_STAB << 16), buf); + if (bfd_bwrite (buf, 4, abfd) != 4) + return false; + + /* Dump out symbols. */ + mmo_internal_3_dump (abfd, &root); + + if (trie_len != (abfd->tdata.mmo_data->byte_no + 3)/4) + { + /* I haven't seen this trig. It seems no use claiming this case + isn't debugged and abort if we get here. Instead emit a + diagnostic and fail "normally". */ + (*_bfd_error_handler) + (_("%s: internal error, symbol table changed size from %d to %d\ + words\n"), + bfd_get_filename (abfd), trie_len, + (abfd->tdata.mmo_data->byte_no + 3)/4); + bfd_set_error (bfd_error_bad_value); + return false; + } + + /* Dump out remaining bytes in the buffer and handle I/O errors by + propagating errors. */ + if ((abfd->tdata.mmo_data->byte_no % 4) != 0 + || abfd->tdata.mmo_data->have_error) + { + memset (abfd->tdata.mmo_data->buf + (abfd->tdata.mmo_data->byte_no % 4), + 0, 4 - (abfd->tdata.mmo_data->byte_no % 4)); + + if (abfd->tdata.mmo_data->have_error + || bfd_bwrite (abfd->tdata.mmo_data->buf, 4, abfd) != 4) + return false; + } + + bfd_put_32 (abfd, (LOP << 24) | (LOP_END << 16) | trie_len, buf); + return bfd_bwrite (buf, 4, abfd) == 4; +} + +/* Write section unless it is the register contents section. For that, we + instead store the section in the supplied pointer. This function is + used through bfd_map_over_sections. */ + +static void +mmo_write_section_unless_reg_contents (abfd, sec, p) + bfd *abfd; + asection *sec; + PTR p; +{ + struct mmo_write_sec_info *infop = (struct mmo_write_sec_info *) p; + + if (infop->retval == false) + return; + + if (strcmp (sec->name, MMIX_REG_CONTENTS_SECTION_NAME) == 0) + { + infop->reg_section = sec; + return; + } + + /* Exclude the convenience register section. */ + if (strcmp (sec->name, MMIX_REG_SECTION_NAME) == 0) + { + if (bfd_get_section_flags (abfd, sec) & SEC_HAS_CONTENTS) + { + /* Make sure it hasn't got contents. It seems impossible to + make it carry contents, so we don't have a test-case for + this. */ + (*_bfd_error_handler) + (_("%s: internal error, internal register section %s had\ + contents\n"), + bfd_get_filename (abfd), sec->name); + bfd_set_error (bfd_error_bad_value); + infop->retval = false; + return; + } + + return; + } + + infop->retval = mmo_internal_write_section (abfd, sec); +} + +/* Do the actual output of a file. Assumes mmo_set_section_contents is + already called. */ + +static boolean +mmo_write_object_contents (abfd) + bfd *abfd; +{ + struct mmo_write_sec_info wsecinfo; + + /* First, there are a few words of preamble. */ + if (! mmo_internal_write_header (abfd)) + return false; + + wsecinfo.reg_section = NULL; + wsecinfo.retval = true; + + bfd_map_over_sections (abfd, mmo_write_section_unless_reg_contents, + (PTR) &wsecinfo); + + if (wsecinfo.retval == false) + return false; + + if (wsecinfo.reg_section != NULL) + { + asection *sec = wsecinfo.reg_section; + unsigned int z = (unsigned int) (sec->vma / 8); + + /* Registers 0..31 must not be global. Do sanity check on the "vma" + of the register contents section and check that it corresponds to + the length of the section. */ + if (z < 32 || z >= 255 || (sec->vma & 7) != 0 + || sec->vma != 256 * 8 - sec->_raw_size - 8) + { + bfd_set_error (bfd_error_bad_value); + + if (sec->_raw_size == 0) + /* There must always be at least one such register. */ + (*_bfd_error_handler) + (_("%s: no initialized registers; section length 0\n"), + bfd_get_filename (abfd)); + else if (sec->vma > (256 - 32) * 8) + /* Provide better error message for the case of too many + global registers. */ + (*_bfd_error_handler) + (_("%s: too many initialized registers; section length %ld\n"), + bfd_get_filename (abfd), + (long) sec->_raw_size); + else + (*_bfd_error_handler) + (_("%s: invalid start address for initialized registers of\ + length %ld: 0x%lx%08lx\n"), + bfd_get_filename (abfd), + (long) sec->_raw_size, + (unsigned long) (sec->vma >> 32), (unsigned long) (sec->vma)); + + return false; + } + + if (! mmo_internal_write_post (abfd, z, sec)) + return false; + } + else + if (! mmo_internal_write_post (abfd, 255, NULL)) + return false; + + return mmo_write_symbols_and_terminator (abfd); +} + +/* Return the size of a NULL pointer, so we support linking in an mmo + object. */ + +static long +mmo_get_reloc_upper_bound (abfd, sec) + bfd *abfd ATTRIBUTE_UNUSED; + asection *sec ATTRIBUTE_UNUSED; +{ + return sizeof (PTR); +} + +/* Similarly canonicalize relocs to empty, filling in the terminating NULL + pointer. */ + +long +mmo_canonicalize_reloc (abfd, section, relptr, symbols) + bfd *abfd ATTRIBUTE_UNUSED; + sec_ptr section ATTRIBUTE_UNUSED; + arelent **relptr; + asymbol **symbols ATTRIBUTE_UNUSED; +{ + *relptr = NULL; + return 0; +} + +/* If there's anything in particular in a mmo bfd that we want to free, + make this a real function. Only do this if you see major memory + thrashing; zealous free:ing will cause unwanted behavior, especially if + you "free" memory allocated with "bfd_alloc", or even "bfd_release" a + block allocated with "bfd_alloc"; they're really allocated from an + obstack, and we don't know what was allocated there since this + particular allocation. */ + +#define mmo_close_and_cleanup _bfd_generic_close_and_cleanup +#define mmo_bfd_free_cached_info _bfd_generic_bfd_free_cached_info + +/* Perhaps we need to adjust this one; mmo labels (originally) without a + leading ':' might more appropriately be called local. */ +#define mmo_bfd_is_local_label_name bfd_generic_is_local_label_name + +/* Is this one really used or defined by anyone? */ +#define mmo_get_lineno _bfd_nosymbols_get_lineno + +/* FIXME: We can do better on this one, if we have a dwarf2 .debug_line + section or if MMO line numbers are implemented. */ +#define mmo_find_nearest_line _bfd_nosymbols_find_nearest_line +#define mmo_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol +#define mmo_read_minisymbols _bfd_generic_read_minisymbols +#define mmo_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol + +#define mmo_get_section_contents_in_window \ + _bfd_generic_get_section_contents_in_window +#define mmo_bfd_get_relocated_section_contents \ + bfd_generic_get_relocated_section_contents +#define mmo_bfd_gc_sections bfd_generic_gc_sections +#define mmo_bfd_link_hash_table_create _bfd_generic_link_hash_table_create +#define mmo_bfd_link_add_symbols _bfd_generic_link_add_symbols +#define mmo_bfd_final_link _bfd_generic_final_link +#define mmo_bfd_link_split_section _bfd_generic_link_split_section + +/* Strictly speaking, only MMIX uses this restricted format, but let's not + stop anybody from shooting themselves in the foot. */ +#define mmo_set_arch_mach bfd_default_set_arch_mach +#define mmo_bfd_relax_section bfd_generic_relax_section +#define mmo_bfd_merge_sections bfd_generic_merge_sections + +/* objcopy will be upset if we return -1 from bfd_get_reloc_upper_bound by + using BFD_JUMP_TABLE_RELOCS (_bfd_norelocs) rather than 0. FIXME: Most + likely a bug in the _bfd_norelocs definition. + + On the other hand, we smuggle in an mmo object (because setting up ELF + is too cumbersome) when linking (from other formats, presumably ELF) to + represent the g255 entry. We need to link that object, so need to say + it has no relocs. Upper bound for the size of the relocation table is + the size of a NULL pointer, and we support "canonicalization" for that + pointer. */ +#define mmo_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup + +/* We want to copy time of creation, otherwise we'd use + BFD_JUMP_TABLE_COPY (_bfd_generic). */ +#define mmo_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data +#define mmo_bfd_copy_private_section_data _bfd_generic_bfd_copy_private_section_data +#define mmo_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data +#define mmo_bfd_set_private_flags _bfd_generic_bfd_set_private_flags +#define mmo_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data + +CONST bfd_target bfd_mmo_vec = +{ + "mmo", /* name */ + bfd_target_mmo_flavour, + BFD_ENDIAN_BIG, /* target byte order */ + BFD_ENDIAN_BIG, /* target headers byte order */ + + /* FIXME: Might need adjustments. */ + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT), + + /* FIXME: Might need adjustments. */ + (SEC_CODE | SEC_DATA | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD + | SEC_READONLY | SEC_EXCLUDE | SEC_DEBUGGING | SEC_IN_MEMORY), + /* section flags */ + 0, /* leading underscore */ + ' ', /* ar_pad_char */ + 16, /* ar_max_namelen */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ + + { + _bfd_dummy_target, + mmo_object_p, /* bfd_check_format */ + _bfd_dummy_target, + _bfd_dummy_target, + }, + { + bfd_false, + mmo_mkobject, + bfd_false, + bfd_false, + }, + { /* bfd_write_contents */ + bfd_false, + mmo_write_object_contents, + bfd_false, + bfd_false, + }, + + BFD_JUMP_TABLE_GENERIC (mmo), + BFD_JUMP_TABLE_COPY (mmo), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (mmo), + /* We have to provide a valid method for getting relocs, returning zero, + so we can't say BFD_JUMP_TABLE_RELOCS (_bfd_norelocs). */ + BFD_JUMP_TABLE_RELOCS (mmo), + BFD_JUMP_TABLE_WRITE (mmo), + BFD_JUMP_TABLE_LINK (mmo), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + NULL, + + NULL +}; diff --git a/bfd/po/SRC-POTFILES.in b/bfd/po/SRC-POTFILES.in index bf1269f..2daa43e 100644 --- a/bfd/po/SRC-POTFILES.in +++ b/bfd/po/SRC-POTFILES.in @@ -1,15 +1,15 @@ aix386-core.c +aout0.c +aout32.c +aout64.c aout-adobe.c aout-arm.c aout-cris.c +aoutf1.h aout-ns32k.c aout-sparcle.c aout-target.h aout-tic30.c -aout0.c -aout32.c -aout64.c -aoutf1.h aoutx.h archive.c archures.c @@ -22,17 +22,21 @@ cf-i386lynx.c cf-m68klynx.c cf-sparclynx.c cisco-core.c +coff64-rs6000.c coff-a29k.c coff-alpha.c coff-apollo.c coff-arm.c coff-aux.c +coffcode.h +coffgen.c coff-go32.c coff-h8300.c coff-h8500.c coff-i386.c coff-i860.c coff-i960.c +cofflink.c coff-m68k.c coff-m88k.c coff-mips.c @@ -41,6 +45,7 @@ coff-sh.c coff-sparc.c coff-stgo32.c coff-svm68k.c +coffswap.h coff-tic30.c coff-tic54x.c coff-tic80.c @@ -48,11 +53,6 @@ coff-u68k.c coff-w65.c coff-we32k.c coff-z8k.c -coff64-rs6000.c -coffcode.h -coffgen.c -cofflink.c -coffswap.h corefile.c cpu-a29k.c cpu-alpha.c @@ -105,14 +105,10 @@ ecofflink.c ecoffswap.h efi-app-ia32.c efi-app-ia64.c -elf-bfd.h -elf-hppa.h -elf-m10200.c -elf-m10300.c -elf.c elf32-arc.c elf32-arm.h elf32-avr.c +elf32.c elf32-cris.c elf32-d10v.c elf32-d30v.c @@ -136,12 +132,12 @@ elf32-openrisc.c elf32-pj.c elf32-ppc.c elf32-s390.c -elf32-sh-lin.c elf32-sh.c +elf32-sh-lin.c elf32-sparc.c elf32-v850.c -elf32.c elf64-alpha.c +elf64.c elf64-gen.c elf64-hppa.c elf64-hppa.h @@ -150,13 +146,17 @@ elf64-ppc.c elf64-s390.c elf64-sparc.c elf64-x86-64.c -elf64.c elfarm-nabi.c elfarm-oabi.c +elf-bfd.h +elf.c elfcode.h elfcore.h +elf-hppa.h elflink.c elflink.h +elf-m10200.c +elf-m10300.c epoc-pe-arm.c epoc-pei-arm.c format.c @@ -203,16 +203,16 @@ merge.c mipsbsd.c netbsd.h newsos3.c -nlm-target.h -nlm.c nlm32-alpha.c +nlm32.c nlm32-i386.c nlm32-ppc.c nlm32-sparc.c -nlm32.c nlm64.c +nlm.c nlmcode.h nlmswap.h +nlm-target.h ns32k.h ns32knetbsd.c oasys.c @@ -222,20 +222,20 @@ pc532-mach.c pdp11.c pe-arm.c pe-i386.c -pe-mcore.c -pe-mips.c -pe-ppc.c -pe-sh.c pei-arm.c +peicode.h pei-i386.c pei-mcore.c pei-mips.c pei-ppc.c pei-sh.c -peicode.h +pe-mcore.c +pe-mips.c +pe-ppc.c +pe-sh.c ppcboot.c -reloc.c reloc16.c +reloc.c riscix.c sco5-core.c section.c @@ -245,8 +245,8 @@ sparclinux.c sparclynx.c sparcnetbsd.c srec.c -stab-syms.c stabs.c +stab-syms.c sunos.c syms.c targets.c @@ -255,11 +255,11 @@ trad-core.c vaxnetbsd.c versados.c version.h +vms.c vms-gsd.c +vms.h vms-hdr.c vms-misc.c vms-tir.c -vms.c -vms.h -xcoff-target.h xcofflink.c +xcoff-target.h diff --git a/bfd/po/bfd.pot b/bfd/po/bfd.pot index d16e3a4..6e93a7e 100644 --- a/bfd/po/bfd.pot +++ b/bfd/po/bfd.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2001-06-13 12:48+0100\n" +"POT-Creation-Date: 2001-10-12 22:46+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -14,151 +14,155 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" -#: aout-adobe.c:189 +#: aout-adobe.c:196 #, c-format msgid "%s: Unknown section type in a.out.adobe file: %x\n" msgstr "" -#: aout-cris.c:207 +#: aout-cris.c:208 #, c-format msgid "%s: Invalid relocation type exported: %d" msgstr "" -#: aout-cris.c:251 +#: aout-cris.c:252 #, c-format msgid "%s: Invalid relocation type imported: %d" msgstr "" -#: aout-cris.c:262 +#: aout-cris.c:263 #, c-format msgid "%s: Bad relocation record imported: %d" msgstr "" -#: aoutx.h:1265 aoutx.h:1679 +#: aoutx.h:1282 aoutx.h:1699 #, c-format msgid "%s: can not represent section `%s' in a.out object file format" msgstr "" -#: aoutx.h:1649 +#: aoutx.h:1669 #, c-format msgid "" "%s: can not represent section for symbol `%s' in a.out object file format" msgstr "" -#: aoutx.h:1651 +#: aoutx.h:1671 msgid "*unknown*" msgstr "" -#: aoutx.h:3688 +#: aoutx.h:3735 #, c-format msgid "%s: relocateable link from %s to %s not supported" msgstr "" -#: archive.c:1821 +#: archive.c:1839 msgid "Warning: writing archive was slow: rewriting timestamp\n" msgstr "" -#: archive.c:2087 +#: archive.c:2106 msgid "Reading archive file mod timestamp" msgstr "" #. FIXME: bfd can't call perror. -#: archive.c:2114 +#: archive.c:2133 msgid "Writing updated armap timestamp" msgstr "" -#: bfd.c:273 +#: bfd.c:274 msgid "No error" msgstr "" -#: bfd.c:274 +#: bfd.c:275 msgid "System call error" msgstr "" -#: bfd.c:275 +#: bfd.c:276 msgid "Invalid bfd target" msgstr "" -#: bfd.c:276 +#: bfd.c:277 msgid "File in wrong format" msgstr "" -#: bfd.c:277 +#: bfd.c:278 +msgid "Archive object file in wrong format" +msgstr "" + +#: bfd.c:279 msgid "Invalid operation" msgstr "" -#: bfd.c:278 +#: bfd.c:280 msgid "Memory exhausted" msgstr "" -#: bfd.c:279 +#: bfd.c:281 msgid "No symbols" msgstr "" -#: bfd.c:280 +#: bfd.c:282 msgid "Archive has no index; run ranlib to add one" msgstr "" -#: bfd.c:281 +#: bfd.c:283 msgid "No more archived files" msgstr "" -#: bfd.c:282 +#: bfd.c:284 msgid "Malformed archive" msgstr "" -#: bfd.c:283 +#: bfd.c:285 msgid "File format not recognized" msgstr "" -#: bfd.c:284 +#: bfd.c:286 msgid "File format is ambiguous" msgstr "" -#: bfd.c:285 +#: bfd.c:287 msgid "Section has no contents" msgstr "" -#: bfd.c:286 +#: bfd.c:288 msgid "Nonrepresentable section on output" msgstr "" -#: bfd.c:287 +#: bfd.c:289 msgid "Symbol needs debug section which does not exist" msgstr "" -#: bfd.c:288 +#: bfd.c:290 msgid "Bad value" msgstr "" -#: bfd.c:289 +#: bfd.c:291 msgid "File truncated" msgstr "" -#: bfd.c:290 +#: bfd.c:292 msgid "File too big" msgstr "" -#: bfd.c:291 +#: bfd.c:293 msgid "#<Invalid error code>" msgstr "" -#: bfd.c:675 +#: bfd.c:700 #, c-format -msgid "bfd assertion fail %s:%d" +msgid "BFD %s assertion fail %s:%d" msgstr "" -#: bfd.c:693 +#: bfd.c:719 #, c-format -msgid "BFD internal error, aborting at %s line %d in %s\n" +msgid "BFD %s internal error, aborting at %s line %d in %s\n" msgstr "" -#: bfd.c:697 +#: bfd.c:723 #, c-format -msgid "BFD internal error, aborting at %s line %d\n" +msgid "BFD %sinternal error, aborting at %s line %d\n" msgstr "" -#: bfd.c:699 +#: bfd.c:725 msgid "Please report this bug.\n" msgstr "" @@ -167,38 +171,38 @@ msgstr "" msgid "Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx." msgstr "" -#: coff-rs6000.c:2517 coff64-rs6000.c:1074 +#: coff-rs6000.c:2578 coff64-rs6000.c:1161 #, c-format msgid "%s: unsupported relocation type 0x%02x" msgstr "" -#: coff-rs6000.c:2563 coff64-rs6000.c:1120 +#: coff-rs6000.c:2624 coff64-rs6000.c:1207 #, c-format msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry" msgstr "" -#: coff-rs6000.c:2809 coff64-rs6000.c:1955 +#: coff-rs6000.c:2874 coff64-rs6000.c:2057 #, c-format msgid "%s: symbol `%s' has unrecognized smclas %d" msgstr "" -#: coff-a29k.c:123 +#: coff-a29k.c:119 msgid "Missing IHCONST" msgstr "" -#: coff-a29k.c:183 +#: coff-a29k.c:180 msgid "Missing IHIHALF" msgstr "" -#: coff-a29k.c:215 +#: coff-a29k.c:212 msgid "Unrecognized reloc" msgstr "" -#: coff-a29k.c:427 +#: coff-a29k.c:408 msgid "missing IHCONST reloc" msgstr "" -#: coff-a29k.c:518 +#: coff-a29k.c:498 msgid "missing IHIHALF reloc" msgstr "" @@ -206,137 +210,137 @@ msgstr "" msgid "GP relative relocation used when GP not defined" msgstr "" -#: coff-alpha.c:1487 elf64-alpha.c:4045 +#: coff-alpha.c:1485 msgid "using multiple gp values" msgstr "" -#: coff-alpha.c:1993 coff-mips.c:1434 +#: coff-alpha.c:1989 coff-mips.c:1433 msgid "GP relative relocation when GP not defined" msgstr "" -#: coff-arm.c:1019 elf32-arm.h:246 +#: coff-arm.c:1051 elf32-arm.h:285 #, c-format msgid "%s: unable to find THUMB glue '%s' for `%s'" msgstr "" -#: coff-arm.c:1048 elf32-arm.h:281 +#: coff-arm.c:1080 elf32-arm.h:320 #, c-format msgid "%s: unable to find ARM glue '%s' for `%s'" msgstr "" -#: coff-arm.c:1342 coff-arm.c:1437 elf32-arm.h:841 elf32-arm.h:946 +#: coff-arm.c:1375 coff-arm.c:1470 elf32-arm.h:886 elf32-arm.h:990 #, c-format msgid "%s(%s): warning: interworking not enabled." msgstr "" -#: coff-arm.c:1346 elf32-arm.h:949 +#: coff-arm.c:1379 elf32-arm.h:993 #, c-format msgid " first occurrence: %s: arm call to thumb" msgstr "" -#: coff-arm.c:1441 elf32-arm.h:844 +#: coff-arm.c:1474 elf32-arm.h:889 #, c-format msgid " first occurrence: %s: thumb call to arm" msgstr "" -#: coff-arm.c:1444 +#: coff-arm.c:1477 msgid " consider relinking with --support-old-code enabled" msgstr "" -#: coff-arm.c:1732 coff-tic80.c:682 cofflink.c:2992 +#: coff-arm.c:1767 coff-tic80.c:686 cofflink.c:3017 #, c-format msgid "%s: bad reloc address 0x%lx in section `%s'" msgstr "" -#: coff-arm.c:2069 +#: coff-arm.c:2107 #, c-format msgid "%s: illegal symbol index in reloc: %d" msgstr "" -#: coff-arm.c:2197 +#: coff-arm.c:2235 #, c-format msgid "%s: ERROR: compiled for APCS-%d whereas target %s uses APCS-%d" msgstr "" -#: coff-arm.c:2212 +#: coff-arm.c:2250 #, c-format msgid "" "%s: ERROR: passes floats in float registers whereas target %s uses integer " "registers" msgstr "" -#: coff-arm.c:2215 +#: coff-arm.c:2253 #, c-format msgid "" "%s: ERROR: passes floats in integer registers whereas target %s uses float " "registers" msgstr "" -#: coff-arm.c:2230 +#: coff-arm.c:2268 #, c-format msgid "" "%s: ERROR: compiled as position independent code, whereas target %s is " "absolute position" msgstr "" -#: coff-arm.c:2233 +#: coff-arm.c:2271 #, c-format msgid "" "%s: ERROR: compiled as absolute position code, whereas target %s is position " "independent" msgstr "" -#: coff-arm.c:2262 +#: coff-arm.c:2300 #, c-format msgid "Warning: input file %s supports interworking, whereas %s does not." msgstr "" -#: coff-arm.c:2265 +#: coff-arm.c:2303 #, c-format msgid "Warning: input file %s does not support interworking, whereas %s does." msgstr "" -#: coff-arm.c:2292 +#: coff-arm.c:2330 #, c-format msgid "private flags = %x:" msgstr "" -#: coff-arm.c:2300 elf32-arm.h:2234 +#: coff-arm.c:2338 elf32-arm.h:2293 msgid " [floats passed in float registers]" msgstr "" -#: coff-arm.c:2302 +#: coff-arm.c:2340 msgid " [floats passed in integer registers]" msgstr "" -#: coff-arm.c:2305 elf32-arm.h:2237 +#: coff-arm.c:2343 elf32-arm.h:2296 msgid " [position independent]" msgstr "" -#: coff-arm.c:2307 +#: coff-arm.c:2345 msgid " [absolute position]" msgstr "" -#: coff-arm.c:2311 +#: coff-arm.c:2349 msgid " [interworking flag not initialised]" msgstr "" -#: coff-arm.c:2313 +#: coff-arm.c:2351 msgid " [interworking supported]" msgstr "" -#: coff-arm.c:2315 +#: coff-arm.c:2353 msgid " [interworking not supported]" msgstr "" -#: coff-arm.c:2363 +#: coff-arm.c:2401 #, c-format msgid "" "Warning: Not setting interworking flag of %s, since it has already been " "specified as non-interworking" msgstr "" -#: coff-arm.c:2367 +#: coff-arm.c:2405 #, c-format msgid "Warning: Clearing the interworking flag of %s due to outside request" msgstr "" @@ -346,47 +350,47 @@ msgstr "" msgid "%s (%s): Section flag %s (0x%x) ignored" msgstr "" -#: coffcode.h:2180 +#: coffcode.h:2117 #, c-format msgid "Unrecognized TI COFF target id '0x%x'" msgstr "" -#: coffcode.h:4252 +#: coffcode.h:4199 #, c-format msgid "%s: warning: illegal symbol index %ld in line numbers" msgstr "" -#: coffcode.h:4266 +#: coffcode.h:4213 #, c-format msgid "%s: warning: duplicate line number information for `%s'" msgstr "" -#: coffcode.h:4626 +#: coffcode.h:4572 #, c-format msgid "%s: Unrecognized storage class %d for %s symbol `%s'" msgstr "" -#: coffcode.h:4757 +#: coffcode.h:4703 #, c-format msgid "warning: %s: local symbol `%s' has no section" msgstr "" -#: coff-tic54x.c:376 coffcode.h:4868 +#: coff-tic54x.c:390 coffcode.h:4810 #, c-format msgid "%s: warning: illegal symbol index %ld in relocs" msgstr "" -#: coffcode.h:4906 +#: coffcode.h:4848 #, c-format msgid "%s: illegal relocation type %d at address 0x%lx" msgstr "" -#: coffgen.c:1640 +#: coffgen.c:1648 #, c-format msgid "%s: bad string table size %lu" msgstr "" -#: coffgen.c:2110 +#: coffgen.c:2125 #, c-format msgid "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld" msgstr "" @@ -395,1118 +399,1127 @@ msgstr "" msgid "uncertain calling convention for non-COFF symbol" msgstr "" -#: cofflink.c:527 elflink.h:1651 +#: cofflink.c:536 elflink.h:1670 #, c-format msgid "Warning: type of symbol `%s' changed from %d to %d in %s" msgstr "" -#: cofflink.c:2290 +#: cofflink.c:2317 #, c-format msgid "%s: relocs in section `%s', but it has no contents" msgstr "" -#: cofflink.c:2629 coffswap.h:895 +#: cofflink.c:2653 coffswap.h:889 #, c-format msgid "%s: %s: reloc overflow: 0x%lx > 0xffff" msgstr "" -#: cofflink.c:2638 coffswap.h:881 +#: cofflink.c:2662 coffswap.h:876 #, c-format msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff" msgstr "" -#: coff-m68k.c:475 coff-mips.c:2432 elf32-m68k.c:2272 +#: coff-m68k.c:481 coff-mips.c:2431 elf32-m68k.c:2238 msgid "unsupported reloc type" msgstr "" -#: coff-mips.c:875 elf32-mips.c:1435 +#: coff-mips.c:875 elf32-mips.c:1448 msgid "GP relative relocation when _gp not defined" msgstr "" #. No other sections should appear in -membedded-pic #. code. -#: coff-mips.c:2469 +#: coff-mips.c:2468 msgid "reloc against unsupported section" msgstr "" -#: coff-mips.c:2477 +#: coff-mips.c:2476 msgid "reloc not properly aligned" msgstr "" -#: coff-tic54x.c:263 coff-tic80.c:445 +#: coff-tic54x.c:279 coff-tic80.c:449 #, c-format msgid "Unrecognized reloc type 0x%x" msgstr "" -#: coff-w65.c:369 +#: coff-w65.c:363 #, c-format msgid "ignoring reloc %s\n" msgstr "" -#: dwarf2.c:424 +#: dwarf2.c:475 msgid "Dwarf Error: Can't find .debug_abbrev section." msgstr "" -#: dwarf2.c:442 +#: dwarf2.c:492 #, c-format msgid "" "Dwarf Error: Abbrev offset (%u) greater than or equal to abbrev size (%u)." msgstr "" -#: dwarf2.c:625 +#: dwarf2.c:682 #, c-format msgid "Dwarf Error: Invalid or unhandled FORM value: %d." msgstr "" -#: dwarf2.c:698 +#: dwarf2.c:755 msgid "Dwarf Error: mangled line number section (bad file number)." msgstr "" -#: dwarf2.c:783 +#: dwarf2.c:841 msgid "Dwarf Error: Can't find .debug_line section." msgstr "" -#: dwarf2.c:807 +#: dwarf2.c:864 #, c-format msgid "Dwarf Error: Line offset (%u) greater than or equal to line size (%u)." msgstr "" -#: dwarf2.c:974 +#: dwarf2.c:1030 msgid "Dwarf Error: mangled line number section." msgstr "" -#: dwarf2.c:1153 dwarf2.c:1307 +#: dwarf2.c:1209 dwarf2.c:1426 #, c-format msgid "Dwarf Error: Could not find abbrev number %d." msgstr "" -#: dwarf2.c:1268 +#: dwarf2.c:1387 #, c-format msgid "" "Dwarf Error: found dwarf version '%hu', this reader only handles version 2 " "information." msgstr "" -#: dwarf2.c:1275 +#: dwarf2.c:1394 #, c-format msgid "" "Dwarf Error: found address size '%u', this reader can not handle sizes " "greater than '%u'." msgstr "" -#: dwarf2.c:1298 +#: dwarf2.c:1417 #, c-format msgid "Dwarf Error: Bad abbrev number: %d." msgstr "" -#: ecoff.c:1323 +#: ecoff.c:1328 #, c-format msgid "Unknown basic type %d" msgstr "" -#: ecoff.c:1592 +#: ecoff.c:1597 #, c-format msgid "" "\n" " End+1 symbol: %ld" msgstr "" -#: ecoff.c:1599 ecoff.c:1602 +#: ecoff.c:1604 ecoff.c:1607 #, c-format msgid "" "\n" " First symbol: %ld" msgstr "" -#: ecoff.c:1614 +#: ecoff.c:1619 #, c-format msgid "" "\n" " End+1 symbol: %-7ld Type: %s" msgstr "" -#: ecoff.c:1621 +#: ecoff.c:1626 #, c-format msgid "" "\n" " Local symbol: %ld" msgstr "" -#: ecoff.c:1629 +#: ecoff.c:1634 #, c-format msgid "" "\n" " struct; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1634 +#: ecoff.c:1639 #, c-format msgid "" "\n" " union; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1639 +#: ecoff.c:1644 #, c-format msgid "" "\n" " enum; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1645 +#: ecoff.c:1650 #, c-format msgid "" "\n" " Type: %s" msgstr "" -#: elf32-arm.h:1191 +#: elf32-arm.h:1234 #, c-format msgid "%s: Warning: Arm BLX instruction targets Arm function '%s'." msgstr "" -#: elf32-arm.h:1387 +#: elf32-arm.h:1430 #, c-format msgid "%s: Warning: Thumb BLX instruction targets thumb function '%s'." msgstr "" -#: elf-hppa.h:1369 elf-hppa.h:1402 elf32-arm.h:1877 elf32-ppc.c:3093 -#: elf32-s390.c:1442 elf32-sh.c:3107 elf64-s390.c:1431 elf64-x86-64.c:1296 +#: elf32-arm.h:1927 #, c-format msgid "" -"%s: warning: unresolvable relocation against symbol `%s' from %s section" +"%s: warning: unresolvable relocation %d against symbol `%s' from %s section" msgstr "" -#: elf-m10200.c:451 elf-m10300.c:663 elf32-arm.h:1951 elf32-avr.c:842 -#: elf32-cris.c:1335 elf32-d10v.c:478 elf32-fr30.c:648 elf32-i860.c:1049 -#: elf32-m32r.c:1266 elf32-openrisc.c:449 elf32-v850.c:1681 +#: elf-m10200.c:465 elf-m10300.c:681 elf32-arm.h:2003 elf32-avr.c:842 +#: elf32-cris.c:1333 elf32-d10v.c:490 elf32-fr30.c:655 elf32-h8300.c:549 +#: elf32-i860.c:1050 elf32-m32r.c:1276 elf32-openrisc.c:456 elf32-v850.c:1695 msgid "internal error: out of range error" msgstr "" -#: elf-m10200.c:455 elf-m10300.c:667 elf32-arm.h:1955 elf32-avr.c:846 -#: elf32-cris.c:1339 elf32-d10v.c:482 elf32-fr30.c:652 elf32-i860.c:1053 -#: elf32-m32r.c:1270 elf32-mips.c:7049 elf32-openrisc.c:453 elf32-v850.c:1685 +#: elf-m10200.c:469 elf-m10300.c:685 elf32-arm.h:2007 elf32-avr.c:846 +#: elf32-cris.c:1337 elf32-d10v.c:494 elf32-fr30.c:659 elf32-h8300.c:553 +#: elf32-i860.c:1054 elf32-m32r.c:1280 elf32-mips.c:7061 elf32-openrisc.c:460 +#: elf32-v850.c:1699 msgid "internal error: unsupported relocation error" msgstr "" -#: elf-m10200.c:459 elf-m10300.c:671 elf32-arm.h:1959 elf32-d10v.c:486 -#: elf32-m32r.c:1274 +#: elf-m10200.c:473 elf-m10300.c:689 elf32-arm.h:2011 elf32-d10v.c:498 +#: elf32-h8300.c:557 elf32-m32r.c:1284 msgid "internal error: dangerous error" msgstr "" -#: elf-m10200.c:463 elf-m10300.c:675 elf32-arm.h:1963 elf32-avr.c:854 -#: elf32-cris.c:1347 elf32-d10v.c:490 elf32-fr30.c:660 elf32-i860.c:1061 -#: elf32-m32r.c:1278 elf32-openrisc.c:461 elf32-v850.c:1705 +#: elf-m10200.c:477 elf-m10300.c:693 elf32-arm.h:2015 elf32-avr.c:854 +#: elf32-cris.c:1345 elf32-d10v.c:502 elf32-fr30.c:667 elf32-h8300.c:561 +#: elf32-i860.c:1062 elf32-m32r.c:1288 elf32-openrisc.c:468 elf32-v850.c:1719 msgid "internal error: unknown error" msgstr "" -#: elf32-arm.h:1991 +#: elf32-arm.h:2043 #, c-format msgid "" "Warning: Not setting interwork flag of %s since it has already been " "specified as non-interworking" msgstr "" -#: elf32-arm.h:1995 +#: elf32-arm.h:2047 #, c-format msgid "Warning: Clearing the interwork flag of %s due to outside request" msgstr "" -#: elf32-arm.h:2043 +#: elf32-arm.h:2095 #, c-format msgid "" "Warning: Clearing the interwork flag in %s because non-interworking code in " "%s has been linked with it" msgstr "" -#: elf32-arm.h:2137 +#: elf32-arm.h:2190 #, c-format msgid "" "Error: %s compiled for EABI version %d, whereas %s is compiled for version %d" msgstr "" -#: elf32-arm.h:2151 +#: elf32-arm.h:2204 #, c-format msgid "Error: %s compiled for APCS-%d, whereas %s is compiled for APCS-%d" msgstr "" -#: elf32-arm.h:2162 -#, c-format -msgid "" -"Error: %s passes floats in %s registers, whereas %s passes them in %s " -"registers" -msgstr "" - -#: elf32-arm.h:2165 elf32-arm.h:2167 +#: elf32-arm.h:2215 elf32-arm.h:2216 msgid "float" msgstr "" -#: elf32-arm.h:2165 elf32-arm.h:2167 +#: elf32-arm.h:2215 elf32-arm.h:2216 msgid "integer" msgstr "" -#: elf32-arm.h:2174 +#: elf32-arm.h:2218 #, c-format -msgid "Error: %s uses %s floating point, whereas %s uses %s floating point" +msgid "" +"Error: %s passes floats in %s registers, whereas %s passes them in %s " +"registers" msgstr "" -#: elf32-arm.h:2177 elf32-arm.h:2179 +#: elf32-arm.h:2228 elf32-arm.h:2229 msgid "soft" msgstr "" -#: elf32-arm.h:2177 elf32-arm.h:2179 +#: elf32-arm.h:2228 elf32-arm.h:2229 msgid "hard" msgstr "" -#: elf32-arm.h:2186 +#: elf32-arm.h:2231 #, c-format -msgid "Warning: %s %s interworking, whereas %s %s" +msgid "Error: %s uses %s floating point, whereas %s uses %s floating point" msgstr "" -#: elf32-arm.h:2189 +#: elf32-arm.h:2243 msgid "supports" msgstr "" -#: elf32-arm.h:2189 +#: elf32-arm.h:2243 msgid "does not support" msgstr "" -#: elf32-arm.h:2191 +#: elf32-arm.h:2244 msgid "does" msgstr "" -#: elf32-arm.h:2191 +#: elf32-arm.h:2244 msgid "does not" msgstr "" +#: elf32-arm.h:2246 +#, c-format +msgid "Warning: %s %s interworking, whereas %s %s" +msgstr "" + #. Ignore init flag - it may not be set, despite the flags field #. containing valid data. -#: elf32-arm.h:2217 elf32-cris.c:2968 elf32-m68k.c:430 elf32-mips.c:2721 +#: elf32-arm.h:2276 elf32-cris.c:2917 elf32-m68k.c:432 elf32-mips.c:2714 #, c-format msgid "private flags = %lx:" msgstr "" -#: elf32-arm.h:2226 +#: elf32-arm.h:2285 msgid " [interworking enabled]" msgstr "" -#: elf32-arm.h:2229 +#: elf32-arm.h:2288 msgid " [APCS-26]" msgstr "" -#: elf32-arm.h:2231 +#: elf32-arm.h:2290 msgid " [APCS-32]" msgstr "" -#: elf32-arm.h:2240 +#: elf32-arm.h:2299 msgid " [new ABI]" msgstr "" -#: elf32-arm.h:2243 +#: elf32-arm.h:2302 msgid " [old ABI]" msgstr "" -#: elf32-arm.h:2246 +#: elf32-arm.h:2305 msgid " [software FP]" msgstr "" -#: elf32-arm.h:2253 +#: elf32-arm.h:2312 msgid " [Version1 EABI]" msgstr "" -#: elf32-arm.h:2256 elf32-arm.h:2267 +#: elf32-arm.h:2315 elf32-arm.h:2326 msgid " [sorted symbol table]" msgstr "" -#: elf32-arm.h:2258 elf32-arm.h:2269 +#: elf32-arm.h:2317 elf32-arm.h:2328 msgid " [unsorted symbol table]" msgstr "" -#: elf32-arm.h:2264 +#: elf32-arm.h:2323 msgid " [Version2 EABI]" msgstr "" -#: elf32-arm.h:2272 +#: elf32-arm.h:2331 msgid " [dynamic symbols use segment index]" msgstr "" -#: elf32-arm.h:2275 +#: elf32-arm.h:2334 msgid " [mapping symbols precede others]" msgstr "" -#: elf32-arm.h:2282 +#: elf32-arm.h:2341 msgid " <EABI version unrecognised>" msgstr "" -#: elf32-arm.h:2289 +#: elf32-arm.h:2348 msgid " [relocatable executable]" msgstr "" -#: elf32-arm.h:2292 +#: elf32-arm.h:2351 msgid " [has entry point]" msgstr "" -#: elf32-arm.h:2297 +#: elf32-arm.h:2356 msgid "<Unrecognised flag bits set>" msgstr "" -#: elf32-avr.c:850 elf32-cris.c:1343 elf32-fr30.c:656 elf32-i860.c:1057 -#: elf32-openrisc.c:457 elf32-v850.c:1689 +#: elf32-avr.c:850 elf32-cris.c:1341 elf32-fr30.c:663 elf32-i860.c:1058 +#: elf32-openrisc.c:464 elf32-v850.c:1703 msgid "internal error: dangerous relocation" msgstr "" -#: elf32-cris.c:874 -#, c-format -msgid "%s(%s): unresolvable relocation %s against symbol `%s' from %s section" -msgstr "" - -#: elf32-cris.c:882 +#: elf32-cris.c:880 #, c-format msgid "%s: unresolvable relocation %s against symbol `%s' from %s section" msgstr "" -#: elf32-cris.c:945 +#: elf32-cris.c:943 #, c-format msgid "" "%s: No PLT nor GOT for relocation %s against symbol `%s' from %s section" msgstr "" -#: elf32-cris.c:948 elf32-cris.c:1075 +#: elf32-cris.c:946 elf32-cris.c:1073 msgid "[whose name is lost]" msgstr "" -#: elf32-cris.c:1064 +#: elf32-cris.c:1062 #, c-format msgid "" "%s: relocation %s with non-zero addend %d against local symbol from %s " "section" msgstr "" -#: elf32-cris.c:1071 +#: elf32-cris.c:1069 #, c-format msgid "" "%s: relocation %s with non-zero addend %d against symbol `%s' from %s section" msgstr "" -#: elf32-cris.c:1089 +#: elf32-cris.c:1087 #, c-format msgid "" "%s: relocation %s is not allowed for global symbol: `%s' from %s section" msgstr "" -#: elf32-cris.c:1207 +#: elf32-cris.c:1205 #, c-format msgid "%s: Internal inconsistency; no relocation section %s" msgstr "" -#: elf32-cris.c:2469 -#, c-format -msgid "" -"%s(%s), section %s:\n" -" relocation %s should not be used in a shared object; recompile with -fPIC" -msgstr "" - -#: elf32-cris.c:2476 +#: elf32-cris.c:2455 #, c-format msgid "" "%s, section %s:\n" " relocation %s should not be used in a shared object; recompile with -fPIC" msgstr "" -#: elf32-cris.c:2971 +#: elf32-cris.c:2920 msgid " [symbols have a _ prefix]" msgstr "" -#: elf32-cris.c:3010 +#: elf32-cris.c:2959 #, c-format msgid "%s: uses _-prefixed symbols, but writing file with non-prefixed symbols" msgstr "" -#: elf32-cris.c:3011 +#: elf32-cris.c:2960 #, c-format msgid "%s: uses non-prefixed symbols, but writing file with _-prefixed symbols" msgstr "" -#: elf32-gen.c:76 elf64-gen.c:76 -#, c-format -msgid "%s(%s): Relocations in generic ELF (EM: %d)" -msgstr "" - -#: elf32-gen.c:81 elf64-gen.c:81 +#: elf32-gen.c:82 elf64-gen.c:82 #, c-format msgid "%s: Relocations in generic ELF (EM: %d)" msgstr "" -#: elf32-hppa.c:633 +#: elf32-hppa.c:596 #, c-format msgid "%s(%s+0x%lx): cannot find stub entry %s" msgstr "" -#: elf32-hppa.c:694 +#: elf32-hppa.c:657 #, c-format msgid "%s: cannot create stub entry %s" msgstr "" -#: elf32-hppa.c:888 -#, c-format -msgid "%s(%s+0x%lx): cannot relocate %s, recompile with -ffunction-sections" -msgstr "" - -#: elf32-hppa.c:901 elf32-hppa.c:1615 -#, c-format -msgid "Could not find relocation section for %s" -msgstr "" - -#: elf32-hppa.c:1046 elf32-hppa.c:3510 +#: elf32-hppa.c:948 elf32-hppa.c:3436 #, c-format msgid "%s(%s+0x%lx): cannot reach %s, recompile with -ffunction-sections" msgstr "" -#: elf32-hppa.c:1386 +#: elf32-hppa.c:1295 #, c-format msgid "" "%s: relocation %s can not be used when making a shared object; recompile " "with -fPIC" msgstr "" -#: elf32-hppa.c:1406 +#: elf32-hppa.c:1315 #, c-format msgid "" "%s: relocation %s should not be used when making a shared object; recompile " "with -fPIC" msgstr "" -#: elf32-hppa.c:2811 +#: elf32-hppa.c:1505 +#, c-format +msgid "Could not find relocation section for %s" +msgstr "" + +#: elf32-hppa.c:2759 #, c-format msgid "%s: duplicate export stub %s" msgstr "" -#: elf32-hppa.c:3394 +#: elf32-hppa.c:3320 #, c-format msgid "%s(%s+0x%lx): fixing %s" msgstr "" -#: elf32-hppa.c:4032 +#: elf32-hppa.c:3955 #, c-format msgid "%s(%s+0x%lx): cannot handle %s for %s" msgstr "" -#: elf32-hppa.c:4355 +#: elf32-hppa.c:4295 msgid ".got section not immediately after .plt section" msgstr "" -#: elf32-i386.c:280 +#: elf32-i386.c:298 #, c-format msgid "%s: invalid relocation type %d" msgstr "" -#: elf32-i386.c:577 -#, c-format -msgid "%s(%s): bad symbol index: %d" -msgstr "" - -#: elf32-i386.c:582 +#: elf32-i386.c:688 #, c-format msgid "%s: bad symbol index: %d" msgstr "" -#: elf32-i386.c:735 elf32-i386.c:1759 -#, c-format -msgid "%s(%s): bad relocation section name `%s'" -msgstr "" - -#: elf32-i386.c:740 elf32-i386.c:1764 +#: elf32-i386.c:830 elf64-ppc.c:2035 #, c-format msgid "%s: bad relocation section name `%s'" msgstr "" -#: elf32-i386.c:1562 +#: elf32-i386.c:2004 elf64-ppc.c:3608 #, c-format msgid "%s(%s+0x%lx): unresolvable relocation against symbol `%s'" msgstr "" -#: elf32-m32r.c:917 +#: elf32-m32r.c:926 msgid "SDA relocation when _SDA_BASE_ not defined" msgstr "" -#: elf32-ia64.c:3416 elf32-m32r.c:1001 elf32-ppc.c:2960 elf64-ia64.c:3416 +#: elf32-ia64.c:3445 elf32-m32r.c:1010 elf32-ppc.c:2953 elf64-ia64.c:3445 #, c-format msgid "%s: unknown relocation type %d" msgstr "" -#: elf32-m32r.c:1209 +#: elf32-m32r.c:1219 #, c-format msgid "%s: The target (%s) of an %s relocation is in the wrong section (%s)" msgstr "" -#: elf32-m32r.c:2011 +#: elf32-m32r.c:2021 #, c-format msgid "%s: Instruction set mismatch with previous modules" msgstr "" -#: elf32-m32r.c:2034 +#: elf32-m32r.c:2044 #, c-format msgid "private flags = %lx" msgstr "" -#: elf32-m32r.c:2039 +#: elf32-m32r.c:2049 msgid ": m32r instructions" msgstr "" -#: elf32-m32r.c:2040 +#: elf32-m32r.c:2050 msgid ": m32rx instructions" msgstr "" -#: elf32-m68k.c:433 +#: elf32-m68k.c:435 msgid " [cpu32]" msgstr "" -#: elf32-mcore.c:364 elf32-mcore.c:490 +#: elf32-mcore.c:373 elf32-mcore.c:499 #, c-format msgid "%s: Relocation %s (%d) is not currently supported.\n" msgstr "" -#: elf32-mcore.c:449 +#: elf32-mcore.c:458 #, c-format msgid "%s: Unknown relocation type %d\n" msgstr "" -#: elf32-mips.c:1594 +#: elf32-mips.c:1607 msgid "32bits gp relative relocation occurs for an external symbol" msgstr "" -#: elf32-mips.c:1743 +#: elf32-mips.c:1756 #, c-format msgid "Linking mips16 objects into %s format is not supported" msgstr "" -#: elf32-mips.c:2608 +#: elf32-mips.c:2601 #, c-format msgid "%s: linking PIC files with non-PIC files" msgstr "" -#: elf32-mips.c:2618 +#: elf32-mips.c:2611 #, c-format msgid "%s: linking abicalls files with non-abicalls files" msgstr "" -#: elf32-mips.c:2647 +#: elf32-mips.c:2640 #, c-format msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)" msgstr "" -#: elf32-mips.c:2656 +#: elf32-mips.c:2649 #, c-format msgid "%s: ISA mismatch (%d) with previous modules (%d)" msgstr "" -#: elf32-mips.c:2679 +#: elf32-mips.c:2672 #, c-format msgid "%s: ABI mismatch: linking %s module with previous %s modules" msgstr "" -#: elf32-mips.c:2693 elf32-ppc.c:1478 elf64-sparc.c:2997 +#: elf32-mips.c:2686 elf32-ppc.c:1489 elf64-ppc.c:1541 elf64-sparc.c:3030 #, c-format msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" msgstr "" -#: elf32-mips.c:2724 +#: elf32-mips.c:2717 msgid " [abi=O32]" msgstr "" -#: elf32-mips.c:2726 +#: elf32-mips.c:2719 msgid " [abi=O64]" msgstr "" -#: elf32-mips.c:2728 +#: elf32-mips.c:2721 msgid " [abi=EABI32]" msgstr "" -#: elf32-mips.c:2730 +#: elf32-mips.c:2723 msgid " [abi=EABI64]" msgstr "" -#: elf32-mips.c:2732 +#: elf32-mips.c:2725 msgid " [abi unknown]" msgstr "" -#: elf32-mips.c:2734 +#: elf32-mips.c:2727 msgid " [abi=N32]" msgstr "" -#: elf32-mips.c:2736 +#: elf32-mips.c:2729 msgid " [abi=64]" msgstr "" -#: elf32-mips.c:2738 +#: elf32-mips.c:2731 msgid " [no abi set]" msgstr "" -#: elf32-mips.c:2741 +#: elf32-mips.c:2734 msgid " [mips1]" msgstr "" -#: elf32-mips.c:2743 +#: elf32-mips.c:2736 msgid " [mips2]" msgstr "" -#: elf32-mips.c:2745 +#: elf32-mips.c:2738 msgid " [mips3]" msgstr "" -#: elf32-mips.c:2747 +#: elf32-mips.c:2740 msgid " [mips4]" msgstr "" -#: elf32-mips.c:2749 +#: elf32-mips.c:2742 msgid " [mips5]" msgstr "" -#: elf32-mips.c:2751 +#: elf32-mips.c:2744 msgid " [mips32]" msgstr "" -#: elf32-mips.c:2753 +#: elf32-mips.c:2746 msgid " [mips64]" msgstr "" -#: elf32-mips.c:2755 +#: elf32-mips.c:2748 msgid " [unknown ISA]" msgstr "" -#: elf32-mips.c:2758 +#: elf32-mips.c:2751 msgid " [32bitmode]" msgstr "" -#: elf32-mips.c:2760 +#: elf32-mips.c:2753 msgid " [not 32bitmode]" msgstr "" -#: elf32-mips.c:4428 +#: elf32-mips.c:4429 msgid "static procedure (no name)" msgstr "" -#: elf32-mips.c:5045 elf64-alpha.c:4418 +#: elf32-mips.c:5047 #, c-format msgid "%s: illegal section name `%s'" msgstr "" -#: elf32-mips.c:5610 +#: elf32-mips.c:5614 msgid "not enough GOT space for local GOT entries" msgstr "" -#: elf32-mips.c:6726 +#: elf32-mips.c:6734 #, c-format msgid "%s: %s+0x%lx: jump to stub routine which is not jal" msgstr "" -#: elf32-mips.c:7715 +#: elf32-mips.c:7733 #, c-format -msgid "Malformed reloc detected for section %s" +msgid "%s: Malformed reloc detected for section %s" msgstr "" -#: elf32-mips.c:7792 +#: elf32-mips.c:7811 #, c-format msgid "%s: CALL16 reloc at 0x%lx not against global symbol" msgstr "" -#: elf32-ppc.c:1444 +#: elf32-ppc.c:1455 elf64-ppc.c:1506 #, c-format msgid "" "%s: compiled with -mrelocatable and linked with modules compiled normally" msgstr "" -#: elf32-ppc.c:1452 +#: elf32-ppc.c:1463 elf64-ppc.c:1514 #, c-format msgid "" "%s: compiled normally and linked with modules compiled with -mrelocatable" msgstr "" -#: elf32-ppc.c:1576 +#: elf32-ppc.c:1587 #, c-format msgid "%s: Unknown special linker type %d" msgstr "" -#: elf32-ppc.c:2242 elf32-ppc.c:2276 elf32-ppc.c:2311 +#: elf32-ppc.c:2235 elf32-ppc.c:2269 elf32-ppc.c:2304 #, c-format msgid "%s: relocation %s cannot be used when making a shared object" msgstr "" -#: elf32-ppc.c:3126 +#: elf-hppa.h:1369 elf-hppa.h:1402 elf32-ppc.c:3086 elf32-s390.c:1424 +#: elf32-sh.c:3134 elf64-s390.c:1411 elf64-x86-64.c:1281 +#, c-format +msgid "" +"%s: warning: unresolvable relocation against symbol `%s' from %s section" +msgstr "" + +#: elf32-ppc.c:3121 elf64-ppc.c:3198 #, c-format msgid "%s: unknown relocation type %d for symbol %s" msgstr "" -#: elf32-ppc.c:3490 elf32-ppc.c:3511 elf32-ppc.c:3561 +#: elf32-ppc.c:3485 elf32-ppc.c:3506 elf32-ppc.c:3556 #, c-format msgid "" "%s: The target (%s) of a %s relocation is in the wrong output section (%s)" msgstr "" -#: elf32-ppc.c:3627 +#: elf32-ppc.c:3622 #, c-format msgid "%s: Relocation %s is not yet supported for symbol %s." msgstr "" -#: elf32-sh.c:1085 +#: elf32-sh.c:1098 #, c-format msgid "%s: 0x%lx: warning: bad R_SH_USES offset" msgstr "" -#: elf32-sh.c:1097 +#: elf32-sh.c:1110 #, c-format msgid "%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x" msgstr "" -#: elf32-sh.c:1114 +#: elf32-sh.c:1127 #, c-format msgid "%s: 0x%lx: warning: bad R_SH_USES load offset" msgstr "" -#: elf32-sh.c:1129 +#: elf32-sh.c:1142 #, c-format msgid "%s: 0x%lx: warning: could not find expected reloc" msgstr "" -#: elf32-sh.c:1166 +#: elf32-sh.c:1178 #, c-format msgid "%s: 0x%lx: warning: symbol in unexpected section" msgstr "" -#: elf32-sh.c:1288 +#: elf32-sh.c:1300 #, c-format msgid "%s: 0x%lx: warning: could not find expected COUNT reloc" msgstr "" -#: elf32-sh.c:1297 +#: elf32-sh.c:1309 #, c-format msgid "%s: 0x%lx: warning: bad count" msgstr "" -#: elf32-sh.c:1690 elf32-sh.c:2077 +#: elf32-sh.c:1703 elf32-sh.c:2093 #, c-format msgid "%s: 0x%lx: fatal: reloc overflow while relaxing" msgstr "" -#: elf32-sh.c:3171 +#: elf32-sh.c:3200 #, c-format msgid "%s: 0x%lx: fatal: unaligned branch target for relax-support relocation" msgstr "" -#: elf32-sparc.c:1519 elf64-sparc.c:2263 +#: elf32-sparc.c:1537 elf64-sparc.c:2281 #, c-format msgid "%s: probably compiled without -fPIC?" msgstr "" -#: elf32-sparc.c:1976 +#: elf32-sparc.c:1990 #, c-format msgid "%s: compiled for a 64 bit system and target is 32 bit" msgstr "" -#: elf32-sparc.c:1990 +#: elf32-sparc.c:2004 #, c-format msgid "%s: linking little endian files with big endian files" msgstr "" -#: elf32-v850.c:675 +#: elf32-v850.c:684 #, c-format msgid "Variable `%s' cannot occupy in multiple small data regions" msgstr "" -#: elf32-v850.c:678 +#: elf32-v850.c:687 #, c-format msgid "" "Variable `%s' can only be in one of the small, zero, and tiny data regions" msgstr "" -#: elf32-v850.c:681 +#: elf32-v850.c:690 #, c-format msgid "" "Variable `%s' cannot be in both small and zero data regions simultaneously" msgstr "" -#: elf32-v850.c:684 +#: elf32-v850.c:693 #, c-format msgid "" "Variable `%s' cannot be in both small and tiny data regions simultaneously" msgstr "" -#: elf32-v850.c:687 +#: elf32-v850.c:696 #, c-format msgid "" "Variable `%s' cannot be in both zero and tiny data regions simultaneously" msgstr "" -#: elf32-v850.c:1064 +#: elf32-v850.c:1074 msgid "FAILED to find previous HI16 reloc\n" msgstr "" -#: elf32-v850.c:1693 +#: elf32-v850.c:1707 msgid "could not locate special linker symbol __gp" msgstr "" -#: elf32-v850.c:1697 +#: elf32-v850.c:1711 msgid "could not locate special linker symbol __ep" msgstr "" -#: elf32-v850.c:1701 +#: elf32-v850.c:1715 msgid "could not locate special linker symbol __ctbp" msgstr "" -#: elf32-v850.c:1890 +#: elf32-v850.c:1908 #, c-format msgid "%s: Architecture mismatch with previous modules" msgstr "" -#: elf32-v850.c:1909 +#: elf32-v850.c:1928 #, c-format msgid "private flags = %lx: " msgstr "" -#: elf32-v850.c:1914 +#: elf32-v850.c:1933 msgid "v850 architecture" msgstr "" -#: elf32-v850.c:1915 +#: elf32-v850.c:1934 msgid "v850e architecture" msgstr "" -#: elf32-v850.c:1916 +#: elf32-v850.c:1935 msgid "v850ea architecture" msgstr "" -#: elf64-alpha.c:986 +#: elf64-alpha.c:857 msgid "GPDISP relocation did not find ldah and lda instructions" msgstr "" -#: elf64-alpha.c:3055 +#: elf64-alpha.c:2909 #, c-format msgid "%s: .got subsegment exceeds 64K (size %d)" msgstr "" -#: elf64-hppa.c:2032 +#: elf64-alpha.c:3463 elf64-alpha.c:3475 +#, c-format +msgid "%s: gp-relative relocation against dynamic symbol %s" +msgstr "" + +#: elf64-hppa.c:2043 #, c-format msgid "stub entry for %s cannot load .plt, dp offset = %ld" msgstr "" -#: elf64-sparc.c:1249 +#: elf64-ppc.c:1469 libbfd.c:1436 +#, c-format +msgid "%s: compiled for a big endian system and target is little endian" +msgstr "" + +#: elf64-ppc.c:1471 libbfd.c:1438 +#, c-format +msgid "%s: compiled for a little endian system and target is big endian" +msgstr "" + +#: elf64-ppc.c:3545 +#, c-format +msgid "%s: Relocation %s is not supported for symbol %s." +msgstr "" + +#: elf64-ppc.c:3589 +#, c-format +msgid "%s: error: relocation %s not a multiple of 4" +msgstr "" + +#: elf64-ppc.c:3742 +#, c-format +msgid "linkage table overflow against `%s'" +msgstr "" + +#: elf64-sparc.c:1272 #, c-format msgid "%s: check_relocs: unhandled reloc type %d" msgstr "" -#: elf64-sparc.c:1286 +#: elf64-sparc.c:1309 msgid "%s: Only registers %%g[2367] can be declared using STT_REGISTER" msgstr "" -#: elf64-sparc.c:1306 -msgid "" -"Register %%g%d used incompatibly: previously declared in %s to %s, in %s " -"redefined to %s" +#: elf64-sparc.c:1329 +msgid "Register %%g%d used incompatibly: %s in %s" msgstr "" -#: elf64-sparc.c:1329 +#: elf64-sparc.c:1333 elf64-sparc.c:1357 elf64-sparc.c:1406 #, c-format -msgid "Symbol `%s' has differing types: previously %s, REGISTER in %s" +msgid " previously %s in %s" msgstr "" -#: elf64-sparc.c:1375 +#: elf64-sparc.c:1354 elf64-sparc.c:1403 #, c-format -msgid "Symbol `%s' has differing types: REGISTER in %s, %s in %s" +msgid "Symbol `%s' has differing types: %s in %s" msgstr "" -#: elf64-sparc.c:2978 +#: elf64-sparc.c:3011 #, c-format msgid "%s: linking UltraSPARC specific with HAL specific code" msgstr "" -#: elf.c:330 +#: elf.c:338 #, c-format msgid "%s: invalid string offset %u >= %lu for section `%s'" msgstr "" -#: elf.c:590 +#: elf.c:443 +#, c-format +msgid "%s: invalid SHT_GROUP entry" +msgstr "" + +#: elf.c:524 +#, c-format +msgid "%s: no group info for section %s" +msgstr "" + +#: elf.c:785 msgid "" "\n" "Program Header:\n" msgstr "" -#: elf.c:638 +#: elf.c:833 msgid "" "\n" "Dynamic Section:\n" msgstr "" -#: elf.c:767 +#: elf.c:962 msgid "" "\n" "Version definitions:\n" msgstr "" -#: elf.c:790 +#: elf.c:985 msgid "" "\n" "Version References:\n" msgstr "" -#: elf.c:795 +#: elf.c:990 #, c-format msgid " required from %s:\n" msgstr "" -#: elf.c:1385 +#: elf.c:1600 #, c-format msgid "%s: invalid link %lu for reloc section %s (index %u)" msgstr "" -#: elf.c:2146 -#, c-format -msgid "" -"creating section symbol, name = %s, value = 0x%.8lx, index = %d, section = " -"0x%.8lx\n" -msgstr "" - -#: elf.c:2749 +#: elf.c:3068 #, c-format msgid "%s: Not enough room for program headers (allocated %u, need %u)" msgstr "" -#: elf.c:2848 +#: elf.c:3167 #, c-format msgid "%s: Not enough room for program headers, try linking with -N" msgstr "" -#: elf.c:2974 +#: elf.c:3293 #, c-format msgid "Error: First section in segment (%s) starts at 0x%x" msgstr "" -#: elf.c:2977 +#: elf.c:3296 #, c-format msgid " whereas segment starts at 0x%x" msgstr "" -#: elf.c:3250 +#: elf.c:3569 #, c-format msgid "%s: warning: allocated section `%s' not in segment" msgstr "" -#: elf.c:3655 +#: elf.c:3887 #, c-format msgid "%s: symbol `%s' required but not present" msgstr "" -#: elf.c:3664 +#: elf.c:3896 #, c-format msgid "" "elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = " "0x%.8lx%s\n" msgstr "" -#: elf.c:3905 +#: elf.c:4137 #, c-format msgid "%s: warning: Empty loadable segment detected\n" msgstr "" -#: elf.c:5290 +#: elf.c:5522 #, c-format msgid "%s: unsupported relocation type %s" msgstr "" -#: elfcode.h:1085 +#: elfcode.h:1096 #, c-format msgid "%s: version count (%ld) does not match symbol count (%ld)" msgstr "" -#: elflink.c:431 +#: elflink.c:434 #, c-format -msgid "%s: Section %s is already to large to put hole of %ld bytes in" +msgid "%s: Section %s is too large to add hole of %ld bytes" msgstr "" -#: elflink.h:1468 +#: elflink.h:1487 #, c-format msgid "%s: %s: invalid version %u (max %d)" msgstr "" -#: elflink.h:1509 +#: elflink.h:1528 #, c-format msgid "%s: %s: invalid needed version %d" msgstr "" -#: elflink.h:1629 +#: elflink.h:1648 #, c-format msgid "Warning: size of symbol `%s' changed from %lu to %lu in %s" msgstr "" -#: elflink.h:1875 +#: elflink.h:1894 #, c-format msgid "%s: warning: unexpected redefinition of `%s'" msgstr "" -#: elflink.h:3676 +#: elflink.h:3730 #, c-format msgid "warning: type and size of dynamic symbol `%s' are not defined" msgstr "" -#: elflink.h:3948 +#: elflink.h:4037 #, c-format msgid "%s: undefined versioned symbol name %s" msgstr "" -#: elflink.h:4169 elflink.h:4177 elflink.h:5480 elflink.h:6420 +#: elflink.h:4264 elflink.h:4272 elflink.h:5830 elflink.h:6807 msgid "Error: out of memory" msgstr "" -#: elflink.h:5258 +#: elflink.h:4434 +msgid "Not enough memory to sort relocations" +msgstr "" + +#: elflink.h:5608 #, c-format msgid "%s: could not find output section %s for input section %s" msgstr "" -#: elflink.h:5661 -#, c-format -msgid "%s: invalid section symbol index 0x%x (%s) ingored" +#: elflink.h:6155 +msgid "warning: relocation against removed section; zeroing" msgstr "" -#: i386linux.c:450 m68klinux.c:454 sparclinux.c:452 +#: i386linux.c:455 m68klinux.c:459 sparclinux.c:456 #, c-format msgid "Output file requires shared library `%s'\n" msgstr "" -#: i386linux.c:458 m68klinux.c:462 sparclinux.c:460 +#: i386linux.c:463 m68klinux.c:467 sparclinux.c:464 #, c-format msgid "Output file requires shared library `%s.so.%s'\n" msgstr "" -#: i386linux.c:646 i386linux.c:696 m68klinux.c:653 m68klinux.c:701 -#: sparclinux.c:649 sparclinux.c:699 +#: i386linux.c:653 i386linux.c:703 m68klinux.c:660 m68klinux.c:708 +#: sparclinux.c:655 sparclinux.c:705 #, c-format msgid "Symbol %s not defined for fixups\n" msgstr "" -#: i386linux.c:720 m68klinux.c:725 sparclinux.c:723 +#: i386linux.c:727 m68klinux.c:732 sparclinux.c:729 msgid "Warning: fixup count mismatch\n" msgstr "" -#: ieee.c:168 +#: ieee.c:235 #, c-format msgid "%s: string too long (%d chars, max 65535)" msgstr "" -#: ieee.c:298 +#: ieee.c:365 #, c-format msgid "%s: unrecognized symbol `%s' flags 0x%x" msgstr "" -#: ieee.c:794 +#: ieee.c:877 #, c-format msgid "%s: unimplemented ATI record %u for symbol %u" msgstr "" -#: ieee.c:819 +#: ieee.c:902 #, c-format msgid "%s: unexpected ATN type %d in external part" msgstr "" -#: ieee.c:841 +#: ieee.c:924 #, c-format msgid "%s: unexpected type after ATN" msgstr "" @@ -1518,199 +1531,199 @@ msgstr "" #: ihex.c:369 #, c-format -msgid "%s:%d: bad checksum in Intel Hex file (expected %u, found %u)" +msgid "%s:%u: bad checksum in Intel Hex file (expected %u, found %u)" msgstr "" -#: ihex.c:421 +#: ihex.c:423 #, c-format -msgid "%s:%d: bad extended address record length in Intel Hex file" +msgid "%s:%u: bad extended address record length in Intel Hex file" msgstr "" -#: ihex.c:438 +#: ihex.c:440 #, c-format -msgid "%s:%d: bad extended start address length in Intel Hex file" +msgid "%s:%u: bad extended start address length in Intel Hex file" msgstr "" -#: ihex.c:455 +#: ihex.c:457 #, c-format -msgid "%s:%d: bad extended linear address record length in Intel Hex file" +msgid "%s:%u: bad extended linear address record length in Intel Hex file" msgstr "" -#: ihex.c:472 +#: ihex.c:474 #, c-format -msgid "%s:%d: bad extended linear start address length in Intel Hex file" +msgid "%s:%u: bad extended linear start address length in Intel Hex file" msgstr "" -#: ihex.c:489 +#: ihex.c:491 #, c-format -msgid "%s:%d: unrecognized ihex type %u in Intel Hex file\n" +msgid "%s:%u: unrecognized ihex type %u in Intel Hex file\n" msgstr "" -#: ihex.c:609 +#: ihex.c:611 #, c-format msgid "%s: internal error in ihex_read_section" msgstr "" -#: ihex.c:644 +#: ihex.c:646 #, c-format msgid "%s: bad section length in ihex_read_section" msgstr "" -#: ihex.c:858 +#: ihex.c:864 #, c-format msgid "%s: address 0x%s out of range for Intex Hex file" msgstr "" -#: libbfd.c:473 +#: libbfd.c:492 #, c-format msgid "not mapping: data=%lx mapped=%d\n" msgstr "" -#: libbfd.c:476 +#: libbfd.c:495 msgid "not mapping: env var not set\n" msgstr "" -#: libbfd.c:1371 +#: libbfd.c:1463 #, c-format -msgid "%s: compiled for a big endian system and target is little endian" +msgid "Deprecated %s called" msgstr "" -#: libbfd.c:1373 +#: libbfd.c:1465 #, c-format -msgid "%s: compiled for a little endian system and target is big endian" +msgid " at %s line %d in %s\n" msgstr "" -#: linker.c:1808 +#: linker.c:1849 #, c-format msgid "%s: indirect symbol `%s' to `%s' is a loop" msgstr "" -#: linker.c:2693 +#: linker.c:2745 #, c-format msgid "Attempt to do relocateable link with %s input and %s output" msgstr "" -#: merge.c:883 +#: merge.c:892 #, c-format msgid "%s: access beyond end of merged section (%ld + %ld)" msgstr "" -#: oasys.c:1016 +#: oasys.c:1036 #, c-format msgid "%s: can not represent section `%s' in oasys" msgstr "" -#: osf-core.c:146 +#: osf-core.c:152 #, c-format msgid "Unhandled OSF/1 core file section type %d\n" msgstr "" #. XXX code yet to be written. -#: peicode.h:796 +#: peicode.h:785 #, c-format msgid "%s: Unhandled import type; %x" msgstr "" -#: peicode.h:801 +#: peicode.h:790 #, c-format msgid "%s: Unrecognised import type; %x" msgstr "" -#: peicode.h:815 +#: peicode.h:804 #, c-format msgid "%s: Unrecognised import name type; %x" msgstr "" -#: peicode.h:1172 +#: peicode.h:1162 #, c-format msgid "%s: Unrecognised machine type (0x%x) in Import Library Format archive" msgstr "" -#: peicode.h:1184 +#: peicode.h:1174 #, c-format msgid "" "%s: Recognised but unhandled machine type (0x%x) in Import Library Format " "archive" msgstr "" -#: peicode.h:1201 +#: peicode.h:1191 #, c-format msgid "%s: size field is zero in Import Library Format header" msgstr "" -#: peicode.h:1229 +#: peicode.h:1219 #, c-format msgid "%s: string not null terminated in ILF object file." msgstr "" -#: pe-mips.c:654 +#: pe-mips.c:658 #, c-format msgid "%s: `ld -r' not supported with PE MIPS objects\n" msgstr "" -#: pe-mips.c:816 +#: pe-mips.c:820 #, c-format msgid "%s: jump too far away\n" msgstr "" -#: pe-mips.c:843 +#: pe-mips.c:847 #, c-format msgid "%s: bad pair/reflo after refhi\n" msgstr "" -#: ppcboot.c:423 +#: ppcboot.c:427 msgid "" "\n" "ppcboot header:\n" msgstr "" -#: ppcboot.c:424 +#: ppcboot.c:428 #, c-format msgid "Entry offset = 0x%.8lx (%ld)\n" msgstr "" -#: ppcboot.c:425 +#: ppcboot.c:429 #, c-format msgid "Length = 0x%.8lx (%ld)\n" msgstr "" -#: ppcboot.c:428 +#: ppcboot.c:432 #, c-format msgid "Flag field = 0x%.2x\n" msgstr "" -#: ppcboot.c:434 +#: ppcboot.c:438 #, c-format msgid "Partition name = \"%s\"\n" msgstr "" -#: ppcboot.c:453 +#: ppcboot.c:457 #, c-format msgid "" "\n" "Partition[%d] start = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" msgstr "" -#: ppcboot.c:459 +#: ppcboot.c:463 #, c-format msgid "Partition[%d] end = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" msgstr "" -#: ppcboot.c:465 +#: ppcboot.c:469 #, c-format msgid "Partition[%d] sector = 0x%.8lx (%ld)\n" msgstr "" -#: ppcboot.c:466 +#: ppcboot.c:470 #, c-format msgid "Partition[%d] length = 0x%.8lx (%ld)\n" msgstr "" -#: som.c:5356 +#: som.c:5401 msgid "som_sizeof_headers unimplemented" msgstr "" -#: srec.c:301 +#: srec.c:302 #, c-format msgid "%s:%d: Unexpected character `%s' in S-record file\n" msgstr "" @@ -1719,149 +1732,149 @@ msgstr "" msgid "Unsupported .stab relocation" msgstr "" -#: vms-gsd.c:354 +#: vms-gsd.c:355 #, c-format msgid "bfd_make_section (%s) failed" msgstr "" -#: vms-gsd.c:368 +#: vms-gsd.c:370 #, c-format msgid "bfd_set_section_flags (%s, %x) failed" msgstr "" -#: vms-gsd.c:404 +#: vms-gsd.c:406 #, c-format msgid "Size mismatch section %s=%lx, %s=%lx" msgstr "" -#: vms-gsd.c:699 +#: vms-gsd.c:703 #, c-format msgid "unknown gsd/egsd subtype %d" msgstr "" -#: vms-hdr.c:403 +#: vms-hdr.c:406 msgid "Object module NOT error-free !\n" msgstr "" -#: vms-misc.c:537 +#: vms-misc.c:543 #, c-format msgid "Stack overflow (%d) in _bfd_vms_push" msgstr "" -#: vms-misc.c:555 +#: vms-misc.c:561 msgid "Stack underflow in _bfd_vms_pop" msgstr "" -#: vms-misc.c:911 +#: vms-misc.c:919 msgid "_bfd_vms_output_counted called with zero bytes" msgstr "" -#: vms-misc.c:916 +#: vms-misc.c:924 msgid "_bfd_vms_output_counted called with too many bytes" msgstr "" -#: vms-misc.c:1047 +#: vms-misc.c:1055 #, c-format msgid "Symbol %s replaced by %s\n" msgstr "" -#: vms-misc.c:1109 +#: vms-misc.c:1117 #, c-format msgid "failed to enter %s" msgstr "" -#: vms-tir.c:68 +#: vms-tir.c:78 msgid "No Mem !" msgstr "" -#: vms-tir.c:302 +#: vms-tir.c:313 msgid "Bad section index in ETIR_S_C_STA_PQ" msgstr "" -#: vms-tir.c:317 +#: vms-tir.c:328 #, c-format msgid "Unsupported STA cmd %d" msgstr "" -#: vms-tir.c:322 vms-tir.c:1274 +#: vms-tir.c:333 vms-tir.c:1301 #, c-format msgid "Reserved STA cmd %d" msgstr "" -#: vms-tir.c:428 +#: vms-tir.c:443 #, c-format msgid "ETIR_S_C_STO_GBL: no symbol \"%s\"" msgstr "" -#: vms-tir.c:449 +#: vms-tir.c:465 #, c-format msgid "ETIR_S_C_STO_CA: no symbol \"%s\"" msgstr "" -#: vms-tir.c:462 +#: vms-tir.c:478 msgid "ETIR_S_C_STO_RB/AB: Not supported" msgstr "" -#: vms-tir.c:520 +#: vms-tir.c:538 msgid "ETIR_S_C_STO_LP_PSB: Not supported" msgstr "" -#: vms-tir.c:526 +#: vms-tir.c:544 msgid "ETIR_S_C_STO_HINT_GBL: not implemented" msgstr "" -#: vms-tir.c:532 +#: vms-tir.c:550 msgid "ETIR_S_C_STO_HINT_PS: not implemented" msgstr "" -#: vms-tir.c:536 vms-tir.c:1446 +#: vms-tir.c:554 vms-tir.c:1473 #, c-format msgid "Reserved STO cmd %d" msgstr "" -#: vms-tir.c:649 +#: vms-tir.c:667 msgid "ETIR_S_C_OPR_INSV: Not supported" msgstr "" -#: vms-tir.c:667 +#: vms-tir.c:685 msgid "ETIR_S_C_OPR_USH: Not supported" msgstr "" -#: vms-tir.c:673 +#: vms-tir.c:691 msgid "ETIR_S_C_OPR_ROT: Not supported" msgstr "" -#: vms-tir.c:692 +#: vms-tir.c:710 msgid "ETIR_S_C_OPR_REDEF: Not supported" msgstr "" -#: vms-tir.c:698 +#: vms-tir.c:716 msgid "ETIR_S_C_OPR_DFLIT: Not supported" msgstr "" -#: vms-tir.c:702 vms-tir.c:1641 +#: vms-tir.c:720 vms-tir.c:1668 #, c-format msgid "Reserved OPR cmd %d" msgstr "" -#: vms-tir.c:770 vms-tir.c:1710 +#: vms-tir.c:788 vms-tir.c:1737 #, c-format msgid "Reserved CTL cmd %d" msgstr "" -#: vms-tir.c:798 +#: vms-tir.c:816 msgid "ETIR_S_C_STC_LP: not supported" msgstr "" -#: vms-tir.c:816 +#: vms-tir.c:834 msgid "ETIR_S_C_STC_GBL: not supported" msgstr "" -#: vms-tir.c:824 +#: vms-tir.c:842 msgid "ETIR_S_C_STC_GCA: not supported" msgstr "" -#: vms-tir.c:833 +#: vms-tir.c:851 msgid "ETIR_S_C_STC_PS: not supported" msgstr "" @@ -1870,11 +1883,11 @@ msgstr "" #. * arg: - #. * #. -#: vms-tir.c:1174 +#: vms-tir.c:1199 msgid "Stack-from-image not implemented" msgstr "" -#: vms-tir.c:1194 +#: vms-tir.c:1219 msgid "Stack-entry-mask not fully implemented" msgstr "" @@ -1887,384 +1900,384 @@ msgstr "" #. * compare argument descriptor with symbol argument (ARG$V_PASSMECH) #. * and stack TRUE (args match) or FALSE (args dont match) value #. -#: vms-tir.c:1210 +#: vms-tir.c:1235 msgid "PASSMECH not fully implemented" msgstr "" -#: vms-tir.c:1230 +#: vms-tir.c:1256 msgid "Stack-local-symbol not fully implemented" msgstr "" -#: vms-tir.c:1245 +#: vms-tir.c:1271 msgid "Stack-literal not fully implemented" msgstr "" -#: vms-tir.c:1267 +#: vms-tir.c:1294 msgid "Stack-local-symbol-entry-point-mask not fully implemented" msgstr "" -#: vms-tir.c:1442 +#: vms-tir.c:1469 #, c-format msgid "Unimplemented STO cmd %d" msgstr "" -#: vms-tir.c:1581 +#: vms-tir.c:1608 msgid "TIR_S_C_OPR_ASH incomplete" msgstr "" -#: vms-tir.c:1595 +#: vms-tir.c:1622 msgid "TIR_S_C_OPR_USH incomplete" msgstr "" -#: vms-tir.c:1609 +#: vms-tir.c:1636 msgid "TIR_S_C_OPR_ROT incomplete" msgstr "" #. #. * redefine symbol to current location #. -#: vms-tir.c:1630 +#: vms-tir.c:1657 msgid "TIR_S_C_OPR_REDEF not supported" msgstr "" #. #. * define a literal #. -#: vms-tir.c:1637 +#: vms-tir.c:1664 msgid "TIR_S_C_OPR_DFLIT not supported" msgstr "" -#: vms-tir.c:1691 +#: vms-tir.c:1718 msgid "TIR_S_C_CTL_DFLOC not fully implemented" msgstr "" -#: vms-tir.c:1699 +#: vms-tir.c:1726 msgid "TIR_S_C_CTL_STLOC not fully implemented" msgstr "" -#: vms-tir.c:1707 +#: vms-tir.c:1734 msgid "TIR_S_C_CTL_STKDL not fully implemented" msgstr "" -#: vms-tir.c:1761 +#: vms-tir.c:1791 #, c-format msgid "Obj code %d not found" msgstr "" -#: vms-tir.c:2102 +#: vms-tir.c:2137 #, c-format msgid "SEC_RELOC with no relocs in section %s" msgstr "" -#: vms-tir.c:2376 +#: vms-tir.c:2424 #, c-format msgid "Unhandled relocation %s" msgstr "" -#: xcofflink.c:1220 +#: xcofflink.c:1241 #, c-format msgid "%s: `%s' has line numbers but no enclosing section" msgstr "" -#: xcofflink.c:1267 +#: xcofflink.c:1294 #, c-format msgid "%s: class %d symbol `%s' has no aux entries" msgstr "" -#: xcofflink.c:1290 +#: xcofflink.c:1317 #, c-format msgid "%s: symbol `%s' has unrecognized csect type %d" msgstr "" -#: xcofflink.c:1302 +#: xcofflink.c:1329 #, c-format msgid "%s: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d" msgstr "" -#: xcofflink.c:1340 +#: xcofflink.c:1365 #, c-format msgid "%s: XMC_TC0 symbol `%s' is class %d scnlen %d" msgstr "" -#: xcofflink.c:1493 +#: xcofflink.c:1517 #, c-format msgid "%s: csect `%s' not in enclosing section" msgstr "" -#: xcofflink.c:1598 +#: xcofflink.c:1624 #, c-format msgid "%s: misplaced XTY_LD `%s'" msgstr "" -#: xcofflink.c:1916 +#: xcofflink.c:1948 #, c-format msgid "%s: reloc %s:%d not in csect" msgstr "" -#: xcofflink.c:2051 +#: xcofflink.c:2083 #, c-format msgid "%s: XCOFF shared object when not producing XCOFF output" msgstr "" -#: xcofflink.c:2072 +#: xcofflink.c:2104 #, c-format msgid "%s: dynamic object with no .loader section" msgstr "" -#: xcofflink.c:2715 +#: xcofflink.c:2749 #, c-format msgid "%s: no such symbol" msgstr "" -#: xcofflink.c:2848 +#: xcofflink.c:2890 msgid "error: undefined symbol __rtinit" msgstr "" -#: xcofflink.c:3389 +#: xcofflink.c:3423 #, c-format msgid "warning: attempt to export undefined symbol `%s'" msgstr "" -#: xcofflink.c:4358 +#: xcofflink.c:4421 #, c-format msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling" msgstr "" -#: xcofflink.c:5192 xcofflink.c:5603 xcofflink.c:5665 xcofflink.c:5968 +#: xcofflink.c:5261 xcofflink.c:5723 xcofflink.c:5785 xcofflink.c:6086 #, c-format msgid "%s: loader reloc in unrecognized section `%s'" msgstr "" -#: xcofflink.c:5214 xcofflink.c:5979 +#: xcofflink.c:5283 xcofflink.c:6097 #, c-format msgid "%s: `%s' in loader reloc but not loader sym" msgstr "" -#: xcofflink.c:5229 +#: xcofflink.c:5298 #, c-format msgid "%s: loader reloc in read-only section %s" msgstr "" -#: elf32-ia64.c:2046 elf64-ia64.c:2046 +#: elf32-ia64.c:2083 elf64-ia64.c:2083 msgid "@pltoff reloc against local symbol" msgstr "" -#: elf32-ia64.c:2104 elf64-ia64.c:2104 +#: elf32-ia64.c:2141 elf64-ia64.c:2141 msgid "non-zero addend in @fptr reloc" msgstr "" -#: elf32-ia64.c:3294 elf64-ia64.c:3294 +#: elf32-ia64.c:3321 elf64-ia64.c:3321 #, c-format msgid "%s: short data segment overflowed (0x%lx >= 0x400000)" msgstr "" -#: elf32-ia64.c:3305 elf64-ia64.c:3305 +#: elf32-ia64.c:3332 elf64-ia64.c:3332 #, c-format msgid "%s: __gp does not cover short data segment" msgstr "" -#: elf32-ia64.c:3575 elf64-ia64.c:3575 +#: elf32-ia64.c:3605 elf64-ia64.c:3605 #, c-format msgid "%s: linking non-pic code in a shared library" msgstr "" -#: elf32-ia64.c:3608 elf64-ia64.c:3608 +#: elf32-ia64.c:3638 elf64-ia64.c:3638 #, c-format msgid "%s: @gprel relocation against dynamic symbol %s" msgstr "" -#: elf32-ia64.c:3744 elf64-ia64.c:3744 +#: elf32-ia64.c:3776 elf64-ia64.c:3776 #, c-format msgid "%s: dynamic relocation against speculation fixup" msgstr "" -#: elf32-ia64.c:3752 elf64-ia64.c:3752 +#: elf32-ia64.c:3784 elf64-ia64.c:3784 #, c-format msgid "%s: speculation fixup against undefined weak symbol" msgstr "" -#: elf32-ia64.c:3935 elf64-ia64.c:3935 +#: elf32-ia64.c:3967 elf64-ia64.c:3967 msgid "unsupported reloc" msgstr "" -#: elf32-ia64.c:4232 elf64-ia64.c:4232 +#: elf32-ia64.c:4265 elf64-ia64.c:4265 #, c-format msgid "%s: linking trap-on-NULL-dereference with non-trapping files" msgstr "" -#: elf32-ia64.c:4241 elf64-ia64.c:4241 +#: elf32-ia64.c:4274 elf64-ia64.c:4274 #, c-format msgid "%s: linking big-endian files with little-endian files" msgstr "" -#: elf32-ia64.c:4250 elf64-ia64.c:4250 +#: elf32-ia64.c:4283 elf64-ia64.c:4283 #, c-format msgid "%s: linking 64-bit files with 32-bit files" msgstr "" -#: elf32-ia64.c:4259 elf64-ia64.c:4259 +#: elf32-ia64.c:4292 elf64-ia64.c:4292 #, c-format msgid "%s: linking constant-gp files with non-constant-gp files" msgstr "" -#: elf32-ia64.c:4269 elf64-ia64.c:4269 +#: elf32-ia64.c:4302 elf64-ia64.c:4302 #, c-format msgid "%s: linking auto-pic files with non-auto-pic files" msgstr "" -#: peigen.c:1009 pepigen.c:1009 +#: peigen.c:964 pepigen.c:964 #, c-format msgid "%s: line number overflow: 0x%lx > 0xffff" msgstr "" -#: peigen.c:1027 pepigen.c:1027 +#: peigen.c:981 pepigen.c:981 #, c-format msgid "%s: reloc overflow 1: 0x%lx > 0xffff" msgstr "" -#: peigen.c:1040 pepigen.c:1040 +#: peigen.c:995 pepigen.c:995 msgid "Export Directory [.edata (or where ever we found it)]" msgstr "" -#: peigen.c:1041 pepigen.c:1041 +#: peigen.c:996 pepigen.c:996 msgid "Import Directory [parts of .idata]" msgstr "" -#: peigen.c:1042 pepigen.c:1042 +#: peigen.c:997 pepigen.c:997 msgid "Resource Directory [.rsrc]" msgstr "" -#: peigen.c:1043 pepigen.c:1043 +#: peigen.c:998 pepigen.c:998 msgid "Exception Directory [.pdata]" msgstr "" -#: peigen.c:1044 pepigen.c:1044 +#: peigen.c:999 pepigen.c:999 msgid "Security Directory" msgstr "" -#: peigen.c:1045 pepigen.c:1045 +#: peigen.c:1000 pepigen.c:1000 msgid "Base Relocation Directory [.reloc]" msgstr "" -#: peigen.c:1046 pepigen.c:1046 +#: peigen.c:1001 pepigen.c:1001 msgid "Debug Directory" msgstr "" -#: peigen.c:1047 pepigen.c:1047 +#: peigen.c:1002 pepigen.c:1002 msgid "Description Directory" msgstr "" -#: peigen.c:1048 pepigen.c:1048 +#: peigen.c:1003 pepigen.c:1003 msgid "Special Directory" msgstr "" -#: peigen.c:1049 pepigen.c:1049 +#: peigen.c:1004 pepigen.c:1004 msgid "Thread Storage Directory [.tls]" msgstr "" -#: peigen.c:1050 pepigen.c:1050 +#: peigen.c:1005 pepigen.c:1005 msgid "Load Configuration Directory" msgstr "" -#: peigen.c:1051 pepigen.c:1051 +#: peigen.c:1006 pepigen.c:1006 msgid "Bound Import Directory" msgstr "" -#: peigen.c:1052 pepigen.c:1052 +#: peigen.c:1007 pepigen.c:1007 msgid "Import Address Table Directory" msgstr "" -#: peigen.c:1053 pepigen.c:1053 +#: peigen.c:1008 pepigen.c:1008 msgid "Delay Import Directory" msgstr "" -#: peigen.c:1054 peigen.c:1055 pepigen.c:1054 pepigen.c:1055 +#: peigen.c:1009 peigen.c:1010 pepigen.c:1009 pepigen.c:1010 msgid "Reserved" msgstr "" -#: peigen.c:1119 pepigen.c:1119 +#: peigen.c:1073 pepigen.c:1073 msgid "" "\n" "There is an import table, but the section containing it could not be found\n" msgstr "" -#: peigen.c:1124 pepigen.c:1124 +#: peigen.c:1078 pepigen.c:1078 #, c-format msgid "" "\n" "There is an import table in %s at 0x%lx\n" msgstr "" -#: peigen.c:1163 pepigen.c:1163 +#: peigen.c:1115 pepigen.c:1115 #, c-format msgid "" "\n" "Function descriptor located at the start address: %04lx\n" msgstr "" -#: peigen.c:1166 pepigen.c:1166 +#: peigen.c:1118 pepigen.c:1118 #, c-format msgid "\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n" msgstr "" -#: peigen.c:1172 pepigen.c:1172 +#: peigen.c:1124 pepigen.c:1124 msgid "" "\n" "No reldata section! Function descriptor not decoded.\n" msgstr "" -#: peigen.c:1177 pepigen.c:1177 +#: peigen.c:1129 pepigen.c:1129 #, c-format msgid "" "\n" "The Import Tables (interpreted %s section contents)\n" msgstr "" -#: peigen.c:1180 pepigen.c:1180 +#: peigen.c:1132 pepigen.c:1132 msgid " vma: Hint Time Forward DLL First\n" msgstr "" -#: peigen.c:1182 pepigen.c:1182 +#: peigen.c:1134 pepigen.c:1134 msgid " Table Stamp Chain Name Thunk\n" msgstr "" -#: peigen.c:1232 pepigen.c:1232 +#: peigen.c:1182 pepigen.c:1182 #, c-format msgid "" "\n" "\tDLL Name: %s\n" msgstr "" -#: peigen.c:1236 peigen.c:1299 pepigen.c:1236 pepigen.c:1299 +#: peigen.c:1186 peigen.c:1249 pepigen.c:1186 pepigen.c:1249 msgid "\tvma: Hint/Ord Member-Name\n" msgstr "" -#: peigen.c:1298 pepigen.c:1298 +#: peigen.c:1248 pepigen.c:1248 msgid "\tThe Import Address Table (difference found)\n" msgstr "" -#: peigen.c:1305 pepigen.c:1305 +#: peigen.c:1255 pepigen.c:1255 msgid "\t>>> Ran out of IAT members!\n" msgstr "" -#: peigen.c:1324 pepigen.c:1324 +#: peigen.c:1273 pepigen.c:1273 msgid "\tThe Import Address Table is identical\n" msgstr "" -#: peigen.c:1397 pepigen.c:1397 +#: peigen.c:1345 pepigen.c:1345 msgid "" "\n" "There is an export table, but the section containing it could not be found\n" msgstr "" -#: peigen.c:1402 pepigen.c:1402 +#: peigen.c:1350 pepigen.c:1350 #, c-format msgid "" "\n" "There is an export table in %s at 0x%lx\n" msgstr "" -#: peigen.c:1433 pepigen.c:1433 +#: peigen.c:1381 pepigen.c:1381 #, c-format msgid "" "\n" @@ -2272,131 +2285,131 @@ msgid "" "\n" msgstr "" -#: peigen.c:1437 pepigen.c:1437 +#: peigen.c:1385 pepigen.c:1385 #, c-format msgid "Export Flags \t\t\t%lx\n" msgstr "" -#: peigen.c:1440 pepigen.c:1440 +#: peigen.c:1388 pepigen.c:1388 #, c-format msgid "Time/Date stamp \t\t%lx\n" msgstr "" -#: peigen.c:1443 pepigen.c:1443 +#: peigen.c:1391 pepigen.c:1391 #, c-format msgid "Major/Minor \t\t\t%d/%d\n" msgstr "" -#: peigen.c:1446 pepigen.c:1446 +#: peigen.c:1394 pepigen.c:1394 msgid "Name \t\t\t\t" msgstr "" -#: peigen.c:1452 pepigen.c:1452 +#: peigen.c:1400 pepigen.c:1400 #, c-format msgid "Ordinal Base \t\t\t%ld\n" msgstr "" -#: peigen.c:1455 pepigen.c:1455 +#: peigen.c:1403 pepigen.c:1403 msgid "Number in:\n" msgstr "" -#: peigen.c:1458 pepigen.c:1458 +#: peigen.c:1406 pepigen.c:1406 #, c-format msgid "\tExport Address Table \t\t%08lx\n" msgstr "" -#: peigen.c:1462 pepigen.c:1462 +#: peigen.c:1410 pepigen.c:1410 #, c-format msgid "\t[Name Pointer/Ordinal] Table\t%08lx\n" msgstr "" -#: peigen.c:1465 pepigen.c:1465 +#: peigen.c:1413 pepigen.c:1413 msgid "Table Addresses\n" msgstr "" -#: peigen.c:1468 pepigen.c:1468 +#: peigen.c:1416 pepigen.c:1416 msgid "\tExport Address Table \t\t" msgstr "" -#: peigen.c:1473 pepigen.c:1473 +#: peigen.c:1421 pepigen.c:1421 msgid "\tName Pointer Table \t\t" msgstr "" -#: peigen.c:1478 pepigen.c:1478 +#: peigen.c:1426 pepigen.c:1426 msgid "\tOrdinal Table \t\t\t" msgstr "" -#: peigen.c:1492 pepigen.c:1492 +#: peigen.c:1441 pepigen.c:1441 #, c-format msgid "" "\n" "Export Address Table -- Ordinal Base %ld\n" msgstr "" -#: peigen.c:1511 pepigen.c:1511 +#: peigen.c:1460 pepigen.c:1460 msgid "Forwarder RVA" msgstr "" -#: peigen.c:1522 pepigen.c:1522 +#: peigen.c:1471 pepigen.c:1471 msgid "Export RVA" msgstr "" -#: peigen.c:1529 pepigen.c:1529 +#: peigen.c:1478 pepigen.c:1478 msgid "" "\n" "[Ordinal/Name Pointer] Table\n" msgstr "" -#: peigen.c:1584 pepigen.c:1584 +#: peigen.c:1533 pepigen.c:1533 #, c-format msgid "Warning, .pdata section size (%ld) is not a multiple of %d\n" msgstr "" -#: peigen.c:1588 pepigen.c:1588 +#: peigen.c:1537 pepigen.c:1537 msgid "" "\n" "The Function Table (interpreted .pdata section contents)\n" msgstr "" -#: peigen.c:1591 pepigen.c:1591 +#: peigen.c:1540 pepigen.c:1540 msgid " vma:\t\t\tBegin Address End Address Unwind Info\n" msgstr "" -#: peigen.c:1594 pepigen.c:1594 +#: peigen.c:1543 pepigen.c:1543 msgid " vma:\t\tBegin End EH EH PrologEnd Exception\n" msgstr "" -#: peigen.c:1596 pepigen.c:1596 +#: peigen.c:1545 pepigen.c:1545 msgid " \t\tAddress Address Handler Data Address Mask\n" msgstr "" -#: peigen.c:1668 pepigen.c:1668 +#: peigen.c:1613 pepigen.c:1613 msgid " Register save millicode" msgstr "" -#: peigen.c:1671 pepigen.c:1671 +#: peigen.c:1616 pepigen.c:1616 msgid " Register restore millicode" msgstr "" -#: peigen.c:1674 pepigen.c:1674 +#: peigen.c:1619 pepigen.c:1619 msgid " Glue code sequence" msgstr "" -#: peigen.c:1725 pepigen.c:1725 +#: peigen.c:1671 pepigen.c:1671 msgid "" "\n" "\n" "PE File Base Relocations (interpreted .reloc section contents)\n" msgstr "" -#: peigen.c:1760 pepigen.c:1760 +#: peigen.c:1701 pepigen.c:1701 #, c-format msgid "" "\n" "Virtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n" msgstr "" -#: peigen.c:1773 pepigen.c:1773 +#: peigen.c:1714 pepigen.c:1714 #, c-format msgid "\treloc %4d offset %4x [%4lx] %s" msgstr "" @@ -2404,7 +2417,7 @@ msgstr "" #. The MS dumpbin program reportedly ands with 0xff0f before #. printing the characteristics field. Not sure why. No reason to #. emulate it here. -#: peigen.c:1812 pepigen.c:1812 +#: peigen.c:1754 pepigen.c:1754 #, c-format msgid "" "\n" diff --git a/bfd/reloc.c b/bfd/reloc.c index 3ab02f9..a9252b7 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -2723,6 +2723,78 @@ ENUMDOC Motorola Mcore relocations. ENUM + BFD_RELOC_MMIX_GETA +ENUMX + BFD_RELOC_MMIX_GETA_1 +ENUMX + BFD_RELOC_MMIX_GETA_2 +ENUMX + BFD_RELOC_MMIX_GETA_3 +ENUMDOC + These are relocations for the GETA instruction. +ENUM + BFD_RELOC_MMIX_CBRANCH +ENUMX + BFD_RELOC_MMIX_CBRANCH_J +ENUMX + BFD_RELOC_MMIX_CBRANCH_1 +ENUMX + BFD_RELOC_MMIX_CBRANCH_2 +ENUMX + BFD_RELOC_MMIX_CBRANCH_3 +ENUMDOC + These are relocations for a conditional branch instruction. +ENUM + BFD_RELOC_MMIX_PUSHJ +ENUMX + BFD_RELOC_MMIX_PUSHJ_1 +ENUMX + BFD_RELOC_MMIX_PUSHJ_2 +ENUMX + BFD_RELOC_MMIX_PUSHJ_3 +ENUMDOC + These are relocations for the PUSHJ instruction. +ENUM + BFD_RELOC_MMIX_JMP +ENUMX + BFD_RELOC_MMIX_JMP_1 +ENUMX + BFD_RELOC_MMIX_JMP_2 +ENUMX + BFD_RELOC_MMIX_JMP_3 +ENUMDOC + These are relocations for the JMP instruction. +ENUM + BFD_RELOC_MMIX_ADDR19 +ENUMDOC + This is a relocation for a relative address as in a GETA instruction or + a branch. +ENUM + BFD_RELOC_MMIX_ADDR27 +ENUMDOC + This is a relocation for a relative address as in a JMP instruction. +ENUM + BFD_RELOC_MMIX_REG_OR_BYTE +ENUMDOC + This is a relocation for an instruction field that may be a general + register or a value 0..255. +ENUM + BFD_RELOC_MMIX_REG +ENUMDOC + This is a relocation for an instruction field that may be a general + register. +ENUM + BFD_RELOC_MMIX_BASE_PLUS_OFFSET +ENUMDOC + This is a relocation for two instruction fields holding a register and + an offset, the equivalent of the relocation. +ENUM + BFD_RELOC_MMIX_LOCAL +ENUMDOC + This relocation is an assertion that the expression is not allocated as + a global register. It does not modify contents. + +ENUM BFD_RELOC_AVR_7_PCREL ENUMDOC This is a 16 bit reloc for the AVR that stores 8 bit pc relative diff --git a/bfd/targets.c b/bfd/targets.c index a86267e..28f5d27 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -153,7 +153,8 @@ DESCRIPTION . bfd_target_versados_flavour, . bfd_target_msdos_flavour, . bfd_target_ovax_flavour, -. bfd_target_evax_flavour +. bfd_target_evax_flavour, +. bfd_target_mmo_flavour .}; . .enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN }; @@ -564,6 +565,7 @@ extern const bfd_target bfd_elf64_ia64_big_vec; extern const bfd_target bfd_elf64_ia64_little_vec; extern const bfd_target bfd_elf64_little_generic_vec; extern const bfd_target bfd_elf64_littlemips_vec; +extern const bfd_target bfd_elf64_mmix_vec; extern const bfd_target bfd_elf64_powerpc_vec; extern const bfd_target bfd_elf64_powerpcle_vec; extern const bfd_target bfd_elf64_s390_vec; @@ -571,6 +573,7 @@ extern const bfd_target bfd_elf64_sparc_vec; extern const bfd_target bfd_elf64_tradbigmips_vec; extern const bfd_target bfd_elf64_tradlittlemips_vec; extern const bfd_target bfd_elf64_x86_64_vec; +extern const bfd_target bfd_mmo_vec; extern const bfd_target bfd_powerpc_pe_vec; extern const bfd_target bfd_powerpc_pei_vec; extern const bfd_target bfd_powerpcle_pe_vec; @@ -802,6 +805,7 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf64_ia64_little_vec, &bfd_elf64_little_generic_vec, &bfd_elf64_littlemips_vec, + &bfd_elf64_mmix_vec, &bfd_elf64_powerpc_vec, &bfd_elf64_powerpcle_vec, &bfd_elf64_s390_vec, @@ -811,6 +815,9 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf64_tradbigmips_vec, &bfd_elf64_tradlittlemips_vec, &bfd_elf64_x86_64_vec, +#if 0 + &bfd_mmo_mmix_vec, +#endif #endif &bfd_powerpc_pe_vec, &bfd_powerpc_pei_vec, |